
 
function checkothervalue(the_form,selectname)
{

if (document.forms[the_form].elements[selectname]!=null)
{
var perlen=document.forms[the_form].elements[selectname].length;
var perval=document.forms[the_form].elements[selectname].selectedIndex;
var tper="d"+selectname;

if (document.all[tper]!=null)
{

if (perval==perlen-1)
document.all[tper].style.visibility="visible";
else document.all[tper].style.visibility="hidden";
}

}

} 
 
function setCheckboxes(the_form, do_check)
{
    var elts      = document.forms[the_form].elements;
    var elts_cnt  = elts.length;
	
    for (var i = 0; i < elts_cnt; i++) {
        elts[i].checked = do_check;
    } // end for

    return true;
} // end of the 'setCheckboxes()' function


var win = "width=400,height=500,left=100,top=100,copyhistory=no,directories=no,menubar=no,location=no,resizable=no,scrollbars=yes";
function get_gallery(id_prof)
{
   window.open("photos_gallery.php?ID="+id_prof,'html',win);
}


function launchIM ()
{
	var win = "width=600,height=450,left=100,top=100,copyhistory=no,directories=no,menubar=no,location=no,resizable=no,scrollbars=no";
	window.open("imchat/",'html',win);
	return false;
}

function launchTellFriend ()
{
    var win = "width=300,height=300,left=100,top=100,copyhistory=no,directories=no,menubar=no,location=no,resizable=no,scrollbars=yes";
    window.open("tellfriend.php",'html',win);
    return false;
}

function launchTellFriendProfile ( sID )
{
    var win = "width=300,height=300,left=100,top=100,copyhistory=no,directories=no,menubar=no,location=no,resizable=no,scrollbars=yes";
    window.open("tellfriend.php?ID="+sID,'html',win);
    return false;
}

function ShowShowHide ( show_name, show_name2, hide_name )
{
    if (hide_name) hide_name.style.display = 'none';
    if (show_name) show_name.style.display = 'inline';
    if (show_name2) show_name2.style.display = 'inline';
}

function ShowHideHide ( show_name, hide_name, hide_name2 )
{
    if (hide_name) hide_name.style.display = 'none';
    if (hide_name2) hide_name2.style.display = 'none';
    if (show_name) show_name.style.display = 'inline';
}



