function testCookie(){ //tests whether the cookie exists (visitor has entered their email)

var x = readCookie('emailcookie');

var appletShutdown = false;

if (x) { //if the cookie exists, the script hides the popup immediately

	//hideItdark();

	hideItdark2();

}

else if (appletShutdown == true){ //switch can be set on individual pages to hide popup immediately

	//hideItdark();

	hideItdark2();

}

else	 { //if neither the cookie nor the switch exists, show the popup

	setTimeout("showItdark2()", 30000); //sets a timer to 30 seconds for the email popup

	

	//This line defines the variable as the URL address without the 'http://' prefix or the specific file name 	

	var site =  window.location.hostname;

//

//

    setTimeout("redirectSc()", 180000); //sets a timer to 180 seconds (3 minutes) for the redirect to shoppingcart

}

}





//function doPopup() {

//url = "http://server.iad.liveperson.net/hc/6523775/?cmd=file&file=visitorWantsToChat&site=6523775&imageUrl=http://professionalteethwhitening.com/~white61/offers&referrer=";

//width = 472;  // width of window in pixels

//height = 320; // height of window in pixels

//delay = 10;    // time in seconds before popup opens

//timer = setTimeout("Start(url, width, height)", delay*1000);

//newwindow=setTimeout("window.open(url,'video','height=320,width=472')",delay*1000);

//}



//function testLpCookie(){

//var x = readCookie('lpcookie');

//if (x) {

//	doPopup();	

//}

//else	 {

//	if (url.indexOf('?') <= -1){

//	document.location.href = ('index.html' + '?' + 'ref' + '=' + '27');

//	}

	

//}

//}
