/*set cookie */
function setCookie( name, value, path, domain, expires, secure ) {
	// set time, it's in milliseconds
	var today = new Date();
	today.setTime( today.getTime() );

	/*
	if the expires variable is set, make the correct 
	expires time, the current script below will set 
	it for x number of days, to make it for hours, 
	delete * 24, for minutes, delete * 60 * 24
	*/
	
	var expires_date = new Date( today.getTime() + (expires) );

	document.cookie = name + "=" +escape( value ) +
	( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) + 
	( ( path ) ? ";path=" + path : "" ) + 
	( ( domain ) ? ";domain=" + domain : "" ) +
	( ( secure ) ? ";secure" : "" );
}

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 ""
	}

/* splash */ 
function loadSplash() {
	ToggleSplash = getCookie('ToggleSplash');
	//write cookie and redirect to normal DLM Homepage if splash is played
	if (ToggleSplash == 'true' || ToggleSplash == '' || ToggleSplash == null)
	{
		//set ToggleSplash to be false, flash won't be play next time
		setCookie('ToggleSplash', 'false', '/', '.go.com', 365*24*60*60*1000, '')
		//setTimeout("location.href = location.href;", 10000);
		setTimeout("location.reload(true);", 10000);
	}
}

/* skip flash intro */ 
function skipIntro() {
	//write cookie and redirect to normal DLM Homepage
	//set ToggleSplash to be false, flash won't be play next time
	setCookie('ToggleSplash', 'false', '/', '.go.com', 365*24*60*60*1000, '')
	
	//setTimeout("location.href = location.href;", 1);
	setTimeout("location.reload(true);", 1);
}

window.onload = loadSplash;