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

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;
}

function eraseCookie(name) {
	createCookie(name,"",-1);
}
function openlink(param1,param2)
{
	var discountWindow = window.open('/js/discountpopup.php?code='+param1,'discountwindow','toolbar=yes,location=yes,directories=yes,resizable=yes,scrollbars=yes');
	var timeSaverCheck = document.getElementById('tsTick');
	if (timeSaverCheck.checked)
	{
	window.location.href=param2;
	}
}

function timesaverset()
{
	var tsCookie = readCookie('tsCookie');
	if (tsCookie)
	{
		var timeSaverCheck = document.getElementById('tsTick');
		if (tsCookie=='true')
		{
			timeSaverCheck.checked=true;
		}
		else
		{
			timeSaverCheck.checked=false;
		}
	}
	else
	{
		createCookie('tsCookie','true',0);
	}
}

function timesaverupdate()
{
	var timeSaverCheck = document.getElementById('tsTick');
	if (timeSaverCheck.checked)
	{
		createCookie('tsCookie','true',0);
	}
	else
	{
		createCookie('tsCookie','false',0);
	}
}

//Hide status bar msg II script- by javascriptkit.com
////Visit JavaScript Kit (http://javascriptkit.com) for script
////Credit must stay intact for use

function hidestatus(){
window.status=''
return true
}

function jsEnableLinks()
{
for (i=0; i < document.links.length; i++) //cycle through all links on the page
{
document.links[i].onmouseover = hidestatus;
document.links[i].onmouseout = hidestatus;
}
}

function initPage()
{
	timesaverset();
	jsEnableLinks();
}
