<!--

function isEmpty(str) {
  if(str.length == 0)
  	return true;
  for(var intLoop=0; intLoop<str.length; intLoop++)
    if(" " != str.charAt(intLoop))
	  return false;
  return true;
}
function isProper(s)
{
  s = removeAllBlanks(s);
  var c = s.charAt(0);
  if(!(c>='A' && c<='Z')) return false;
  for(var i=1; i<s.length; i++) {
    c = s.charAt(i);
    if(!(c>='a' && c<='z'))
      return false;
  }
  return true;
}

function removeAllBlanks(s) {
  var i = 0;
  var r = "";
  for(i=0; i<s.length; i++)
    if(s.charAt(i) != ' ')
	  r += s.charAt(i);

  return(r);
}

function EMail(o) {
  o.className = "";
  o.value = removeAllBlanks(o.value);
  return (o.value != "") && (o.value.indexOf('@') > 0) && (o.value.indexOf('.') > 0);
}

function OnSubmit(f)
{
  // check e-mail
  var result = true;
  result = EMail(document.forms[0].elements["EmailAddress"]);
  if(!result) {
    alert("E-mail is empty or has wrong format.");
	document.forms[0].elements["EmailAddress"].focus();
	event.returnValue = false;
  	return event.returnValue;
  }

  // check obligatory fields
  for(var i = 0; i < document.forms[0].elements.length; i++) {
	if(document.forms[0].elements[i].className=="nef")
	  if(isEmpty(document.forms[0].elements[i].value)) {
		document.forms[0].elements[i].value = "";
		alert("You must answer all REQUIRED questions!");
		document.forms[0].elements[i].focus();
	    event.returnValue = false;
		return event.returnValue;
	  }
  }

  // check comboboxes
  result = (document.all.ClientIsMale.value != "-") &&
						(document.all.MaritalStatus.value != "-") &&
	 	 			    (document.all.USCitizen.value != "-") &&
		 			    (document.all.State.value != "-") &&
						(document.all.FianceeCountryOfCitizenship.value != "-") &&
		 			    (document.all.FianceeCountryResidence.value != "-") &&
		 			    (document.all.MetYet.value != "-") &&
    					(document.all.MetYet.value=="No" || document.all.LastMeetingCountry.value!="-") &&
    					(document.all.MetYet.value=="No" || !isEmpty(document.all.LastMeetingDate.value)) &&
    					(document.all.MetYet.value=="No" || document.all.Timetogether.value!="-") &&
						(document.all.MetYet.value=="Yes" || document.all.FutureMeetingCountry.value!="-") &&
						(document.all.MetYet.value=="Yes" || !isEmpty(document.all.FutureMeetingCity.value));
  if(!result) {
    alert("You should provide specific answers to all REQUIRED questions!");
	if(document.all.ClientIsMale.value == "-")
	    document.all.ClientIsMale.focus();
	else
		if(document.all.MaritalStatus.value == "-")
			document.all.MaritalStatus.focus();
	    else
		  	if(document.all.USCitizen.value == "-")
		    	document.all.MaritalStatus.focus();
        	else
                if(document.all.State.value == "-")
                	document.all.State.focus();
                else
                	if(document.all.FianceeCountryOfCitizenship.value == "-")
                    	document.all.FianceeCountryOfCitizenship.focus();
                	else
                        if(document.all.FianceeCountryResidence.value == "-")
                        	document.all.FianceeCountryResidence.focus();
                        else
                        	if(document.all.MetYet.value == "-")
                            	document.all.MetYet.focus();
                          	else
                                if(!(document.all.MetYet.value=='No' || !isEmpty(document.all.LastMeetingCountry.value)))
                                	document.all.LastMeetingCountry.focus();
                                else
                                  	if(!(document.all.MetYet.value=='No' || document.all.LastMeetingDate.value!=""))
                                    	document.all.LastMeetingDate.focus();
                                  	else
                                        if(!(document.all.MetYet.value=='No' || document.all.Timetogether.value!="-"))
                                        	document.all.Timetogether.focus();
                                        else
                                        	if(!(document.all.MetYet.value=='Yes' || document.all.FutureMeetingCountry.value!="-"))
                                            	document.all.FutureMeetingCountry.focus();
                                          	else
                                                if(!(document.all.MetYet.value=="Yes" || document.all.TravelArrangements.value!="-"))
                                                	document.all.TravelArrangements.focus();
                                                else
                                                  	document.all.FutureMeetingCity.focus();
    event.returnValue = false;
    return event.returnValue;
  }

  // check proper fields
/*
  result = isProper(document.all.FirstName.value) &&
  		   isProper(document.all.LastName.value) &&
  		   (isEmpty(document.all.StreetAddress.value) || isProper(document.all.StreetAddress.value)) &&
           (isEmpty(document.all.City.value) || isProper(document.all.City.value));
  if(!result) {
    alert('Write text in upper and lower case (e.g., "John Smith", rather than "john smith")');
    if(!isProper(document.all.FirstName.value))
	  document.all.FirstName.focus();
	else
      if(!isProper(document.all.LastName.value))
	    document.all.LastName.focus();
	  else
		if(!(isEmpty(document.all.StreetAddress.value) || isProper(document.all.StreetAddress.value)))
		  document.all.StreetAddress.focus();
		else
	      document.all.City.focus();
    event.returnValue = false;
    return event.returnValue;
  }
*/
  event.returnValue = true;
  return event.returnValue;
}

