function validate_signup(form)
{

/*Company Information*/
    if (!(form.company_name.value.length>0)) {
    alert("Please enter Company Name");
    form.company_name.focus();
    return false;
    }
    if (!(form.register_num_loc.value.length>0)) {
    alert("Please enter Commercial Register no/ acknowledgment and location");
    form.register_num_loc.focus();
    return false;
    }
    if (!(form.register_date_place.value.length>0)) {
    alert("Please enter Date & Place of Commercial Registration / acknowledgment");
    form.register_date_place.focus();
    return false;
    }

/*Company Full Address*/
    if (!(form.company_country.value.length>0)) {
    alert("Please enter Company Country");
    form.company_country.focus();
    return false;
    }
    if (!(form.company_city.value.length>0)) {
    alert("Please enter Company City");
    form.company_city.focus();
    return false;
    }
    if (!(form.company_address.value.length>0)) {
    alert("Please enter Company Full Address");
    form.company_address.focus();
    return false;
    }
    if (!(form.company_email.value.length>0)) {
    alert("Please enter Company Email");
    form.company_email.focus();
    return false;
    }
    if (!(form.company_tel.value.length>0)) {
    alert("Please enter Company Telephone");
    form.company_tel.focus();
    return false;
    }

/*Company Activities*/
    if (!(form.company_activity.value.length>0)) {
    alert("Please enter Company Main Activities");
    form.company_activity.focus();
    return false;
    }
    
/*Bank Reference*/
    if (!(form.company_bank_name.value.length>0)) {
    alert("Please enter Local Bank Names You Deal With/Branch");
    form.company_bank_name.focus();
    return false;
    }

/*General Manager*/
    if (!(form.gm_first_name.value.length>0)) {
    alert("Please enter General Manager First Name");
    form.gm_first_name.focus();
    return false;
    }
    if (!(form.gm_family_name.value.length>0)) {
    alert("Please enter General Manager Family Name");
    form.gm_family_name.focus();
    return false;
    }
    if (!(form.gm_nationality.value.length>0)) {
    alert("Please enter General Manager Nationality");
    form.gm_nationality.focus();
    return false;
    }
    if (!(form.gm_email.value.length>0)) {
    alert("Please enter General Manager Email");
    form.gm_email.focus();
    return false;
    }
    if (!(form.gm_father_name.value.length>0)) {
    alert("Please enter General Manager Father's Name");
    form.gm_father_name.focus();
    return false;
    }
    if (!(form.gm_mother_name.value.length>0)) {
    alert("Please enter General Manager Mother's Name");
    form.gm_mother_name.focus();
    return false;
    }
    if (!(form.gm_phone.value.length>0)) {
    alert("Please enter General Manager Mobile or Telephone");
    form.gm_phone.focus();
    return false;
    }

/*Company Representative for Operations & Activity Notifications*/
    if (!(form.monitoring_contact_firstname.value.length>0)) {
    alert("Please enter the First Name of the Company Representative for Operations and Online Activity");
    form.monitoring_contact_firstname.focus();
    return false;
    }
    if (!(form.monitoring_contact_lastname.value.length>0)) {
    alert("Please enter the Last Name of the Company Representative for Operations and Online Activity");
    form.monitoring_contact_lastname.focus();
    return false;
    }
    if (!(form.monitoring_contact_email.value.length>0)) {
    alert("Please enter the Email of the Company Representative for Operations and Online Activity");
    form.monitoring_contact_email.focus();
    return false;
    }
    if (!(form.monitoring_contact_tel.value.length>0)) {
    alert("Please enter the Mobile or Telephone of the Company Representative for Operations and Online Activity");
    form.monitoring_contact_tel.focus();
    return false;
    }

/*Company Representative for Technical Notifications*/
    if (!(form.technical_contact_firstname.value.length>0)) {
    alert("Please enter the First Name of the Company Representative for Technical Notifications");
    form.technical_contact_firstname.focus();
    return false;
    }
    if (!(form.technical_contact_lastname.value.length>0)) {
    alert("Please enter the Last Name of the Company Representative for Technical Notifications");
    form.technical_contact_lastname.focus();
    return false;
    }
    if (!(form.technical_contact_email.value.length>0)) {
    alert("Please enter the Email of the Company Representative for Technical Notifications");
    form.technical_contact_email.focus();
    return false;
    }
    if (!(form.technical_contact_tel.value.length>0)) {
    alert("Please enter the Mobile or Telephone of the Company Representative for Technical Notifications");
    form.technical_contact_tel.focus();
    return false;
    }

/*Company Representative for Financial Notifications*/
    if (!(form.financial_contact_firstname.value.length>0)) {
    alert("Please enter the First Name of the Company Representative for Financial Notifications");
    form.financial_contact_firstname.focus();
    return false;
    }
    if (!(form.financial_contact_lastname.value.length>0)) {
    alert("Please enter the Last Name of the Company Representative for Financial Notifications");
    form.financial_contact_lastname.focus();
    return false;
    }
    if (!(form.financial_contact_email.value.length>0)) {
    alert("Please enter the Email of the Company Representative for Financial Notifications");
    form.financial_contact_email.focus();
    return false;
    }
    if (!(form.financial_contact_tel.value.length>0)) {
    alert("Please enter the Mobile or Telephone of the Company Representative for Financial Notifications");
    form.financial_contact_tel.focus();
    return false;
    }

/*Website and E-Commerce*/
    if (!(form.merchant_website_address.value.length>0)) {
    alert("Please enter the Merchant Website Address");
    form.merchant_website_address.focus();
    return false;
    }
    if (!(form.merchant_website_descriptor.value.length>0)) {
    alert("Please enter the Commercial Name(to be shown on cardholder bank statement)");
    form.merchant_website_descriptor.focus();
    return false;
    }
    if (!(form.merchant_webdesign_company.value.length>0)) {
    alert("Please enter the Web Design Company Name");
    form.merchant_webdesign_company.focus();
    return false;
    }

/*Products and Services Sold on Your Website*/
    if (!(form.products_description.value.length>0)) {
    alert("Please enter the Description of Products and Services Sold at Your Website");
    form.products_description.focus();
    return false;
    }
    if (!(form.products_country_origin.value.length>0)) {
    alert("Please enter the Country(s) of Origin for Products and Services Sold at Your Website");
    form.products_country_origin.focus();
    return false;
    }
    if ( !form.products_sold_location[0].checked && !form.products_sold_location[1].checked && !form.products_sold_location[2].checked ) {
    alert("Please select the Location where Products and Services at your website are sold to (In Country, World Wide, Other...)");
    return false;
    }
    if ( !form.delivery_method[0].checked && !form.delivery_method[1].checked && !form.delivery_method[2].checked && !form.delivery_method[3].checked ) {
    alert("Please select the Delivery Method of the Products and Services sold at your website (Online, Mail,Courier, Other...)");
    return false;
    }
    if (!(form.minimum_transaction_amount.value.length>0)) {
    alert("Please enter the Minimum Amount Expected Per-Transaction (USD)");
    form.minimum_transaction_amount.focus();
    return false;
    }
    if (!(form.maximum_transaction_amount.value.length>0)) {
    alert("Please enter the Maximun Amount Expected Per-Transaction (USD)");
    form.maximum_transaction_amount.focus();
    return false;
    }
    if (!(form.highest_montly_volume.value.length>0)) {
    alert("Please enter the Highest Monthly Volume Expected (USD)");
    form.highest_montly_volume.focus();
    return false;
    }

/*NetCommerce Product You Are Applying For*/
    if (!form.apply_for_ipay.checked && !form.apply_for_ipos.checked && !form.apply_for_ebill.checked){
    alert("Please select at least one of NetCommerce Products your are applying for.");
    return false;
    }
    
/*Payment Method*/
    if (form.bank_account_name[form.bank_account_name.selectedIndex].value == "Company account not selected") {
    alert("Please select the Payment Method");
    form.bank_account_name.focus();
    return false;
    }
    if (!(form.settlement_currency.value.length>0)) {
    alert("Please enter the currency to be used (USD and/or LBP)");
    form.settlement_currency.focus();
    return false;
    }
    if (!form.i_agree.checked) {
    alert("Please Agree to the Correctness of the information entered and for the authorization of NetCommerce to verify them");
    form.i_agree.focus();
    return false;
    }

return true;
}

