function setCookie(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=/";
}

function getCookie(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;
}

function initSplash() {
	$(function() {
		$.fancybox({
			'autoDimensions'	: false,
			'autoScale'			: false,
			'width'         	: 700,
			'height'        	: 500,
			'transitionIn'		: 'none',
			'transitionOut'		: 'none',
			'overlayColor'		: '#000',
			'overlayOpacity'	: 0.8,
			'type'				: 'iframe',
			'href'				: 'http://us3.com/splash/splash.html',
			'scrolling'			: 'no',
			'onComplete'		: setCookie('splashLoaded', 1, 1)
		});
	});
}

$(document).ready(function($){
	if(!getCookie('splashLoaded')){
		initSplash();
	}
});
