var the_date = new Date();
the_date.setTime(the_date.getTime() + (365*24*60*60*1000));
var exp_date = '; expires=' + the_date.toGMTString();

function setCookie(name, value, expires, path, domain)
	{
	if ( value != 'empty' )
		{
		var setPath =(path) ? '; path=' + path : '; path=/';	
		var setDomain = (domain) ? '; domain=' + domain : '';
		if (expires == 'no')
			document.cookie = name + '=' + escape(value) +'#' + exp_date +setDomain + setPath +  ';' ;
		else
			document.cookie = name + '=' + escape(value) +'#' +setDomain + setPath +  ';' ;
	}
}
	
function getCookie(name)
{
	var theCookie = document.cookie;
	var whichCookie = name + '=';
	var rightCookie = theCookie.indexOf(whichCookie);
	if (rightCookie != -1)
	{
		var startCookie = rightCookie + whichCookie.length;
		var endCookie = theCookie.indexOf('#',startCookie);
		if (endCookie == -1)
		{
			endCookie = theCookie.length;
		}
		var theValue= unescape(theCookie.substring(startCookie, endCookie));
		return theValue;
	}
	else
	{
		var theValue ='empty';
		return theValue;
	}
}

function skipalways() {
	setCookie('flash','true','no');
	window.location = "index2.php";
}
	
function skiponce() {
	setCookie('flash','true','yes');
	window.location = "index2.php";
}