//disable all billing contacts if checkbox is checked
var BillFName = "";
var BillLName = "";
var BillMName = "";
var BillPos = "";
var BillEmail = "";

var BillPhone1 = "";
var BillPhone2 = "";
var BillPhone3 = "";

var BillMPhone1 = "";
var BillMPhone2 = "";
var BillMPhone3 = "";

var BillFax1 = "";
var BillFax2 = "";
var BillFax3 = "";

function InitSaveVariables(form) {
	BillName = form.bc_fname.value;
	BillLName = form.bc_lname.value;
	BillMName = form.bc_mname.value;
	BillEmail = form.bc_email.value;
	
	BillPhone1 = form.bc_telno1.value;
	BillPhone2 = form.bc_telno2.value;
	BillPhone3 = form.bc_telno3.value;
	
	BillMPhone1 = form.bc_mobileno1.value;
	BillMPhone2 = form.bc_mobileno2.value;
	BillMPhone3 = form.bc_mobileno3.value;
	
	BillFax1 = form.bc_faxno1.value;
	BillFax2 = form.bc_faxno2.value;
	BillFax3 = form.bc_faxno3.value;
	
	BillPos = form.bc_pos.value;
}

function CopyAdBill(form) {

	if (form.copyadbill.checked) {
		InitSaveVariables(form);
		form.bc_fname.value = form.ac_fname.value;
		form.bc_lname.value = form.ac_lname.value;
		form.bc_mname.value = form.ac_mname.value;
		form.bc_email.value = form.ac_email.value;
		form.bc_pos.value = form.ac_pos.value;
		
		form.bc_telno1.value = form.ac_telno1.value;
		form.bc_telno2.value = form.ac_telno2.value;
		form.bc_telno3.value = form.ac_telno3.value;
		
		form.bc_mobileno1.value = form.ac_mobileno1.value;
		form.bc_mobileno2.value = form.ac_mobileno2.value;
		form.bc_mobileno3.value = form.ac_mobileno3.value;
		
		form.bc_faxno1.value = form.ac_faxno1.value;
		form.bc_faxno2.value = form.ac_faxno2.value;
		form.bc_faxno3.value = form.ac_faxno3.value;
		
		form.bc_fname.readOnly = true;
		form.bc_lname.readOnly = true;
		form.bc_mname.readOnly = true;
		form.bc_email.readOnly = true;
		form.bc_pos.readOnly = true;
		
		form.bc_telno1.readOnly = true;
		form.bc_telno2.readOnly = true;
		form.bc_telno3.readOnly = true;
		
		form.bc_mobileno1.readOnly = true;
		form.bc_mobileno2.readOnly = true;
		form.bc_mobileno3.readOnly = true;
		
		form.bc_faxno1.readOnly = true;
		form.bc_faxno2.readOnly = true;
		form.bc_faxno3.readOnly = true;

	} else {
		form.bc_fname.value = BillFName;
		form.bc_lname.value = BillLName;
		form.bc_mname.value = BillMName;
		form.bc_email.value = BillEmail;
		form.bc_pos.value = BillPos;
		
		form.bc_telno1.value = BillPhone1;
		form.bc_telno2.value = BillPhone2;
		form.bc_telno3.value = BillPhone3;
		
		form.bc_mobileno1.value = BillMPhone1;
		form.bc_mobileno2.value = BillMPhone2;
		form.bc_mobileno3.value = BillMPhone3;
		
		form.bc_faxno1.value = BillFax1;
		form.bc_faxno2.value = BillFax2;
		form.bc_faxno3.value = BillFax3;
		
		form.bc_fname.readOnly = false;
		form.bc_lname.readOnly = false;
		form.bc_mname.readOnly = false;
		form.bc_email.readOnly = false;
		form.bc_pos.readOnly = false;
		
		form.bc_telno1.readOnly = false;
		form.bc_telno2.readOnly = false;
		form.bc_telno3.readOnly = false;
		
		form.bc_mobileno1.readOnly = false;
		form.bc_mobileno2.readOnly = false;
		form.bc_mobileno3.readOnly = false;
		
		form.bc_faxno1.readOnly = false;
		form.bc_faxno2.readOnly = false;
		form.bc_faxno3.readOnly = false;			
	}
}

//disable all technical contacts if checkbox is checked
var TechFName = "";
var TechLName = "";
var TechMName = "";
var TechPos = "";
var TechEmail = "";

