function addToCart(strProductCode){
	var objControls;
	var objSelect;	
	var strSelect = "MainCat_"+strProductCode;
	var strInput ="btnAdd_" + strProductCode;
	var strProductId;
	objControls=window.document.getElementsByTagName ('input');
	objSelect=window.document.getElementById(strSelect);
	for(var i=0;i<objControls.length; ++i){
		
		if(objControls[i].type=='submit' && objControls[i].id == strInput){
			strProductId = objSelect[objSelect.selectedIndex].value;
			if(strProductId=="Please Select"){
			alert("Please select a item under the drop down list below in order to add it to your shopping cart.");
			}else{
			window.open("addConfirmation.php?pdtCode="+strProductCode+"&pdtId="+strProductId,null,"height=170,width=400,status=yes,toolbar=no,menubar=no,scrollbars=yes,location=no,left=380,top=400,screenX=400,screenY=400");
			}
//alert(objSelect[objSelect.selectedIndex].value);		
//window.open("addConfirmation.php?pdtCode="+strProductCode+"&pdtId="+strProductId,null,"height=200,width=400,status=yes,toolbar=no,menubar=no,location=Yes,left=0,top=100,screenX=0,screenY=100''");

}
	}
}
function popupmember(){
window.open("member.html",null,"height=390,width=600,status=yes,toolbar=no,menubar=no,scrollbars=yes,location=no,left=300,top=210,screenX=400,screenY=400");
}
function popuproyalty(){
window.close();
window.open("http://www.hobbsnhersh.com/services.html");
}
function popupDetails(strProductCode){
window.open("pdtDetails.php?pdtId="+strProductCode,null,"height=625,width=650,status=yes,toolbar=no,menubar=no,scrollbars=yes,location=no,left=250,top=75,screenX=400,screenY=400");
}
function IsNumeric(sText)
{
   var ValidChars = "0123456789.";
   var IsNumber=true;
   var Char;

 
   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
       		alert("Please enter numeric values.");
         }
      }
  
   }
function printPdtDetails(){
	var to_print=confirm("You will be able to see the full list of ingredients and guaranteed analysis by clicking on the [+}. \n If you would like to proceed with printing this page, please click \"Ok\". If not, please click \"Cancel\".");
	if(to_print==true){
		window.print();
	}else{
		;
	}
}
function popuprepack(){
window.open("repack.html",null,"height=390,width=500,status=yes,toolbar=no,menubar=no,scrollbars=yes,location=no,left=300,top=210,screenX=400,screenY=400");
}
function popupproplanpromo(){
window.open("proplanpromotion.html",null,"height=430,width=750,status=yes,toolbar=no,menubar=no,scrollbars=yes,location=no,left=200,top=210,screenX=400,screenY=400");
}

function checkout(){
	var confirmText="The following will affect the quantity of your products if its checked or entered\n";
	confirmText=confirmText+"\n";
	confirmText=confirmText+"1. Remove CheckBox is checked (Product will be removed)\n";
	confirmText=confirmText+"2. Quantity of the item is changed (if 0, product will be removed)\n";
	confirmText=confirmText+"3. Repacking option is changed\n\n";
	confirmText=confirmText+"Please click on OK to proceed and Cancel to edit your shopping cart";
	var Check_Out=confirm(confirmText);
	if(Check_Out==true){
		window.event.returnValue = true;		
	}else{
		window.event.returnValue = false;
	}	
}
<!-- Dynamic Version by: Nannette Thacker -->
<!-- http://www.shiningstar.net -->
<!-- Original by :  Ronnie T. Moore -->
<!-- Web Site:  The JavaScript Source -->
<!-- Use one function for multiple text areas on a page -->
<!-- Limit the number of characters per textarea -->
<!-- Begin
function textCounter(field,cntfield,maxlimit) {
if (field.value.length > maxlimit){// if too long...trim it!
alert("Sorry, the word limit is up.");
field.value = field.value.substring(0, maxlimit);
//var alertMsg="Sorry. Your had reached your words limit.Please limit your words to " + maxlimit + " of characters. \n sorry for the trouble.";
// otherwise, update 'characters left' counter
}else{
cntfield.value="";
cntfield.value = maxlimit - field.value.length;
cntfield.value = cntfield.value + " of characters left";
}
}
//  End -->
function checkFieldsFB(){
	window.event.returnValue = false;
	var err="";
	if(document.frmFeedback.txtName.value==""){
		err="Your name is not filled.\n";
	}
	if(document.frmFeedback.txtEmail.value==""){
		err=err+"Your email is not filled.\n";
	}
	if(document.frmFeedback.txtComments.value==""){
		err=err+"Comments are not filled.";
	}
	if(err==""){
		window.event.returnValue = true;
	}else{
		window.event.returnValue = false;
		alert("Please correct the following error(s):\n\n" + err);
	
	}
}
function checkFieldsCU(){
window.event.returnValue = false;
	var err="";
	if(document.frmContact.txtName.value==""){
		err="Your name is not filled.\n";
	}
	if(document.frmContact.txtEmail.value==""){
		err=err+"Your email is not filled.\n";
	}
	if(document.frmContact.txtComments.value==""){
		err=err+"Comments are not filled.";
	}
	if(err==""){
		window.event.returnValue = true;
	}else{
		window.event.returnValue = false;
		alert("Please correct the following error(s):\n\n" + err);
	}
}

function checkFieldsTYF(){
window.event.returnValue = false;
	var err="";
	if(document.frmTYF.txtName.value==""){
		err="Your name is not filled.\n";
	}
	if(document.frmTYF.txtEmail.value==""){
		err=err+"Your email is not filled.\n";
	}
	if(document.frmTYF.txtEmailFriend.value==""){
		err=err+"Your Friends' emails are not filled.\n";
	}

	if(document.frmTYF.txtMessage.value==""){
		err=err+"Your Message to your friend is not filled.";
	}
	if(err==""){
		window.event.returnValue = true;
	}else{
		window.event.returnValue = false;
		alert("Please correct the following error(s):\n\n" + err);
	
	}
}

function MM_CheckFlashVersion(reqVerStr,msg){
  with(navigator){
    var isIE  = (appVersion.indexOf("MSIE") != -1 && userAgent.indexOf("Opera") == -1);
    var isWin = (appVersion.toLowerCase().indexOf("win") != -1);
    if (!isIE || !isWin){  
      var flashVer = -1;
      if (plugins && plugins.length > 0){
        var desc = plugins["Shockwave Flash"] ? plugins["Shockwave Flash"].description : "";
        desc = plugins["Shockwave Flash 2.0"] ? plugins["Shockwave Flash 2.0"].description : desc;
        if (desc == "") flashVer = -1;
        else{
          var descArr = desc.split(" ");
          var tempArrMajor = descArr[2].split(".");
          var verMajor = tempArrMajor[0];
          var tempArrMinor = (descArr[3] != "") ? descArr[3].split("r") : descArr[4].split("r");
          var verMinor = (tempArrMinor[1] > 0) ? tempArrMinor[1] : 0;
          flashVer =  parseFloat(verMajor + "." + verMinor);
        }
      }
      // WebTV has Flash Player 4 or lower -- too low for video
      else if (userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 4.0;

      var verArr = reqVerStr.split(",");
      var reqVer = parseFloat(verArr[0] + "." + verArr[2]);
  
      if (flashVer < reqVer){
        if (confirm(msg))
          window.location = "http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash";
      }
    }
  } 
}