	function submitAttach()
	{
		//document.myForm.target="fileuploaderframe";
		var filenamevalue=document.myForm.AttachFile.value;
		
		if(filenamevalue==""){alert("Please Attach a File."); return false;}		
		var  ext=filenamevalue.substr(filenamevalue.lastIndexOf(".")).toLowerCase();
		
		
		
		
		var extarraystr="";
		var extallowed_flag=false;
		
		for(var k=0;k<extarray.length;k++)
		{
			extarraystr=extarraystr+extarray[k]+", ";
			if(extarray[k]==ext)
			{
				extallowed_flag=true;
			}
		}
		if(extallowed_flag){}
		else
		{
			alert("Files with "+extarraystr+" extensions only are allowed.");
			return false;
		}
		
		document.myForm.enctype="multipart/form-data";
		document.myForm.action=roottocm+"controller/cmcontroller/externalenquiry.php?reqPage=uploadfile";
		AIM.submit(document.myForm, {'onStart' : startCallback, 'onComplete' : completeCallback});
		document.myForm.submit();
		//completeCallback();
	}
	function startCallback() {
		return true;
	}
	
	function completeCallback(response)
	 {
		document.getElementById("uploadedfilesdiv").innerHTML=response;
	}
	function ValidateForm()
		{
			if(document.myForm.firstname.value=="" && document.myForm.firstname){
					alert("Enter FirstName.");
					document.myForm.firstname.focus();
					return false;
			}			
			if(document.myForm.lastname.value==""){
					alert("Enter LastName.");
					document.myForm.lastname.focus();
					return false;
			}
			if(document.myForm.designation.value==0){
					alert("Enter Designation.");
					document.myForm.designation.focus();
					return false;
			}
			if(document.myForm.companyname.value==0){
					alert("Enter Company Name.");
					document.myForm.companyname.focus();
					return false;
			}
			if(document.myForm.industrysegment.value==0){
					alert("Enter Industry.");
					document.myForm.industrysegment.focus();
					return false;
			}
			if(document.myForm.email.value==""){
					alert("Enter EMail ID.");
					document.myForm.email.focus();
					return false;
			}
			if(isValidEmail(document.myForm.email.value)==false){					
					document.myForm.email.focus();
					return false;
			}
			if(document.myForm.phoneno.value==""){
					alert("Enter TelephoneNo.");
					document.myForm.phoneno.focus();
					return false;
			}			
			if(isValidTelephoneNumber(document.myForm.phoneno)==false){
					document.myForm.phoneno.focus();
					return false;
			}
			if(document.myForm.mobileno.value!=""){					
					if(isValidTelephoneNumber(document.myForm.mobileno)==false){
							document.myForm.mobileno.focus();	
							return false;						
					}						
			}
			if(document.myForm.country.value==0){
					alert("Enter Country.");
					document.myForm.country.focus();
					return false;
			}	
			/*if(document.myForm.InterestedIn.value==""){
					alert("Enter Interested In.");
					document.myForm.InterestedIn.focus();
					return false;
			}*/			
			if(document.myForm.knowusthro.value==0){
					alert("Enter how you came to know about AdsStation.Biz");
					document.myForm.knowusthro.focus();
					return false;
			}			
			if(document.myForm.designation.value==""){
					alert("Enter Designation.");
					document.myForm.designation.focus();
					return false;
			}
			if(document.myForm.companyname.value==""){
					alert("Enter CompanyName.");
					document.myForm.companyname.focus();
					return false;
			}	
		document.myForm.target="_self";
		document.myForm.action=roottocm+"controller/cmcontroller/externalenquiry.php?reqPage=extenquiry";
		document.myForm.submit();
	}
	function deletefile(delfilename)
	{
		document.getElementsByName("delfilename")[0].value=delfilename;
		document.myForm.action=roottocm+"controller/cmcontroller/externalenquiry.php?reqPage=deletefile";
		AIM.submit(document.myForm, {'onStart' : startCallback, 'onComplete' : completeCallback});
		document.myForm.submit();
	}
	function enableothertextbox(elemname)
	{
		var elem=document.getElementsByName(elemname)[0];
		var otherelem=document.getElementsByName("other"+elemname)[0];
		
		if(elem.value.toLowerCase()=="other" || elem.value.toLowerCase()=="others")
		otherelem.style.display="";
		else
		otherelem.style.display="none";
	}
	function downloadfile(filename)
	{
		var new_win=window.open(roottocm+"controller/cmcontroller/download_file.php?path="+filename,"downloadfilepopup","resizable=yes,scrollbars=yes,width=800,height=650");
	}