
  <!--
	function submitForm(action, val){
				//document.getElementById('pageToShow').setAttribute('value', 'shoppingCart');
				document.cart.pageToShow.setAttribute('value', 'shoppingCart');
				//alert(document.getElementById('pageToShow').getAttribute('value'));
				if (action == 'remove' && val != null){
					document.getElementById('delKey').setAttribute('value', val);
					document.cart.submit();
				}else if (action == 'update' && val != null){
					document.getElementById('updateKey').setAttribute('value', val);
					var name = "qty"+val;
					var newQty = document.getElementById(name).value;
					if (isNaN(parseInt(newQty)) || newQty < 0 || !isInteger(newQty)){
						alert("please check the number you have entered for your quantity. It must be a positive integer");
						return;
					}
					document.getElementById('updateQty').setAttribute('value',newQty);
					document.cart.submit();
				}else if (action == 'checkout' && val != null){
					//document.getElementById('checkout').setAttribute('value', val);
					//document.cart.submit();
					window.location = "?pageToShow=checkOut";
				}
			}
	function findPoster(){
		if (is_empty(document.forms['searchfrm'].keyword)){
			alert('Please Enter Your Keywrod');
        }else{
		   document.forms['searchfrm'].submit();
		}
    }
	    var theWaitWindow = null;     // temporarily window while calling a script
        
    function viewpage(url,width,height) {
      options = "toolbar=0,status=0,menubar=0,scrollbars=1," +
                "resizable=1,width=" + width + ",height=" + height ;
       var mywin = window.open(url,"", options);
    }
    
    
    function _JSWait(msg){
  	  var option = "width=400, height=150," +
			 "resizable=yes,"+
			 "menubar=no," +
			 "toolbar=no," +
			 "location=no," +
			 "status=no, " + 
			 "left=80, " +
			 "top=80 ";
  	  var newWin = window.open('../pwait.php?msg='+ msg,'waitWin',option);
  	  newWin.focus();
  	  return newWin;
    }
    
    var max_len = 225;
    function count(desc){
       var desc_len = desc.value.length;
       if(desc_len < max_len){
          var cnt_id = document.getElementById("maxchar");
          cnt_id.innerHTML = (max_len - desc_len);
       }else{
          alert("You may only type 255 characters in this box");
          desc.focus();
       }
    }
  
 function select(obj,msg){
          obj.focus();
          obj.select();
          alert(msg);
          return false;
    }
    
    function select_menu(obj,msg){
          obj.focus();
          alert(msg);
          return false;
    }    
    function firstUpper(str){
       var b = str.charAt(0).toUpperCase();
       var b = b + str.slice(1,str.length).toLowerCase();
       return b;
    }
    
 
    function is_valid(obj) {
       var invalid = "!\"#%&\'()$;<=>?[\\]*+,-./:^";
       for(i=0;i <invalid.length;i++){
           if(obj.value.indexOf(invalid.charAt(i)) >= 0){
              return false;
           }
       }
       return true;
    }
    
    function is_digit(obj) { 
      var isValid = 1;
      for(i=0;i<obj.value.length;i++){
        var ch = obj.value.charCodeAt(i);
        isvalid = (ch >= 48 && ch <= 57);
        if(!isValid) return false;
      }
      isvalid = !isNaN(obj.value);
      return isvalid;
    }

  function is_empty(obj) {
        obj.value = L_trim(obj);
        obj.value = R_trim(obj);
      	if ((obj.value.length==0) || (obj.value==null)) {
         return true;
        }else{
           return false;
        }
    }
    
    function L_trim(obj){
       var hasChar = false;
       var tempObjVlaue = "";
       for(i = 0; i < obj.value.length ; i++){
          cur_char = obj.value.charCodeAt(i);
          if(cur_char != 32)
            hasChar = true;
            
          if(hasChar)
             return obj.value.substr(i);
       }
       return obj.value;
    }
    

    function R_trim(obj){
       var hasChar = false;
       var tempObjVlaue = "";
       var cur_char = "";
       for(i = obj.value.length; i >= 0 ; i--){
          cur_char = obj.value.charCodeAt(i-1);
          if(cur_char != 32)
            hasChar = true;
            
          if(hasChar){
             return obj.value.substr(0,i);
          }   
       }
       return obj.value;
    }
    
    function trim(obj){
    	obj = obj.L_trim;
    	obj = obj.R_trim;
    	return obj;
    	
    }
    
    function isValidPhone(phone) {
	   var valid = true;
	   var GoodChars = "0123456789()-+ "
	   var i = 0
	   for (i =0; valid  && i <= phone.value.length -1; i++) {
	      if (GoodChars.indexOf(phone.value.charAt(i)) == -1) {
                valid = false;
	       } 
	   } 
	   return valid; 
    }
    
    function isValidEmail(str) {
       // are regular expressions supported?

       var supported = 0;
       if (window.RegExp) {
    	    var tempStr = "a";
	    var tempReg = new RegExp(tempStr);
	    if (tempReg.test(tempStr)) supported = 1;
       }
       if (!supported) 
          return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);
          
       var r1 = new RegExp("(@.*@)|(\\.\\.)|(@\\.)|(^\\.)");
       var r2 = new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$");
       return (!r1.test(str) && r2.test(str));
    } 
    
    function Trim(TRIM_VALUE){
	    if(TRIM_VALUE.length < 1){
	    	return"";
	    }
	    TRIM_VALUE = RTrim(TRIM_VALUE);
	    TRIM_VALUE = LTrim(TRIM_VALUE);
	    if(TRIM_VALUE==""){
	    	return "";
	    }else{
	    	return TRIM_VALUE;
	    }
    } //End Function
    
    function RTrim(VALUE){
	    var w_space = String.fromCharCode(32);
	    var v_length = VALUE.length;
	    var strTemp = "";
	    if(v_length < 0){
		    return"";
	    }
	    var iTemp = v_length -1;

	    while(iTemp > -1){
		    if(VALUE.charAt(iTemp) == w_space){
		    
		    }else{
		    	strTemp = VALUE.substring(0,iTemp +1);
		    	break;
		    }
		    iTemp = iTemp-1;
	    } //End While
	    
	    return strTemp;
	    
    } //End Function
    
    function LTrim(VALUE){
	    var w_space = String.fromCharCode(32);
	    if(v_length < 1){
		    return"";
	    }
	    
	    var v_length = VALUE.length;
	    var strTemp = "";

	    var iTemp = 0;

	    while(iTemp < v_length){
		    if(VALUE.charAt(iTemp) == w_space){
		    
		    }else{
			    strTemp = VALUE.substring(iTemp,v_length);
			    break;
		    }
		    iTemp = iTemp + 1;
	    } //End While
	    return strTemp;
    } //End Function
    
    function isEmptyStr(str){
    	return (Trim(str).length == 0);
    }


			function submitInfoForm(){

				var doc = document;
				var fn = doc.getElementById('firstname').value;
				var fnChk = isEmptyStr(fn) || !isAlpha(fn);

				var ln = doc.getElementById('lastname').value;
				var lnChk = isEmptyStr(ln) || !isAlpha(ln);

				var ph1 = doc.getElementById('phone1').value;
				var ph1Chk = isEmptyStr(ph1) || !isInteger(Trim(ph1)) || Trim(ph1).length != 3;

				var ph2 = doc.getElementById('phone2').value;
				var ph2Chk = isEmptyStr(ph2) || !isInteger(Trim(ph2)) || Trim(ph2).length != 3;

				var ph3 = doc.getElementById('phone3').value;
				var ph3Chk = isEmptyStr(ph3) || !isInteger(Trim(ph3)) || Trim(ph3).length != 4;

				var email= doc.getElementById('email').value;
				var emailChk = isEmptyStr(email) || !isValidEmail(email);

				var add1 = doc.getElementById('address1').value;
				var add1Chk = isEmptyStr(add1);

				var add2 = doc.getElementById('address2').value;
				//no checks needed since it's an optional field.

				var city = doc.getElementById('city').value;
				var cityChk = isEmptyStr(city) || !isAlpha(city);

				var state = doc.getElementById('state').value;
				var stateChk = isEmptyStr(state) || !isAlpha(state);

				var zip = doc.getElementById('zip').value;
				var zipChk = isEmptyStr(zip);

				var country = doc.getElementById('country').value;
				var countryChk = isEmptyStr(country) || !isAlpha(country);

				var allChk = 	fnChk	||
								lnChk	||
								ph1Chk	||
								ph2Chk 	||
								ph3Chk	||
								emailChk	||
								add1Chk	||
								cityChk ||
								stateChk	||
								zipChk	||
								countryChk
								;

				if (allChk){
					alert("One of the fields has an incorrect format. Please refer to the notes below each box.");
				}else{
					alert("submittig - thank you");
					doc.checkOutForm.submit();
				}
			}

	
function isInteger(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)
		         {
		         IsNumber = false;
		         }
		      }
		   return IsNumber;

   		}

   		function isFloat(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)
				 {
				 IsNumber = false;
				 }
			  }
		   return IsNumber;

   		}

		function isAlpha(sText)

		{
		   var ValidChars = "abcdefghijklmnopqrstuvwxyz.,";
		   var IsNumber=true;
		   var Char;


		   for (i = 0; i < sText.length && IsNumber == true; i++)
		      {
		      Char = sText.charAt(i).toLowerCase();
		      if (ValidChars.indexOf(Char) == -1)
		         {
		         IsNumber = false;
		         }
		      }
		   return IsNumber;

   		}


  -->

