function Rcertify() { 
popupWin = window.open('http://www.bbbonline.org/cks.asp?id=11000368', 
'Participant', 'location=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=/identity_assets/images/product/" + imgName + "><br><br><a href=javascript:window.close()><img src=/identity_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=/identity_assets/images/global/" + imgName + "><br><br><a href=javascript:window.close()><img src=/identity_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();
		}
	}			
}


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() { //v3.0
	var d = document; 
	
	if(d.images)
	{ 
		if(!d.MM_p) 
			d.MM_p=new Array();
			
		var i;
		var j = d.MM_p.length;
		var 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 MM_findObj(n, d) 
{ //v4.01
	var p;
	var i;
	var 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_swapImage() { //v3.0
	var i;
	var j=0;
	var x;
	var 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];
			
		}

	}
}
//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;
			}
		}
	}