function setcountries(theform)
{

var cmas = new Array(200);

cmas[0] = "Afghanistan";
cmas[1] = "Albania";
cmas[2] = "Algeria";
cmas[3] = "Andorra";
cmas[4] = "Angola";
cmas[5] = "Argentina";
cmas[6] = "Armenia";
cmas[7] = "Australia";
cmas[8] = "Austria";
cmas[9] = "Azerbaydjan";
cmas[10] = "Bahamas";
cmas[11] = "Bahrain";
cmas[12] = "Bangladesh";
cmas[13] = "Barbados";
cmas[14] = "Belarus";
cmas[15] = "Belgium";
cmas[16] = "Belize";
cmas[17] = "Benin";
cmas[18] = "Bermuda";
cmas[19] = "Bhutan";
cmas[20] = "Bolivia";
cmas[21] = "Bosnia";
cmas[22] = "Botswana";
cmas[23] = "Brazil";
cmas[24] = "Brunei";
cmas[25] = "Bulgaria";
cmas[26] = "Burkina Faso";
cmas[27] = "Burma";
cmas[28] = "Burundi";
cmas[29] = "Cambodia";
cmas[30] = "Cameroon";
cmas[31] = "Canada";
cmas[32] = "Cape Verde";
cmas[33] = "Chad";
cmas[34] = "Chile";
cmas[35] = "China";
cmas[36] = "Colombia";
cmas[37] = "Comoros";
cmas[38] = "Congo";
cmas[39] = "Congo (Zaire)";
cmas[40] = "Costa Rica";
cmas[41] = "Croatia";
cmas[42] = "Cuba";
cmas[43] = "Cyprus";
cmas[44] = "Czech Republic";
cmas[45] = "Denmark";
cmas[46] = "Djibouti";
cmas[47] = "Dominica";
cmas[48] = "Ecuador";
cmas[49] = "Egypt";
cmas[50] = "El Salvador";
cmas[51] = "Eritrea";
cmas[52] = "Estonia";
cmas[53] = "Ethiopia";
cmas[54] = "Fiji";
cmas[55] = "Finland";
cmas[56] = "France";
cmas[57] = "Gabon";
cmas[58] = "Gambia";
cmas[59] = "Germany";
cmas[60] = "Ghana";
cmas[61] = "Gibraltar";
cmas[62] = "Greece";
cmas[63] = "Grenada";
cmas[64] = "Guam";
cmas[65] = "Guatemala";
cmas[66] = "Guinea";
cmas[67] = "Guinea-Bissau";
cmas[68] = "Guyana";
cmas[69] = "Haiti";
cmas[70] = "Honduras";
cmas[71] = "Hong Kong";
cmas[72] = "Hungary";
cmas[73] = "Iceland";
cmas[74] = "India";
cmas[75] = "Indonesia";
cmas[76] = "Iran";
cmas[77] = "Iraq";
cmas[78] = "Ireland";
cmas[79] = "Israel";
cmas[80] = "Italy";
cmas[81] = "Ivory Coast";
cmas[82] = "Jamaica";
cmas[83] = "Japan";
cmas[84] = "Jordan";
cmas[85] = "Kazakhstan";
cmas[86] = "Kenya";
cmas[87] = "Kuwait";
cmas[88] = "Laos";
cmas[89] = "Latvia";
cmas[90] = "Lebanon";
cmas[91] = "Liberia";
cmas[92] = "Libya";
cmas[93] = "Liechtenstein";
cmas[94] = "Lithuania";
cmas[95] = "Luxembourg";
cmas[96] = "Macau";
cmas[97] = "Macedonia";
cmas[98] = "Madagascar";
cmas[99] = "Malawi";
cmas[100] = "Malaysia";
cmas[101] = "Maldives";
cmas[102] = "Mali";
cmas[103] = "Malta";
cmas[104] = "Mauritania";
cmas[105] = "Mauritius";
cmas[106] = "Mexico";
cmas[107] = "Moldova";
cmas[108] = "Monaco";
cmas[109] = "Mongolia";
cmas[110] = "Morocco";
cmas[111] = "Mozambique";
cmas[112] = "Namibia";
cmas[113] = "Nepal";
cmas[114] = "Netherlands";
cmas[115] = "New Zealand";
cmas[116] = "Nicaragua";
cmas[117] = "Niger";
cmas[118] = "Nigeria";
cmas[119] = "North Korea";
cmas[120] = "Norway";
cmas[121] = "Oman";
cmas[122] = "Pakistan";
cmas[123] = "Palestine";
cmas[124] = "Panama";
cmas[125] = "Paraguay";
cmas[126] = "Peru";
cmas[127] = "Philippines";
cmas[128] = "Poland";
cmas[129] = "Portugal";
cmas[130] = "Qatar";
cmas[131] = "Romania";
cmas[132] = "Russia";
cmas[133] = "Rwanda";
cmas[134] = "San Marino";
cmas[135] = "Saudi Arabia";
cmas[136] = "Senegal";
cmas[137] = "Sierra Leone";
cmas[138] = "Singapore";
cmas[139] = "Slovakia";
cmas[140] = "Slovenia";
cmas[141] = "Somalia";
cmas[142] = "South Africa";
cmas[143] = "South Korea";
cmas[144] = "Spain";
cmas[145] = "Sri Lanka";
cmas[146] = "Sudan";
cmas[147] = "Suriname";
cmas[148] = "Sweden";
cmas[149] = "Switzerland";
cmas[150] = "Syria";
cmas[151] = "Taiwan";
cmas[152] = "Tanzania";
cmas[153] = "Thailand";
cmas[154] = "Tobago";
cmas[155] = "Togo";
cmas[156] = "Trinidad";
cmas[157] = "Tunisia";
cmas[158] = "Turkey";
cmas[159] = "Turkmenistan";
cmas[160] = "Uganda";
cmas[161] = "Ukraine";
cmas[162] = "U.A.E.";
cmas[163] = "United Kingdom";
cmas[164] = "United States";
cmas[165] = "Uruguay";
cmas[166] = "Venezuela";
cmas[167] = "Vietnam";
cmas[168] = "Yemen";
cmas[169] = "Yugoslavia";
cmas[170] = "Zambia";
cmas[171] = "Zimbabwe";

var a =0;

 document.forms[theform].country.options[a] = new Option ("Any", "any");
a=a+1; 
for(var i=0;i<=171;i++) {
  document.forms[theform].country.options[a] = new Option (cmas[i], i);
  a=a+1;
 }

 document.forms[theform].country.selectedIndex=165;

  setStates1(2); 


}