var TechPhone1 = "";
var TechPhone2 = "";
var TechPhone3 = "";

var TechMPhone1 = "";
var TechMPhone2 = "";
var TechMPhone3 = "";

var TechFax1 = "";
var TechFax2 = "";
var TechFax3 = "";

function InitSaveVariablesT(form) {
	TechFName = form.tc_fname.value;
	TechLName = form.tc_lname.value;
	TechMName = form.tc_mname.value;
	TechEmail = form.tc_email.value;
	TechPos = form.tc_pos.value;
	
	TechPhone1 = form.tc_telno1.value;
	TechPhone2 = form.tc_telno2.value;
	TechPhone3 = form.tc_telno3.value;
	
	TechMPhone1 = form.tc_mobileno1.value;
	TechMPhone2 = form.tc_mobileno2.value;
	TechMPhone3 = form.tc_mobileno3.value;
	
	TechFax1 = form.tc_faxno1.value;
	TechFax2 = form.tc_faxno2.value;
	TechFax3 = form.tc_faxno3.value;
}

function CopyAdTech(form) {

	if (form.copyadtech.checked) {
		InitSaveVariablesT(form);
		form.tc_fname.value = form.ac_fname.value;
		form.tc_lname.value = form.ac_lname.value;
		form.tc_mname.value = form.ac_mname.value;
		form.tc_email.value = form.ac_email.value;
		form.tc_pos.value = form.ac_pos.value;
		
		form.tc_telno1.value = form.ac_telno1.value;
		form.tc_telno2.value = form.ac_telno2.value;
		form.tc_telno3.value = form.ac_telno3.value;
		
		form.tc_mobileno1.value = form.ac_mobileno1.value;
		form.tc_mobileno2.value = form.ac_mobileno2.value;
		form.tc_mobileno3.value = form.ac_mobileno3.value;
		
		form.tc_faxno1.value = form.ac_faxno1.value;
		form.tc_faxno2.value = form.ac_faxno2.value;
		form.tc_faxno3.value = form.ac_faxno3.value;
		
		form.tc_fname.readOnly = true;
		form.tc_lname.readOnly = true;
		form.tc_mname.readOnly = true;
		form.tc_email.readOnly = true;
		form.tc_pos.readOnly = true;
		
		form.tc_telno1.readOnly = true;
		form.tc_telno2.readOnly = true;
		form.tc_telno3.readOnly = true;
		
		form.tc_mobileno1.readOnly = true;
		form.tc_mobileno2.readOnly = true;
		form.tc_mobileno3.readOnly = true;
		
		form.tc_faxno1.readOnly = true;
		form.tc_faxno2.readOnly = true;
		form.tc_faxno3.readOnly = true;		

	} else {
		form.tc_fname.value = TechFName;
		form.tc_lname.value = TechLName;
		form.tc_mname.value = TechMName;
		form.tc_email.value = TechEmail;
		form.tc_pos.value = TechPos;
		
		form.tc_telno1.value = TechPhone1;
		form.tc_telno2.value = TechPhone2;
		form.tc_telno3.value = TechPhone3;
		
		form.tc_mobileno1.value = TechMPhone1;
		form.tc_mobileno2.value = TechMPhone2;
		form.tc_mobileno3.value = TechMPhone3;
		
		form.tc_faxno1.value = TechFax1;
		form.tc_faxno2.value = TechFax2;
		form.tc_faxno3.value = TechFax3;		
		
		form.tc_fname.readOnly = false;
		form.tc_lname.readOnly = false;
		form.tc_mname.readOnly = false;
		form.tc_email.readOnly = false;
		form.tc_pos.readOnly = false;
		
		form.tc_telno1.readOnly = false;
		form.tc_telno2.readOnly = false;
		form.tc_telno3.readOnly = false;
		
		form.tc_mobileno1.readOnly = false;
		form.tc_mobileno2.readOnly = false;
		form.tc_mobileno3.readOnly = false;
		
		form.tc_faxno1.readOnly = false;
		form.tc_faxno2.readOnly = false;
		form.tc_faxno3.readOnly = false;			
	}
}

