// JavaScript Document
var PPCurTotal=0;
var timerObj=null;
var objParentDiv = null;
var objParentDiv_ = null;
var timeoutSet= false;
var resizeInProgress = false;
var thisIden = 0;

var isGrowing = false;
var isShrinking = false;
var divScrollParam = 10;
var divAnimParam = 10;

var topLocationOfCart = 110;
var leftLocationOfCart = 601;
var EImg='http://www.melaleuca.com/images/spacer_trans.gif'
if(document.location.href.match("hswion") || document.location.href.match("intranet")) {
	_rsPath='/website/ps/rsAjax.cfm';
} else {
	_rsPath='../ps/rsAjax.cfm';
}


//Browser detect
var detect = navigator.userAgent.toLowerCase();
var OS,browserName,version,total,thestring;

if (checkIt('konqueror'))
{
	browser = "Konqueror";
	OS = "Linux";
}

else if (checkIt('safari')) browserName = "Safari"
else if (checkIt('omniweb')) browserName = "OmniWeb"
else if (checkIt('opera')) browserName = "Opera"
else if (checkIt('webtv')) browserName = "WebTV";
else if (checkIt('icab')) browserName = "iCab"
else if (checkIt('msie')) browserName = "ie"
else if (!checkIt('compatible'))
{
	browserName = "netscape"
	version = detect.charAt(8);
}
else browserName = "An unknown browser";

if (!version) version = detect.charAt(place + thestring.length);

if (!OS)
{
	if (checkIt('linux')) OS = "Linux";
	else if (checkIt('x11')) OS = "Unix";
	else if (checkIt('mac')) OS = "Mac"
	else if (checkIt('win')) OS = "Windows"
	else OS = "an unknown operating system";
}

msiemacsize = 0;
function isaMac() { if (navigator.appVersion.indexOf("PPC") != -1 || navigator.appVersion.indexOf("68K") != -1) return true; else return false; }
if (navigator.appName == "Microsoft Internet Explorer" && isaMac() && parseInt(navigator.appVersion) <= 4 && navigator.appVersion.indexOf('MSIE 5') == -1)
	msiemacsize = 14;

function popWin(goPage,nom,windowWidth,windowHeight) 
{
	if (parseInt(navigator.appVersion) >= 4) { wX = (screen.width/2)-(windowWidth/2+10); wY = (screen.height/2)-(windowHeight/2+20); }
	else { wX = 0; wY = 0; }
	var popped = window.open(goPage,nom,'width='+windowWidth+',height='+(windowHeight+msiemacsize)+',status=no,menubar=no,scrollbars=no,resizable=yes,screenX='+wX+',screenY='+wY+',left='+wX+',top='+wY);
	if (navigator.appName=="Netscape" || document.all) popped.focus();
}

function chkPPTotal(PPMin){
	if(PPCurTotal < PPMin){
		document.getElementById('minPointWarning').style.display='block'
		return true;
	}
	return false;
}

function checkIt(string)
{
	place = detect.indexOf(string) + 1;
	thestring = string;
	return place;
}
// end browser detect
try {
	xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
	try {
		xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	} catch (E) {
		xmlhttp = false;
	}
}
if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
  xmlhttp = new XMLHttpRequest();
}

function recreateXMLHTTPObj(){
	try {
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
	
		try {
			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		} catch (E) {
			xmlhttp = false;
		}
	}
	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
	xmlhttp = new XMLHttpRequest();
	}
	
}

function getURLParam(strParamName){
	var strReturn = "";
	var strHref = window.location.href;
	if(strHref.indexOf("&") > -1 ){
		var strQueryString = strHref.substr(strHref.indexOf("&")).toLowerCase();
		var aQueryString = strQueryString.split("&");
		for( var iParam = 0; iParam < aQueryString.length; iParam++ ){
			if(aQueryString[iParam].indexOf(strParamName + "=") > -1 ){
				var aParam = aQueryString[iParam].split("=");
				strReturn = aParam[1];
				break;
			}
		}
	}
	return strReturn;
}

function addSolUGuardCal(sku){
	qty = 1;
	canDelete = 1;
	canChangeQty=0;
	deleteOnStartup=1;
	maxQtyInCart=1;
	prodPrice='';
	prodPoints='';
	prodType=0;
	pricing=2;
	InsertType=1;
	Ctype = 'MCart';
	DWREngine.setVerb("GET")
	DWREngine._execute(_rsPath, null, 'RSaddItemToCartWithAllParams', sku, qty, canDelete,canChangeQty, deleteOnStartup, maxQtyInCart, 1, 1, prodPrice,prodPoints,prodType,pricing,InsertType, GenCart);
}

function textSolUGuardCal(inID, addToCart){
	var textDiv = document.getElementById(inID);

	textDiv.style.display = "none";
	if(addToCart == 1) //if they clicked add to cart display that they added it
	{
		document.getElementById("showAltText"+inID).style.display = "block";
	}
	textDiv.style.display = "none"; //no longer display that div that they added to the cart or they clicked no thanks on

	
	var countOff = 0;
	
	if(document.getElementById("div4020") != null && typeof(document.getElementById("div4020")) != "undefined")
	{
		if(document.getElementById("div4020").style.display == "none" || document.getElementById("div4020").innerHTML =="You have successfully added the original Sol-U-Guard Botanitcal to your cart.")
			countOff = countOff + 1;
	}
	else
	{	countOff = countOff + 1;}

	if(document.getElementById("div8911") != null && typeof(document.getElementById("div8911")) != "undefined")
	{
		 if(document.getElementById("div8911").style.display == "none" ||  document.getElementById("div8911").innerHTML =="You have successfully added the original Sol-U-Guard Botanitcal to your cart.")
			countOff = countOff + 1;
	}
	else
	{	countOff = countOff + 1;}

	if(document.getElementById("div8901") != null && typeof(document.getElementById("div8901")) != "undefined")
	{
		if(document.getElementById("div8901").style.display == "none" ||  document.getElementById("div8901").innerHTML =="You have successfully added the original Sol-U-Guard Botanitcal to your cart.") 
			countOff = countOff + 1;
	}	
	else
	{	countOff = countOff + 1;}
	
	if(countOff==3)
	{
		rtnError();
	}
}

function addHealthSavingsCard(oCountryIden,oLangIden){
	var curDate = new Date();
	var startDate = new Date(2008,10,25);
	var endDate = new Date(2009,0,1);
	if(curDate >= startDate && curDate < endDate)
		sku = 2399;
	else
		sku = 1628;
	
	qty = 1;
	canDelete = 1;
	canChangeQty=0;
	deleteOnStartup=1;
	maxQtyInCart=1;
	prodPrice='';
	prodPoints='';
	prodType=0;
	pricing=2;
	InsertType=1;
	Ctype = 'MCart';
	DWREngine.setVerb("GET")
	DWREngine._execute(_rsPath, null, 'RSaddItemToCartWithAllParams', sku, qty, canDelete,canChangeQty, deleteOnStartup, maxQtyInCart, oCountryIden, oLangIden, prodPrice,prodPoints,prodType,pricing,InsertType, GenCart);
}

function addHealthSavingsCardSpouse(oCountryIden,oLangIden){
	sku = 1632;
	qty = 1;
	canDelete = 1;
	canChangeQty=0;
	deleteOnStartup=1;
	maxQtyInCart=1;
	prodPrice='';
	prodPoints='';
	prodType=0;
	pricing=2;
	InsertType=1;
	Ctype = 'MCart';
	DWREngine.setVerb("GET")
	DWREngine._execute(_rsPath, null, 'RSaddItemToCartWithAllParams', sku, qty, canDelete,canChangeQty, deleteOnStartup, maxQtyInCart, oCountryIden, oLangIden, prodPrice,prodPoints,prodType,pricing,InsertType, GenCart);
}


/******************************************************
Code from promo 79 (4778 gives 6999)
*******************************************************/
function setBoxesUpTo(count) {
	//disable all checkboxes and select boxes
	var checkboxArray = new Array();
	var selectArray = new Array();
	
	for(i = 0; i < 5; i++) {
		checkboxArray[i] = document.getElementById("rbBottleCount" + (i+1));
		selectArray[i] = document.getElementById("btlConfig" + (i+1));
		
		if(checkboxArray[i] != undefined) {
			checkboxArray[i].checked = false;
		}
		if(selectArray[i] != undefined) {
			selectArray[i].disabled = true;
		}
	}
	
	//enable up to count
	for(i = 0; i < count; i++) {
		if(checkboxArray[i] != undefined) {
			checkboxArray[i].checked = true;
		}
		if(selectArray[i] != undefined) {
			selectArray[i].disabled = false;
		}
	}
	return;
}

function setPromo6999Special() {
	var checkboxArray = new Array();
	var selectArray = new Array();
	var MsgTextArr = [];
	
	var configList = "";
	
	for(i = 0; i < 5; i++) {
		checkboxArray[i] = document.getElementById("rbBottleCount" + (i+1));
		selectArray[i] = document.getElementById("btlConfig" + (i+1));
		
		if(selectArray[i] != undefined && selectArray[i] != undefined && checkboxArray[i].checked) {
			//currentCheckbox was checked, append the value of the select box to the promoValue
			if(selectArray[i].selectedIndex == 0) { 
				//if nothing was selected, return an error alert
				MsgTextArr = (UserDefinedJsMessage[0]) ? UserDefinedJsMessage[0] : "You must specify which type of mixing spray bottle you would like to receive for your";
				MsgTextArr = (UserDefinedJsMessage[1]) ? UserDefinedJsMessage[1] : "bottle"
				alert(MsgTextArr[0] + ' ' + appendNumericSuffix(i+1) + ' ' + MsgTextArr[1] + '.');
				return;
			} else {
				configList += (selectArray[i].options[selectArray[i].selectedIndex].value + ",");
			}
			
		}
		
	}
	configList = configList.substr(0,configList.length - 1);
	//alert(configList);
	setPromo(79,configList);
}

function radioGetValue(objRadio){
	for (i = 0; i < objRadio.length; ++i){
		try{
			if (objRadio[i].checked){
				return objRadio[i].value;
			}
		}
		catch(errMsg){
			return 'undefined'
		}
	}
}

function appendNumericSuffix(number) {
	if(number == 11) {
		return '11th';
	} else if (number == 12) {
		return '12th';
	} else if (number == 13) {
		return '13th';
	} else {
		onesPlace = number % 10;
		if(onesPlace == 1) {
			return number + 'st';
		} else if (onesPlace == 2) {
			return number + 'nd';
		} else if (onesPlace == 3) {
			return number + 'rd';
		} else {
			return number + 'th';
		}
	}
}

function miniCartComplete(){
	if(document.cookie.substring(document.cookie.search("dontShowMiniCart=1"), 18) != 'dontShowMiniCart=1' && !hasAddedToMiniCart && showMiniCartOnProductAdd){
		hasAddedToMiniCart = true;
		showMiniCartOnProductAdd = false;
		document.cookie="dontShowMiniCart=1"
		if (!document.location.href.match("bc.") ) {
			showMiniCart();
		}
		setTimeout('showMiniCart()', 2000);
	}else{
		hasAddedToMiniCart = false;
	}
}
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;
}
var curChkOutKitBox
function chkOutKitBoxShow(oBox,oSwitch){
	curChkOutKitBox=document.getElementById(oBox);
	if(curChkOutKitBox != null)
	{
		curChkOutKitBox.disabled = oSwitch;	
	}
	//document.getElementById(curChkOutKitBox).disabled=oSwitch;
}
//rsAddProductXMLHTTP(sku, 'SCart', '0', 'index.cfm?f=ps.generateShoppingCart', 'divSCart', "checkIfOnViewCart()", '');
function rsAddProductXMLHTTP(oSKU, oCType, oProdType, rsFct, srcdiv, fctToCall, updQtyFlag){
    //aParams[0] = oSKU + delim + oProdType + delim + oCType;
	//RSID = jsrsExecute("rsfunction.cfm", GenCart, 'addProd', aParams);
	DWREngine.setVerb("GET")
	DWREngine._execute(_rsPath, null, rsFct, oSKU, oCType, oProdType, rtnCart);
	/*
	sndString = "oSKU=" + oSKU + "&oCType=" + oCType + "&oProdType=" + oProdType;
	if(updQtyFlag=='1'){
		sndString += "&oUpdQtyFlag=1";
	}
	postAsync(rsFct, srcdiv, sndString, fctToCall);
	return false;
	*/
}

function postAsync(pg, targDiv, sendString, fctCall){
xmlhttp.open("POST", pg,true);
xmlhttp.onreadystatechange=function(){
  if(xmlhttp.readyState==4) {
	  	try{
				if(errDoc != undefined) {
					try{
					errDoc.getElementById('divResponse').innerHTML = "<textarea style='width:100%; height: 70%;' wrap='off'>" + xmlhttp.responseText + "</textarea>";
					} catch(err2) {	}
				}
			if(targDiv!=''){
				objDiv = getElement(targDiv);
				if(objDiv != null){
					// grabbing the qty from each and every return.	
					tempVariable = xmlhttp.responseText.substring(xmlhttp.responseText.search("<EM style='DISPLAY: none;'>")+27,xmlhttp.responseText.search("</EM>"));
					if(parseInt(tempVariable)){
						document.getElementById('cartContentsNum').innerHTML = tempVariable
					}
					// done, update objDiv.
					//getElement('output').value = xmlhttp.responseText;
					loc='';
					if(xmlhttp.responseText.indexOf('<rsFctLocation>') > 0)
					{
						loc=xmlhttp.responseText.substring(xmlhttp.responseText.search("<rsFctLocation>")+15,xmlhttp.responseText.search("</rsFctLocation>"));
					}
					if(trim(loc)!='')
					{
						window.location = loc;
					}
					else
					{
						objDiv.innerHTML = xmlhttp.responseText;
					}
					//alert(xmlhttp.responseText);
					//document.getElementById('output').value = xmlhttp.responseText;
				}
			}
			//document.getElementById('testing').value = xmlhttp.responseText
			if(fctCall !=''){eval(fctCall);}
		}catch(err){
			//getElement('divDebug').innerHTML = xmlhttp.responseText; 
			alert('error occured during RS Call.'); 
			var r = '';
			for (var p in err)
			  r += p + ': ' + err[p] + '\n';
			alert(r);
		}
  }
}
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
xmlhttp.send(sendString);

	if(errDoc != undefined) {
		try{
		errDoc.getElementById('divSent').innerHTML = pg + "&" + sendString;
		errDoc.getElementById('divResponse').innerHTML = '';	
		} catch(err2) {	}
	}
}

function isNumeric(strValue){
	if (strValue == "")  { return false }
//	if (strValue.charAt(0) == "-")
//	    start = 1;
//	else
	    start = 0;
	for (i = start; i < strValue.length; i++){
	    if ((strValue.charAt(i) < "0") && (strValue.charAt(i) != ".")) { return false; }
	    if ((strValue.charAt(i) > "9") && (strValue.charAt(i) != ".")) { return false; }
	}
	return true;
}

function trim(strValue)
{
	var objRegExp = /^(\s*)$/;
	// Check for all spaces
	if (objRegExp.test(strValue)){
	    strValue = strValue.replace(objRegExp, '');
	    if( strValue.length == 0)
	        return strValue;
	}
	// Check for leading & trailing spaces
	objRegExp = /^(\s*)([\W\w]*)(\b\s*$)/;
	if (objRegExp.test(strValue)){
	    //remove leading and trailing whitespace characters
	    strValue = strValue.replace(objRegExp, '$2');
	}
	return strValue;
}


