// 
//Author: Adrian Bulgariu
//Action: Repairs the location cookie
//

if (location.href.lastIndexOf('=') !=-1)
{

	function setcookie ( name, value, exp_y, exp_m, exp_d, path, domain, secure)
	{
	  var cookie_string = name + "=" + escape ( value );
	
	  if ( exp_y )
	  {
		var expires = new Date ( exp_y, exp_m, exp_d );
		cookie_string += "; expires=" + expires.toGMTString();
	  }
	
	  if ( path )
			cookie_string += "; path=" + escape ( path );
	
	  if ( domain )
			cookie_string += "; domain=" + escape ( domain );
	
	  if ( secure )
			cookie_string += "; secure";
	
	  document.cookie = cookie_string;
	}

	firstpos=location.href.lastIndexOf('=')+1;
	lastpos=location.href.length;
	lh=location.href.substring(firstpos,lastpos);
	setcookie('location', lh);
	
}

