function   readCookie(name)   
{   
  var   cookieValue   =   "";   
  var   search   =   name   +   "=";   
  if(document.cookie.length   >   0)   
  {     
	  offset   =   document.cookie.indexOf(search);   
	  if   (offset   !=   -1)   
	  {     
		  offset   +=   search.length;   
		  end   =   document.cookie.indexOf(";",   offset);   
		  if   (end   ==   -1)   end   =   document.cookie.length;   
		  cookieValue   =   unescape(document.cookie.substring(offset,   end))   
	  }   
  }   
  return   cookieValue;   
}   
function   writeCookie(name,   value,   hours)   
{   
  var   expire   =   "";   
  if(hours   !=   null)   
  {   
	  expire   =   new   Date((new   Date()).getTime()   +   hours   *   3600000);   
	  expire   =   ";   expires="   +   expire.toGMTString();   
  }   
  document.cookie   =   name   +   "="   +   escape(value)   +   expire;   
}
function checkthis(id) {
	writeCookie('pro_'+id,'1',24);
	document.getElementById("spancheck"+id).style.display='none';
	document.getElementById("spanclear"+id).style.display='block';
}

function clearthis(id) {
	writeCookie('pro_'+id,'0',0);
	document.getElementById("spancheck"+id).style.display='block';
	document.getElementById("spanclear"+id).style.display='none';
}
function clearthisincar(id) {
	writeCookie('pro_'+id,'0',0);
	window.location.href='?s=7';
}
function clearall() {
	i=0;
	while(1){
		x = document.getElementById('id_'+i);
		if(!x) window.location.href='?s=7';
		writeCookie('pro_'+x.value,'0',0);
		i++;
	}
}
function changeQTY() {
	i=0;
	while(1){
		x = document.getElementById('id_'+i);
		if(!x) window.location.href='?s=7';
		t = document.getElementById('qty_'+x.value);
		writeCookie('pro_'+x.value,t.value,24);
		i++;
	}
}