function toggleDiv(blockNum){
	var blockNumber = "#QA_" + blockNum;
	$(blockNumber).toggle("slide", { direction: "up" }, 1000);
}	

function showDiv(blockNum) {
	var blockNumber = "#QA_" + blockNum;	
	$(blockNumber).toggle("slide", { direction: "up" }, 1000);	
}

function hideDiv(blockNumber) {
	var blockToHide = "QA_" + blockNumber;	
	document.getElementById(blockToHide).style.display = 'none';	
}

function buttonHider(blockNum) {
	var moreButtonNumber = "viewmorebutton" + blockNum;
	document.getElementById(moreButtonNumber).style.display = 'block';	
}

function getCookie(c_name)
{
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=");
  if (c_start!=-1)
    { 
    c_start=c_start + c_name.length+1; 
    c_end=document.cookie.indexOf(";",c_start);
    if (c_end==-1) c_end=document.cookie.length;
    return unescape(document.cookie.substring(c_start,c_end));
    } 
  }
return "";
}

function setCookie(c_name,value,expiredays)
{var exdate=new Date();exdate.setDate(exdate.getDate()+expiredays);
document.cookie=c_name+ "=" +escape(value)+
((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}

function checkSurveyClick()
{
Surveyname=getCookie('Surveyname');
if (Surveyname!=null && Surveyname!="")
  {  
	document.write('survey taken');	
  }
  else 
  {  
	toggleBox('info',1);  
  }
}
// For survey section on the homepage

function toggleBox(szDivID, iState) // 1 visible, 0 hidden
{
    if(document.layers)	   //NN4+
    {
       document.layers[szDivID].visibility = iState ? "show" : "hide";
    }
    else if(document.getElementById)	  //gecko(NN6) + IE 5+
    {
        var obj = document.getElementById(szDivID);
        obj.style.visibility = iState ? "visible" : "hidden";
    }
    else if(document.all)	// IE 4
    {
        document.all[szDivID].style.visibility = iState ? "visible" : "hidden";
    }
}

function swopenPop(url,width,height) {
parameters="toolbar=no,directories=no,status=no,location=0,resizable=no,scrollbars=no,menubar=no,width="+width+",height="+height;
window.open(url, "", parameters);

}

function submitTestForm(productID) {	
	document.frmTest.action=document.frmTest.action+"?ProductID="+productID;	
	document.frmTest.submit();
}

function submitShopOnline() {	
	var action = document.shopcharmin.action=document.shopcharmin.action;
	if (document.shopcharmin.cii_sZip.value != "") {
		document.shopcharmin.action=document.shopcharmin.action=action+"&cii_sZip="+document.shopcharmin.cii_sZip.value;	
		document.shopcharmin.submit();
	} else {
		document.shopcharmin.action=document.shopcharmin.action=action+"&cii_sZip=Enter ZIP Code";
		document.shopcharmin.submit();
	}
}