function GetSMonthYear() {
  var months = new Array("January", "February", "March", "April", "May", "June",
  					     "July", "August", "September", "October", "November", "December");
  var r = "";
  chronos = new Date();
  var y = chronos.getYear();
  var m = chronos.getMonth();
  for(var i=0; i<12; i++) {
    if(m > 11) {
      y = y + 1;
	  m = m - 12;
    }
    r += '<option value="' + months[m]+" "+y + '">' +  months[m]+" "+y + '</option>';
	m++;
  }
  return r;
}

// list of all contries
function ListOfContries() {

  var countries = new Array(
	"Afganistan","Albania","Algeria","American Samoa","Andorra","Angola","Anguilla","Antarctica","Antigua & Barbuda","Argentina","Armenia","Aruba","Australia","Austria","Azerbaijan",
	"Bahamas","Bahrain","Bangladesh","Barbados","Belarus","Belgium","Belize","Benin","Bermuda","Bhutan","Bolivia","Bosnia and Herzegovina","Botswana","Bouvet Island","Brazil","British Indian Territory","British Virgin Islands","Brunei Darussulam","Bulgaria","Burkina Faso","Burundi",
	"Cambodia","Cameroon","Canada","Cape Verde","Central African Republic","Chad","Chile","China","Christmas Island","Cocos Islands","Colombia","Comoros","Congo","Cook Islands","Costa Rica","Cote D'Ivoire","Croatia","Cuba","Cyprus","Czech Republic",
	"Denmark","Djibouti","Dominica","Dominican Republic",
	"Ecuador","Egypt","El Salvador","Equatorial Guinea","Eritrea","Estonia","Ethiopia",
	"Falkland Islands (Malvinas)","Faroe Islands","Fiji","Finland","France","French Guiana","French Polynesia","French Southern Territories",
	"Gabon","Gambia","Georgia (ex-Soviet)","Germany","Ghana","Gibraltar","Greece","Greenland","Grenada","Guadalupe","Guam","Guatemala","Guerney","Guinea-Bissau","Equatorial Guinea","Guyana",
	"Haiti","Heard Island and Mcdonald Islands","Honduras","Hong Kong","Hungary",
	"Iceland","India","Indonesia","Iran","Iraq","Ireland","Israel","Ivory Coast","Italy",
	"Jamaica","Japan","Jersey","Jordan",
	"Kazakhstan","Kenya","Kiribati","Korea (North)","Korea (South)","Kuwait","Kyrgyzstan",
	"Lao People's Democratic Republic","Latvia","Lebanon","Lesotho","Liberia","Libya","Liechtenstein","Lithuania","Luxembourg",
	"Macao","Macedonia","Madagascar","Malawi","Malaysia","Maldives","Mali","Malta","Marshall Islands","Martinique","Mauritania","Mauritius","Mayotte","Mexico","Micronesia","Moldova","Monaco","Mongolia","Monserrat","Morocco","Mozambique","Myanmar",
	"Namibia","Nauru","Nepal","Netherlands","Netherlands Antilles","New Caledonia","New Zealand","Nicaragua","Niger","Nigeria","Niue","Norfolk Island","Northern Mariana Islands","Norway",
	"Oman",
	"Pakistan","Palau","Palestinian Territory","Panama","Papua New Guinea","Paraguay","Peru","Philippines","Pitcairn","Poland","Portugal","Puerto Rico",
	"Qatar",
	"Reunion","Romania","Russia (Russian Federation)","Rwanda",
	"Sahara","Saint Helena","Saint Kitts-Nevis","Saint Lucia","Saint Pierre and Miquelon","Saint Vincente & the Granadinas","Samoa","San Marino","Sao Tome & Principe","Saudi Arabia","Senegal","Serbia and Montenegro","Seychelles","Sierra Leone","Singapore","Slovakia","Slovenia","Solomon Islands","Somalia","South Africa","Spain","Sri Lanka","Sudan","Surinam","Swaziland","Sweden","Switzerland","Syria",
	"Taiwan","Tajikistan","Tanzania","Thailand","Timor-Lest (West Timor)","Togo","Tokelau","Tonga","Trinidad & Tobago","Tunisia","Turkey","Turkmenistan","Turks and Caicos Islands","Tuvalu",
	"Uganda","Ukraine","United Arab Emirates","United Kingdom","United States","Uruguay","Uzbekistan",
	"Vanuatu","Vatican City State (Holy See)","Venezuela","Vietnam",
	"Wallis and Futuna","Western Sahara",
	"Yemen",
	"Zambia","Zimbabwe"
	);

  var r = "";
  for(var i=0; i<countries.length; i++)
    r += '<option value="' + countries[i] + '">' + countries[i] + '</option>';
  return r;
}