function setStates1(inc){
var array1 = 54;
var states = new Array(array1);
states[0] = "Alabama";
states[1] = "Alaska";
states[2] = "Arizona";
states[3] = "Arkansas";
states[4] = "California";
states[5] = "Colorado";
states[6] = "Connecticut";
states[7] = "D.C.";
states[8] = "Delaware";
states[9] = "Florida";
states[10] = "Georgia";
states[11] = "Guam";
states[12] = "Hawaii";
states[13] = "Idaho";
states[14] = "Illinois";
states[15] = "Indiana";
states[16] = "Iowa";
states[17] = "Kansas";
states[18] = "Kentucky";
states[19] = "Louisiana";
states[20] = "Maine";
states[21] = "Maryland";
states[22] = "Massachusetts";
states[23] = "Michigan";
states[24] = "Minnesota";
states[25] = "Mississippi";
states[26] = "Missouri";
states[27] = "Montana";
states[28] = "Nebraska";
states[29] = "Nevada";
states[30] = "New Hampshire";
states[31] = "New Jersey";
states[32] = "New Mexico";
states[33] = "New York";
states[34] = "North Carolina";
states[35] = "North Dakota";
states[36] = "Ohio";
states[37] = "Oklahoma";
states[38] = "Oregon";
states[39] = "Pennsylvania";
states[40] = "Puerto Rico";
states[41] = "Rhode Island";
states[42] = "South Carolina";
states[43] = "South Dakota";
states[44] = "Tennessee";
states[45] = "Texas";
states[46] = "The Virgin Islands";
states[47] = "Utah";
states[48] = "Vermont";
states[49] = "Virginia";
states[50] = "Washington";
states[51] = "West Virginia";
states[52] = "Wisconsin";
states[53] = "Wyoming";
var a=0;
if (inc==1)
{


 document.form3.Relationship.options[a] = new Option ("Any", "any");
 a=a+1;
 for(var i=0;i<array1;i++) {
  document.form3.Relationship.options[a] = new Option (states[i], states[i]);
  a=a+1;
 }
 
 }
 
 if (inc==2)
{


 document.form2.Relationship.options[a] = new Option ("Any", "any");
 a=a+1;
 for(var i=0;i<array1;i++) {
  document.form2.Relationship.options[a] = new Option (states[i], i);
  a=a+1;
 }
 
 }
 
 
}