function checkfield(fieldname,fieldlabel,acceptonly){		
	var s= new String();		
	characters = new RegExp ("[^A-Za-z .'-]","i");
	numbers = new RegExp ("[^0-9 .]","i");
	numchar = new RegExp ("[^0-9-^A-Za-z .'-]","i");
	s = document.sub_form[fieldname].value;
	result = s.search(eval(acceptonly));
	if (result != -1){
		if (acceptonly == "numchar"){
			msg = fieldlabel + " can only contain numbers and characters" + ".";
		}else if  (acceptonly == "numbers"){
			msg = fieldlabel + " can only contain numbers" + ".";
		}else{
			msg = fieldlabel + " can only contain characters" + ".";
		}		
		document.sub_form[fieldname].value = s.substring(0,s.length-5);
		alert(msg);
		return false;
	}			
}

//subscription form validation 
function form_validator(sub_form)
{
	if (document.sub_form.comp_name.value == "")
	{
		alert("Please specify a Name for the \"Company Name\" Field.");
		document.sub_form.comp_name.focus();
		return (false);
	} 	

	if (document.sub_form.street.value == "")
	{
		alert("Please specify a Street for the \"Street\" Field.");
		document.sub_form.street.focus();
		return (false);
	}

	if (document.sub_form.city_state.value == "")
	{
		alert("Please specify a City or State for the \"City/State\" Field.");
		document.sub_form.city_state.focus();
		return (false);
	}
	
	if (document.sub_form.zip_code.value == "")
	{
		alert("Please specify a Zip Code for the \"Zip Code\" Field.");
		document.sub_form.zip_code.focus();
		return (false);
	}			 	

	if (document.sub_form.country.value == "")
	{
		alert("Please select a Country for the \"Country\" Field.");
		document.sub_form.country.focus();
		return (false);
	}	
	
	if (document.sub_form.industry.value == "")
	{
		alert("Please select an Industry for the \"Industry\" Field.");
		document.sub_form.industry.focus();
		return (false);
	}
	
	if (document.sub_form.sub_type.value == "")
	{
		alert("Please select a Subscription Type for the \"Subscription Type\" Field.");
		document.sub_form.sub_type.focus();
		return (false);
	}
	
	//for administrative contact
	if (document.sub_form.ac_fname.value == "")
	{
		alert("Please select a First Name for the \"Administrative Contact First Name\" Field.");
		document.sub_form.ac_fname.focus();
		return (false);
	}
	
	if (document.sub_form.ac_lname.value == "")
	{
		alert("Please select a Last Name for the \"Administrative Contact Last Name\" Field.");
		document.sub_form.ac_lname.focus();
		return (false);
	}								
	/*
	if (document.sub_form.ac_mname.value == "")
	{
		alert("Please select a Middle Name for the \"Administrative Contact Middle Name\" Field.");
		document.sub_form.ac_mname.focus();
		return (false);
	}*/
	
	if (document.sub_form.ac_email.value == "")
	{
		alert("Please specify an E-mail Address for the \"Administrative Contact E-mail\" Field.");
		document.sub_form.ac_email.focus();
		return (false);
	}
	
	if (!document.sub_form.ac_email.value == "") {
		email = document.sub_form.ac_email.value;
		AtPos = email.indexOf("@");
		StopPos = email.lastIndexOf(".");
		//Message = "";
		
		if (email == "") {
			alert("Email address on the \"Administrative Contact E-mail\" Field is incorrect." + "\n");
			document.sub_form.ac_email.focus();
			return(false);
		}
		
		if (AtPos == -1 || StopPos == -1) {
			alert("Email address on the \"Administrative Contact E-mail\" Field is incorrect.");
			document.sub_form.ac_email.focus();
			return(false);
		}
		
		if (StopPos < AtPos) {
			alert("Email address on the \"Administrative Contact E-mail\" Field is incorrect.");
			document.sub_form.ac_email.focus();
			return(false);
		}
		
		if (StopPos - AtPos == 1) {
			alert("Email address on the \"Administrative Contact E-mail\" Field is incorrect.");
			document.sub_form.ac_email.focus();
			return(false);
		}	
	}
	
	if (document.sub_form.ac_telno1.value == "")
	{
		alert("Please specify a Country Code for the \"Administrative Contact Tel. #\" Field.");
		document.sub_form.ac_telno1.focus();
		return (false);
	}
	
	if (document.sub_form.ac_telno2.value == "")
	{
		alert("Please specify a Area Code for the \"Administrative Contact Tel. #\" Field.");
		document.sub_form.ac_telno2.focus();
		return (false);
	}
	
	if (document.sub_form.ac_telno3.value == "")
	{
		alert("Please specify a Tel. # for the \"Administrative Contact Tel. #\" Field.");
		document.sub_form.ac_telno3.focus();
		return (false);
	}
	
	/*
	if (document.sub_form.ac_mobileno1.value == "")
	{
		alert("Please specify a Country Code for the \"Administrative Contact Mobile #\" Field.");
		document.sub_form.ac_mobileno1.focus();
		return (false);
	}
	
	if (document.sub_form.ac_mobileno2.value == "")
	{
		alert("Please specify a Area Code for the \"Administrative Contact Mobile #\" Field.");
		document.sub_form.ac_mobileno2.focus();
		return (false);
	}							
	
	if (document.sub_form.ac_mobileno3.value == "")
	{
		alert("Please specify a Mobile # for the \"Administrative Contact Mobile #\" Field.");
		document.sub_form.ac_mobileno3.focus();
		return (false);
	}
	
	if (document.sub_form.ac_pos.value == "")
	{
		alert("Please specify a Position for the \"Administrative Contact Position\" Field.");
		document.sub_form.ac_pos.focus();
		return (false);
	}
	
	
	if (document.sub_form.ac_faxno1.value == "")
	{
		alert("Please specify a Country Code for the \"Administrative Contact Fax #\" Field.");
		document.sub_form.ac_faxno1.focus();
		return (false);
	}	
	
	if (document.sub_form.ac_faxno2.value == "")
	{
		alert("Please specify a Area Code for the \"Administrative Contact Fax #\" Field.");
		document.sub_form.ac_faxno2.focus();
		return (false);
	}				
	
	if (document.sub_form.ac_faxno3.value == "")
	{
		alert("Please specify a Fax # for the \"Administrative Contact Fax #\" Field.");
		document.sub_form.ac_faxno3.focus();
		return (false);
	}	*/
	
	//for billing contacts
	/*
	if (document.sub_form.bc_fname.value == "")
	{
		alert("Please select a First Name for the \"Billing Contact First Name\" Field.");
		document.sub_form.bc_fname.focus();
		return (false);
	}
	
	if (document.sub_form.bc_lname.value == "")
	{
		alert("Please select a Last Name for the \"Billing Contact Last Name\" Field.");
		document.sub_form.bc_lname.focus();
		return (false);
	}								
	
	if (document.sub_form.bc_mname.value == "")
	{
		alert("Please select a Middle Name for the \"Billing Contact Middle Name\" Field.");
		document.sub_form.bc_mname.focus();
		return (false);
	}
	
	if (document.sub_form.bc_email.value == "")
	{
		alert("Please specify an E-mail Address for the \"Billing Contact E-mail\" Field.");
		document.sub_form.bc_email.focus();
		return (false);
	}
	
	if (!document.sub_form.bc_email.value == "") {
		email = document.sub_form.bc_email.value;
		AtPos = email.indexOf("@");
		StopPos = email.lastIndexOf(".");
		//Message = "";
		
		if (email == "") {
			alert("Email address on the \"Billing Contact E-mail\" Field is incorrect." + "\n");
			document.sub_form.bc_email.focus();
			return(false);
		}
		
		if (AtPos == -1 || StopPos == -1) {
			alert("Email address on the \"Billing Contact E-mail\" Field is incorrect.");
			document.sub_form.bc_email.focus();
			return(false);
		}
		
		if (StopPos < AtPos) {
			alert("Email address on the \"Billing Contact E-mail\" Field is incorrect.");
			document.sub_form.bc_email.focus();
			return(false);
		}
		
		if (StopPos - AtPos == 1) {
			alert("Email address on the \"Billing Contact E-mail\" Field is incorrect.");
			document.sub_form.bc_email.focus();
			return(false);
		}	
	}
	
	if (document.sub_form.bc_telno1.value == "")
	{
		alert("Please specify a Country Code for the \"Billing Contact Tel. #\" Field.");
		document.sub_form.bc_telno1.focus();
		return (false);
	}
	
	if (document.sub_form.bc_telno2.value == "")
	{
		alert("Please specify a Area Code for the \"Billing Contact Tel. #\" Field.");
		document.sub_form.bc_telno2.focus();
		return (false);
	}
	
	if (document.sub_form.bc_telno3.value == "")
	{
		alert("Please specify a Tel. # for the \"Billing Contact Tel. #\" Field.");
		document.sub_form.bc_telno3.focus();
		return (false);
	}*/
	
	/*
	if (document.sub_form.bc_mobileno1.value == "")
	{
		alert("Please specify a Country Code for the \"Billing Contact Mobile #\" Field.");
		document.sub_form.bc_mobileno1.focus();
		return (false);
	}
	
	if (document.sub_form.bc_mobileno2.value == "")
	{
		alert("Please specify a Area Code for the \"Billing Contact Mobile #\" Field.");
		document.sub_form.bc_mobileno2.focus();
		return (false);
	}							
	
	if (document.sub_form.bc_mobileno3.value == "")
	{
		alert("Please specify a Mobile # for the \"Billing Contact Mobile #\" Field.");
		document.sub_form.bc_mobileno3.focus();
		return (false);
	}
	
	if (document.sub_form.bc_pos.value == "")
	{
		alert("Please specify a Position for the \"Billing Contact Position\" Field.");
		document.sub_form.bc_pos.focus();
		return (false);
	}
	

	if (document.sub_form.bc_faxno1.value == "")
	{
		alert("Please specify a Country Code for the \"Billing Contact Fax #\" Field.");
		document.sub_form.bc_faxno1.focus();
		return (false);
	}	
	
	if (document.sub_form.bc_faxno2.value == "")
	{
		alert("Please specify a Area Code for the \"Billing Contact Fax #\" Field.");
		document.sub_form.bc_faxno2.focus();
		return (false);
	}				
	
	if (document.sub_form.bc_faxno3.value == "")
	{
		alert("Please specify a Fax # for the \"Billing Contact Fax #\" Field.");
		document.sub_form.bc_faxno3.focus();
		return (false);
	}*/
	
	//for technical contacts
	/*
	if (document.sub_form.tc_fname.value == "")
	{
		alert("Please select a First Name for the \"Technical Contact First Name\" Field.");
		document.sub_form.tc_fname.focus();
		return (false);
	}
	
	if (document.sub_form.tc_lname.value == "")
	{
		alert("Please select a Last Name for the \"Technical Contact Last Name\" Field.");
		document.sub_form.tc_lname.focus();
		return (false);
	}								
	
	if (document.sub_form.tc_mname.value == "")
	{
		alert("Please select a Middle Name for the \"Technical Contact Middle Name\" Field.");
		document.sub_form.tc_mname.focus();
		return (false);
	}
	
	if (document.sub_form.tc_email.value == "")
	{
		alert("Please specify an E-mail Address for the \"Technical Contact E-mail\" Field.");
		document.sub_form.tc_email.focus();
		return (false);
	}
	
	if (!document.sub_form.tc_email.value == "") {
		email = document.sub_form.tc_email.value;
		AtPos = email.indexOf("@");
		StopPos = email.lastIndexOf(".");
		//Message = "";
		
		if (email == "") {
			alert("Email address on the \"Technical Contact E-mail\" Field is incorrect." + "\n");
			document.sub_form.tc_email.focus();
			return(false);
		}
		
		if (AtPos == -1 || StopPos == -1) {
			alert("Email address on the \"Technical Contact E-mail\" Field is incorrect.");
			document.sub_form.tc_email.focus();
			return(false);
		}
		
		if (StopPos < AtPos) {
			alert("Email address on the \"Technical Contact E-mail\" Field is incorrect.");
			document.sub_form.tc_email.focus();
			return(false);
		}
		
		if (StopPos - AtPos == 1) {
			alert("Email address on the \"Technical Contact E-mail\" Field is incorrect.");
			document.sub_form.tc_email.focus();
			return(false);
		}	
	}
	
	if (document.sub_form.tc_telno1.value == "")
	{
		alert("Please specify a Country Code for the \"Technical Contact Tel. #\" Field.");
		document.sub_form.tc_telno1.focus();
		return (false);
	}
	
	if (document.sub_form.tc_telno2.value == "")
	{
		alert("Please specify a Area Code for the \"Technical Contact Tel. #\" Field.");
		document.sub_form.tc_telno2.focus();
		return (false);
	}
	
	if (document.sub_form.tc_telno3.value == "")
	{
		alert("Please specify a Tel. # for the \"Technical Contact Tel. #\" Field.");
		document.sub_form.tc_telno3.focus();
		return (false);
	}*/
	
	/*
	if (document.sub_form.tc_mobileno1.value == "")
	{
		alert("Please specify a Country Code for the \"Technical Contact Mobile #\" Field.");
		document.sub_form.tc_mobileno1.focus();
		return (false);
	}
	
	if (document.sub_form.tc_mobileno2.value == "")
	{
		alert("Please specify a Area Code for the \"Technical Contact Mobile #\" Field.");
		document.sub_form.tc_mobileno2.focus();
		return (false);
	}							
	
	if (document.sub_form.tc_mobileno3.value == "")
	{
		alert("Please specify a Mobile # for the \"Technical Contact Mobile #\" Field.");
		document.sub_form.tc_mobileno3.focus();
		return (false);
	}
	
	if (document.sub_form.tc_pos.value == "")
	{
		alert("Please specify a Position for the \"Technical Contact Position\" Field.");
		document.sub_form.tc_pos.focus();
		return (false);
	}
	
	
	if (document.sub_form.tc_faxno1.value == "")
	{
		alert("Please specify a Country Code for the \"Technical Contact Fax #\" Field.");
		document.sub_form.tc_faxno1.focus();
		return (false);
	}	
	
	if (document.sub_form.tc_faxno2.value == "")
	{
		alert("Please specify a Area Code for the \"Technical Contact Fax #\" Field.");
		document.sub_form.tc_faxno2.focus();
		return (false);
	}				
	
	if (document.sub_form.tc_faxno3.value == "")
	{
		alert("Please specify a Fax # for the \"Technical Contact Fax #\" Field.");
		document.sub_form.tc_faxno3.focus();
		return (false);
	}*/	
	
	if (document.sub_form.pay_type.value == "")
	{
		alert("Please select a Payment Type for the \"Payment Type\" Field.");
		document.sub_form.pay_type.focus();
		return (false);
	}	
	
	if (document.sub_form.minimum_amount.value == "")
	{
		alert("Minimum Amount must not be empty.");
		document.sub_form.minimum_amount.focus();
		return (false);
	}			

	/*
	if (document.sub_form.username.value == "")
	{
		alert("Please specify a username.");
		document.sub_form.username.focus();
		return (false);
	}	*/
	
	if (document.sub_form.sec_ques.value == "")
	{
		alert("Please select a security question.");
		document.sub_form.sec_ques.focus();
		return (false);
	}	
	
	if (document.sub_form.sec_ans.value == "")
	{
		alert("Please specify an answer for the securtiy question you have chosen.");
		document.sub_form.sec_ans.focus();
		return (false);
	}	
		
	if (document.sub_form.code.value == "")
	{
		alert("You need to enter the code shown to verify your registration.");
		document.sub_form.code.focus();
		return (false);
	}			
	
	if(document.sub_form.C15.checked == false){
		alert("Please check the \"I AGREE TO THE  TERMS OF SERVICE\" checkbox.");
		sub_form.C15.focus();
		return (false);		
	}		
}