function check_empty(ctrl, form)
{
	obj = eval("document." + form + "." + ctrl)
	if (!obj)
	{
		alert (ctrl + " not an object!")
		return 0
	}
	if (obj.value.length == 0)
	{
		alert ("Please fill the required fields!")
		obj.focus();
		return 1
	}
	return 0
}

function check_float(ctrl, form)
{
	err = check_empty(ctrl, form); if (err == 1) return 1;
	
	allowed = "0123456789."
	obj = eval("document." + form + "." + ctrl)
	
	for (counter = 0; counter < obj.value.length; counter++)
	{
		my_char = obj.value.charAt(counter)
		if (allowed.indexOf(my_char) == -1)
		{
			alert("Invalid format. Only numbers are allowed");
			obj.select();
			return 1
		}
	}
	return 0
	}
function popup(id,wdht,hght)  {

   iwin = window.open("popupimage.asp?id="+id,"",

   "status=no,toolbar=no,location=no,menu=no,width="+wdht+",height="+hght);

}   

function open_file(f)
{  
	pwin = window.open(f, "PWIN", "top=0,left=0,width=650,height=570,scrollbars=yes");
}


function check_list(ctrl, form)
{
	obj = eval("document." + form + "." + ctrl)
	if (!obj)
	{
		alert (ctrl + " not an object!")
		return 0
	}
	my_index = obj.selectedIndex;
	//my_value = obj.options[my_index].value
	//if (my_value == "")
	if (my_index == 0)
	{
		alert ("Please fill the required fields!")
		obj.focus();
		return 1
	}
	return 0
}
function validEmail(field, form)
{
	url = document[form][field].value;
	a = url.lastIndexOf("@");
	b = url.lastIndexOf(".");
	c = url.indexOf(":");
	d = url.indexOf("/");
	e = url.substring(0,a);
	f = e.indexOf("@");
	g = url.substring(a+1,url.length);
	h = g.indexOf("[");
	i = g.indexOf("]");
	j = g.indexOf("<");
	k = g.indexOf(">");
	l = url.substring(a+1,b);
	m = url.substring(b+1,url.length);
	n = url.substring(0,a);
	o = 0;
	
		if (a > b) {o++};
		 if (c != -1) {o++};
		  if (d != -1) {o++};
			 if (f != -1) {o++};
			  if (h != -1) {o++};
				 if (i != -1) {o++};
				  if (j != -1) {o++};
					 if (k != -1) {o++};
					  if (l.length < 3) {o++};
						 if (m.length < 2) {o++};
						  if (n.length < 1) {o++};
							 if (o != 0) 
							 {
							 	alert("Invalid email address!");
								document[form][field].select();
								return 1
							 }
	return 0
}
function check_email(ctrl, form) {
	obj = eval("document." + form + "." + ctrl)
	if (!obj)
	{
		alert (ctrl + " not an object!")
		return 0
	}
	
	// Return false if the E-Mail field is blank.
	err = check_empty(ctrl, form); if (err == 1) return 1;
   
	 // Return false if e-mail field does not contain a '@' and '.' .
   if (obj.value.indexOf ('@',0) == -1 || 
       obj.value.indexOf ('.',0) == -1)
      {
      alert("email is not valid.");
			obj.focus();
      return 1
      }
  return 0
}

