function showDebug() 
{
	alert("products ....: " + sessvars.shoppingCartProduct + "\nquantities ..: " + sessvars.shoppingCartQuantity);
}

function setProductSession(prodList, prodQtd)
{
	sessvars.shoppingCartProduct = prodList;	
	sessvars.shoppingCartQuantity = prodQtd;
	// showDebug();
}

// COOKIES END /////////////////////////////////////////////////////////////////


function addFavourite (querystring, title)
{
	var site = "http://www.ky.com/index_us.jsp?section=";
	if(document.all)
	{
		window.external.AddFavorite (site+querystring, title);
	}
	else
	{
		window.sidebar.addPanel(title, site+querystring, "");
		alert("Remember to uncheck the \"Load this bookmark in the sidebar\" on this bookmark´s properties.");
	}
}

function ReadyToBuy(prodList, quantList)
{
	var theForm = document.getElementById("frm-drugstore");
	var hdnProdList = document.getElementById("hdnProdList");
	var hdnQuantList = document.getElementById("hdnQuantList");
	
	hdnProdList.value = prodList;
	hdnQuantList.value = quantList;

	// if the disclaimer window should be showed
	// showDisclaimerBuy();
	buy();
}

function buy()
{
	var theForm = document.getElementById("frm-drugstore");
	theForm.target = "_blank";
	theForm.submit();
}

function showDisclaimerBuy()
{
	document.getElementById('disclaimer').style.display = 'block';
	var disclaimerText = "This link will take you to a Web site to which this <a href=\"index_us.jsp?section=privacy\" title=\"Privacy Policy\">Privacy Policy</a> does not apply. <br />We encourage you to read the <a href=\"index_us.jsp?section=privacy\" title=\"Privacy Policy\">Privacy Policy</a> of every Web site you visit."
	
	topPosition = (document.all)?document.documentElement.scrollTop:window.pageYOffset; 
	centerPosition = (document.documentElement.clientWidth - document.getElementById('disclaimer').offsetWidth) / 2;
	
	document.getElementById('disclaimer-iframe').style.display = 'block';
	document.getElementById('disclaimer-iframe').style.visibility = 'hidden';
	document.getElementById('disclaimer-iframe').style.zIndex = 10;
	document.getElementById('disclaimer').style.zIndex = 50;
	
	document.getElementById('disclaimer-txt').innerHTML = disclaimerText;
	
	document.getElementById('disclaimer-iframe').style.left = centerPosition + "px";
	document.getElementById('disclaimer-iframe').style.top = topPosition + 250 + "px";
	
	document.getElementById('disclaimer').style.left = centerPosition + "px";
	document.getElementById('disclaimer').style.top = topPosition + 250 + "px";

	document.getElementById("link").style.display = "none";

	document.getElementById("btnAccept").style.display = "block";
}