function MM_findObj(n, d) { 
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}



function showMiniCart(){
	try{
	if(resizeInProgress){return;}
	if(objParentDiv != null){
		if(objParentDiv.style.display == "block"){		
			divScrollParam = 10;
			shrinkDiv();
		}
		return;
	}
	objParentDiv=getElement('miniCart');
	objParentDiv_=getElement('innerCart');
	//timeMiniCartOut(4000);
	if(objParentDiv.style.display == "block"){
		divScrollParam = 10;
		shrinkDiv();
	}else{
		objParentDiv.style.display= "block";
		objParentDiv_.style.top = (objParentDiv_.offsetHeight * -1) + 'px';
		miniCartHeight = objParentDiv_.offsetHeight;
		objParentDiv.style.height = '0px';
		divScrollParam = 10;
		growDivTo(miniCartHeight);
		hideElement("SELECT",document.getElementById('maincontent'));
		if(arguments.length > 0 && arguments[0] == '1') {
			trackMiniCartView();			
		}
	}
	}catch(err){}
}

function rPX(inStr){return inStr.substring(0,inStr.indexOf('px'));}


function timeMiniCartOut(duration){
	if(timeoutSet){return;}
	objParentDiv=getElement('miniCart');
	objParentDiv_=getElement('innerCart');
	divScrollParam = 10;
	timerObj = setTimeout("shrinkDiv()",duration);
	timeoutSet = true;
}

function clearTimeOutMiniCart(){
	timeoutSet = false;
	clearTimeout(timerObj);
	timerObj=null;
}

var oldRC = "";
function highlightMiniCartRow(){
	oldRC = getElement('targMiniRow').style.backgroundColor;
	getElement('targMiniRow').style.backgroundColor = '66CC99';
	setTimeout('removeRedRow()',1000);
}

function removeRedRow(){getElement('targMiniRow').style.backgroundColor = oldRC;}

function growDivTo(maxHeight){
	try{
	if(isShrinking){return;}
	curHeight = rPX(objParentDiv.style.height);
	if(parseInt(curHeight) <= parseInt(maxHeight))	{
		if((parseInt(maxHeight) - parseInt(curHeight))<= divScrollParam){
			objParentDiv.style.height = maxHeight + 'px';
			objParentDiv_.style.top = -3 + 'px';
			objParentDiv = null;
			objParentDiv_ = null;
			isGrowing = false;
			resizeInProgress = false;
			if(hasAddedToMiniCart){highlightMiniCartRow(); //hasAddedToMiniCart = false;
			}
		}else{
			resizeInProgress = true;
			isGrowing = true;
			newHeight = parseInt(objParentDiv.style.height) + divScrollParam ;
			newTop = parseInt(objParentDiv_.style.top) + divScrollParam ;
			objParentDiv.style.height = newHeight + 'px';
			objParentDiv_.style.top = newTop + 'px';
			setTimeout('growDivTo('+ maxHeight +')',1);
		}
	}
	}catch(err){}
}

function shrinkDiv() {
	try{
	if(isGrowing){return;}
	curHeight = rPX(objParentDiv.style.height);
	if(parseInt(curHeight) > divScrollParam){
		resizeInProgress = true;
		isShrinking = true;
		newHeight = parseInt(objParentDiv.style.height) - divScrollParam ;
		newTop = parseInt(objParentDiv_.style.top) - divScrollParam ;
		objParentDiv.style.height = newHeight + 'px';
		objParentDiv_.style.top = newTop + 'px';
		setTimeout('shrinkDiv()',1);
	}else{
		resizeInProgress = false;
		isShrinking = false;
		objParentDiv.style.display = "none";
		if(objParentDiv.id == "miniCart"){
			document.getElementById('miniCartLine').style.display = 'none';
		}
		objParentDiv = null;
		objParentDiv_ = null;
		showElement("SELECT");
	}
	}catch(err){}
	
}

function divOpenClose(divName){
	try{
	if(resizeInProgress){return;}
	objParentDiv=getElement(divName);
	szIDv = divName + "_";
	objParentDiv_=getElement(szIDv);
	if(objParentDiv.style.display != "block"){
		objParentDiv.style.display = "block";
		objParentDiv_.style.top = (objParentDiv_.offsetHeight * -1) + 'px';
		growDivTo(objParentDiv_.offsetHeight);
	}else{
		shrinkDiv();
	}
	}catch(err){}
	return false;
}

function toggleGroupText(obj, txt, sku, prodIden){
	if(langIden==4){tstStr = "Seleccione " + txt;}else{tstStr = "Select " + txt;}
	gotErr = false;
	try{bgColor = getElement('kitRow'+sku).style.backgroundColor;}catch(errObj){gotErr = true;}
	if(!gotErr){ //for kits
		if(getElement('kitRow'+sku).style.backgroundColor != '#f6f6f6' && getElement('kitRow'+sku).style.backgroundColor.indexOf('246') == -1){
			if(langIden==4){obj.innerHTML = "Ocultar " + txt;}else{obj.innerHTML = "Hide " + txt;}

			try{
				objToChange = getElement('kitRow'+sku);
				getElement('kitRow'+sku).style.backgroundColor = '#f6f6f6';
				getElement('sDesc'+sku).style.backgroundColor = '#f6f6f6';
			}catch(err){}
			
		}else{
			obj.innerHTML = tstStr;
			try{
				objToChange = getElement('kitRow'+sku);
				getElement('kitRow'+sku).style.backgroundColor = '#FFFFFF';
				getElement('sDesc'+sku).style.backgroundColor = '#FFFFFF';
			}catch(err){}
		}
	}
	else
	{ //for groups
		szTst = obj.innerHTML;
		if(szTst.indexOf('Select')!=-1){
			obj.innerHTML = "Hide " + txt;
			try{
				objToChange = getElement('srcProd'+prodIden)
				getElement('srcProd'+prodIden).style.backgroundColor = '#f6f6f6';
				getElement('sDesc'+prodIden).style.backgroundColor = '#f6f6f6';
			}catch(err){}
			
		}else{
			obj.innerHTML = tstStr;
			try{
				objToChange = getElement('srcProd'+prodIden)
				getElement('srcProd'+prodIden).style.backgroundColor = '#FFFFFF';
				getElement('sDesc'+prodIden).style.backgroundColor = '#FFFFFF';
			}catch(err){}
			try{//hide any kit display that is in a group...
				eleStr = 'dvGrpKit' + prodIden;
				getElement(eleStr).style.display = 'none';
			}catch(err){}
		}
	}
}

function prodDetailShowZoom(mouseDisplay){
	var dz = document.getElementById("zoomImage") ;
	var kw = document.getElementById("kitWindow") ;
	
	if(mouseDisplay==1){
		prodDetailZoomRtn()
		return;
	}
	if(dz != null){
		if(dz.style.display=='block'){
			prodDetailZoomRtn()
		}else{

			if(kw != null)
				kw.style.display = 'none';
			
			newImg = getElement("divPhoto").style.background;
			newImg = newImg.substring(newImg.indexOf('(')+1,newImg.indexOf(')'));
			getElement("hidZoom").src = newImg.replace(new RegExp('display','g'),'zoom');
			dz.style.display='block' ;
		}
	}
}
function prodDetailZoomRtn(){
	document.getElementById('zoomImage').style.display='none';
	try{
		document.getElementById('kitWindow').style.display = 'block';
	} catch(e) {}
}

function getElement(eName){return document.getElementById(eName);}

function showGroupDetail(sku, retail, price, savings, pps, iden, img, imgPath, useridenfk, oLDesc, isKit, countryIden, kitDiv, accessState, oil, kosher, measureUnits){
	var TxtMessage = "";
	if(isKit==1){
		getElement('pdAdd').innerHTML = "";
		getElement('pdhQty').innerHTML = "";
		getElement('pdQty').innerHTML = '';
		getElement(kitDiv).style.display = 'block';
		getElement(kitDiv).style.height = '250px';
		fetchKit(kitDiv, sku, 0, countryIden, '', 0);
	}else{
		try{getElement(kitDiv).style.display = 'none';}catch(err){}
		getElement('pdhQty').innerHTML = "QTY";
		obj = getElement('pdQty').innerHTML = '<input type=\'text\' style=\'width: 18px\' class=\'qtyBox\' name=\'qtyD\' id=\'qtyD\' value=\'1\'>';
		//add button code.
		xTra = '' ;
		qtyValue = 'qtyD'
		var btnString = "" ;
		TxtMessage = (UserDefinedJsMessage[2]) ? UserDefinedJsMessage[2] : "Add To Cart";
		// add to cart
		getElement('pdAdd').innerHTML = '<div class="buttonwrapper"><a class="add1button" href="javascript:;" onclick="addProdFromProdDetail(\''+ sku +'\'); animateCartAdd(\''+iden+'\'); return false;"><span>' + TxtMessage + '</span></a></div>';
	}

	//table headers
	getElement('pdhSku').innerHTML = (UserDefinedJsMessage[3]) ? UserDefinedJsMessage[3] : "Sku";
	getElement('pdhRetail').innerHTML = (UserDefinedJsMessage[4]) ? UserDefinedJsMessage[4] : "Regular";
	getElement('pdhPrice').innerHTML = (UserDefinedJsMessage[5]) ? UserDefinedJsMessage[5] : "PC";
	getElement('pdhSavings').innerHTML = (UserDefinedJsMessage[6]) ? UserDefinedJsMessage[6] : "Savings";
	getElement('pdhPPS').innerHTML = (UserDefinedJsMessage[7]) ? UserDefinedJsMessage[7] : "PTS";
	if(getElement('imgOil') != null){
		getElement('imgOil').style.display = (oil && parseInt(oil) == 1) ? 'block' : 'none' ;
	}
	if(getElement('imgKosher') != null){
		getElement('imgKosher').style.display = (kosher && parseInt(kosher) == 1) ? 'block' : 'none' ;
	}
	
	var pSize = getElement('productSize') ;
	
	if(pSize != null)
		pSize.innerHTML = (measureUnits) ? "Size : " + measureUnits : "" ;
		
	var groupInfo = getElement('groupInfo') ;
		if(groupInfo != null)
			groupInfo.style.display = 'none' ;

	//table data
	getElement('pdSku').innerHTML = sku;
	getElement('pdRetail').innerHTML = retail;
	getElement('pdPrice').innerHTML = price;
	getElement('pdSavings').innerHTML = savings;
	getElement('pdPPS').innerHTML = pps;


	//prod name, title, desc, image
	getElement('prodTitle').innerHTML = getElement('hid_p_name'+iden).value;
	getElement('prodTag').innerHTML = getElement('hid_p_tag'+iden).value;
	getElement('prodDesc').innerHTML = getElement('hid_p_desc'+iden).value;
	getElement('divPhoto').style.background = "transparent url("+img+") no-repeat center";
	if(getElement('dspProdDetDiv') != null){
		dspProd = getElement('dspProdDetDiv') ;
		dspProd.innerHTML = '';
		dspProd.style.overflow = 'hidden'
		dspProd.innerHTML = oLDesc;
		dspProd.style.overflow = 'auto'
	}
		
}

function populateGrpItemNew(p_iden, divToHide, prodiden, imagename, gid, sku, price1, price2, savings, bps, aTag, imgPath, useridenfk, prodDetailLink, optText,username, isKit, countryIden, accessState, inStock){
	//image
	var MsgTextArr = [];
	MsgTextArr[0] = (UserDefinedJsMessage[8]) ? UserDefinedJsMessage[8] : "Add";
	MsgTextArr[1] = (UserDefinedJsMessage[9]) ? UserDefinedJsMessage[9] : "Hide";
	try{getElement('grpSelImage' + gid).src = imagename;}catch(err){}
	if(isKit==1){
		getElement(divToHide).style.display = 'block';
		getElement(divToHide).style.height = '250px';
		obj = getElement('grpSelGRPTag' + gid);
		obj.innerHTML = sku;
		obj.href=prodDetailLink;
		//imageLink
		getElement('grpSelHref' + gid).href=prodDetailLink;
		//name tag	
		getElement('grpProdName' + gid).innerHTML = getElement('hid_p_name' + p_iden).value;
		getElement('grpProdName' + gid).href = prodDetailLink;
		//short desc
	//	getElement('grpShortDesc' + gid).innerHTML = getElement('hid_p_desc' + p_iden).value;
		getElement('grpShortDesc' + gid).innerHTML = "";
		//retail price
		getElement('grpRetail' + gid).innerHTML = price1;
		//PC
		getElement('grpPC' + gid).innerHTML = price2;
		//Savings
		getElement('grpSV' + gid).innerHTML = savings;
		//PPS
		getElement('grpPPS' + gid).innerHTML = bps;
		//grpQty
		qtyName = "txtQty" + gid ;
		
		getElement('grpQty' + gid).innerHTML = "<input type='text' style='width: 18px' class='qtyBox' value='1' id='"+qtyName+"' name='"+qtyName+"' onclick=''>";
		qtyValue = 'document.getElementById(qtyName).value' ;
		//grpAdd
		xTra = '';
		var s = '' ;
		s += '<br><br><a href="javascript:;" onClick="toggleGroupText(this, \''+optText+'\', \'\',0);document.getElementById(\''+divToHide+'\').style.display=\'none\';return divOpenClose(\'dv'+gid+'\');"><strong>'+MsgTextArr[1]+' '+ optText +'</strong></a>' ;
		getElement('grpAdd' + gid).innerHTML = s ;
		fetchKit(divToHide, sku, 0, countryIden, '', 0);
	}else{
		hideDiv = divToHide.replace('dv','dvGrpKit');
		//alert(divToHide);
		//alert(hideDiv+'_');
		//alert(getElement('dvGrpKit3_'));
		try{getElement(hideDiv).style.display = 'none';
			//alert('call open close');
			//divOpenClose(hideDiv);
			//alert(getElement(hideDiv));
			//alert(getElement(hideDiv+'_'))
			//alert('done calling open close');
			}catch(errT){}
		//GrpTag
		obj = getElement('grpSelGRPTag' + gid);
		obj.innerHTML = sku;
		obj.href=prodDetailLink;
		//imageLink
		getElement('grpSelHref' + gid).href=prodDetailLink;
		//name tag	
		getElement('grpProdName' + gid).innerHTML = getElement('hid_p_name' + p_iden).value;
		getElement('grpProdName' + gid).href = prodDetailLink;
		//short desc
	//	getElement('grpShortDesc' + gid).innerHTML = getElement('hid_p_desc' + p_iden).value;
		getElement('grpShortDesc' + gid).innerHTML = "";
		//retail price
		getElement('grpRetail' + gid).innerHTML = price1;
		//PC
		getElement('grpPC' + gid).innerHTML = price2;
		//Savings
		getElement('grpSV' + gid).innerHTML = savings;
		//PPS
		getElement('grpPPS' + gid).innerHTML = bps;
		//grpQty
		qtyName = "txtQty" + gid ;
		getElement('grpQty' + gid).innerHTML = "<input type='text' style='width: 18px' class='qtyBox' value='1' id='"+qtyName+"' name='"+qtyName+"' onclick=''>";
		qtyValue = 'document.getElementById(qtyName).value' ;
		//grpAdd
		xTra = '';
		if(accessState!=2){xTra="alert('You must log in to use the shopping list.');return false;"}
		var s = '<table cellspacing=0 cellpadding=0 align=right>';
		if(inStock == 1){
			s += '<tr>';
			s += '<td><a href="javascript:;" onClick="_shoppingListObj_exe(event,\''+username+'\','+countryIden+',1,'+p_iden+')" title="Add to list"><img src="'+imgPath+'sList2.gif" border=0></a></td>';
			s += '<td><div class="buttonwrapper"><a class="add1button" href="javascript:;" onclick="addProdFromProdPage(\''+sku+'\',\'txtQty'+gid+'\'); animateCartAdd(\'srcProd'+gid+'\'); return false;" ><span>'+MsgTextArr[0]+'</span></a></div></td>';
			s += '</tr>';
			
		}else{
			s += '<tr><td colspan=2><span class="orange_txt">Temporarily Unavailable</span></td></tr>' ;	
		}
		s += '<tr><td colspan=2 align=right><br><br><a href="" onClick="toggleGroupText(this, \''+optText+'\', \'\',0);return handleGrpOption(\''+divToHide+'\');"><strong>' + MsgTextArr[1] + ' ' + optText +'</strong></a></td></tr>' ;
		s += '</table>'
		
		getElement('grpAdd' + gid).innerHTML = s ;
	}
}


