/***********************************************
* Form fields Validation Script
***********************************************/

function ValidateForm(f){

      with(f){
         if (isEmpty(_1_Product.value)) {
            alert("Please enter your Name");
            _1_Product.focus();
            return false;
         }

         if (isEmpty(_2_Stock.value)) {
            alert("Please enter your Enquiry");
            _2_Stock.focus();
            return false;
         }

         if (isEmpty(_3_Name.value)) {
            alert("Please enter your Name");
            _3_Name.focus();
            return false;
         }
         if (isEmpty(_4_Email_From.value)) {
            alert("Please enter your Email Address");
            _4_Email_From.focus();
            return false;
         }

         if ( !isEmail(_4_Email_From.value) ) {
            alert("Please enter a valid Email Address.");
            _4_Email_From.focus();
            return false;
         }

         if (!isEmpty(_5_Phone.value)) {
	         if (!IsNumber(_5_Phone.value, true)) {
            	alert("Please enter only numbers for your Phone");
            	_5_Phone.focus();
            	return false;
         	}
         }

         if (!isEmpty(_6_Fax.value)) {
         if (!IsNumber(_6_Fax.value, true)) {
            	alert("Please enter only numbers for your Fax");
            	_6_Fax.focus();
            	return false;
         	}
         }

         if (isEmpty(_7_Enquiries.value)) {
            alert("Please enter your Enquiry");
            _7_Enquiries.focus();
            return false;
         }
   	}
   return true;
 }


/***********************************************
* Popup Pic Script
***********************************************/

function PopupPic() {
 if (arguments[1] == null || arguments[1].length == 0 || arguments[2] == null || arguments[2].length == 0) {
  window.open( "popup.asp?" + arguments[0], "", "resizable=1,HEIGHT=200,WIDTH=200"); 
 }
 else {
  window.open( "popup.asp?" + arguments[0], "", "resizable=1,HEIGHT=" + arguments[2] + ",WIDTH=" + arguments[1] + ""); 
 }
} 


/***********************************************
* Popup URL Script
***********************************************/

function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=no,location=0,statusbar=0,menubar=yes,resizable=0,width=600,height=510');");
}


/***********************************************
* ShowandHide Script
***********************************************/

//<!--
function viewinfo(id) {
	box = document.getElementById(id);
	if(box.className == "visible") {
		box.className = "hidden";
	} else {
		box.className = "visible";
	}
}
//-->
