function post(paramstr, url, target)
 {
  var f = document.createElement('form');
  if (url != undefined) { f.action = url; }
  f.method = 'post';
  f.style.display = 'none';
 
  s = new String(paramstr);
  params = s.split('&');
  for (i=0; i < params.length; i++)
   {
    v = params[i].split('=');
    if (v.length == 2)
     {
      input = document.createElement('input');
      f.appendChild(input);
      input.name = v[0];
      input.value = v[1];
     }
   }

  el = document.getElementsByTagName('body')[0];
  el.appendChild(f);
  if (target != null) { f.target = target;}  
  f.submit();
 }
 
function od_set_groups(ids_string, prefix)
 { 
  ids = ids_string.split(','); 
  for (i=0; i < ids.length; i++) 
   {
    el = document.getElementById(prefix + ids[i]); 
    el.style.display = 'none';
   }
 }  
 
function show_all_manufacturers()
 {
  post('action=show_hide_manufacturers&show_all=1')
 } 
   
function hide_manufacturers()
 {
  post('action=show_hide_manufacturers&show_all=0')
 }     
 
function show_all_models()
 {
  post('action=show_hide_models&show_all=1')
 } 
   
function hide_models()
 {
  post('action=show_hide_models&show_all=0')
 }  
 
function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name) {
	createCookie(name,"",-1);
}
 
 
function notification(){ 
	if (readCookie('show_message') == 1) 
	 {
	   $("#notification").show(); 
	 setTimeout('$("#notification").hide()', 8000);
	 } 
	eraseCookie('show_message'); 
}

function bookmark(url,title){
  if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) {
  window.external.AddFavorite(url,title);
  } else {
    window.sidebar.addPanel(title,url,"");
  }
}


