<!--


/*
	include in the source file with the following

	<script type="text/javascript" src="cookies.js"></script>

*/


function SaveLogin()
{
	if (document.getElementById("autologin").checked)
	{
		setCookie("autologin","1","100");
	}
	else
	{
		setCookie("autologin","0","100");
	}


}


function CheckLogin()
{
	document.getElementById("autologin").checked=true;
}


function UncheckLogin()
{
	document.getElementById("autologin").checked=false;
}













// check to see if cookies are enabled

function checkCookies()
{

	if (navigator.cookieEnabled == 0) {
	  alert("You need to enable cookies for this site to load properly!");
	}
}





/*
In this function  we first convert the number of days to a valid date, then we add the number of days until 
the cookie should expire. After that we store the cookie name, cookie value and the 
expiration date in the document.cookie object.

*/

function setCookie(c_name,value,expiredays)
{
var exdate=new Date();
exdate.setDate(exdate.getDate()+expiredays);
document.cookie=c_name+ "=" +escape(value)+
((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}


/*
This function  first checks if a cookie is stored at all in the document.cookie object. If the 
document.cookie object holds some cookies, then check to see if our specific 
cookie is stored. If our cookie is found, then return the value, if not - return an empty string.

*/

function getCookie(c_name)
{
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=");
  if (c_start!=-1)
    { 
    c_start=c_start + c_name.length+1; 
    c_end=document.cookie.indexOf(";",c_start);
    if (c_end==-1) c_end=document.cookie.length;
    return unescape(document.cookie.substring(c_start,c_end));
    } 
  }
return "";
}






function deleteCookie( c_name) {
  if ( getCookie( c_name ) ) 
	document.cookie = name + "=" +    "";

expires="Thu, 01-Jan-1970 00:00:01 GMT";
}
















function setCookieMulti( name, value, expires, path, domain, secure ) {
  var today = new Date();
  today.setTime( today.getTime() );
  if ( expires ) {
    expires = expires * 1000 * 60 * 60 * 24;
  }
  var expires_date = new Date( today.getTime() + (expires) );
  document.cookie = name+"="+escape( value ) +
    ( ( expires ) ? ";expires="+expires_date.toGMTString() : "" ) + //expires.toGMTString()
    ( ( path ) ? ";path=" + path : "" ) +
    ( ( domain ) ? ";domain=" + domain : "" ) +
    ( ( secure ) ? ";secure" : "" );
}





function getCookieMulti( name ) {
  var start = document.cookie.indexOf( name + "=" );
  var len = start + name.length + 1;
  if ( ( !start ) && ( name != document.cookie.substring( 0, name.length ) ) ) {
    return null;
  }
  if ( start == -1 ) return null;
  var end = document.cookie.indexOf( ";", len );
  if ( end == -1 ) end = document.cookie.length;
  return unescape( document.cookie.substring( len, end ) );
}







function deleteCookieMulti( name, path, domain ) {
  if ( getCookie( name ) ) document.cookie = name + "=" +
    ( ( path ) ? ";path=" + path : "") +
    ( ( domain ) ? ";domain=" + domain : "" ) +
    ";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}

//-->


