function cleandomainchk ()
{
	if ( document.one.domain.value == 'www.yourcompany' ) document.one.domain.value = 'www.';
}
function filldomainchk ()
{
if ( document.one.domain.value == 'www.' ) document.one.domain.value = 'www.yourcompany';
}
//-------------------------------------form Chking----------------------------------------------//
function cagree(theForm)
	{
	//alert(theForm.same.checked)
	if (theForm.agree.checked == true)
	  {
		theForm.CompanyPerson.value = theForm.Company.value;
		theForm.Personname.value  = theForm.person.value ;
	  }
	else
	  {
		theForm.CompanyPerson.value = "";
		theForm.Personname.value  = "";
	  }
	}

function msg(n_msg,x){

if(x==1){
var msg="The following fields were found to be blank or incorrect.\nPlease check and correct it before submiting the form \n"
msg=msg+"------------------------------------------------------------------\n\n"
msg=msg+n_msg+"\n\n"
alert(msg); return false;}}


function check_login(){
//alert("alal");
var x=0;
var t=0;
var f=0;
var n_msg=""
var regexp = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/;
var promx = true; 

if (document.form1.promsubmit.value == 1)
{ 
return promx; 
}
else
{
if(!document.form1.person.value){n_msg=n_msg+"Contact Person\n"; x=1;}
if(!document.form1.Company.value){n_msg=n_msg+"Company Name\n"; x=1;}
if(!document.form1.mobile.value){n_msg=n_msg+"Mobile No.\n"; x=1;}
if(!document.form1.tele.value){n_msg=n_msg+"Telephone No.\n"; x=1;}
if(!document.form1.fax.value){n_msg=n_msg+"Fax No.\n"; x=1;}
if(!document.form1.email.value){n_msg=n_msg+"Email Address\n"; x=1;}
if(document.form1.email.value){if(document.form1.email.value.search(regexp) == -1){n_msg=n_msg+"Email - Invalid Characters\n"; x=1;}}
if(!document.form1.pobox.value){n_msg=n_msg+"Post Box No.\n"; x=1;}
if(!document.form1.add.value){n_msg=n_msg+"Address\n"; x=1;}
if(!document.form1.country.value){n_msg=n_msg+"Country\n"; x=1;}
if(!document.form1.city.value){n_msg=n_msg+"City\n"; x=1;}
if(!document.form1.strsig.value){n_msg=n_msg+"Please enter the Token No. shown in the box.\n"; x=1;}
if(document.form1.strsig.value){if(isNaN(document.form1.strsig.value)){n_msg=n_msg+"Invalid Ticket No. Use only numeric characters\n"; x=1; }}
if(!document.form1.agree.checked){n_msg=n_msg+"Please click on the checkbox if you agree to confirm the above order!\n"; x=1;}
return msg(n_msg,x) 
}
}
function submitFormclear(theForm)
{
theForm.nedbcd.unchecked
theForm.nedbfzcd.unchecked
theForm.nedbandfzcd.unchecked
theForm.nedbdxbID.unchecked
theForm.nedbfax.unchecked
theForm.nedbsaudi.unchecked
theForm.nedbbah.unchecked
theForm.nedboman.unchecked
theForm.nedbqatar.unchecked
theForm.nedbkwt.unchecked
theForm.nedbleb.unchecked
theForm.nedbtur.unchecked
theForm.nedbcyp.unchecked
theForm.nedbjor.unchecked
theForm.nedbiran.unchecked
theForm.nedbegypt.unchecked
theForm.nedbfaxs.unchecked
theForm.nedbccompany.value  = "";
theForm.nedbcpobox.value  = "";
theForm.nedbcaddress.value  = "";
theForm.nedbccity.value  = "";
theForm.nedbccountry.value  = "";
theForm.nedbcphone.value  = "";
theForm.nedbcfax.value  = "";
theForm.nedbcemail.value  = "";
theForm.nedbcwebsite.value  = "";
theForm.nedbcperson.value  = "";
theForm.nedbcmobile.value  = "";
theForm.nedbccomments.value  = "";
theForm.nedbcagree.unchecked
theForm.nedbcforc.value = "";
theForm.nedbcforcname.value  = "";
theForm.nedbcforcdesig.value  = "";
}
//Script to add an attachment file field 
var nfiles = 1;
function Expand(){
  nfiles++
  var adh = '<div align=left> Attachment '+nfiles+'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:&nbsp;<input type="file" name="File '+nfiles+'"></div>';
  files.insertAdjacentHTML('BeforeEnd',adh);
  return false;
};

//Open a window with progress bar indicator.
function ProgressBar(){
  var ProgressURL
  ProgressURL = 'progress.asp?UploadID=<%=UploadID%>'

  var v = window.open(ProgressURL,'_blank','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=350,height=200')
  
  return true;
}