function setCounties1(){
var array1 = 94;
var county = new Array(array1);
county[0] = "Aberdeenshire";
county[1] = "Angus";
county[2] = "Anglesey";
county[3] = "Argyllshire";
county[4] = "Avon";
county[5] = "Ayrshire";
county[6] = "Banffshire";
county[7] = "Bedfordshire";
county[8] = "Berkshire";
county[9] = "Berwickshire";
county[10] = "Breconshire";
county[11] = "Buckinghamshire";
county[12] = "Buteshire";
county[13] = "Caernarvonshire";
county[14] = "Caithness";
county[15] = "Cambridgeshire";
county[16] = "Cardiganshire";
county[17] = "Carmarthenshire";
county[18] = "Cheshire";
county[19] = "Clackmannanshire";
county[20] = "Clwyd";
county[21] = "Cornwall";
county[22] = "Cumbria";
county[23] = "Denbighshire";
county[24] = "Derbyshire";
county[25] = "Devon";
county[26] = "Dorset";
county[27] = "Dumfries";
county[28] = "Dunbarton";
county[29] = "Durham";
county[30] = "Dyfed";
county[31] = "East Lothian";
county[32] = "Essex";
county[33] = "Fifeshire";
county[34] = "Flintshire";
county[35] = "Glamorgan";
county[36] = "Gloucestershire";
county[37] = "Greater Manchester";
county[38] = "Gwent";
county[39] = "Gwynedd";
county[40] = "Hampshire";
county[41] = "Hereford & Worcester";
county[42] = "Hertfordshire";
county[43] = "Humberside";
county[44] = "Inverness-shire";
county[45] = "Isle of Wight";
county[46] = "Kent";
county[47] = "Kincardine";
county[48] = "Kinross";
county[49] = "Kirkcudbrightshire";
county[50] = "Lanarkshire";
county[51] = "Lancashire";
county[52] = "Leicestershire";
county[53] = "Lincolnshire";
county[54] = "London";
county[55] = "Merionethshire";
county[56] = "Merseyside";
county[57] = "Midlothian";
county[58] = "Monmouthshire";
county[59] = "Montgomeryshire";
county[60] = "Morayshire";
county[61] = "Nairn";
county[62] = "Norfolk";
county[63] = "North Yorkshire & Teesside";
county[64] = "Northamptonshire";
county[65] = "Northern Ireland";
county[66] = "Northumbria";
county[67] = "Nottinghamshire";
county[68] = "Orkney Islands";
county[69] = "Oxfordshire";
county[70] = "Peeblesshire";
county[71] = "Pembrokeshire";
county[72] = "Perthshire";
county[73] = "Powys";
county[74] = "Radnorshire";
county[75] = "Renfrewshire";
county[76] = "Ross and Cromarty";
county[77] = "Roxburghshire";
county[78] = "Selkirkshire";
county[79] = "Shetland Islands";
county[80] = "Shropshire";
county[81] = "Somerset";
county[82] = "South & West Yorkshire";
county[83] = "Staffordshire";
county[84] = "Stirlingshire";
county[85] = "Suffolk";
county[86] = "Surrey";
county[87] = "Sussex";
county[88] = "Sutherlandshire";
county[89] = "Warwickshire";
county[90] = "West Lothian";
county[91] = "West Midlands";
county[92] = "Wigtownshire";
county[93] = "Wiltshire";
var a=0;
 document.form3.Relationship.options[a] = new Option ("Any", "any");
 a=a+1;
 for(var i=0;i<array1;i++) {
  document.form3.Relationship.options[a] = new Option (county[i], county[i]);
  a=a+1;
 }
}

function checkstate()
{


if (document.form3.Relationship.selectedIndex==4)
document.form3.college.disabled=false;
if (document.form3.Relationship.selectedIndex!=4)
document.form3.college.disabled=true;



}


function checkstatequick()
{


if (document.form2.Relationship.selectedIndex==4)
document.form2.college.disabled=false;
if (document.form2.Relationship.selectedIndex!=4)
document.form2.college.disabled=true;



}

function setRegion1(){
var array1 = 12;
var region = new Array(array1);
region[0]="Central England";
region[1]="North England";
region[2]="North East England";
region[3]="East England";
region[4]="South East England";
region[5]="South England";
region[6]="South West England";
region[7]="West England";
region[8]="North West England";
region[9]="Scotland";
region[10]="Wales";
region[11]="Northern Ireland";


var a=0;
// document.form3.RealName.options[a] = new Option ("Any", "any");
 a=a+1;
 for(var i=0;i<array1;i++) {
//  document.form3.RealName.options[a] = new Option (region[i], region[i]);
  a=a+1;
 }
}


function checkSex(){
var sIndex = document.form3.Sex.selectedIndex;
var sexval = document.form3.Sex.options[sIndex].value;
if (sexval == "male")
 {
 	document.form3.LookingFor.value="female";
 }
 if (sexval == "female")
 {
 	document.form3.LookingFor.value="male";
 }
}
function checkCountry1(){
 document.form3.Relationship.options.length=0;
// document.form3.RealName.options.length=0;
 var cIndex = document.form3.Country.selectedIndex;
 var country = document.form3.Country.options[cIndex].value;
 if(country=="163")
{
 setCounties1();
// setRegion1();
}
 else {
  if(country=="164") 
  {
   setStates1(1); 
  }
  else 
  {
 
document.form3.Relationship.options[0] = new Option ("Any", "any");
  }
//   document.form3.RealName.options[0]=new Option ("Any","any"); 
 }
}


function checkCountry2(){
 document.form2.Relationship.options.length=0;
// document.form3.RealName.options.length=0;
 var cIndex = document.form2.country.selectedIndex;
 var country = document.form2.country.options[cIndex].value;
 if(country=="16344")
{
// setCounties1();
// setRegion1();
}
 else {
  if(country=="164") 
  {
   setStates1(2); 
  }
  else 
  {
 
document.form2.Relationship.options[0] = new Option ("Any", "any");
  }
//   document.form2.RealName.options[0]=new Option ("Any","any"); 
 }
}