function trylang(thevalue)
{   
	if(thevalue == "bank"){
		
		document.getElementById("amntpeso").style.display = '';
		document.getElementById("totalamntpeso").style.display = '';
		
		document.getElementById("amntdollar").style.display = 'none';
		document.getElementById("totalamntdollar").style.display = 'none';
		
		document.getElementById("noamnt").style.display = 'none';
		
	}else if(thevalue == "credit"){
		
		document.getElementById("amntdollar").style.display = '';
		document.getElementById("totalamntdollar").style.display = '';
		
		document.getElementById("amntpeso").style.display = 'none';
		document.getElementById("totalamntpeso").style.display = 'none';
		
		document.getElementById("noamnt").style.display = 'none';
		
	}else{
		
		document.getElementById("amntpeso").style.display = 'none';
		document.getElementById("totalamntpeso").style.display = 'none';
		
		document.getElementById("amntdollar").style.display = 'none';
		document.getElementById("totalamntdollar").style.display = 'none';
		
		document.getElementById("noamnt").style.display = '';
		
	}
	
	//ajaxObj("http://localhost/samutsari/includes/function.php?task=hello&value="+thevalue,"minimum_amount");	
}

/*
function checkid(thevalue)
{   
	ajaxObj("http://localhost/samutsari/includes/check.php?task=hello&value="+thevalue,"checkmsg");	
}*/