function handleGrpOption(divToHide){
	divScrollParam = 20;
	sample = divOpenClose(divToHide);
	return false;
}


function findPosX(obj)
{
	var curleft = 0;
	if (obj.offsetParent){
		while (obj.offsetParent){
			curleft += obj.offsetLeft
			obj = obj.offsetParent;
		}
	}else if (obj.x)
		curleft += obj.x;
	return curleft;
}

function findPosY(obj){
	var curtop = 0;
	if (obj.offsetParent){
		while (obj.offsetParent){
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
	}else if (obj.y)
		curtop += obj.y;
	return curtop;
}

function DHTMLSound(surl) {
  document.getElementById('dummyspan').innerHTML = "<embed src='"+surl+"' hidden=true autostart=true loop=false>";
}

function animateCartAdd(src)
{
	//topLocationOfCart
	//leftLocationOfCart
	try{
		wireFrame = document.getElementById('dvWire');
		origDiv = document.getElementById(src);
		wireFrame.style.display = "block";
		wireFrame.style.height = origDiv.offsetHeight + 'px';
		wireFrame.style.width = origDiv.offsetWidth + 'px';
		wireFrame.style.top = findPosY(origDiv) + 'px';
		wireFrame.style.left = findPosX(origDiv) + 'px';
		var tx = parseInt(leftLocationOfCart);
		var ty = parseInt(topLocationOfCart);
		slideTo(tx, ty, 25, 50);
		//animateToCart();
		//moveToMiniCart();
	}catch(err){
		wireFrame.style.display = "none";
	}
}



function pos(x, y) {
  this.x = Math.round(x);
  this.y = Math.round(y);
}

var ar = new Array();
var arIdx = 0;
var deltaWidth = 0;
var deltaHeight = 0;
function hideMiniIcon() {
	document.getElementById('miniCartIcon').style.display='none'
}
function doSlide(){
	try{
	myControl = getElement('dvWire');
	myControl.style.top = Math.round(ar[arIdx].y) + 'px';
	myControl.style.left = Math.round(ar[arIdx].x) + 'px';
	
	myControl.style.height = (parseInt(myControl.style.height) - deltaHeight ) + 'px';
	myControl.style.width = (parseInt(myControl.style.width) - deltaWidth ) + 'px';
	
	if(arIdx != ar.length){
		arIdx++;
		setTimeout('doSlide()',2);
	}
	else
	{
		myControl.style.display = 'none';
		document.getElementById('miniCartIcon').style.display='block'
		setTimeout('hideMiniIcon()', 3000);
	}
	}catch(err){
		ar = new Array();
		arIdx = 0;
		deltaWidth = 0;
		deltaHeight = 0;
		myControl.style.display = 'none';
		document.getElementById('miniCartIcon').style.display='block'
		setTimeout('hideMiniIcon()', 3000);
	}
}

function slideTo(tx, ty, steps, interval, statement) {
  myControl = getElement('dvWire');
  var fx = parseInt(myControl.style.left);
  var fy = parseInt(myControl.style.top);
  var dx = parseInt(tx) - fx;
  var dy = parseInt(ty) - fy;
  //alert(ty);
  var sx = dx / steps;
  var sy = dy / steps;
  //var ar = new Array();
  for (var i = 0; i < steps; i++) {
    fx += parseInt(sx);
    fy += parseInt(sy);
	ar[i] = new pos(fx, fy);
	//alert(fx);
	//myControl.style.top = Math.round(fy) + 'px';
	//myControl.style.left = Math.round(fx) + 'px';
  }
  
  	arIdx = 0;
	
  	deltaWidth = Math.round(parseInt(myControl.style.width) / steps);
	deltaHeight = Math.round(parseInt(myControl.style.height) / steps);
  	doSlide();
}


var showMiniCartOnProductAdd = true;
var hasAddedToMiniCart = false;

function moveToMiniCart()
{
	
	/*
	if(showMiniCartOnProductAdd && !hasAddedToMiniCart){
		hasAddedToMiniCart = true;
		showMiniCart();
		setTimeout('showMiniCart()', 3000);
	}
	else
	{
		hasAddedToMiniCart = false;
	}
	objDest = getElement('miniNewItem');
	objWire = getElement('dvWire');

	try{
		objWire.style.top = findPosY(objDest)  + 'px';
		objWire.style.left = findPosX(objDest) + 'px';
	}catch(err){
		//object will not exist on product details page for now.
	}
	*/
}

var prodAddedFromProdPage = false;

function addProdFromProdPage(oSKU,oQTY,cartType){
	srcQty = getElement(oQTY);
	oQTY = srcQty.value;
	addProdQtyFromProdPage(oSKU,oQTY,cartType);
}

function addProdQtyFromProdPage(oSKU,oQTY,cartType){
	var TxtMessage = "";
	if(!isNumeric(oQTY) || trim(oQTY) == ''){
		TxtMessage = (UserDefinedJsMessage[10]) ? UserDefinedJsMessage[10] : "Please enter a valid quantity";
		alert(TxtMessage + '.');
		return false;
	}
	passValue = oSKU + '.' + oQTY;
	prodAddedFromProdPage = true;
	if (cartType == null) {
		Ctype='MCart';
	} else {
		Ctype=cartType;
	}
	DWREngine.setVerb("GET")
	DWREngine._execute(_rsPath, null, 'addProd', passValue, 0, Ctype, '', 0, 0, GenCart);
	return false;
}

function chkAdv(fwd){
	if(fwd==null){fwd='index.cfm?f=ps.contentPage&sCatID=100132';}
	if(fwd==''){fwd='index.cfm?f=ps.contentPage&sCatID=100132';}
	if(fwd=='undefined'){fwd='index.cfm?f=ps.contentPage&sCatID=100132';}
	DWREngine.setVerb("GET")
	DWREngine._execute(_rsPath, null, 'chkAdv', 1, fwd, rtnAdv);
}

function rtnAdv(co){
	if(co.ERROR == 0){
		window.location = co.FORWARDLOCATION;
	}else{
		document.getElementById('divMsgCarttxt').innerHTML = co.MSG;
		MM_showHideLayers('divMessage','','show')
		hideElement("SELECT",document.getElementById('maincontent'));
	}
}

function addImpulseBuy(sku,qty,loc,pos){
	var TxtMessage = "";
	srcQty = getElement(qty);
	qty = srcQty.value;
	
	if(trim(qty) == '' || !isNumeric(qty)){
		TxtMessage = (UserDefinedJsMessage[10]) ? UserDefinedJsMessage[10] : "Please enter a valid quantity";
		alert(TxtMessage + '.')
		return false;
	}
	
	passValue = sku + '.' + qty;
	prodAddedFromProdPage = true;
	Ctype='MCart';
	DWREngine.setVerb("GET")
	DWREngine._execute(_rsPath, null, 'addProdImp', passValue, 0, Ctype, '', 0, 0, loc, pos, GenCart);
	//rsAddProductXMLHTTP(passValue, 'MCart', '0', 'index.cfm?f=ps.generateMinicart', 'miniCartContents', "reloadCheckout()", '');
	if(OrderStep>1){
		OrderStep=1
		showCheckOut(Array('checkOut1','checkOut2','checkOut3'),500)
	}
	return false;
}
function reloadCheckout() {
	document.location.href = 'index.cfm?f=ps.checkOut';
}

function isEnterKey (evt){
  var keyCode = document.layers ? evt.which : document.all ? evt.keyCode : evt.keyCode;
  
  if (keyCode != 13)
    return false;
  else
    return true;
}

function toggleProdType(ckObj, oSKU, oType, oCartType){
	oProdTypeNew = 0;
	if(ckObj.checked){oProdTypeNew = 1;}
	DWREngine.setVerb("GET")
	DWREngine._execute(_rsPath, null, 'addProd', oSKU, oType, oCartType, oProdTypeNew, 1, 0, GenCart);
	//sndString = "oSKU=" + sku + "&oCType=" + cartType + "&oProdType=" + prodType + "&oProdTypeNew=" + oProdTypeNew;
	//postAsync('index.cfm?f=ps.generateShoppingCart', 'divSCart', sndString, '');
	return false;
}

function delFromCart(sku, prodType, cartType){
	passVal = sku + '.0';
	addProdQShop(passVal, prodType, cartType)
	//rsAddProductXMLHTTP(passVal, cartType, prodType,  'index.cfm?f=ps.generateShoppingCart', 'divSCart', "", '');
	nd();
	return false;
}

function addToCart_updQty(newQty, cartType, prodType){
	addProdQShop(newQty, prodType, cartType)
	//rsAddProductXMLHTTP(newQty, cartType, prodType,  'index.cfm?f=ps.generateShoppingCart', 'divSCart', "", '1');
	return false;
}

function addProdQShop(oSKU, oType, oCartType){
	//rsAddProductXMLHTTP(sku, 'SCart', '0', 'index.cfm?f=ps.generateShoppingCart', 'divSCart', "checkIfOnViewCart()", ''); 
	oSKU = oSKU.replace(/^\s+/, '');
	oSKU = oSKU.replace(/\s+$/, '');
	if(oSKU==''){return false;}
	if(oSKU == "190")
	{
		oSKU = "9215";
	}
	Ctype=oCartType;
	DWREngine.setVerb("GET")
	DWREngine._execute(_rsPath, null, 'addProd', oSKU, oType, oCartType, '', 1, 0, GenCart);

	try{
		document.frmQshop.qshop.value='';
		document.frmQshop.qshop.focus();
		document.frmQshop.qshop.select();
		document.frmQshop2.qshop.value='';
		document.frmQshop2.qshop.focus();
		document.frmQshop2.qshop.select();
	}catch(err){}
	return false;
}

function emptyCart(){
	DWREngine.setVerb("GET")
	DWREngine._execute(_rsPath, null, 'addProd', '', '', 'SCart', '', 0, 1, GenCart);
	return false
}

function checkIfOnViewCart()
{
	strSrch=window.location+'';
	strSrch=strSrch.toLowerCase();
	if(strSrch.indexOf('ps.shoppingcart') == -1){
		//alert('redirect! ' + strSrch.indexOf('ps.expressLink'));
		window.location = 'index.cfm?f=ps.shoppingcart';
	}
}

function addProdFromProdDetail(sku){
	var TxtMessage = "";
	objQty= getElement('qtyD');
	if(!isNaN(objQty.value) && parseInt(objQty.value) > 0) {
		psVal = sku + '.' + objQty.value;
		Ctype='MCart';
		DWREngine.setVerb("GET")
		DWREngine._execute(_rsPath, null, 'addProd', psVal, 0, Ctype, '', 0, 0, GenCart);
		//rsAddProductXMLHTTP(psVal, 'MCart', '0', 'index.cfm?f=ps.generateMinicart', 'miniCartContents', "miniCartComplete()", '');
		return true;
	} else {
		TxtMessage = (UserDefinedJsMessage[11]) ? UserDefinedJsMessage[11] : "You must enter a positive quantity in order to add this product to your cart";
		alert(TxtMessage);
		return false;
	}
	
}

/*function removeProdFromProdPUE(sku){
	psVal = sku + '.0';
	rsAddProductXMLHTTP(psVal, 'MCart', '0', 'index.cfm?f=ps.checkOut', 'miniCartContents', '', '');
	return false;
}*/

function ckLoginForm(f,src){
	var TxtMessage = "";
	retval = true;
	if(trim(f.username.value) == ""){
		retval = false;
		TxtMessage = (UserDefinedJsMessage[25]) ? UserDefinedJsMessage[25] : "Please enter a username";
		alert(TxtMessage);
		f.username.focus();
		f.username.select();
	}

	if(trim(f.password.value) == "" && retval){
		retval = false;
		if(src!='U')
		{
			TxtMessage = (UserDefinedJsMessage[12]) ? UserDefinedJsMessage[12] : "Please enter a password";
			alert(TxtMessage);
		}
		f.password.focus();
		f.password.select();
	}
	if(retval){
		f.submit();
	}
	return false;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { 
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}


function shoppingCartUpdateQty(sku, ptype, sCartType)
{
	newQty = sku + '.' + getElement('txt'+sku+'updateQty').value;
	addToCart_updQty(newQty, sCartType, ptype);
}


/*start kit code...*/

function strKitItem() {}
strKitItem.prototype.parentKitSKU = '';
strKitItem.prototype.optCount = '';
strKitItem.prototype.isKit = false;
strKitItem.prototype.kit = new Array();
strKitItem.prototype.prodIden = null;
strKitItem.prototype.qty = null;      
strKitItem.prototype.choiceIden = null;

var kit = new Array();

function _fetchKit(srcDiv, sku, oProdType, countryIden, configIdx, ckOutFlag){
	var TxtMessage = (UserDefinedJsMessage[13]) ? UserDefinedJsMessage[13] : "Please wait loading options...";
	getElement(srcDiv).style.top = 0;
	if(document.getElementById(srcDiv).style.display != 'block'){getElement(srcDiv).style.display = 'block'}
	document.getElementById(srcDiv).innerHTML = '<div style="color:blue;width:445px;height:230px;">'+TxtMessage+'</div>';
	//sndString = "oSku="+sku+"&oCountryIden="+countryIden+"&oSrcDiv="+srcDiv+"&oCidx="+configIdx;
	if(ckOutFlag=='1'){
		//sndString += "&oCkOutFlag="+ckOutFlag;
		oCkOutFlag=1
	}else{
		oCkOutFlag=0
	}
	DWREngine.setVerb("GET");
	DWREngine._execute(_rsPath, null, 'getKit', srcDiv, sku, oProdType, configIdx, ckOutFlag, isLSDKitAdding, genKit);
	//postAsync('index.cfm?f=ps.productListKit', srcDiv, sndString, 'selFirstKitOpt('+sku+')');
}

function genKit(co){
	var TxtMessage = "";
	if(co.ERROR==0){
		try{
			if(co.SRCDIV!=''){
				
				objDiv = getElement(co.SRCDIV);
				if(objDiv != null){
					objDiv.innerHTML = co.DISPLAY;
				}

				if(co.RTNTYPE==1){
					selFirstKitOpt(co.SKU);
				}else if(co.RTNTYPE==3){
					refreshMiniCart();
					try{
						if(co.DISPLAYPROMOTEXT != 0 && co.DISPLAYPROMOTEXT != undefined)
						{
							document.getElementById('divPromo').innerHTML = co.DISPLAYPROMOTEXT;
							//MM_showHideLayers('divPromo','','show')
							hideElement("SELECT",document.getElementById('divPromo'));
							document.getElementById('divPromo').style.display = "block";
							return;
						}
					}catch(errObj){}
					kit = new Array();
					tstForWard=getURLParam('rtncall')
					if(tstForWard != ''){
						if(tstForWard == 'scart'){
							window.location = 'index.cfm?f=ps.shoppingcart';
						} else if (tstForWard == 'express') {
							window.location = 'index.cfm?f=ps.expressLink';
						}
					}
				}else if(co.RTNTYPE==4){
					Ctype='SCart';
					DWREngine.setVerb("GET");
					DWREngine._execute(_rsPath, null, 'addProd', '', '', Ctype, '', 0, 0, GenCart);
					//GenCart(co);
				}else if(co.RTNTYPE==5){
					Ctype='SchedOrderCart';
					DWREngine.setVerb("GET");
					DWREngine._execute(_rsPath, null, 'addProd', '', '', Ctype, '', 0, 0, GenCart);
					//GenCart(co);
				}
					
				return;
			}
		}catch(err){
			TxtMessage = (UserDefinedJsMessage[14]) ? UserDefinedJsMessage[14] : "error occured during RS Call";
			//getElement('divDebug').innerHTML = xmlhttp.responseText; 
			alert(TxtMessage + '.');
			var r = '';
			for (var p in err)
			  r += p + ': ' + err[p] + '\n';
			alert(r);
		}
	}
}

function fetchKit(srcDiv, sku, oProdType, countryIden, configIdx, ckOutFlag){

	tst = getElement('kitRow'+sku);

	if(tst ==null){
		_fetchKit(srcDiv, sku, oProdType, countryIden, configIdx, ckOutFlag);
	}else{
//		if(getElement('kitRow'+sku).style.backgroundColor == '#f6f6f6' || getElement('kitRow'+sku).style.backgroundColor.indexOf('246') != -1){
			_fetchKit(srcDiv, sku, oProdType, countryIden, configIdx, ckOutFlag);
//		}
//		else
//		{
//				alert('HELLO');
//		}
	}

}


function selFirstKitOpt(parentSKU){	
	nxtOpt = getElement('kitConfig0'+parentSKU);
	if(nxtOpt!=null){
		nxtOpt.onclick();
	}
}

function getParentBaseIndex(sku)
{
	retval = -1;
	tst = '';

	for(i=0;i<=kit.length;i++)
	{
		try
		{	tst = kit[i][0].parentKitSKU;  }
		catch(errObj)
		{	break;	}
				
		if(tst == sku)
		{
			retval = i;
			break;
		}
	}
	return retval;
}

function getChildIndex(idx,choice)
{
	retval = -1;
	
	for(i=0;i<kit[idx].length;i++){
		tstCI = kit[idx][i].choiceIden;
		if(tstCI == choice){
			retval = i;
			break;
		}
	}
	return retval;
}

function updateSelection(selText, prodCountryIden, parentSKU, choice, optCount, optionIndex){
	var TxtMessage = "";
	kitItem = new strKitItem();
	kitItem.parentKitSKU = parentSKU;
	kitItem.optCount = optCount;
	kitItem.isKit = false;
	kitItem.prodIden = prodCountryIden;
	kitItem.choiceIden = choice;
	kitItem.qty = 1;
	idx = getParentBaseIndex(parentSKU);
	if(idx == -1){
		idx = kit.length;
		cItemIdx = 0;
		cItem = new Array();
		cItem[0] = kitItem;
		kit[idx] = cItem;
	}else{
		cItemIdx = getChildIndex(idx,choice);
		if(cItemIdx == -1){
			cItemIdx = kit[idx].length;
		}
		kit[idx][cItemIdx] = kitItem;
	}
	/*
	strAlert = "";
	for(i=0; i<kit.length; i++){
		strAlert += '\r\rKit('+i+') SKU: '+kit[i][0].parentKitSKU;
		for(j=0;j<kit[i].length; j++){
			strAlert += '\r  Kit Option('+ kit[i][j].choiceIden +') - prodIden: '+kit[i][j].prodIden;
		}
	}
	alert(strAlert);
	*/
	newOptIndex = optionIndex -1;

	curParentObj = getElement('kitConfig'+newOptIndex+parentSKU);
	curParentObj.innerHTML = selText.substring(0,20)+'...';
	curParentObj.title = selText
	curParentObj.selection = prodCountryIden;
	oImg = getElement('bCntr'+(optionIndex-1)+parentSKU);
	
	nImg = new Image();
	nImg.src = 'images_us/butt_tickon.gif';
	oImg.src = nImg.src;
	nxtOpt = getElement('kitConfig'+optionIndex+parentSKU);
	try {
		if (getElement('kitConfigDone' + parentSKU).innerHTML == '') {
			TxtMessage = (UserDefinedJsMessage[15]) ? UserDefinedJsMessage[15] : "Your Selected Items Are";
			getElement('kitConfigDone' + parentSKU).innerHTML = '<table cellpadding="0" cellspacing="0" border="0" width="530"><tr><td width="100">&nbsp;</td><td width="430"><span class="orange_txt">'+TxtMessage+':</span></td></tr></table>';
		}
	} catch(e) {}
	
	if(nxtOpt!=null){
		try {
			getElement('kitConfigDone' + parentSKU).innerHTML = getElement('kitConfigDone' + parentSKU).innerHTML + '<table cellpadding="0" cellspacing="0" border="0" width="530"><tr><td width="100">&nbsp;</td><td class="txt" style="height: 15px; padding-bottom: 5px;">&middot; '+ selText + '</td></tr></table>';
		} catch (e) {}
		nxtOpt.onclick();
	} else {
		getElement('btnAddToCartKIT' + parentSKU).style.display = 'block';
		try{getElement('btnList' + parentSKU).style.display = 'block' ;} catch(errObj){}
		TxtMessage = (UserDefinedJsMessage[16]) ? UserDefinedJsMessage[16] : "Finished setting up this product.  Click the Add button to continue adding to your order."; 
		getElement('kitItemOptions' + parentSKU).innerHTML = '<br>&nbsp;'+TxtMessage;
		try {
		getElement('kitConfigDone' + parentSKU).innerHTML = getElement('kitConfigDone' + parentSKU).innerHTML + '<table cellpadding="0" cellspacing="0" border="0" width="530"><tr><td width="100">&nbsp;</td><td class="txt" style="height: 15px; padding-bottom: 5px;">&middot; '+ selText + '</td></tr></table>';
		} catch (e) {}
	}

}
function saveKit(sku, oProdType, oSrcDiv, editFlag, configIdx, ckOutFlag){
	inputGood = true;
	errMsg = "";
	inpoSrcDiv = oSrcDiv;
	if(kit.length==0 && inputGood){
		inputGood = false;
		errMsg = (UserDefinedJsMessage[17]) ? UserDefinedJsMessage[17] : "Please make sure all options are configured before saving this item to your cart.";
	}
	if(inputGood){
		pIdx = getParentBaseIndex(sku);
	}
	if(pIdx == -1 && inputGood){
		inputGood = false;
		errMsg = (UserDefinedJsMessage[17]) ? UserDefinedJsMessage[17] : "Please make sure all options are configured before saving this item to your cart.";
	}

	if(pIdx != -1 && inputGood){
		//check configured count...
		if(kit[pIdx].length != kit[pIdx][0].optCount){
			inputGood = false;
			errMsg = (UserDefinedJsMessage[18]) ? UserDefinedJsMessage[18] : "All options available have not been selected, please make sure you have configured all the options before saving.";
		}
	}

	if(inputGood){
		
		oChoice = "";
		
		for(i=0; i<kit.length; i++){
			//strAlert += '\r\rKit('+i+') SKU: '+kit[i][0].parentKitSKU;
			for(j=0;j<kit[i].length; j++){
				//strAlert += '\r  Kit Option('+ kit[i][j].choiceIden +') - prodIden: '+kit[i][j].prodIden;
				oChoice += kit[i][j].choiceIden + '_' + kit[i][j].prodIden + '|';
			}
		}
		
		oChoice = oChoice.substring(0,oChoice.length-1);
		//sndString = 'oQty=1&oSku='+sku+'&oChoice='+oChoice+'&oProdType=0';
		oSrcDiv = oSrcDiv.substring(0,oSrcDiv.length-1);
		
		if(ckOutFlag==1){
			//sndString += '&oCkOutFlag=1';
			chkOutFlag=1
		}else{
			chkOutFlag=0
		}
		if(editFlag==0){
			//add cart configuration
			try{
				divOpenClose(oSrcDiv);
				toggleGroupText(getElement('ktText'+sku), 'Options', sku, 0);
			}catch(errObj){}
			//check to see if it is a kit in a group and hide it...
			if(inpoSrcDiv.indexOf('dvGrpKit') != -1){
				try{//hide any kit display that is in a group...
					getElement(inpoSrcDiv).style.display = 'none';
				}catch(err){}
			}
			DWREngine.setVerb("POST")
			DWREngine._execute(_rsPath, null, 'setKit', sku, 1, oProdType, oChoice, chkOutFlag, genKit);
			if(isLSDKitAdding==1)
			{
				document.getElementById('dvEditKit').style.display = 'none';
				isLSDKitAdding=0;
			}
			//postAsync('index.cfm?f=ps.saveKit', '', sndString, 'refreshMiniCart()');
		}else{
			//update cart configuration
			getElement('dvEditKit').style.display = "none";
			strSrch=window.location+'';
			strSrch=strSrch.toLowerCase();
			if(strSrch.indexOf('ps.expresslink') > -1){
				cartType='SchedOrderCart';
			} else {
				if(strSrch.indexOf('ps.shoppingcart') == -1){
					cartType='MCart';
				}else{
					cartType='SCart';
				}
			}
			
			//sndString += '&oConfigIdx='+configIdx;
			DWREngine.setVerb("POST")
			DWREngine._execute(_rsPath, null, 'setKitConfig', sku, 1, oProdType, oChoice, chkOutFlag, configIdx, cartType, genKit);
			//postAsync('index.cfm?f=ps.updateKitConfig', 'divSCart', sndString, '');
		}
		
	}else{
		alert(errMsg);
	}
	
	return false;
}

function removeKitConfig(oCallElement, sku, oProdType, countryIden, configIdx, ckOutFlag){
	//sndString = 'oSku='+sku+'&oProdType=0&oConfigIdx='+configIdx;
	//if(ckOutFlag==1){
	//	sndString += '&oCkOutFlag=1';
	//}
	strSrch=window.location+'';
	strSrch=strSrch.toLowerCase();
	if(strSrch.indexOf('ps.shoppingcart') == -1){
		cartType='MCart';
	}else{
		cartType='SCart';
	}
	DWREngine.setVerb("GET")
	DWREngine._execute(_rsPath, null, 'removeKit', sku, oProdType, countryIden, configIdx, ckOutFlag, cartType, genKit);
	//postAsync('index.cfm?f=ps.removeKitConfig', 'divSCart', sndString, '');
}

var curParentObj = null;

function getKitItemOptions(oKitProdCountryIden, srcDiv, oSku, oChoice, numOptions, optionIndex,parentObj){
	var TxtMessage = "";
	curParentObj = parentObj;
	//optionClicked = getElement('kitConfig'+(optionIndex-1));
	//if(optionClicked!=null){optionClicked.style.color = 'red';}
	TxtMessage = (UserDefinedJsMessage[13]) ? UserDefinedJsMessage[13] : "Please wait loading options...";
	obj = getElement(srcDiv).innerHTML = '<div style="color:blue;">'+TxtMessage+'</div>'; 
	//sndString = "oKitProdCountryIden="+oKitProdCountryIden+'&oSku='+oSku+'&oChoice='+oChoice+'&oNumOptions='+numOptions+'&oOptionIndex='+optionIndex;

	//if(xmlhttp.readyState == 4){
		//handle object for firefox xmlhttp problem on kits
	//	xmlhttp = null;
	//	recreateXMLHTTPObj();
	//}
	DWREngine.setVerb("GET")
	DWREngine._execute(_rsPath, null, 'getKitOptions', srcDiv, oSku, oKitProdCountryIden, oChoice, numOptions, optionIndex, genKit);
	//postAsync('index.cfm?f=ps.getKitOptions', srcDiv, sndString, '');
}
function editKit(oEdit, kitSku, oProdType, countryIden, configIdx, ckOutFlag){
	oDsp = getElement('dvEditKit');
	if(oDsp.style.display=='block'){
		oDsp.style.display='none';
	}else{
		ntop = (oEdit.offsetTop)+130;
		oDsp.style.top=ntop+'px';
		oDsp.style.display='block';	
		fetchKit('dvEditKit', kitSku, oProdType, countryIden, configIdx, ckOutFlag)
	}
}

function closeEditKit(){
	document.getElementById('dvEditKit').style.display = 'none';
	try{
	chkOutKitBoxShow(curChkOutKitBox,false);
	}catch(er){}
	checkLSDKitAdd();
	return false;
}

/* end kit code...*/

function refreshMiniCart(){
//	rsAddProductXMLHTTP(psVal, 'MCart', '0', 'index.cfm?f=ps.generateMinicart', 'miniCartContents', "miniCartComplete()");
	Ctype='MCart';
	DWREngine.setVerb("GET")
	DWREngine._execute(_rsPath, null, 'addProd', '', 0, Ctype, '', 0, 0, GenCart);
	//postAsync('index.cfm?f=ps.generateMinicart', 'miniCartContents', '', 'miniCartComplete()', '');
	return false;
}

function refreshShoppingCart(){
//	rsAddProductXMLHTTP(psVal, 'MCart', '0', 'index.cfm?f=ps.generateMinicart', 'miniCartContents', "miniCartComplete()");
	Ctype='SCart';
	DWREngine.setVerb("GET");
	DWREngine._execute(_rsPath, null, 'addProd', '', 0, Ctype, '', 0, 0, GenCart);
	//postAsync('index.cfm?f=ps.generateMinicart', 'miniCartContents', '', 'miniCartComplete()', '');
	return false;
}

function go1(control){
	if (document.getElementById(control).options[document.getElementById(control).selectedIndex].value != "none") {
	location = document.getElementById(control).options[document.getElementById(control).selectedIndex].value
	}
}







function rtnError(){
	MM_showHideLayers('divMessage','','hide')
	showElement("SELECT");
}
function rtnErrorGo2Cart(){
	window.location='index.cfm?f=ps.shoppingcart'
}
var	ie=document.all
var	dom=document.getElementById
function showElement(elmID){
	if(document.all){
		for(i=0;i<document.all.tags(elmID).length;i++){
			obj = document.all.tags(elmID)[i];
			if(!obj||!obj.offsetParent){
				continue;
			}
			obj.style.visibility="";
		}
	}
}
function hideElement( elmID, overDiv ){
	if(document.all){
		for( i = 0; i < document.all.tags( elmID ).length; i++ ){
	  		obj = document.all.tags( elmID )[i];
	  		if( !obj || !obj.offsetParent ){
				continue;
	  		}
		  // Find the element's offsetTop and offsetLeft relative to the BODY tag.
		
		  objLeft   = obj.offsetLeft;
		  objTop    = obj.offsetTop;
		  objParent = obj.offsetParent;

		  while( objParent.tagName.toUpperCase() != "BODY" & objParent.tagName.toUpperCase() != "HTML"){
			objLeft  += objParent.offsetLeft;
			objTop   += objParent.offsetTop;
			objParent = objParent.offsetParent;
		  }
		  objHeight = obj.offsetHeight;
		  objWidth = obj.offsetWidth;

		  if(( overDiv.offsetLeft + overDiv.offsetWidth ) <= objLeft );
		  
		  else if(( overDiv.offsetTop + overDiv.offsetHeight ) <= objTop );

		  else if( overDiv.offsetTop >= ( objTop + objHeight ));

		  else if( overDiv.offsetLeft >= ( objLeft + objWidth ));

		  else{
			obj.style.visibility = "hidden";
		  }
	
		}
	}
}
function validEmail(strEmail) {
	var matchArr1=strEmail.match(/^[A-Za-z0-9_.-]+@[A-Za-z0-9_.-]+\.([a-z|A-Z]{2,4})$/);
	if (matchArr1==null) {
		return false
	} else {
		return true
	}
}
function validateEmailUpdateViaPromo(strEmail){
	if(!validEmail(strEmail)){alert('Please enter a valid email address.');return false;}
	DWREngine.setVerb("GET")
	DWREngine._execute(_rsPath, null, 'setEmailAddress', strEmail, validEmailUpdateViaPromoReturn);
}

function alertText()
{
	document.getElementById('divPromoHeader').innerHTML = '';
}

function setBizKitInCustom()
{
	
	txtBizKit = document.getElementById('txtBizKit').value;
	
	if(trim(txtBizKit)=='')
	{
		alert('Please enter a valid membership kit number.');
		return false;
	}
	DWREngine.setVerb("GET")
	DWREngine._execute(_rsPath, null, 'setBizKitInCustom', txtBizKit, setBizKitInCustomRtn);
}

function setBizKitInCustomRtn(co)
{
	if(co.HTMLSTRING != undefined && co.HTMLSTRING != '')
	{
		if(co.HTMLSTRING == '2')
		{
			alert("The membership kit number you entered is not valid.");
			return false;
		}
		else
		{
			/*alert(co.HTMLSTRING);*/
			alert("There was an error updating your membership kit number");
			return false;
		}
	}
	closeCheckoutPromo();
}

function noThanksCustomPromo(customPromo)
{
	DWREngine.setVerb("GET")
	DWREngine._execute(_rsPath, null, 'noThanksCustomPromo', customPromo, closeCheckoutPromo);
}


function validEmailUpdateViaPromoReturn(co){
	if(co!="true"){
		alert(co);
		return;
	}
	closePromo();
}
function addCartItemsToINO(){
	DWREngine.setVerb("GET")
	DWREngine._execute(_rsPath, null, 'addAllCartItemsToINO', '', addCartItemsToINOReturn);
}
function addCartItemsToINOReturn(co){
	window.location.href=window.location.href;
}

function expressOrder(column,rowCount,currentCheckBox) {
	if (document.getElementById(currentCheckBox).checked) {
		for (i=1;i < rowCount;i++) {
			try {
				document.getElementById('col1_'+i+'_1').style.backgroundColor='#E9E9E9';
				document.getElementById('col2_'+i+'_1').style.backgroundColor='#FFFFFF';
				document.getElementById('col3_'+i+'_1').style.backgroundColor='#FFFFFF';
				document.getElementById(column+i+'_1').style.backgroundColor='#FFEBC2';
			} catch(er) {}
			try{
				document.getElementById('col1_'+i).style.display='none';
				document.getElementById('col2_'+i).style.display='none';
				document.getElementById('col3_'+i).style.display='none';
				document.getElementById(column+i).style.display='block';
			} catch(e) {}
		}
		document.getElementById('checkbox1').checked = 0;
		document.getElementById('checkbox2').checked = 0;
		document.getElementById('checkbox3').checked = 0;
		document.getElementById(currentCheckBox).checked = 1;
	} else {
		for (i=1;i < rowCount;i++) {
			if (column == 'col1_') {
				try {
				document.getElementById('col2_'+i+'_1').style.backgroundColor='#FFFFFF';
				document.getElementById('col3_'+i+'_1').style.backgroundColor='#FFFFFF';
				document.getElementById(column+i+'_1').style.backgroundColor='#E9E9E9';
				} catch(er) {}
			} else {
				try {
				document.getElementById('col1_'+i+'_1').style.backgroundColor='#E9E9E9';
				document.getElementById('col2_'+i+'_1').style.backgroundColor='#FFFFFF';
				document.getElementById('col3_'+i+'_1').style.backgroundColor='#FFFFFF';
				document.getElementById(column+i+'_1').style.backgroundColor='#FFFFFF';
				} catch(er) {}
			}
			try{
				try {
					document.getElementById(column+i).style.display='none';
				} catch(er) {}
			} catch(e) {
			}
		}
	}
}
function doCalculateExpressOrder(column,rowCount) {
	currentColumnTotal = 0;
	currentColumnPTS = 0;
	for (i=1;i < rowCount;i++) {
		//alert('test: ' + currentColumnTotal);
		try {
			currentColumnTotal = currentColumnTotal + (document.getElementById('col_'+i+'_2').innerHTML * parseInt(document.getElementById(column+i+'_3').value));
			currentColumnPTS = currentColumnPTS + (document.getElementById('col_'+i+'_4').innerHTML * parseInt(document.getElementById(column+i+'_3').value));
		} catch(er){}
	}
	document.getElementById(column+'pts').innerHTML = currentColumnPTS;
	document.getElementById(column+'total').innerHTML = currentColumnTotal.toFixed(2);
	document.getElementById(column+'total2').innerHTML = currentColumnTotal.toFixed(2);
}
function printWindow() {
	bV = parseInt(navigator.appVersion);
	if (bV >= 4) window.print();
}

/* 	Ajax loading function 
 	Requires ajax.js, dynamicMessage.js, screen_common.css
	Parameters all these are optional:
		parentObj = The id of any element you wish to display the load message in. Default position is in the uppler left corner
		cssStyle = Style sheet you wish to apply to the message. Default style sheet is loadingMessage found in screen_common.css.
		zIndex = Z index of the message. Default z index is 5000.
		msg = The message you wish to display. Default message is 'Please Wait ...'. 
		timeToWait = Time to pass before time out error is displayed. Default is set to 3000
	Parameters all these are not optional:
		returnErrorMsg = Message to be displayed if ajax fails to return data in set amount of time.
		or
		returnErrorFunction = Function to occur if ajax fails to return data in set amount of time.
		
	Example of how to call function
		paramObj = new Object() ;
		paramObj.parentObj = document.getElementById(parentSrc) ;
		paramObj.returnErrorMsg = 'We aplogize we could not retrieve the data at this time.'
		var loadMesage = new loadingMessage(paramObj) ;
*/

function loadingMessage(obj){
	this.top = (obj.parentObj) ? addTopPosition(obj.parentObj, obj.parentObj.offsetTop) : 0 ;
	this.left = (obj.parentObj) ? addLeftPosition(obj.parentObj, obj.parentObj.offsetTop) : 0 ;
	this.cssStyle = (obj.cssStyle) ? obj.cssStyle : 'loadingMessage' ;
	this.zIndex = (obj.zIndex) ? obj.zIndex : '5000' ;
	this.msg = (obj.msg) ? obj.msg : 'Please Wait ... ' ;
	this.timeToWait = (obj.timeToWait) ? obj.timeToWait : 3000 ;
	this.returnErrorMsg = (obj.returnErrorMsg && obj.returnErrorMsg != '') ? obj.returnErrorMsg : '' ;
	this.returnErrorFunction = (obj.returnErrorFunction && obj.returnErrorFunction) ? obj.returnErrorFunction : '' ;
 	this.loadingDiv = createLoadingMessageDiv(this) ;
	this.loadingDiv.innerHTML = this.msg ;
	this.loadingDiv.style.display = 'block' ;
	
	if(browserName == "ie"){
		hideElement("SELECT", 'select1') ;	
	}
	openLoadingDiv = setTimeout("timeOpenMessage(objToPass)" , this.timeToWait) ;
	objToPass = this ; 
	DWREngine.setPostHook(function(){loadingMessageFinish(objToPass)});
}

function loadingMessageFinish(obj){
	if(browserName == "ie"){
		showElement("SELECT") ;
	}
	clearTimeout(openLoadingDiv)
	obj.loadingDiv.style.display = 'none' ;
}

function createLoadingMessageDiv(obj){
	var createMessageDiv = document.createElement('div') ;
	createMessageDiv.style.position = 'absolute' ;
	createMessageDiv.style.top = obj.top + 'px' ;
	createMessageDiv.style.left = obj.left + 'px' ;
	createMessageDiv.style.zIndex = obj.zIndex ;
	createMessageDiv.className = obj.cssStyle ;
	document.body.appendChild(createMessageDiv) ;
	return createMessageDiv
}

function timeOpenMessage(obj){
	var TxtMessage = "";
	if(obj.loadingDiv.style.display == 'block'){
		if(obj.returnErrorMsg != ''){
			TxtMessage = (UserDefinedJsMessage[19]) ? UserDefinedJsMessage[19] : "Close";
			objDiv = obj.loadingDiv ;
			obj.returnErrorMsg += '<br><br><a href="JavaScript:;" onClick="objDiv.style.display=\'none\'">'+TxtMessage+'</a>';
			obj.loadingDiv.innerHTML = obj.returnErrorMsg ;	
		}else if(obj.returnErrorFunction != ''){
			obj.loadingDiv.style.display = 'none' ;
			eval(obj.returnErrorFunction) ;	
		}
	}
	clearTimeout(obj.openLoadingDiv) ;
}

btnFocus=''
var	ie=document.all

function hideElement1(elmID,overDiv){
	if(ie){
		for(i=0;i<document.all.tags(elmID).length; i++){
			obj=document.all.tags(elmID)[i];
			if(!obj||!obj.offsetParent){
				continue;
			}
			obj.style.visibility="hidden";
		}
	}
}
function msgDisp(oDivName,oHead,oBody,oTop,oLeft,oH,oW,oBName,oFctName,oBtnFocus){
	msgText = "<div id=msg1 style='position:absolute;background-color:#f4f4f4;top:"+oTop+"px;left:"+oLeft+"px;width:"+oW+"px;height:"+oH+"px;border:thin solid #B6B5B5;padding:5;display:block;z-index:2000'><table width=100%><tr><td width=100% height="+oH*.2+" class='orange_txt'>"+oHead+"</td></tr><tr><td width=100% height="+oBody*.5+" bgcolor=#b6b5b5><table width=100% height="+oH*.5+"><tr><td width=100% height=100% bgcolor=#ffffff class=grey_txt valign=top>"+oBody+"</td></tr></table></td></tr><tr><td width='100%' height="+oH*.3+" align=right>"
	if(oBName!=''){
		msgText += "<input type='button' id=msgBtn1 value='"+oBName+"' class=btnGreen onClick=\"clsMsgDiv('"+oDivName+"');"+oFctName+";return false\">"
	}
	msgText += "</td></tr></table></div>"
	document.getElementById(oDivName).innerHTML=msgText
	document.getElementById(oDivName).style.display='block'
	hideElement1("SELECT",document.getElementById(oDivName));
	if(oBName!=''){
		document.getElementById('msg1').focus();
	}
	if(oBtnFocus!=''){btnFocus=oBtnFocus}
}
function clsMsgDiv(oDiv){
	object = MM_findObj(oDiv);
	if(object.style.display == 'block'){
		object.innerHTML=''
		object.style.display = 'none';
	}else{
		object.style.display = 'block';
	}
	showElement("SELECT");
	if((btnFocus!='') && (btnFocus!=undefined)){
		document.getElementById(btnFocus).focus();
	}
	btnFocus=''
}
/** debug added **/
var errDoc
var errST
var errET

/*
function ajaxDebugJSError(message, url, line) {
	errorObj = errDoc.getElementById("divJsError");
	errorObj.innerHTML = errorObj.innerHTML + 'Error on line ' + line + ' of document ' + url + ': ' + message, FVL_FATAL + "<br>";
	return true;
}
*/

function ajaxDebug(){
	_rsDebug = 2;
	errDoc = window.open("", "AjaxDebug", 'width=450,height=500,toolbar=1,status=1,scrollBars=1,resizable=1').document;
	errDoc.open;
	errDoc.write('<b>Ajax Debug<br>');
	errDoc.write('<hr><font color=blue>Data Sent:</b></font>');
	errDoc.write('<div id=divSent></div><br>');  
	errDoc.write('<hr><font color=blue><b>Data Response:</b></font>');
	errDoc.write('<div id=divResponse></div><br>');
	//errDoc.write('<hr><font color=blue><b>Inline JS Errors:</b></font>');
	//errDoc.write('<div id=divJsError></div><br>');
	errDoc.write('END');
	errDoc.close();
	errDoc.focus();
	//errDoc.onerror = ajaxDebugJSError;
	return false;
}



function setSchedOrderDate(newOrderDate)
{
	DWREngine.setVerb("GET");
	DWREngine._execute(_rsPath, null, 'scheduleOrder', newOrderDate, retSched);
}

function retSched(co)
{
	if(co.ERROR!=0)
	{
		alert(co.ERRORMESSAGE);
	}
}

function radioGetValue(objRadio){
	for (i = 0; i < objRadio.length; ++i){
		try{
			if (objRadio[i].checked){
				return objRadio[i].value;
			}
		}
		catch(errMsg){
			return 'undefined'
		}
	}
}

function validatePromo93(userId, fullName, countryIden){
	var sku = radioGetValue(document.getElementsByName('promoProdSel'));
	var email = document.getElementById('promo_ELemail').value;
	var day = document.getElementById('promo_ELdayOfMonth').options[document.getElementById('promo_ELdayOfMonth').selectedIndex].value;
	var TxtMessage = "";
	
	if(!sku || sku == '' || sku == 'undefined') {
		TxtMessage = (UserDefinedJsMessage[20]) ? UserDefinedJsMessage[20] : "Please Select a free product";
		alert(TxtMessage);
		return false;
	}
	if(email == "") {
		//validate Email Address
		TxtMessage = (UserDefinedJsMessage[21]) ? UserDefinedJsMessage[21] : "Please enter your email address";
		alert(TxtMessage);
		return false;
	} else {
		//validate Email Address
		if(!validEmail(email)) {
			TxtMessage = (UserDefinedJsMessage[22]) ? UserDefinedJsMessage[22] : "The email address entered is invalid.  Please enter a valid email address.";
			alert(TxtMessage);
			return false;
		} else {
			//update expressLink info		#jsStringFormat(trim(client.fullname))#
			postAsync('index.cfm?f=ps.setRemindMe', '', 'cID='+userId+'&cName='+fullName+'&cEmail='+email+'&cSchedDay='+day+'&cCountryIden='+countryIden+'&fromCustom=0&makePerm=1', '');
			setPromo(93,sku,647);			
		}
	}
	return true;
}

function removePromo(oPromoID,oSKU){
	if(arguments.length > 2) {
		s=s_gi(s_account);
		s.campaign=arguments[2];
		s.tl(this,'o','Promo Add to Cart');
	}
	
	DWREngine.setVerb("GET")
	DWREngine._execute(_rsPath, null, 'removePromoProduct', oPromoID, oSKU, rtnPromo);
}

function setPromo(oPromoID,oSKU){
	if(arguments.length > 2) {
		s=s_gi(s_account);
		s.campaign=arguments[2];
		s.tl(this,'o','Promo Add to Cart');
	}
	
	DWREngine.setVerb("GET")
	DWREngine._execute(_rsPath, null, 'setPromoProduct', oPromoID, oSKU, rtnPromo);
}

function setPromoPop(oPromoID,oSKU,oWidth,oHeight,oLeft,oTop){
	setPromo(oPromoID,oSKU);
	newWindow = window.open('showPromo.cfm?promoID='+oPromoID, 'CurPromo', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=yes,width='+oWidth+',height='+oHeight+',left='+oLeft+', top='+oTop+',screenX='+oLeft+',screenY='+oTop+'');
	newWindow.focus();
}
function closePromo() {
	document.getElementById('divPromo').style.display='none';
	showElement('SELECT') ;
}

function closeCheckoutPromo() {
	window.location += '&cancelPromo=1';
	return false;
}
function setDateNewOrder() {
	var newOrderDate = document.getElementById('txtOrderDate').value;
	DWREngine.setVerb("POST") ;
	//getElement("dspOrderDateHead").innerHTML = getElement('txtOrderDate').value;
	DWREngine._execute(_rsPath, null, 'createNewScheduledOrder', 'productList','scheduledOrdersDiv', newOrderDate, rsxDuplicateOrderReturn) ;
	showDTPick();
}
function setDateExistingOrder() {
	var newOrderDate = document.getElementById('txtOrderDate').value;
	DWREngine.setVerb("POST") ;
	DWREngine._execute(_rsPath, null, 'updateExistingOrdersDate', 'productList','scheduledOrdersDiv', js_schedOrderId, thisIden, newOrderDate, rsxDuplicateOrderReturn) ;
	showDTPick();
}


function rsxDuplicateOrderReturn(co){
	divTag = co.DIVTAG ;
	divTagList = co.DIVTAGLIST;	
	js_schedOrderId = co.ORDERID;

	if(divTagList !='' && co.HTMLSTRING_MASTERLIST != undefined) {
		objMasterDiv =  getElement(divTagList) ;
		if(objMasterDiv != undefined) {
			objMasterDiv.style.display = 'block' ;
			objMasterDiv.innerHTML = 	co.HTMLSTRING_MASTERLIST ;
		} 
	}		

	if(divTag == 'listProducts')
		divTag = 'productList' ;

	if(divTag != '' && co.HTMLSTRING != undefined){
		objDiv = getElement(divTag) ;
		if(objDiv != undefined) {
			objDiv.style.display = 'block' ;
			objDiv.innerHTML = 	co.HTMLSTRING ;
			if(co.NOSCHEDULEDORDER != undefined && objMasterDiv != undefined) {
				objDiv.innerHTML = "<div class='txt'></div>";
			}
		}
	}
	
	if(co.MODIFIEDFIELDSETCONTENTS != undefined) {
		document.getElementById("schedOrder").innerHTML = co.MODIFIEDFIELDSETCONTENTS;
	}
	var tempWindowLoc = window.location.href;
	if(tempWindowLoc.toLowerCase().match("ps.expresslink") == null) {
		//alert('This order is now a Future Order.  Save/Confirm this order to ready it for processing on the date you have selected.')
		
		//if(tempWindowLoc.toLowerCase().match("ps.checkout") != null) {
		//	refreshLoc = tempWindowLoc.split('?')[0] + '?f=ps.expresslink';
		//} else {
			refreshLoc = tempWindowLoc;
		//}
		window.location.href = refreshLoc;//
	}

	//if(co.CURRENTMODIFY != undefined) {
	//	document.getElementById("modifiedOrderFieldset").style.display = co.CURRENTMODIFY;
	//}

	newRowHandle = document.getElementById("SO_rowID" + js_schedOrderId);
	if(newRowHandle != undefined)
		newRowHandle.style.backgroundColor = '#FAEFEB';
	setTimeout('refreshMiniCart()', 500);
	if(window.location.href.toLowerCase().match('ps.shoppingcart') != null){
		setTimeout('getShoppingCart()', 1000);
	}
}

function getMousePosition(e){
	var p = {x:0, y:0} ;
	if(!e) var e = window.event ;
	if(e.pageX || e.pageY){
		p.x = e.pageX ;
		p.y = e.pageY ;
	}else if(e.clientX || e.client.Y){
		p.x = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft ;
		p.y = e.clientY + document.body.scrollTop + document.documentElement.scrollTop ;
	}
	return p ;
}

function trapEnterKey(event, exeFunction){
	var keyCode = (event.keyCode) ? event.keyCode : (event.which) ? event.which : event.charCode ;
	if(keyCode == 13){
		if(exeFunction) eval(exeFunction) ;
		return false;
	}else{
		return true ;
	}
}

function findPos(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
		}
	}
	return [curleft,curtop];
}

// New QuickShop 9/15/2006
var _quickShop = {_product:{loading:0}, _div:{}, _txt:{}, fnc:""} ;

_quickShop.exe = function(d, txt, fnc){
	var txtObj = document.getElementById(txt) ;
	var divObj = document.getElementById(d) ;
	var xyPosArr ;
	if(txtObj != null && d != null){
		_quickShop._div = divObj ;
		_quickShop._txt = txtObj ;
		
		xyPosArr = findPos(_quickShop._txt) ;
		_quickShop._div.style.left = parseInt(xyPosArr[0]) + 'px' ;
		//_quickShop._div.style.top = parseInt(xyPosArr[1]) + 'px' ;
		
		if(! _quickShop._product.loading && _quickShop._product.loading != 1){
			_quickShop._txt.value = "Loading..." ;
			_quickShop.getProducts() ;
			_quickShop._product.loading = 1 ;
			_quickShop._txt.disabled = true ;
		}
			
	}else{
		alert("txtObj = " + typeof txtObj + "\ndivObj = " + typeof divObj)	
	}
	
	if(fnc)
		_quickShop.fnc = fnc ;
}

_quickShop.getProducts = function(){
	DWREngine.setVerb("POST") ;
	DWREngine._execute(_rsPath, null, 'quickShopProductSearchQuery', _quickShop.rtnProducts) ;
}

_quickShop.rtnProducts = function(o){

	if(o.ERROR && o.ERROR == 1)
		alert(o.ERRORMESSAGE) ;
	else{
		if(o.STR && o.STR != ""){
			_quickShop.constructArray(o.STR) ;
			_quickShop._txt.value = "" ;
			_quickShop._txt.disabled = false ;
			
				// firefox will not assign focus to _txt without redirecting focus to another element first
				if(browserName != "ie"){
					var tagObj = document.getElementsByTagName("input") ;
					tagObj[0].focus() ;
				}
			_quickShop._txt.focus() ;
		}
	}

}

_quickShop.constructArray = function(str){
	var arr = str.split("|"), tempArr
	_quickShop._product.arr = [] ;
	for(n=0; n<arr.length; n++){
		tempArr = arr[n].split(",") ;
		_quickShop._product.arr[n] = {sku:tempArr[0], name:tempArr[1]} ;	
	}
}

_quickShop.fncIsString = function(s){
	var isString = 0 ;
	if(s != ""){
		if(isNaN(s))
			isString = 1 ;
	}
	return isString ;
}

_quickShop.exeSearchString = function(){
	var s = _quickShop._txt.value, isString, sArr, html
		
	if(s != "" && s != " "){
		isString  = _quickShop.fncIsString(s.charAt(0)) ;
		sArr = _quickShop.searchValues(isString, s) ;
		html = _quickShop.buildHTML(sArr) ;
		_quickShop._div.style.display = 'block' ;
		_quickShop._div.innerHTML = html ;
	}else{
		_quickShop._div.style.display = 'none' ;	
	}
}

_quickShop.searchValues = function(isString, s){
	var arr = [], sCount = s.length, arrCount = 0 ;
	var sMatch, s = s.toLowerCase() ;
	//alert(_quickShop._product.arr[2].name.substring(0, sCount))
	for(i=0; i<_quickShop._product.arr.length; i++){
		sMatch = 0 ;
		if(isString == 1){
			if(_quickShop._product.arr[i].name.substring(0, sCount).toLowerCase() == s)
				sMatch = 1 ;	
		}else{
			if(_quickShop._product.arr[i].sku.substring(0, sCount).toLowerCase() == s)
				sMatch = 1 ;
		}
		if(sMatch == 1){
			arr[arrCount] = {sku:_quickShop._product.arr[i].sku, name:_quickShop._product.arr[i].name} ;
			arrCount += 1 ;
		}
	}
	return arr ;
}

_quickShop.buildHTML = function(arr){
	var s = "<table cellpadding=0 cellspacing=0>" ;
	for(n=0; n<arr.length; n++){
		s += "<tr class='qShopSearchBox' onMouseOver='this.className=\"qShopSearchBox_over\"' onMouseOut='this.className=\"qShopSearchBox\"' onClick='_quickShop.addItem("+arr[n].sku+"); return false'>" ;
		s += "<td valign='top' style='padding-top:5px;'>" + arr[n].sku + "</td>" ;
		s += "<td valign='top' style='padding-left:5px; padding-top:5px;'>" + arr[n].name + "</td></tr>" ;
	}
	s += "</table>" ;
	return s ;
}

_quickShop.closeSearchBox = function(c){
	if(c)
		_quickShop._div.style.display = 'none' ;
	else
		x = setTimeout('_quickShop.closeSearchBox(1)', 100) ;
}

_quickShop.addItem = function(sku){
	if(sku){
		_quickShop._txt.value = sku ;
		if(_quickShop.fnc != "")
			eval(_quickShop.fnc) ;
	}
	_quickShop._div.style.display = 'none' ;
	clearTimeout(x)
}



/********************** start add to list functions *****************************/


var _shoppingListObj = {p:{x:0, y:0}, dim:{h:200, w:200}, _d:null} ;

function _shoppingListObj_exe(event, username, countryIden, languageIden, productIden){
	var _mousePosition = getMousePosition(event)
	
	_shoppingListObj.setDivPosition(_mousePosition.x, _mousePosition.y) ;
	_shoppingListObj.createDivTag() ;
	document.getElementById("divChooseShoppingListBottom").innerHTML = "Loading..." ;
	DWREngine.setVerb("POST") ;
	DWREngine._execute(_rsPath, null, "getPersonalShoppingLists", "divChooseShoppingListBottom", username, countryIden, languageIden, productIden, _shoppingListObj.ajxReceive) ;
}

_shoppingListObj.ajxReceive = function(o){
	var divTag = document.getElementById(o.DIVTAG) ;
	divTag.innerHTML = o.HTMLSTRING ;
	if(o.CLOSE)
		setTimeout("document.getElementById('divChooseShoppingList').style.display='none'", 4000) ;
}

_shoppingListObj.setDivPosition = function(x, y){
	var setPosX, setPosY
	var screenDimensions = {windowHeight:document.documentElement.clientHeight || document.body.clientHeight, topPosition:document.documentElement.scrollTop || document.body.scrollTop, screenWidth:document.documentElement.clientWidth || document.body.clientWidth} ;
		setPosX = (x - Math.round(_shoppingListObj.dim.w/2))  ;
	do{
		setPosX += 10 ;
	}while(setPosX < 200)
	
	_shoppingListObj.p.x = setPosX ;
	_shoppingListObj.p.y = y + 10 ;
}

_shoppingListObj.createDivTag = function(){
	var s = "" ;
	var TxtMessage = (UserDefinedJsMessage[23]) ? UserDefinedJsMessage[23] : "Please choose a Shopping List below";
	if(_shoppingListObj._d == null){
		_shoppingListObj._d = document.createElement("div") ;
		_shoppingListObj._d.id = "divChooseShoppingList" ;
		_shoppingListObj._d.style.position = "absolute" ;
		_shoppingListObj._d.style.border = "2px solid #7c7c7c" ;
		_shoppingListObj._d.style.padding = "0px" ;
		_shoppingListObj._d.style.width = _shoppingListObj.dim.w + "px" ;
		_shoppingListObj._d.style.height = _shoppingListObj.dim.h + "px" ;
		_shoppingListObj._d.style.overflow = "auto" ;
		_shoppingListObj._d.style.backgroundColor = "#f4f4f4" ;
		_shoppingListObj._d.style.zIndex = 1000 ;
		document.body.appendChild(_shoppingListObj._d) ;
		// build top html table
			s += "<div id='divChooseShoppingListTop'  style='padding-bottom:2px; background-color:#f4f4f4;'><table cellpadding=0 cellspacing=0 width="+_shoppingListObj.dim.w+"><tr>" ;
			s += "<td style='width:80%; padding-left:5px;' class='greySmall_txt'>"+TxtMessage+"</td>" ;
			s += "<td style='width:20%; height:25px; text-align:right; padding-right:2px; vertical-align:top'>" ;
			// close link
				s += "[<a href='JavaScript:;' onClick='document.getElementById(\"divChooseShoppingList\").style.display=\"none\"'>X</a>]" ;
			s += "</td></tr></table></div>" ;
		// bottom html table
			s += "<div id='divChooseShoppingListBottom' style='background-color:#ffffff; height:"+(_shoppingListObj.dim.h - 45)+"px; padding:3px; border:1px solid #d5d5d5; overflow:auto;'></div>" ;
		_shoppingListObj._d.innerHTML = s ;
	}else{
		_shoppingListObj._d.style.display = "block" ;	
	}
	
	_shoppingListObj._d.style.top = _shoppingListObj.p.y + 'px' ;
	_shoppingListObj._d.style.left = _shoppingListObj.p.x + 'px' ;
}

_shoppingListObj.addItem = function(productIden, detailsIden){
	document.getElementById("divChooseShoppingListBottom").innerHTML = "Saving..." ;
	DWREngine.setVerb("POST") ;
	DWREngine._execute(_rsPath, null, "addItemToShoppingList", "divChooseShoppingListBottom", productIden, detailsIden, _shoppingListObj.ajxReceive) ;
}

	function msgDisplay(oHead,oBody){
		var TxtMessage = (UserDefinedJsMessage[24]) ? UserDefinedJsMessage[24] : "Continue";
		document.getElementById('divMsgCarttxt').innerHTML = '<br><br><b>'+oHead+'</b><br><br><br>'+oBody+'<br><br><br><br><br><div align=right><a href="javascript:;" onclick="rtnError()">'+TxtMessage+'</a></div>';
		MM_showHideLayers('divMessage','','show')
		hideElement("SELECT",document.getElementById('maincontent'));
		return;
	}


function formatCurrency(num) {
		num = num.toString().replace(/\$|\,/g,'');
		if(isNaN(num))
			num = "0";
		sign = (num == (num = Math.abs(num)));
		num = Math.floor(num*100+0.50000000001);
		cents = num%100;
		num = Math.floor(num/100).toString();
		if(cents<10)
			cents = "0" + cents;
		for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
		num = num.substring(0,num.length-(4*i+3))+','+
		num.substring(num.length-(4*i+3));
		return (((sign)?'':'-') + '$' + num + '.' + cents);
	}

	var isLSDKitAdding = 0;
	var lsdKitEle;
	function checkLSDKitAdd()
	{
		if(isLSDKitAdding != 0)
		{
			lsdKitEle.checked = false;
			calcTotalLsd(lsdKitEle);
			isLSDKitAdding = 0;
		}
	}
	
	function calcTotalLsd(ele)
	{
		arrCk = document.getElementsByName('ckbox');
		tmpVal = ele.value;
		tmpArr = tmpVal.split("|");
		showKit = 0;
		jsUsed = 0.00;
		itemsChecked = 0;
		
		eleVal = ele.value;
		arrEle = eleVal.split("|");
		eleKit = arrEle[3];
		cIden = arrEle[4];
			
		for(i=0; i<arrCk.length; i++)
		{			
			if(arrCk[i].checked){
				itemsChecked++;
				sVal = arrCk[i].value;
				arrVal = sVal.split("|");
				group = arrVal[2];
				kitflag = arrVal[3];
				if(group == tmpArr[2] && arrCk[i] != ele)
				{
					arrCk[i].checked = false;
				}
				else
				{
					jsUsed = jsUsed + ((arrVal[1]) * 1);
				}
				if(arrCk[i]==ele && kitflag==1)
				{
					showKit =1;
					kitSku = arrVal[0];
				}
			}
		}
		if(itemsChecked == 1 && mlsd == 24)
		{
			if(jsUsed >= 24){jsUsed = 24;}
		}
		curAdvAvail = document.getElementById("advAvail").value;
		curAdvUsed = document.getElementById("advUsed").value;
		
		_curAdvAvail = curAdvAvail - (jsUsed + ((curAdvUsed)*1));
		_curAdvUsed = jsUsed + ((curAdvUsed)*1);
		
		if(_curAdvAvail < 0){_curAdvAvail=0};
		if(_curAdvUsed < 0){_curAdvUsed=0};
		
		curAdvRemaining = _curAdvAvail  - _curAdvUsed * 1;
		if(_curAdvUsed > mlsd){
			curAdditional = jsUsed - mlsd;
			_curAdvAvail = curAdvAvail - mlsd;
			//curAdvRemaining = curAdvAvail - mlsd;
			_curAdvUsed = mlsd;

		}else{
			curAdditional = 0;
		}

		document.getElementById("dvadvAvail").innerHTML = formatCurrency(_curAdvAvail);
		document.getElementById("dvadvUsed").innerHTML = formatCurrency(_curAdvUsed);
		//document.getElementById("dvadvRemaining").innerHTML = formatCurrency(curAdvRemaining);
		document.getElementById("dvadvAdditional").innerHTML = formatCurrency(curAdditional);
		
		if(showKit==1){
			isLSDKitAdding = 1;
			lsdKitEle = ele;
			editKit(document.getElementById("dvEditKit"), kitSku,1,cIden, '', '');
			document.getElementById("dvEditKit").style.top = (findPosY(ele)-231) + 'px';
		}
		if(eleKit==1 && !ele.checked && isLSDKitAdding == 0)
		{
			removeKitConfig(document.getElementById("dvEditKit"), kitSku, 1, cIden, 1, '');
			refreshMiniCart();
		}
		else if(eleKit==1 && !ele.checked && isLSDKitAdding == 1)
		{
			document.getElementById("dvEditKit").style.display = 'none';
		}
	}
	
	function addListToCart()
	{
		arrCk = document.getElementsByName('ckbox');
		skuString='';
		
		for(i=0; i<arrCk.length; i++)
		{
			if(arrCk[i].checked){
				sVal = arrCk[i].value;
				arrVal = sVal.split("|");
				if(arrVal[3]!=1)
				{
					if(skuString.length !=0 ){
						skuString += "," + arrVal[0];
					}else{
						skuString += arrVal[0];
					}
				}
			}
		}
		DWREngine.setVerb("GET");
		DWREngine._execute(_rsPath, null, 'setLSD', skuString, rtnLSD);
	
		//alert(skuString);
	}
	
	function rtnLSD(co)
	{
		frm = document.getElementById("frmlsd");
		frm.submit();
		
	}
	
	function setPromoQty(dvPrefix, qtyCtrl){
		document.getElementById(qtyCtrl.id + 'Price').innerHTML = '$'+parseInt(qtyCtrl.value)*5;
		for(i=1; i <= 3; i++){
			ctrl=document.getElementById(dvPrefix+i);
			if(parseInt(qtyCtrl.value)>=i){
				ctrl.style.display="block";
			}else{
				ctrl.style.display="none";
			}
		}
	}
	
	function setPromoQtyCDN(dvPrefix, qtyCtrl){
		document.getElementById(qtyCtrl.id + 'Price').innerHTML = '$'+parseInt(qtyCtrl.value)*6;
		for(i=1; i <= 3; i++){
			ctrl=document.getElementById(dvPrefix+i);
			if(parseInt(qtyCtrl.value)>=i){
				ctrl.style.display="block";
			}else{
				ctrl.style.display="none";
			}
		}
	}
	
	function setPromoNovTargetList(oPromoID,oQty,oSKU,oSKU2){
		if(!isNumeric(oQty) || trim(oQty) == ''){
			TxtMessage = (UserDefinedJsMessage[10]) ? UserDefinedJsMessage[10] : "Please enter a valid quantity";
			alert(TxtMessage + '.');
			return false;
		}
		setPromo(oPromoID, "'"+oSKU+'|'+oQty+'|'+oSKU2+"'");
		return false;
	}

	function promoFebValidateInput(oPromoID,oSKU){

		inputGood = 1; //assume input is good
		allZeros = 1;  //assume all values are 0 
		
		checkingValue = document.getElementById('option1').value;
		if(!isNumeric(checkingValue) || trim(checkingValue) == '')
			inputGood = 0;
		else if(checkingValue != 0)
			allZeros = 0;
		checkingValue = document.getElementById('option2').value;			
		if(!isNumeric(checkingValue) || trim(checkingValue) == '')
			inputGood = 0;
		else if(checkingValue != 0)
			allZeros = 0;			
		checkingValue = document.getElementById('option3').value;			
		if(!isNumeric(checkingValue) || trim(checkingValue) == '')
			inputGood = 0;
		else if(checkingValue != 0)
			allZeros = 0;	
		checkingValue = document.getElementById('option4').value;			
		if(!isNumeric(checkingValue) || trim(checkingValue) == '')
			inputGood = 0;
		else if(checkingValue != 0)
			allZeros = 0;
		checkingValue = document.getElementById('option5').value;			
		if(!isNumeric(checkingValue) || trim(checkingValue) == '')
			inputGood = 0;
		else if(checkingValue != 0)
			allZeros = 0;
		checkingValue = document.getElementById('option6').value;			
		if(!isNumeric(checkingValue) || trim(checkingValue) == '')
			inputGood = 0;
		else if(checkingValue != 0)
			allZeros = 0;
		checkingValue = document.getElementById('option7').value;			
		if(!isNumeric(checkingValue) || trim(checkingValue) == '')
			inputGood = 0;
		else if(checkingValue != 0)
			allZeros = 0;
		checkingValue = document.getElementById('option8').value;			
		if(!isNumeric(checkingValue) || trim(checkingValue) == '')
			inputGood = 0;
		else if(checkingValue != 0)
			allZeros = 0;
		checkingValue = document.getElementById('option9').value;			
		if(!isNumeric(checkingValue) || trim(checkingValue) == '')
			inputGood = 0;
		else if(checkingValue != 0)
			allZeros = 0;
		checkingValue = document.getElementById('option10').value;			
		if(!isNumeric(checkingValue) || trim(checkingValue) == '')
			inputGood = 0;			
		else if(checkingValue != 0)
			allZeros = 0;
			
		if(inputGood == 0){
			TxtMessage = (UserDefinedJsMessage[10]) ? UserDefinedJsMessage[10] : "Please enter a valid quantity";
			alert(TxtMessage + '.');
			return false;
		}
		else if(allZeros == 1){
			TxtMessage = (UserDefinedJsMessage[10]) ? UserDefinedJsMessage[10] : "Please enter at least one quantity greater than 0 otherwise select skip.";
			alert(TxtMessage + '.');
			return false;
		}
		
		setPromo(oPromoID,oSKU);
		return false;
	}
	
	function promoSeptValidateInput(){
		inputGood=1;
		skuSaveString="";
		for(i=1;i<=4;i++){
			if(i!=3){ //change for october  just eliminate 1 NOT 3
				ctrlQty=document.getElementById('selQty'+i);
				if(parseInt(ctrlQty.value)!=0){
					if(i==1){
						skuSaveString+="1025."+ctrlQty.value+"|";
					}else{
						for(j=1;j<=parseInt(ctrlQty.value);j++){
							itm=document.getElementById('selItem'+i+j);
							if(itm.value==""){
								alert('You have an unconfigured item based upon the qty selected.');
								inputGood=false;
							}else{
								skuSaveString+=itm.value+".1|";
							}
						}
					}
				}
			}
		}

		//pantry packs
		calcPantryPacks();
		if(parseInt(document.getElementById('spBarQty').innerHTML) > parseInt(document.getElementById('spBarTotal').innerHTML)){
			alert('You have selected more than '+ document.getElementById('spBarTotal').innerHTML +' bars');
			inputGood=0;
		}else{
			if(parseInt(document.getElementById('spBarQty').innerHTML) != parseInt(document.getElementById('spBarTotal').innerHTML)){
				alert('The quantity of bars must be equal on the total line.');
				inputGood=0;
			}
		}
		
		
		if(inputGood){
			gb=document.getElementById('txtGold').value;
			pb=document.getElementById('txtPlat').value;
			bb=document.getElementById('txtBody').value;
			ob=document.getElementById('txtOpal').value;
			cb=document.getElementById('txtCleansing').value;
			
			if(gb!=0){skuSaveString+='kk117.'+gb+"|";}
			if(pb!=0){skuSaveString+='kk3308.'+pb+"|";}
			if(bb!=0){skuSaveString+='kk5540.'+bb+"|";}
			if(ob!=0){skuSaveString+='kk5117.'+ob+"|";}
			if(cb!=0){skuSaveString+='kk6455.'+cb+"|";}
			
			//save this stuff.
			DWREngine.setVerb("GET");
			DWREngine._execute(_rsPath, null, 'savePromoSkuString', skuSaveString, rtnSavePromoSkuString);
		}
		return false;
	}
	
	function promoOctValidateInput(){
		inputGood=1;
		skuSaveString="";
		
		for(i=1;i<=4;i++){
			//if(i!=3){ //change for october  just eliminate 1 NOT 3
				ctrlQty=document.getElementById('selQty'+i);
				if(parseInt(ctrlQty.value)!=0){
					if(i==1){
						skuSaveString+="5024."+ctrlQty.value+"|";
					}else{
						for(j=1;j<=parseInt(ctrlQty.value);j++){
							itm=document.getElementById('selItem'+i+j);
							if(itm.value==""){
								alert('You have an unconfigured item based upon the qty selected.');
								inputGood=false;
							}else{
								skuSaveString+=itm.value+".1|";
							}
						}
					}
				}
			//}
		}

		
		if(inputGood){
		
			//save this stuff.
			DWREngine.setVerb("GET");
			DWREngine._execute(_rsPath, null, 'savePromoSkuString', skuSaveString, rtnSavePromoSkuString);
		}
		return false;
	}
	
	function rtnSavePromoSkuString(co){
		window.location += '&cancelPromo=1'; return false;
	}
	
	function calcPantryPacks(){
		qtyCtrl=document.getElementById('selQty3');
		document.getElementById('spBarTotal').innerHTML = parseInt(qtyCtrl.value)*3;
		document.getElementById('selQty3Price').innerHTML = '$'+(parseInt(qtyCtrl.value)*5);
		gb=document.getElementById('txtGold');
		pb=document.getElementById('txtPlat');
		bb=document.getElementById('txtBody');
		ob=document.getElementById('txtOpal');
		cb=document.getElementById('txtCleansing');
		document.getElementById('spBarQty').innerHTML = parseInt(gb.value) + parseInt(pb.value) + parseInt(bb.value) + parseInt(ob.value) + parseInt(cb.value);
	}
	
	function calcPantryPacksCDN(){
		qtyCtrl=document.getElementById('selQty3');
		document.getElementById('spBarTotal').innerHTML = parseInt(qtyCtrl.value)*3;
		document.getElementById('selQty3Price').innerHTML = '$'+(parseInt(qtyCtrl.value)*6);
		gb=document.getElementById('txtGold');
		pb=document.getElementById('txtPlat');
		bb=document.getElementById('txtBody');
		ob=document.getElementById('txtOpal');
		cb=document.getElementById('txtCleansing');
		document.getElementById('spBarQty').innerHTML = parseInt(gb.value) + parseInt(pb.value) + parseInt(bb.value) + parseInt(ob.value) + parseInt(cb.value);
	}
	
	
function trackPromotion(promoID){
	//this function is for omniture tracking for the nov targetted list promo
	
	var s=s_gi(s_account);
	s.linkTrackVars='campaign';
	
	switch(promoID)
	{
		case 159:
			s.campaign='FreeShippingPromo';  //campain name
			s.tl(this,'o','200812FreeShippingPromo_pop1');   
		break;
		case 160:
			s.campaign='FreeShippingPromo'; //campain name
			s.tl(this,'o','200812FreeShippingPromo_pop2');   
		break;		
	}
	
	
}


function checkIfIsNumeric(inValue, txtBoxNum)
{
	var evaluateIsNumeric = true;
	
	if(document.getElementById("txtOpt1").value == '')
		document.getElementById("txtOpt1").value = 0;
	if(document.getElementById("txtOpt2").value == '')
		document.getElementById("txtOpt2").value = 0;
	if(document.getElementById("txtOpt3").value == '')
		document.getElementById("txtOpt3").value = 0;
	if(txtBoxNum == 4)
	{
		if(document.getElementById("txtOpt4").value == '')
			document.getElementById("txtOpt4").value = 0;
	}
		
	if(!isNumeric(document.getElementById("txtOpt1").value))
		evaluateIsNumeric = false;
	if(!isNumeric(document.getElementById("txtOpt2").value))
		evaluateIsNumeric = false;
	if(!isNumeric(document.getElementById("txtOpt3").value))
		evaluateIsNumeric = false;
	if(txtBoxNum == 4)
	{
		if(!isNumeric(document.getElementById("txtOpt4").value))
			evaluateIsNumeric = false;
	}
	
	if(evaluateIsNumeric == false)
	{
		alert("Please enter only numeric numbers for the quantity");
		return false;
	}
	else
		return true;
		
}

function getCount(inValue)
{
	numericIsGood = checkIfIsNumeric(inValue,4);
	if(numericIsGood)
	{
		var compareCount = 0;
		if(inValue == 1) //promo #1
		{
			compareCount = document.getElementById("selOpt1").value;
		}
		var getCount = parseInt(document.getElementById("txtOpt1").value) +  parseInt(document.getElementById("txtOpt2").value) +  parseInt(document.getElementById("txtOpt3").value) +  parseInt(document.getElementById("txtOpt4").value);
	
		if(getCount != compareCount)
		{
			if(inValue == 1) //promo #1
			{
				alert("You must select exactly " + compareCount + " Sun Shades Lip Balm.");
			}
		}

	}
}

function prepareSelectPromoJun(oPromoID, oSKU, inValue)
{
	//promo validation on add to cart
	numericIsGood = checkIfIsNumeric(inValue,4);
	if(numericIsGood)
	{
		var getCount = parseInt(document.getElementById("txtOpt1").value) +  parseInt(document.getElementById("txtOpt2").value) +  parseInt(document.getElementById("txtOpt3").value) +  parseInt(document.getElementById("txtOpt4").value);
		var getCount2 = 0;
	
		if(inValue == 1) //promo #1
		{
			compareCount = document.getElementById("selOpt1").value;
		}
		else if(inValue == 2) //promo #2
		{
			compareCount = document.getElementById("selOpt1").value;
		}		
		else if(inValue == 3) //promo #3
		{
			compareCount = document.getElementById("selOpt1").value;
			getCount2= parseInt(document.getElementById("txtOpt5").value) +  parseInt(document.getElementById("txtOpt6").value) +  parseInt(document.getElementById("txtOpt7").value);
		}			
		
		if(getCount != compareCount && getCount != 0)
		{
			if(inValue == 1) //promo #1
			{
				alert("You must select exactly " + compareCount + " Sun Shades Lip Balm.");
			}
			else if(inValue == 2) //promo #2
			{
				alert("You must select exactly " + compareCount + " MelaSoft Products.");
			}
			else if(inValue == 3) //promo #3
			{
				alert("You must select exactly " + compareCount + " Breath-Away Products.");
			}			
		}
		else if(getCount2 != compareCount && inValue ==3) //promo #3
		{
			alert("You must select exactly " + compareCount + " Whitening Tooth Polish Products.");
		}
		else if(getCount== 0)
		{
			if(inValue == 1) //promo #1
			{
				alert("Please select the specified number of Sun Shades Lip Balm to add to your cart or click the 'No Thanks' button.");		
			}
			else if(inValue ==2)
			{
				alert("Please select the specified number of MelaSoft Products to add to your cart or click the 'No Thanks' button.");		
			}
			else if(inValue ==3)
			{
				alert("Please select the specified number of Breat-Away and Whitening Tooth Polish Products to add to your cart or click the 'No Thanks' button.");		
			}			
		}
		else
			setPromo(oPromoID, oSKU);
	}
}

function prepareSelectPromoJul(oPromoID, oSKU, inValue)
{
	//promo validation on add to cart
	if(inValue == 3)
		txtNum = 3;
	else
		txtNum = 7;
		
	numericIsGood = checkIfIsNumeric(inValue,txtNum);
	if(numericIsGood)
	{
		var getCount = parseInt(document.getElementById("txtOpt1").value) +  parseInt(document.getElementById("txtOpt2").value) +  parseInt(document.getElementById("txtOpt3").value);
		if(txtNum == 7)
			getCount = getCount +  parseInt(document.getElementById("txtOpt4").value)+  parseInt(document.getElementById("txtOpt5").value)+  parseInt(document.getElementById("txtOpt6").value)+  parseInt(document.getElementById("txtOpt7").value);
			
		if(inValue == 3) //promo #3
		{
			compareCount = document.getElementById("selOpt1").value;
		}
		else if(inValue == 4) //promo #4
		{
			compareCount = document.getElementById("selOpt1").value;
		}		
		
		if(getCount != compareCount && getCount != 0)
		{
			if(inValue == 3) //promo #3
			{
				alert("You must select exactly " + compareCount + " Attain Bars.");
			}
			else if(inValue == 4) //promo #4
			{
				alert("You must select exactly " + compareCount + " Bath Bar Products.");
			}
		}
		else if(getCount== 0)
		{
			if(inValue == 3) //promo #3
			{
				alert("Please select the specified number of Attain Bars to add to your cart or click the 'No Thanks' button.");		
			}
			else if(inValue ==4) //promo # 4
			{
				alert("Please select the specified number of Bath Bars to add to your cart or click the 'No Thanks' button.");		
			}
		}
		else
			setPromo(oPromoID, oSKU);
	}
}

function updateCountPromoJun(inValue, langID)
{
	//promo validation on change
	numericIsGood = checkIfIsNumeric(inValue,4);
	if(numericIsGood)
	{
		var getCount = parseInt(document.getElementById("txtOpt1").value) +  parseInt(document.getElementById("txtOpt2").value) +  parseInt(document.getElementById("txtOpt3").value) +  parseInt(document.getElementById("txtOpt4").value);
		var getCount2 = 0;
	
		if(inValue == 1) //promo #1
		{
			compareCount = document.getElementById("selOpt1").value;
		}
		else if(inValue == 2) //promo #2
		{
			compareCount = document.getElementById("selOpt1").value;
		}		
		else if(inValue == 3) //promo #3
		{
			compareCount = document.getElementById("selOpt1").value;
			getCount2= parseInt(document.getElementById("txtOpt5").value) +  parseInt(document.getElementById("txtOpt6").value) +  parseInt(document.getElementById("txtOpt7").value);
		}			
		
		if(getCount<= compareCount)
		{
			if(inValue == 1)
			{
				if(langID == 4)
					document.getElementById("divCount1").innerHTML = getCount + " paquete de " + compareCount;				
				else if(langID == 5)
					document.getElementById("divCount1").innerHTML = getCount + " lot de" + compareCount;				
				else
					document.getElementById("divCount1").innerHTML = getCount + "/" + compareCount + "-pack";
			}
			else if(inValue ==2)
			{
				if(langID == 4)
					document.getElementById("divCount1").innerHTML = getCount + " / " + compareCount;				
				else if(langID == 5)
					document.getElementById("divCount1").innerHTML = getCount + " lot de" + compareCount;				
				else
					document.getElementById("divCount1").innerHTML = getCount + "/" + compareCount + "-pack";
			}
			else if(inValue ==3)
			{
				if(langID == 4)
					document.getElementById("divCount1").innerHTML = getCount + " / " + compareCount;				
				else if(langID == 5)
					document.getElementById("divCount1").innerHTML = getCount + " lot de" + compareCount;				
				else
					document.getElementById("divCount1").innerHTML = getCount + "/" + compareCount + "-pack";
			}			
		}
		
		if(inValue ==3 && getCount2 <=compareCount)
		{
			if(langID == 4)
					document.getElementById("divCount2").innerHTML = getCount2 + " / " + compareCount;				
				else if(langID == 5)
					document.getElementById("divCount2").innerHTML = getCount2 + " lot de" + compareCount;				
				else
					document.getElementById("divCount2").innerHTML = getCount2 + "/" + compareCount + "-pack";
		}
		
		if(getCount > compareCount)
		{
			if(inValue == 1) //promo #1
			{
				alert("You must select exactly " + compareCount + " Sun Shades Lip Balm.");
			}
			else if(inValue == 2) //promo #2
			{
				alert("You must select exactly " + compareCount + " MelaSoft Products.");
			}
			else if(inValue == 3) //promo #3
			{
				alert("You must select exactly " + compareCount + " Breath-Away Products.");
			}			
		}
		if(inValue ==3 && getCount2 > compareCount)
		{
			alert("You must select exactly " + compareCount + " Whitening Tooth Polish Products.");
		}
	}
}

function updateCountPromoJul(inValue, langID)
{
	if(inValue == 3)
		txtNum = 3;
	else
		txtNum = 7;
		
	//promo validation on change
	numericIsGood = checkIfIsNumeric(inValue, txtNum);
	if(numericIsGood)
	{
		var getCount = parseInt(document.getElementById("txtOpt1").value) +  parseInt(document.getElementById("txtOpt2").value) +  parseInt(document.getElementById("txtOpt3").value);
		if(txtNum == 4)
			getCount = getCount +  parseInt(document.getElementById("txtOpt4").value)+  parseInt(document.getElementById("txtOpt5").value)+  parseInt(document.getElementById("txtOpt6").value)+  parseInt(document.getElementById("txtOpt7").value);
			
		if(inValue == 3) //promo #3
		{
			compareCount = document.getElementById("selOpt1").value;
		}
		else if(inValue == 4) //promo #4
		{
			compareCount = document.getElementById("selOpt1").value;
		}		
		
		if(getCount<= compareCount)
		{
			if(langID == 4)
				document.getElementById("divCount1").innerHTML = getCount + " / " + compareCount;				
			else if(langID == 5)
				document.getElementById("divCount1").innerHTML = getCount + " / " + compareCount;				
			else
				document.getElementById("divCount1").innerHTML = getCount + "/" + compareCount + "-pack";
		}
		
		if(getCount > compareCount)
		{
			if(inValue == 3) //promo #3
			{
				alert("You must select exactly " + compareCount + " Attain Bars");
			}
			else if(inValue == 4) //promo #4
			{
				alert("You must select exactly " + compareCount + " Bath Bar Products");
			}
		}
	}
}



function prepareIncrementalPromoMay(oPromoID)
{
	var selectedCount = document.getElementById('selCount').value;
	var sel1 = "";
	var sel2 = "";
	var sel3 = "";
	var sendSkuList = "";
	
	if(selectedCount == 1)
	{
		sel1 = document.getElementById('selCount1').value
		sendSkuList = sel1 + ".1";
	}
	else if(selectedCount ==2)
	{
		sel1 = document.getElementById('selCount1').value
		sel2 = document.getElementById('selCount2').value		
		sendSkuList = sel1 + ".1," + sel2 +".1";
	}
	else if(selectedCount ==3)
	{
		sel1 = document.getElementById('selCount1').value
		sel2 = document.getElementById('selCount2').value
		sel3 = document.getElementById('selCount3').value		
		sendSkuList = sel1 + ".1,"+sel2 +".1,"+sel3+".1";
	}
	
	setPromo(oPromoID, sendSkuList);	
}

function showOptions(inID)
{
	selectedValue = document.getElementById(inID).value;
	if(selectedValue == 1)
	{
		document.getElementById("selCount1").style.visibility="visible";
		document.getElementById("selCount2").style.visibility="hidden";		
		document.getElementById("selCount3").style.visibility="hidden";				
	}
	else if(selectedValue == 2)
	{
		document.getElementById("selCount1").style.visibility="visible";
		document.getElementById("selCount2").style.visibility="visible";		
		document.getElementById("selCount3").style.visibility="hidden";						
	}
	else if(selectedValue ==3)
	{
		document.getElementById("selCount1").style.visibility="visible";
		document.getElementById("selCount2").style.visibility="visible";		
		document.getElementById("selCount3").style.visibility="visible";				
	}
}

function changeDescription(inID)
{
	switch(inID)
	{
		//MONTH 1
		case "img5780":
			document.getElementById("divTitle1").innerHTML="Cool Mint Whitening Tooth Polish";
			document.getElementById("divTitle2").innerHTML="(Valued at AU $6.95 / NZ $7.95) ";		
			document.getElementById("divDescription").innerHTML="<strong>Why Paste When You Can Polish?</strong> Featuring T40-C3 Melaleuca Oil, propolis and myrrh, Cool Mint Whitening Tooth Polish controls odour-causing bacteria and helps prevent tooth decay. Our whitening formula brightens teeth with papain and strengthens tooth enamel with fluoride.";	
		break;
		case "img117":
			document.getElementById("divTitle1").innerHTML="The Gold Bar";
			document.getElementById("divTitle2").innerHTML="(Valued at AU $5.95 / NZ $6.95)";		
			document.getElementById("divDescription").innerHTML="<strong>Wash away stress.</strong> Escape to a lush oasis of moisturizing botanicals and nurturing natural extracts with The Gold Bar (citrus scent). Naturally derived aloe vera, glycerin, and Melaleuca Oil combine with gentle cleansers to offer you unparalleled luxury.";	
		break;
		case "img2490":
			document.getElementById("divTitle1").innerHTML="Moisturising Liquid Soap &#45 Mountain Rain";
			document.getElementById("divTitle2").innerHTML="(Valued at AU $9.90 / NZ $11.20) ";		
			document.getElementById("divDescription").innerHTML="<strong>A refreshing feeling that goes beyond clean.</strong> Welcome summer with the fresh and tantalizing fragrances of Moisturising Liquid Soap. Hundreds of moisturising beads burst with our exclusive ButterSilk blend as you wash your hands, leaving your skin soft and hydrated.";	
		break;
		case "img2854":
			document.getElementById("divTitle1").innerHTML="Lemon Brite Hand Dishwashing Liquid";
			document.getElementById("divTitle2").innerHTML="(Valued at AU $9.75 / NZ $11.25)";		
			document.getElementById("divDescription").innerHTML="<strong>Lemon Brite gives you a hand with the dishes.</strong>  Washing dishes by hand can be tough, tedious work. Lemon Brite makes it easier. Its concentrated formula, powerful triple&#45detergent system, and thick suds cut grease and break down food residues&#45before your hands even hit the water. And though it's tough on grease, Lemon Brite contains naturally derived detergents and biodegradable ingredients that are gentle on your skin. ";	
		break;
		case "img9749":
			document.getElementById("divTitle1").innerHTML="Body Satin Body Wash &#45 Plumeria";
			document.getElementById("divTitle2").innerHTML="(Valued at AU $11.95 / NZ $14.95)";		
			document.getElementById("divDescription").innerHTML="<strong>Hawaiian flowers, sugared fruits and a touch of citrus.</strong> Drench your skin in the invigorating, awakening moisture of Body Satin Body Wash. Bright fragrances set the mood for your day while rich lather rinses away dirt and washes in moisture. Rich ButterSilk&#45with its unique blend of exotic mango, shea, and cocoa butters&#45works in harmony with Pentavitin to moisturise skin and safeguard against future dehydration.";	
		break;
		//MONTH 2
		case "img3847":
			document.getElementById("divTitle1").innerHTML="MelaGel&#174; Topical Gel &#45 Tube";
			document.getElementById("divTitle2").innerHTML="(Valued at AU $12.95 / NZ $14.95)";		
			document.getElementById("divDescription").innerHTML="MelaGel is a natural, versatile balm that gives soothing relief for a variety of skin conditions.";	
		break;
		case "img8932":
			document.getElementById("divTitle1").innerHTML="Body Satin Body Lotion &#45 Ocean Breeze";
			document.getElementById("divTitle2").innerHTML="(Valued at AU $15.95 / NZ $19.50)";		
			document.getElementById("divDescription").innerHTML="The amazing formula of Body Satin Body Lotion transforms even the driest skin into a soft, silky oasis.";	
		break;
		case "img2491":
			document.getElementById("divTitle1").innerHTML="Clear Power&#174; Surface and Glass Cleaner";
			document.getElementById("divTitle2").innerHTML="(Valued at AU $11.40 / NZ $13.00)";		
			document.getElementById("divDescription").innerHTML="Sparkling glass without ammonia! Clear Power uses natural distilled white vinegar and naturally derived solvents instead of ammonia for a home-friendly formula that effectively removes fingerprints, dirt, and grime.";	
		break;
		case "img9696":
			document.getElementById("divTitle1").innerHTML="MelaSoft&#174; Fabric Softener Spring Breeze";
			document.getElementById("divTitle2").innerHTML="(Valued at AU $10.95 / NZ $12.95)";		
			document.getElementById("divDescription").innerHTML="Whether it's a fluffy towel, or your favourite cuddly t-shirt, there's nothing like the appeal of remarkable softness. And it's easy to experience the remarkable softness and freshness in all your laundry with MelaSoft Spring Breeze.";	
		break;
		case "img5457":
			document.getElementById("divTitle1").innerHTML="Alloy&#174; Body Wash";
			document.getElementById("divTitle2").innerHTML="(Valued at AU $11.95 / NZ $13.95)";		
			document.getElementById("divDescription").innerHTML="Wake up your senses with the invigorating scent of Alloy Body Wash and Alloy Cleansing Bar. Natural cleansers eliminate dirt and oils while moisturisers soften skin, so you're refreshed and ready for whatever comes.";	
		break;
		
		default:
			document.getElementById("divTitle1").innerHTML="New Customer Loyalty Promotion";
			document.getElementById("divTitle2").innerHTML="";		
			document.getElementById("divDescription").innerHTML="<strong>We Deliver Wellness!</strong>  We develop, manufacture and sell over 300 of the world's leading wellness products for your home and family. We carefully craft products you use everyday with the highest standards of safety, health, and wellness in mind. Discover a few of our amazing products!";	
		break;
	}
}


/********************** end add to list functions *******************************************/