function check_area(ctrl, form)
{
	obj = eval("document." + form + "." + ctrl)
	if (!obj)
	{
		alert (ctrl + " not an object!")
		return 0
	}
	if (obj.value.length == 0)
	{
		alert ("Veuillez remplir les champs obligatoires!")
		obj.focus();
		return 1
	}
	if (obj.value.length > 10000)
	{
		alert ("Field size is too large! Please limit your text to 10000 letters.")
		obj.focus();
		return 1
	}
	return 0
}
function check_password(ctrl, form, field, len)
{
	obj = eval("document." + form + "." + ctrl)
	if (!obj)
	{
		alert (ctrl + " n'est pas un objet!")
		return 0
	}
	if (obj.value.length == 0)
	{
		alert ("Veuillez remplir les champs obligatoires!")
		obj.focus();
		return 1
	}
	if (obj.value.length < len)
	{
		alert (field + " should be at least " + len + " characters!")
		obj.focus();
		return 1
	}
	return 0
}
function check_confpass(ctrl1, ctrl2, form)
{
	obj1 = eval("document." + form + "." + ctrl1)
	obj2 = eval("document." + form + "." + ctrl2)
	
	if (obj2.value.length == 0)
	{
		alert ("Please fill the required fields!")
		obj2.focus();
		return 1
	}
	if (obj1.value != obj2.value)
	{
		alert ("Password not confirmed correctly.");
		obj1.value = "";
		obj2.value = "";
		obj1.focus();
		return 1
	}
	return 0
}
function check_del(temp) {
	if (confirm ("Are you sure you want to delete this " + temp + "?"))
		return true;
	return false;
}

function confirm_msg(temp) {
	if (confirm (temp))
		return true;
	return false;
}
function popupBanner(pic) {
	window.open("viewpic.asp?photo=" + pic,"Banner","width=600,height=200,top=50,left=100,scrollbars=1");
	return true;
}