function redirectSc(){

// No longer using this statement

//	window.location = 'http://professionalteethwhitening.com/~' + (shoCart) + '/shoppingcart/products.php?PARTNER=' + (affCode);

//

//

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

	var url =  window.location.hostname;

//

//

//This block of code tests the variable and if it matches the case, it redirects the browser to the location given

switch (url) {

case '61white.com':

    window.location = 'http://professionalteethwhitening.com/shoppingcart/products.php?PARTNER=white61';

    break;

case '71white.com':

    window.location = 'http://professionalteethwhitening.com/shoppingcart/products.php?PARTNER=ptwhite';

    break;

case 'brighterimagelab.com':

    window.location = 'http://professionalteethwhitening.com/shoppingcart/products_lp.php?PARTNER=brighter';

    break;

case 'britesmilelive.com':

    window.location = 'http://professionalteethwhitening.com/shoppingcart/products_lp.php?PARTNER=brightsmi';

    break;

case 'castlewhitening.com':

    window.location = 'http://professionalteethwhitening.com/shoppingcart/products_lp.php?PARTNER=castlewh';

    break;

case 'cosmeticteethbleaching.com':

    window.location = 'http://professionalteethwhitening.com/shoppingcart/products_lp.php?PARTNER=cosmettb';

    break;

case 'ewhitening.com':

    window.location = 'http://professionalteethwhitening.com/shoppingcart/products.php?PARTNER=ewhiteni';

    break;

case 'ewhiteteeth.com':

    window.location = 'http://professionalteethwhitening.com/shoppingcart/products_lp.php?PARTNER=ewhitete';

    break;

case 'labdirectteethwhitening.com':

    window.location = 'http://labdirectteethwhitening.com/shoppingcart/products.php?PARTNER=labdirectteethwhitening.com';

    break;

case 'labdirectwhitening.com':

    window.location = 'http://professionalteethwhitening.com/shoppingcart/products_lp.php?PARTNER=labdirec';

    break;

case 'laserteethwhitening4less.com':

    window.location = 'http://professionalteethwhitening.com/shoppingcart/products_lp.php?PARTNER=lasertee';

    break;

case 'onlineteethbleaching.com':

    window.location = 'http://professionalteethwhitening.com/shoppingcart/products.php?PARTNER=onlinete';

    break;

case 'onlinewhitening.com':

    window.location = 'http://professionalteethwhitening.com/shoppingcart/products_lp.php?PARTNER=onlinewh';

    break;

case 'opalescence.biz':

    window.location = 'http://professionalteethwhitening.com/shoppingcart/products_lp.php?PARTNER=opalbiz';

    break;

case 'opalescencedirect.com':

    window.location = 'http://professionalteethwhitening.com/shoppingcart/products_lp.php?PARTNER=opalesce';

    break;

case 'opalescencegel.com':

    window.location = 'http://professionalteethwhitening.com/shoppingcart/products_lp.php?PARTNER=opalgel';

    break;

case 'opalescenceteethwhitening.com':

    window.location = 'http://professionalteethwhitening.com/shoppingcart/products_lp.php?PARTNER=opalestw';

    break;

case 'professionalteethbleaching.com':

    window.location = 'http://professionalteethwhitening.com/shoppingcart/products.php?PARTNER=ptbleach';

    break;

case 'salonteethwhitening.com':

    window.location = 'http://professionalteethwhitening.com/shoppingcart/products_lp.php?PARTNER=salontee';

    break;

case 'smilecenterlive.com':

    window.location = 'http://professionalteethwhitening.com/shoppingcart/products_lp.php?PARTNER=smilecen';

    break;

case 'smilecenteronline.com':

    window.location = 'http://professionalteethwhitening.com/shoppingcart/products_lp.php?PARTNER=smileonl';

    break;

case 'smilewhiteningkit.com':

    window.location = 'http://professionalteethwhitening.com/shoppingcart/products_lp.php?PARTNER=smilewhi';

    break;

case 'teethbleachingdirect.com':

    window.location = 'http://professionalteethwhitening.com/shoppingcart/products_lp.php?PARTNER=teethble';

    break;

case 'teethwhitening.net':

    window.location = 'http://professionalteethwhitening.com/shoppingcart/products.php?PARTNER=teethwhi';

    break;

case 'teethwhiteningathome.net':

    window.location = 'http://professionalteethwhitening.com/shoppingcart/products_lp.php?PARTNER=teethome';

    break;

case 'teethwhiteningathome4less.com':

    window.location = 'http://professionalteethwhitening.com/shoppingcart/products_lp.php?PARTNER=twathome';

    break;

case 'teethwhiteninghouston.com':

    window.location = 'http://professionalteethwhitening.com/shoppingcart/products_lp.php?PARTNER=twhousto';

    break;

case 'teethwhiteninglab.com':

    window.location = 'http://teethwhiteninglab.com/shoppingcart/products.php?PARTNER=teethlad';

    break;

case 'teethwhiteningsale.com':

    window.location = 'http://professionalteethwhitening.com/shoppingcart/products_lp.php?PARTNER=teethsal';

    break;

case 'teethwhiteningsalons.com':

    window.location = 'http://professionalteethwhitening.com/shoppingcart/products_lp.php?PARTNER=twsalons';

    break;

case 'whitesmilelive.com':

    window.location = 'http://professionalteethwhitening.com/shoppingcart/products_lp.php?PARTNER=whitlive';

    break;

case 'whiteteethbleaching.com':

    window.location = 'http://professionalteethwhitening.com/shoppingcart/products_lp.php?PARTNER=whiteble';

    break;

case 'whiteteethdirect.com':

    window.location = 'http://professionalteethwhitening.com/shoppingcart/products_lp.php?PARTNER=whitedir';

    break;

case 'whiteteethonline.net':

    window.location = 'http://professionalteethwhitening.com/shoppingcart/products_lp.php?PARTNER=whiteonl';

    break;

case 'whiteteethsale.com':

    window.location = 'http://professionalteethwhitening.com/shoppingcart/products_lp.php?PARTNER=whitesal';

    break;

case 'zoomteethwhitening4less.com':

    window.location = 'http://professionalteethwhitening.com/shoppingcart/products_lp.php?PARTNER=zoomteet';

    break;

case 'professionalteethwhitening.com':

	  window.location = 'http://professionalteethwhitening.com/shoppingcart/products.php?PARTNER=professi';

    break;

default:

    window.location = 'http://professionalteethwhitening.com/shoppingcart/products.php?PARTNER=' + url;

}

}





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