function showDisclaimer (disclaimerText,linkId,type) {

	switch(linkId.substring(8)){
	case ("bali.swf"):
		// linkId = "http://www.drugstore.com/products/prod.asp?pid=139741&catid=21303&brand=7944&trx=PLST-0-BRAND&trxp1=21303&trxp2=139741&trxp3=1&trxp4=0&btrx=BUY-PLST-0-BRAND&cmbProdBrandFilter=7944";
		// linkId = "http://www.drugstore.com/products/prod.asp?pid=139741&aid=337919";
		linkId = "http://www.drugstore.com/products/prod.asp?pid=139741&aid=337919&aparam=ky";
		break;
		
	case ("fireside.swf"):
		linkId = "http://www.drugstore.com/search/search.asp?searchtype=1&trx=28198&trxp1=60&ipp=20&srchtree=1&search=KY";
		break;
	
	case ("fireice.swf"):
		linkId = "http://www.drugstore.com/products/prod.asp?pid=139744&catid=21303&brand=7944&trx=PLST-0-BRAND&trxp1=21303&trxp2=139744&trxp3=1&trxp4=0&btrx=BUY-PLST-0-BRAND&cmbProdBrandFilter=7944";
		break;
	
	case ("imc.swf"):
		// linkId = "http://www.drugstore.com/products/prod.asp?pid=151255&catid=21303&trx=PLST-0-SEARCH&trxp1=21303&trxp2=151255&trxp3=1&trxp4=0&btrx=BUY-PLST-0-SEARCH";
		linkId = "http://www.drugstore.com/products/prod.asp?pid=177390&aid=337919";
		break;
	
	case ("jelly.swf"):
		// linkId = "http://www.drugstore.com/products/prod.asp?pid=12679&catid=682&trx=PLST-0-SEARCH&trxp1=682&trxp2=12679&trxp3=1&trxp4=0&btrx=BUY-PLST-0-SEARCH";
		// linkId = "http://www.drugstore.com/products/prod.asp?pid=12679&aid=337919";
		linkId = "http://www.drugstore.com/products/prod.asp?pid=12679&aid=337919&aparam=ky";
		break;
	
	case ("liquibeads.swf"):
		// linkId = "http://www.drugstore.com/products/prod.asp?pid=87142&catid=682&trx=PLST-0-SEARCH&trxp1=682&trxp2=87142&trxp3=1&trxp4=0&btrx=BUY-PLST-0-SEARCH";
		// linkId = "http://www.drugstore.com/products/prod.asp?pid=166229&aid=337919";
		linkId = "http://www.drugstore.com/products/prod.asp?pid=166229&aid=337919&aparam=ky";
		break;
	
	case ("longlasting.swf"):
		// linkId = "http://www.drugstore.com/products/prod.asp?pid=87142&catid=682&trx=PLST-0-SEARCH&trxp1=682&trxp2=87142&trxp3=1&trxp4=0&btrx=BUY-PLST-0-SEARCH";
		// linkId = "http://www.drugstore.com/products/prod.asp?pid=87142&aid=337919";
		linkId = "http://www.drugstore.com/products/prod.asp?pid=87142&aid=337919&aparam=ky";
		break;
	
	case ("lotionvariety.swf"):
		linkId = "http://www.drugstore.com/products/prod.asp?pid=160929&catid=95636&trx=PLST-0-SEARCH&trxp1=95636&trxp2=160929&trxp3=1&trxp4=0&btrx=BUY-PLST-0-SEARCH";
		break;
	
	case ("malibu.swf"):
		linkId = "http://www.drugstore.com/products/prod.asp?pid=154844&catid=95636&brand=7944&trx=PLST-0-BRAND&trxp1=95636&trxp2=154844&trxp3=1&trxp4=0&btrx=BUY-PLST-0-BRAND&cmbProdBrandFilter=7944";
		break;
	
	case ("naturalliquid.swf"):
		// linkId = "http://www.drugstore.com/products/prod.asp?pid=12684&catid=682&trx=PLST-0-SEARCH&trxp1=682&trxp2=12684&trxp3=1&trxp4=0&btrx=BUY-PLST-0-SEARCH";
		// linkId = "http://www.drugstore.com/products/prod.asp?pid=12684&aid=337919";
		linkId = "http://www.drugstore.com/products/prod.asp?pid=12684&aid=337919&aparam=ky";
		break;
	
	case ("naturalmist.swf"):
		linkId = "http://www.drugstore.com/products/prod.asp?pid=156102&catid=682&trx=PLST-0-SEARCH&trxp1=682&trxp2=156102&trxp3=1&trxp4=0&btrx=BUY-PLST-0-SEARCH";
		break;
	
	case ("naturalsilk.swf"):
		// linkId = "http://www.drugstore.com/products/prod.asp?pid=158787&catid=682&trx=PLST-0-SEARCH&trxp1=682&trxp2=158787&trxp3=1&trxp4=0&btrx=BUY-PLST-0-SEARCH";
		// linkId = "http://www.drugstore.com/products/prod.asp?pid=158787&aid=337919";
		linkId = "http://www.drugstore.com/products/prod.asp?pid=158787&aid=337919&aparam=ky";
		break;
	
	case ("oilvariety.swf"):
		// linkId = "http://www.drugstore.com/products/prod.asp?pid=148752&catid=21303&trx=PLST-0-SEARCH&trxp1=21303&trxp2=148752&trxp3=1&trxp4=0&btrx=BUY-PLST-0-SEARCH";
		// linkId = "http://www.drugstore.com/products/prod.asp?pid=148752&aid=337919";
		linkId = "http://www.drugstore.com/products/prod.asp?pid=148752&aid=337919&aparam=ky";
		break;
	
	case ("parislotion.swf"):
		linkId = "http://www.drugstore.com/products/prod.asp?pid=154842&catid=95636&brand=7944&trx=PLST-0-BRAND&trxp1=95636&trxp2=154842&trxp3=1&trxp4=0&btrx=BUY-PLST-0-BRAND&cmbProdBrandFilter=7944";
		break;
	
	case ("parisoil.swf"):
		// linkId = "http://www.drugstore.com/products/prod.asp?pid=139742&catid=21303&brand=7944&trx=PLST-0-BRAND&trxp1=21303&trxp2=139742&trxp3=1&trxp4=0&btrx=BUY-PLST-0-BRAND&cmbProdBrandFilter=7944";
		// linkId = "http://www.drugstore.com/products/prod.asp?pid=139742&aid=337919";
		linkId = "http://www.drugstore.com/products/prod.asp?pid=139742&aid=337919&aparam=ky";
		break;
	
	case ("secretlotion.swf"):
		linkId = "http://www.drugstore.com/products/prod.asp?pid=154843&catid=95636&brand=7944&trx=PLST-0-BRAND&trxp1=95636&trxp2=154843&trxp3=1&trxp4=0&btrx=BUY-PLST-0-BRAND&cmbProdBrandFilter=7944";
		break;
	
	case ("secretoil.swf"):
		linkId = "http://www.drugstore.com/products/prod.asp?pid=139743&catid=21303&brand=7944&trx=PLST-0-BRAND&trxp1=21303&trxp2=139743&trxp3=1&trxp4=0&btrx=BUY-PLST-0-BRAND&cmbProdBrandFilter=7944";
		break;
	
	case ("silk-e.swf"):
		// linkId = "http://www.drugstore.com/products/prod.asp?pid=38977&catid=682&trx=PLST-0-SEARCH&trxp1=682&trxp2=38977&trxp3=1&trxp4=0&btrx=BUY-PLST-0-SEARCH";
		// linkId = "http://www.drugstore.com/products/prod.asp?pid=38977&aid=337919";
		linkId = "http://www.drugstore.com/products/prod.asp?pid=38977&aid=337919&aparam=ky";
		break;
	
	case ("tingling.swf"):
		// linkId = "http://www.drugstore.com/templates/brand/default.asp?brand=7944&trx=SEARCH-BNAV-0-BSTORE&trxp2=7944";
		// linkId = "http://www.drugstore.com/products/prod.asp?pid=161430&aid=337919";
		linkId = "http://www.drugstore.com/products/prod.asp?pid=161430&aid=337919&aparam=ky";
		break;
	
	case ("tingling_ultra.swf"):
		// linkId = "http://www.drugstore.com/products/prod.asp?pid=166232&catid=72419&trx=PLST-0-CAT&trxp1=72419&trxp2=166232&trxp3=1&trxp4=0&btrx=BUY-PLST-0-CAT";
		// linkId = "http://www.drugstore.com/products/prod.asp?pid=166232&aid=337919";
		linkId = "http://www.drugstore.com/products/prod.asp?pid=166232&aid=337919&aparam=ky";
		break;
	
	case ("warming.swf"):
		// linkId = "http://www.drugstore.com/products/prod.asp?pid=139740&catid=21303&trx=PLST-0-SEARCH&trxp1=21303&trxp2=139740&trxp3=1&trxp4=0&btrx=BUY-PLST-0-SEARCH";
		if (type == "2.5")
		{
			// linkId = "http://www.drugstore.com/products/prod.asp?pid=148751&aid=337919";
			linkId = "http://www.drugstore.com/products/prod.asp?pid=148751&aid=337919&aparam=ky";
		}
		else
		{
			// linkId = "http://www.drugstore.com/products/prod.asp?pid=139740&aid=337919";
			linkId = "http://www.drugstore.com/products/prod.asp?pid=139740&aid=337919&aparam=ky";
		}
		
		break;
	
	case ("warmingjelly.swf"):
		// linkId = "http://www.drugstore.com/products/prod.asp?pid=90170&catid=682&trx=PLST-0-SEARCH&trxp1=682&trxp2=90170&trxp3=1&trxp4=0&btrx=BUY-PLST-0-SEARCH";
		if (type == "2.5")
		{
			// linkId = "http://www.drugstore.com/products/prod.asp?pid=90169&aid=337919";
			linkId = "http://www.drugstore.com/products/prod.asp?pid=90169&aid=337919&aparam=ky";
		}
		else
		{
			// linkId = "http://www.drugstore.com/products/prod.asp?pid=90170&aid=337919";
			linkId = "http://www.drugstore.com/products/prod.asp?pid=90170&aid=337919&aparam=ky";
		}
		break;
	
	case ("warmingliquid.swf"):
		// linkId = "http://www.drugstore.com/products/prod.asp?pid=84333&catid=682&trx=PLST-0-SEARCH&trxp1=682&trxp2=84333&trxp3=1&trxp4=0&btrx=BUY-PLST-0-SEARCH";
		if (type == "2.5")
		{
			// linkId = "http://www.drugstore.com/products/prod.asp?pid=84333&aid=337919";	
			linkId = "http://www.drugstore.com/products/prod.asp?pid=84333&aid=337919&aparam=ky";
		}
		else
		{
			linkId = "http://www.drugstore.com/products/prod.asp?pid=80872&aid=337919";	
		}

		break;
	
	case ("warmingmist.swf"):
		linkId = "http://www.drugstore.com/products/prod.asp?pid=156101&catid=682&trx=PLST-0-SEARCH&trxp1=682&trxp2=156101&trxp3=1&trxp4=0&btrx=BUY-PLST-0-SEARCH";
		break;
	
	case ("warmingsilk.swf"):
		// linkId = "http://www.drugstore.com/products/prod.asp?pid=158786&catid=682&trx=PLST-0-SEARCH&trxp1=682&trxp2=158786&trxp3=1&trxp4=0&btrx=BUY-PLST-0-SEARCH";
		// linkId = "http://www.drugstore.com/products/prod.asp?pid=158786&aid=337919";
		linkId = "http://www.drugstore.com/products/prod.asp?pid=158786&aid=337919&aparam=ky";
		break;
	
	case ("tingling_jelly.swf"):
		// linkId = "http://www.drugstore.com/products/prod.asp?pid=166230&catid=682";
		// linkId = "http://www.drugstore.com/products/prod.asp?pid=166230&aid=337919";
		linkId = "http://www.drugstore.com/products/prod.asp?pid=166230&aid=337919&aparam=ky";
		break;
	
	default:
	  
	}

	document.getElementById('disclaimer').style.display = 'block';
	
	topPosition = (document.all)?document.documentElement.scrollTop:window.pageYOffset; 
	centerPosition = (document.documentElement.clientWidth - document.getElementById('disclaimer').offsetWidth) / 2;
	
	document.getElementById('disclaimer-iframe').style.display = 'block';
	document.getElementById('disclaimer-iframe').style.visibility = 'hidden';
	document.getElementById('disclaimer-iframe').style.zIndex = 10;
	document.getElementById('disclaimer').style.zIndex = 50;
	
	document.getElementById('disclaimer-txt').innerHTML = disclaimerText;
	
	document.getElementById('disclaimer-iframe').style.left = centerPosition + "px";
	document.getElementById('disclaimer-iframe').style.top = topPosition + 250 + "px";
	
	document.getElementById('disclaimer').style.left = centerPosition + "px";
	document.getElementById('disclaimer').style.top = topPosition + 250 + "px";

	document.getElementById("link").href = linkId;
}

function closeDisclaimer(){
	document.getElementById('disclaimer').style.display = 'none';
	document.getElementById('disclaimer-iframe').style.display = 'none';
}
