function redirect(pParam) {
	if ( pParam == null && !isCookie("scottsTest") ) {
		//window.location = "http://www1.scotts.com/";
	} else {
		var expdate = new Date (); // pre-set to the current time and date
		expdate.setTime(expdate.getTime() + 1000 * 60 * 60 * 24 * 7); // add week to it 
		setCookie("scottsTest","true",expdate);
		//  Comment this out until we change the dns again
		//if(document.domain='prodatg.scotts.com')
		//{
		// window.location="http://www.scotts.com/";
		//}
	}
}

function setCookie(name, value, expires) {
	// no expiration date specified? use this date and it will just be deleted soon.
	if (!expires) expires = new Date(); 
	document.cookie = name + "=" + escape(value) + "; expires=" + expires.toGMTString() + "; path=/";
}
function isCookie(name) {
	var cookies = document.cookie;
	if (cookies.indexOf(name) != -1) {
		var startpos = cookies.indexOf(name)+name.length+1;
		return true;
	} else {
		return false; // the cookie couldn't be found! it was never set before, or it expired.
	}
}

function showLangToggle() {
	window.open('/smg/languageToggle.jsp','langPop',
		'width=310,height=125,resizable=no,scrollbars=no,toolbar=no,location=no,' + 
		'directories=no,status=no,menubar=no,copyhistory=no' +
		'screenY=50,screenX=50,left=50,top=50');
}