//show or hide total amount field
function loading(val){
	
	form = document.sub_form;
	
	trylang(val);

    /*	
	if (form.copyadbill.checked) {
		InitSaveVariables(form);
		form.bc_fname.value = form.ac_fname.value;
		form.bc_lname.value = form.ac_lname.value;
		form.bc_mname.value = form.ac_mname.value;
		form.bc_email.value = form.ac_email.value;
		form.bc_pos.value = form.ac_pos.value;
		
		form.bc_telno1.value = form.ac_telno1.value;
		form.bc_telno2.value = form.ac_telno2.value;
		form.bc_telno3.value = form.ac_telno3.value;
		
		form.bc_mobileno1.value = form.ac_mobileno1.value;
		form.bc_mobileno2.value = form.ac_mobileno2.value;
		form.bc_mobileno3.value = form.ac_mobileno3.value;
		
		form.bc_faxno1.value = form.ac_faxno1.value;
		form.bc_faxno2.value = form.ac_faxno2.value;
		form.bc_faxno3.value = form.ac_faxno3.value;
		
		form.bc_fname.readOnly = true;
		form.bc_lname.readOnly = true;
		form.bc_mname.readOnly = true;
		form.bc_email.readOnly = true;
		form.bc_pos.readOnly = true;
		
		form.bc_telno1.readOnly = true;
		form.bc_telno2.readOnly = true;
		form.bc_telno3.readOnly = true;
		
		form.bc_mobileno1.readOnly = true;
		form.bc_mobileno2.readOnly = true;
		form.bc_mobileno3.readOnly = true;
		
		form.bc_faxno1.readOnly = true;
		form.bc_faxno2.readOnly = true;
		form.bc_faxno3.readOnly = true;

	} else {
		form.bc_fname.value = BillFName;
		form.bc_lname.value = BillLName;
		form.bc_mname.value = BillMName;
		form.bc_email.value = BillEmail;
		form.bc_pos.value = BillPos;
		
		form.bc_telno1.value = BillPhone1;
		form.bc_telno2.value = BillPhone2;
		form.bc_telno3.value = BillPhone3;
		
		form.bc_mobileno1.value = BillMPhone1;
		form.bc_mobileno2.value = BillMPhone2;
		form.bc_mobileno3.value = BillMPhone3;
		
		form.bc_faxno1.value = BillFax1;
		form.bc_faxno2.value = BillFax2;
		form.bc_faxno3.value = BillFax3;
		
		form.bc_fname.readOnly = false;
		form.bc_lname.readOnly = false;
		form.bc_mname.readOnly = false;
		form.bc_email.readOnly = false;
		form.bc_pos.readOnly = false;
		
		form.bc_telno1.readOnly = false;
		form.bc_telno2.readOnly = false;
		form.bc_telno3.readOnly = false;
		
		form.bc_mobileno1.readOnly = false;
		form.bc_mobileno2.readOnly = false;
		form.bc_mobileno3.readOnly = false;
		
		form.bc_faxno1.readOnly = false;
		form.bc_faxno2.readOnly = false;
		form.bc_faxno3.readOnly = false;			
	}	
	
	if (form.copyadtech.checked) {
		InitSaveVariablesT(form);
		form.tc_fname.value = form.ac_fname.value;
		form.tc_lname.value = form.ac_lname.value;
		form.tc_mname.value = form.ac_mname.value;
		form.tc_email.value = form.ac_email.value;
		form.tc_pos.value = form.ac_pos.value;
		
		form.tc_telno1.value = form.ac_telno1.value;
		form.tc_telno2.value = form.ac_telno2.value;
		form.tc_telno3.value = form.ac_telno3.value;
		
		form.tc_mobileno1.value = form.ac_mobileno1.value;
		form.tc_mobileno2.value = form.ac_mobileno2.value;
		form.tc_mobileno3.value = form.ac_mobileno3.value;
		
		form.tc_faxno1.value = form.ac_faxno1.value;
		form.tc_faxno2.value = form.ac_faxno2.value;
		form.tc_faxno3.value = form.ac_faxno3.value;
		
		form.tc_fname.readOnly = true;
		form.tc_lname.readOnly = true;
		form.tc_mname.readOnly = true;
		form.tc_email.readOnly = true;
		form.tc_pos.readOnly = true;
		
		form.tc_telno1.readOnly = true;
		form.tc_telno2.readOnly = true;
		form.tc_telno3.readOnly = true;
		
		form.tc_mobileno1.readOnly = true;
		form.tc_mobileno2.readOnly = true;
		form.tc_mobileno3.readOnly = true;
		
		form.tc_faxno1.readOnly = true;
		form.tc_faxno2.readOnly = true;
		form.tc_faxno3.readOnly = true;		

	} else {
		form.tc_fname.value = TechFName;
		form.tc_lname.value = TechLName;
		form.tc_mname.value = TechMName;
		form.tc_email.value = TechEmail;
		form.tc_pos.value = TechPos;
		
		form.tc_telno1.value = TechPhone1;
		form.tc_telno2.value = TechPhone2;
		form.tc_telno3.value = TechPhone3;
		
		form.tc_mobileno1.value = TechMPhone1;
		form.tc_mobileno2.value = TechMPhone2;
		form.tc_mobileno3.value = TechMPhone3;
		
		form.tc_faxno1.value = TechFax1;
		form.tc_faxno2.value = TechFax2;
		form.tc_faxno3.value = TechFax3;		
		
		form.tc_fname.readOnly = false;
		form.tc_lname.readOnly = false;
		form.tc_mname.readOnly = false;
		form.tc_email.readOnly = false;
		form.tc_pos.readOnly = false;
		
		form.tc_telno1.readOnly = false;
		form.tc_telno2.readOnly = false;
		form.tc_telno3.readOnly = false;
		
		form.tc_mobileno1.readOnly = false;
		form.tc_mobileno2.readOnly = false;
		form.tc_mobileno3.readOnly = false;
		
		form.tc_faxno1.readOnly = false;
		form.tc_faxno2.readOnly = false;
		form.tc_faxno3.readOnly = false;			
	}	*/	
	
	//return false;
}

