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 passterm(term){
 if (term=""){ value = "blank";}
 if (term=" "){ value = "blank";}
 if (term='#') { value = "blank"; }
 if(value="blank"){
    goToPage('searchresults.php');
 }
 else{
  goToPage('searchresults.php?searchtext='+term);
 } 
} 

function goToPage(p){
 //if(p=0){p="";}
 location.href = p;
}

function usbt_popup(url,winName,features){
 newwin=window.open(url,"winName","features");
 <!-- newwin=window.open(url,"Terms","menubar=no, scrollbars=yes, width=420, height=380, directories=no,location=no,resizable=yes,status=no,toolbar=no"); -->
}

function usea_popup(url, name, w, h)
{
// Fudge factors for window decoration space.
 // In my tests these work well on all platforms & browsers.
w += 32;
h += 96;
 var win = window.open(url,
  name,
  'width=' + w + ', height=' + h + ', ' +
  'location=no, menubar=no, ' +
  'status=no, toolbar=yes, scrollbars=yes, directories=no, resizable=yes');
 win.resizeTo(w, h);
 win.focus();
}
