function Rcertify() { 
popupWin = window.open('http://www.bbbonline.org/cks.asp?id=10412208165249866', 
'Participant', 'location=yes,resizable=yes,scrollbars=yes,resizable=yes,width=800,height=500') 
window.name = 'opener'; 
}
function openWindowReturnRef(url,winName,width,height){
	var winRef = window.open(url,winName, "height=" + height + ",width=" + width + ",status=yes,toolbar=no,menubar=no,location=no,directories=no,resizable=yes,scrollbars=yes,titlebar=no");
	return winRef;
}

function openWindow(url,winName,width,height){
	var winRef = openWindowReturnRef(url,winName,width,height)
}
function openLongWindow(url,winName,width,height,top,left){
	var winRef = openLongWindowReturnRef(url,winName,width,height,top,left)
}
function openLongWindowReturnRef(url,winName,width,height,top,left){
var winRef = window.open(url,winName, "height=" + height + ",width=" + width + ",top=" + top + ",left=" + left + ",status=yes,toolbar=no,menubar=no,location=no,directories=no,resizable=yes,scrollbars=yes,titlebar=no");
	return winRef;
}

/*function OpenEmailFriendWindow(url,prodName, categoryText){
	var urlqs = url + '?productName=' + prodName + "&productUrl=" + escape(location.href)+ "&categoryText=" + categoryText;
	var emailWin = openWindowReturnRef(urlqs,'Email',460,500)
}*/
function OpenEmailFriendWindow(url,prodName, categoryText, image){
	var urlqs = url + '?productName=' + prodName + "&productUrl=" + escape(location.href)+ "&categoryText=" + categoryText+ "&img=" + escape(image);
	var emailWin = openWindowReturnRef(urlqs,'Email',460,500)
}

function OpenLargeImageWindow(imgName,prodName){
	var win = openWindowReturnRef('','LargeImage',420,300);
	var docHtml = "<center><h3>" + prodName + "</h3><img src=/styles_assets/images/product/" + imgName + "><br><br><a href=javascript:window.close()><img src=/styles_assets/images/closewin.gif width=122 height=22 border=0></a></center>";
	win.document.write(docHtml);
	win.focus();
}

function OpenLargeImageSampleCheck(imgName){
	var win = openWindowReturnRef('','LargeImage',420,300);
	var docHtml = "<center><h3>Sample Check</h3><img src=/styles_assets/images/global/" + imgName + "><br><br><a href=javascript:window.close()><img src=/styles_assets/images/product/closewin.gif width=122 height=22 border=0></a></center>";
	win.document.write(docHtml);
	win.focus();
}


function ValidateCheckSearch(searchVal){
	if(searchVal.length > 0){
		return true;
	}else{
		alert("Please enter a keyword.");
		return false;		
	}
}


var iInitSelectedIndex;
var oLastFocusedSelect = null;

function SetInitialSelectedIndex(oSelect){
	if(oSelect){
		if(oSelect != oLastFocusedSelect){					
			iInitSelectedIndex = oSelect.selectedIndex;
			oLastFocusedSelect = oSelect;
		}
	}
}
var updating = false;
function checkUpdating(){
	if (updating)return false;
	else return true;}
	
function UpdateQty(oSelect){
	if(oSelect){
	    updating = true;
		var bUpdateQty = true;
		var oForm = oSelect.form;
		var sStartPattern = "_ctl";
		var sEndPattern = ":ddlQty";
		var iStartIndex = (oSelect.name).indexOf(sStartPattern) + sStartPattern.length;
		var iQtyStringLength = (oSelect.name).indexOf(sEndPattern) - iStartIndex;
		var iItemIndex = (oSelect.name).substr(iStartIndex, iQtyStringLength) - 1;
		var iNewQty = oSelect.options[oSelect.selectedIndex].value;
		
		if(oForm.valuePackDiscount){
			if(oForm.valuePackDiscount.value < 0){
				if(oSelect.selectedIndex < iInitSelectedIndex){
					bUpdateQty = window.confirm("Decreasing the quantity of this product could potentially make you ineligible for any Value Pack discount for which you currently qualify.  Would you like to proceed?");
				}	
			}
		}

		if(bUpdateQty){
			if(oForm.hasQtyChanged) oForm.hasQtyChanged.value = "yes";
			if(oForm.newLineItemQty) oForm.newLineItemQty.value = iNewQty;
			if(oForm.lineItemIndex) oForm.lineItemIndex.value = iItemIndex;
			oForm.submit();
		}else{
			oSelect.selectedIndex = iInitSelectedIndex;
			oLastFocusedSelect = null;
			oSelect.blur();
		}
	}			
}

//EZshield more information Popup
function showPopup(left,top,divId){
    var popUp = document.getElementById(divId);

    //popUp.style.width = w + "px";
	popUp.style.top = top + "px";
	if(left!=0)
	{
		popUp.style.left=left + "px";
	}
    //popUp.style.height = h + "px";  
    popUp.style.visibility = "visible";  
}
     
function HidePopup(divId)
{
   var popUp = document.getElementById(divId);
   popUp.style.visibility="hidden";
}
//End Ezshield more information

function newtab(id,myobject) {

	// define tab ID's
	var tabs = new Array("divmono","divcuts");
	
	// highlight selected
	var tabobj=document.getElementById("tablist")
	var tabobjlinks=tabobj.getElementsByTagName("li")
		if(id!="divmono")
		{
			tabobjlinks[0].className="normal"
			tabobjlinks[1].className="current"
		}else
		{
			tabobjlinks[1].className="normal"
			tabobjlinks[0].className="current"
		}

	// loop over tabs array to find out what to hide/unhide
	for (i=0; i<tabs.length; i++) {
		if(tabs[i]==id) {
			document.getElementById(id).style.display="block"
		} else {
			document.getElementById(tabs[i]).style.display="none"
		}
		
	}
	return false;
}

function showonetab(id)
{
	// define tab ID's
	var tabs = new Array("divmono","divcuts");
	
	// highlight selected
	var tabobj=document.getElementById("tablist")
	var tabobjlinks=tabobj.getElementsByTagName("li")
	if(id!="divmono")
	{
		tabobjlinks[0].className="normal"
		tabobjlinks[1].style.display="none"
	}else
	{
		tabobjlinks[0].style.display="none"
		tabobjlinks[1].className="normal"
	}
	
	// loop over tabs array to find out what to hide/unhide
	for (i=0; i<tabs.length; i++) {
		if(tabs[i]==id) {
			document.getElementById(id).style.display="block"
		} else {
			document.getElementById(tabs[i]).style.display="none"
		}
		
	}	
}

function checkOptOut(objSite,objPartner,objAction)
	{
		if(objAction == "optout")
		{
			if(objSite.checked != true)
			{
				objPartner.checked = false;
			}
		}
		else
		{
			if(objPartner.checked == true)
			{
				objSite.checked = true;
			}
		}
	}