// JavaScript Document

// some functions to get and set cookie values
// first a function to create the cookies
function createCookie (name,value,days) 
	{
	if (days) 
		{
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
		}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
	}

// then a function to read previously created cookies
function readCookie (name) 
	{
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) 
		{
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
		}
	return null;
	}

// this function launches the intro
function launchIntro ()
	{
	// first check the browser cookies to see if we have already shown this particular user the intro
	check = readCookie("shown");
	if( check != "true" )
		{
		// create the popup box by using the Icebox function createPopup ()
		createPopup2( "intro_html.html" );
		setTimeout( hidePopup, 10000 );
		// now that we have shown the intro once we need to set a cookie so that it won't be shown again in the next 7 days
		createCookie( "shown", "true" );
		}
	}

// launch the initialization function when the page is loaded
jQuery(document).ready( launchIntro );