function ListNumbers(iFrom, iTo) {
  var r = "";
  for(var i=iFrom; i<=iTo; i++)
    r += '<option value="' +i+ '">' +i+ '</option>';
  return r;
}

function cMetYet(o) {
//  if(o.value == "Yes")
//	;
//    document.all.fmc.innerText = '';
//  else {
//	document.all.Timetogether.readOnly = true;
//	document.all.Timetogether.hidden = true;
//  }
}


var popupURL = "popup.cfm";

function openWin () {

  popup =
window.open(popupURL,"Version",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,width=240,height=240');

}



function _CF_onError(form_object, input_object, object_value, error_message)
    {
	alert(error_message);
       	return false;
    }



function _CF_hasValue(obj, obj_type)
    {
    if (obj_type == "TEXT" || obj_type == "PASSWORD")
	{
    	if (obj == null || obj.value.length == 0)
      		return false;
    	else
      		return true;
    	}
    else if (obj_type == "SELECT")
	{
        for (i=0; i < obj.length; i++)
	    	{
		if (obj.options[i].selected)
			return true;
		}

       	return false;
	}
    else if (obj_type == "SINGLE_VALUE_RADIO" || obj_type == "SINGLE_VALUE_CHECKBOX")
	{

		if (obj.checked)
			return true;
		else
       		return false;
	}
    else if (obj_type == "RADIO" || obj_type == "CHECKBOX")
	{

        for (i=0; i < obj.length; i++)
	    	{
		if (obj[i].checked)
			return true;
		}

       	return false;
	}
	}


function  _CF_checkCFForm_1(_CF_this)
{
    if  (!_CF_hasValue(_CF_this.Name, "TEXT" ))
        {
        if  (!_CF_onError(_CF_this, _CF_this.Name, _CF_this.Name.value, "Name is required please"))
        {
            return false;
        }
    }
    if(!_CF_hasValue(_CF_this.Email, "TEXT" ))
    {
        if  (!_CF_onError(_CF_this, _CF_this.Email, _CF_this.Email.value, "E-mail is required please"))
        {
            return false;
        }
    }
    if  (!_CF_hasValue(_CF_this.State, "TEXT" ))
    {
        if  (!_CF_onError(_CF_this, _CF_this.State, _CF_this.State.value, "State is required please"))
        {
            return false;
        }
    }
    if  (!_CF_hasValue(_CF_this.ZipCode, "TEXT" ))
    {
        if  (!_CF_onError(_CF_this, _CF_this.ZipCode, _CF_this.ZipCode.value, "Zip Code is required please"))
        {
            return false;
        }
    }
    if  (!_CF_hasValue(_CF_this.Country, "TEXT" ))
    {
        if  (!_CF_onError(_CF_this, _CF_this.Country, _CF_this.Country.value, "Country is required please"))
        {
            return false;
        }
    }
    if  (!_CF_hasValue(_CF_this.SearchEngine, "TEXT" ))
    {
        if  (!_CF_onError(_CF_this, _CF_this.SearchEngine, _CF_this.SearchEngine.value, "Search Engine is required please"))
        {
            return false;
        }
    }
    return true;
}

//-->