//

//

//This block of code tests the variable and if it matches the case, it redirects the browser to the location given

switch (site) {

case '61white.com':

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

    break;

case '71white.com':

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

    break;

case 'brighterimagelab.com':

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

    break;

case 'britesmilelive.com':

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

    break;

case 'castlewhitening.com':

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

    break;

case 'cosmeticteethbleaching.com':

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

    break;

case 'ewhitening.com':

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

    break;

case 'ewhiteteeth.com':

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

    break;

case 'labdirectteethwhitening.com':

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

    break;

case 'labdirectwhitening.com':

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

    break;

case 'laserteethwhitening4less.com':

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

    break;

case 'onlineteethbleaching.com':

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

    break;

case 'onlinewhitening.com':

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

    break;

case 'opalescence.biz':

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

    break;

case 'opalescencedirect.com':

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

    break;

case 'opalescencegel.com':

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

    break;

case 'opalescenceteethwhitening.com':

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

    break;

case 'professionalteethbleaching.com':

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

    break;

case 'salonteethwhitening.com':

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

    break;

case 'smilecenterlive.com':

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

    break;

case 'smilecenteronline.com':

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

    break;

case 'smilewhiteningkit.com':

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

    break;

case 'teethbleachingdirect.com':

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

    break;

case 'teethwhitening.net':

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

    break;

case 'teethwhiteningathome.net':

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

    break;

case 'teethwhiteningathome4less.com':

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

    break;

case 'teethwhiteninghouston.com':

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

    break;

case 'teethwhiteninglab.com':

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

    break;

case 'teethwhiteningsale.com':

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

    break;

case 'teethwhiteningsalons.com':

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

    break;

case 'whitesmilelive.com':

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

    break;

case 'whiteteethbleaching.com':

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

    break;

case 'whiteteethdirect.com':

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

    break;

case 'whiteteethonline.net':

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

    break;

case 'whiteteethsale.com':

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

    break;

case 'zoomteethwhitening4less.com':

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

    break;

default:

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

    break;

}

}

}



//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');

//	}

	

//}

//}