function PopUp(){
    var ScreenWidth=window.screen.width;
    var ScreenHeight=window.screen.height;
    var movefromedge=0;
    placementx=movefromedge;
    placementy=movefromedge;
    var PopUpUrl="index.php?page=toa.php"
    WinPop=window.open(PopUpUrl,"","width=1026,height=768,toolbar=1,location=1,directories=1,status=1,scrollbars=1,menubar=1,resizable=01,left="+placementx+",top="+placementy+",screenX="+placementx+",screenY="+placementy+",");
}

//add more invite emial input boxes
function add_email(){

	var myTbody=document.getElementById('addinvtemail');
			
	if(document.all && navigator.userAgent.indexOf("Opera") == -1 ) {
		newRow=myTbody.firstChild.cloneNode(true);
	} else {

		//clone last row
		for(var i=0; i<myTbody.childNodes.length; i++) {
			if(myTbody.childNodes[i].tagName == "TR")
				newRow=myTbody.childNodes[i].cloneNode(true);

		}
	}	
		
	var newInpt = newRow.getElementsByTagName('input');		
	
	//email input box
	var newEmailValue = newInpt[0].value.substring(0,newInpt[0].value = "");
	newInpt[0].setAttribute('value', newEmailValue);	

	myTbody.appendChild(newRow);		
}

//delete email input box
function delete_email_row(button) {
	//get parent
	//input         td                 tr
	var tr = button.parentNode.parentNode;
	var myTbody=document.getElementById('addinvtemail');
	if(document.all && navigator.userAgent.indexOf("Opera") == -1 ) {
		if(myTbody.childNodes.length <= 1) {
			alert("This row cannot be deleted.");
			return false;
		}
	} else {
		result = 0;
		for(var i=0; i<myTbody.childNodes.length; i++) {
					
			if(myTbody.childNodes[i].tagName == "TR")
				result ++;
			}
			
			if(result <= 1) {
				alert("This row cannot be deleted.");
				return false;
			}
		}
	
	myTbody.removeChild(tr);  
	
}

function textCounter(field, countfield, maxlimit) {
	if (field.value.length > maxlimit){ // if too long...trim it!
		field.value = field.value.substring(0, maxlimit);
		// otherwise, update 'characters left' counter
	}else{ 
		countfield.value = maxlimit - field.value.length;
	}
}

function bookmarksite(title, url){
	if (document.all)
		window.external.AddFavorite(url, title);
	else if (window.sidebar)
		window.sidebar.addPanel(title, url, "")
}