	function load(the_url)
	{
		var load = window.open(the_url,'','scrollbars=yes,menubar=yes,height=600,width=800,resizable=yes,toolbar=yes,location=yes,status=yes');
	}
	function SetCookie (cookieName, cookieValue) 
	{
	  if (testSessionCookie()) 
	  {
		 document.cookie = escape(cookieName) + "=" + escape(cookieValue) + "; path=/";
		 return true;
	  }
	  else return false;
	}
	function GetCookie (cookieName) 
	{
	  var exp = new RegExp (escape(cookieName) + "=([^;]+)");
	  if (exp.test (document.cookie + ";")) 
	  {
		 exp.exec (document.cookie + ";");
		 return unescape(RegExp.$1);
	  }
	  else return false;
	}
	function testSessionCookie () 
	{
	  document.cookie ="testSessionCookie=Enabled";
	  if (GetCookie ("testSessionCookie")=="Enabled")
		 return true 
	  else
		 return false;
	}
	function testPersistentCookie () 
	{
	  writePersistentCookie ("testPersistentCookie", "Enabled", "minutes", 1);
	  if (GetCookie ("testPersistentCookie")=="Enabled"){return true;}
	  else{return false;}
	}
	function writePersistentCookie (CookieName, CookieValue, periodType, offset) 
	{
	  var expireDate = new Date ();
	  offset = offset / 1;
	  var myPeriodType = periodType;
	  switch (myPeriodType.toLowerCase()) 
	  {
		 case "years":
			expireDate.setYear(expireDate.getFullYear()+offset);
			break;
		 case "months":
			expireDate.setMonth(expireDate.getMonth()+offset);
			break;
		 case "days":
			expireDate.setDate(expireDate.getDate()+offset);
			break;
		 case "hours":
			expireDate.setHours(expireDate.getHours()+offset);
			break;
		 case "minutes":
			expireDate.setMinutes(expireDate.getMinutes()+offset);
			break;
		 default:
			alert ("Invalid periodType parameter for writePersistentCookie()");
			break;
	  } 
	  document.cookie = escape(CookieName ) + "=" + escape(CookieValue) + "; expires=" + expireDate.toGMTString() + "; path=/";
	}  
	function DeleteCookie (cookieName) 
	{
	  if (GetCookie (cookieName)){writePersistentCookie (cookieName,"Pending delete","years", -1);}
	  return true;     
	}
	/////////Rating Stuff
	var states= new Array();
	function SetRating(id, rating)
	{
		for(i=1;i<=5;i++)
		{
			if(rating >= i){$('#SPHERE_'+id+'_'+i).attr('src', '/images/items/rating_star.png');}
			else{$('#SPHERE_'+id+'_'+i).attr('src', '/images/items/rating_star_faded.png');}
		}
	}
	function MakeRating(id, rating)
	{
		var sphere=document.getElementById('BLAH');
		var itemo=document.getElementById('SPHERE_'+id);
		states[id]=rating;
		$.post("/set_vote.php", { ITEM: id, VOTE: rating },function(data){$('#SPHERE_'+id).html('<IMG SRC=/assets/stars-'+rating+'.jpg WIDTH=82 HEIGHT=16>');});
	}
	function ResetRating(id)
	{
		rating=states[id];
		SetRating(id, rating);
	}
	function ShowRating(id, rating)
	{
		states[id]=rating;
		document.write('<DIV CLASS=SPHERE ID=SPHERE_'+id+' onMouseOut="ResetRating('+id+');">');
		var i=0;
		for(i=1;i<=5;i++)
		{
			if(rating >= i){document.write('<IMG SRC=/images/items/rating_star.png ID=SPHERE_'+id+'_'+i+' onClick="MakeRating('+id+','+i+');" onMouseOver="SetRating('+id+','+i+');">');}
			else{document.write('<IMG SRC=/images/items/rating_star_faded.png ID=SPHERE_'+id+'_'+i+' onClick="MakeRating('+id+','+i+');" onMouseOver="SetRating('+id+','+i+');">');}
		}	
		document.write("</DIV>");
		SetRating(id, rating);
	}
	function ShowComments(item_id)
	{
		$('#COMMENTS_'+item_id).html('<IFRAME src =/panels/items/get_comments.php?ITEM='+item_id+' WIDTH=100% HEIGHT=100% SCROLLING=NO frameborder=0 allowtransparency="true"></IFRAME>');
	}
	function SetCommmentSize(item_id, size)
	{
		$('#COMMENTS_'+item_id).height(size);
	}