// <!-- 
states = new Array (
" --- ",
"Alabama",
"Alaska",
"Arizona",
"Arkansas",
"California",
"Colorado",
"Connecticut",
"Delaware",
"District of Col.",
"Florida",
"Georgia",
"Hawaii",
"Idaho",
"Illinois",
"Indiana",
"Iowa",
"Kansas",
"Kentucky",
"Louisiana",
"Maine",
"Maryland",
"Massachusetts",
"Michigan",
"Minnesota",
"Mississippi",
"Missouri",
"Montana",
"Nebraska",
"Nevada",
"New Hampshire",
"New Jersey",
"New Mexico",
"New York",
"North Carolina",
"North Dakota",
"Ohio",
"Oklahoma",
"Oregon",
"Pennsylvania",
"Rhode Island",
"South Carolina",
"South Dakota",
"Tennessee",
"Texas",
"Utah",
"Vermont",
"Virginia",
"Washington",
"West Virginia",
"Wisconsin",
"Wyoming",
"Alberta",
"British Columbia",
"Manitoba",
"New Brunswick",
"Newfoundland",
"Northwest Terri.",
"Nova Scotia",
"Ontario",
"Prince Edward I.",
"Quebec",
"Saskatchewan",
"Yukon"

);

countries = new Array (
" --- ",
"United States",
"Vietnam",
"Canada",
"Australia",
"Europe",
"France",
"Germany",
"England",
"Russia",
"Japan",
"Other"          
);

ethnicities = new Array (
" --- ",
 "Unspecified",
 "Vietnamese",
 "Asian",
 "Black/African",
 "Caucasian",
 "Hispanic/Lat."
 );
 
languages = new Array (
" --- ",
 "Unspecified",
 "Vietnamese",
 "English",
 "French",
 "Mandarin",
 "Cantonese"
 ); 

education = new Array (
" --- ",
 "Unspecified",
 "Secondary/High",
 "Student",
 "Trade/Technical",
 "University",
 "Masters",
 "Doctorate",
 "Post-Graduate",
 "Some University"

);

professions = new Array (
" --- ",
 "Unspecified",
 "Advertising",
 "Clerical Worker",
 "Producer",
 "Consultant",
 "Doctor/Medical",
 "Finance/Acct.",
 "Graphic Artist",
 "Home Business",
 "Home Maker",
 "K-12 Faculty",
 "Lawyer/Para.",
 "Management",
 "MIS/Programming",
 "Office Manager",
 "Other",
 "Political",
 "Professional",
 "RD Engineering",
 "Retired",
 "Sales/Marketing",
 "Scientist",
 "Technical",
 "Travel Agent",
 "Tradesman",
 "University Staff",
 "Student",
 "Upper Manager"
);

marital_status = new Array (
" --- ",
 "Unspecified",
 "Never Married",
 "Divorced",
 "Widowed",
 "Separated"
 );
religions = new Array (
" --- ",
 "Unspecified",
 "Buddhist",
 "Catholic",
 "Christian",
 "Orthodox",
 "Protestant"
 );

relationships = new Array (
" --- ",
 "Unspecified",
 "Long-term",
 "Activity/travel",
 "Pen pal"
 );
kids = new Array ("-", "Y", "N");
 
function dropDownMenu(OptionListName, from, to, fix, convert, unit1, unit2, sel)  
{
	if ( sel > 0 )
		document.writeln('<SELECT name="' + OptionListName + '">');	
	for(i=from; i<=to; i++){
		if ( i == fix ) 
			selected = 'SELECTED';
		else
			selected = '';
		if ( sel > 0 )
			document.writeln('<OPTION value="'+i+'"' + selected +'>' + i + unit1 );
		else if ( i == fix )
			document.writeln( i + unit1 );	
		if ( i*convert != 0 ) {
			if ( convert == 0.394 ){
				if ( i == fix || sel > 0 )
					document.writeln( ' (' + parseInt(i*convert/12) + '\' ' + parseInt(i*convert)%12 + '")');
			}
			else {
				if ( i == fix || sel > 0 )
				document.writeln( ' (' + parseInt(i*convert) + unit2 + ')');
			}
		}
		if ( sel > 0 )
			document.writeln( '</OPTION>');				
	}
	if ( sel > 0 )
		document.writeln('</SELECT>');
}


function SelectOption(Source, OptionListName, ListVal)
{
		document.writeln('<SELECT name="' + OptionListName + '">');
		for (i=0; i < Source.length; i++)
		{
			if ( Source[i] == ListVal)
			{
				document.writeln('<OPTION value="'+Source[i]+'" SELECTED>' + Source[i] + '</OPTION>');
			}
			else {
				document.writeln('<OPTION value="'+Source[i]+'">' + Source[i] + '</OPTION>');
			}
		}
		document.writeln('</SELECT>');
}


function validate_contact_info(form) {
if ( valid_no_empty(form.first_name) == false )
{	
	fixElement(form.first_name,"Please enter First Name ");
	return false;	
}
if ( valid_no_empty(form.last_name) == false )
{
	fixElement(form.last_name,"Please enter Last Name ");
	return false;	
}
if ( valid_no_empty(form.city) == false )
{
	fixElement(form.city,"Please enter City ");
	return false;	
}
if ( check_select(form.country)  == false) 
{
	fixElement(form.country,"Please select Country ");
	return false;	
}
if ( valid_no_empty(form.phone) == false )
{
	fixElement(form.phone,"Please enter Telephone ");
	return false;	
}
return true;
}

function validate_description(form)
{
if ( valid_no_empty(form.title) == false )
{	
	fixElement(form.title,"Please enter title");
	return false;
}
if ( valid_no_empty(form.description) == false )
{
	fixElement(form.description,"Please enter Description ");
	return false;	
}
if ( form.description.value.length > 500 )
{
	fixElement(	form.description, "Your description is limited to 500 characters!");
	return false;
}
if ( form.description.value.indexOf('@') > -1 ||
	 form.description.value.indexOf('http://') > -1 )
{
	fixElement(	form.description, "Violation on 'No email address policy' will lock your profile!");
	return false;	
}	 

return true;	
}

function validate_addphoto(form)
{
if ( valid_no_empty(form.upload_photo) == false )
{	
	return false;
}
//if ( validBox(form.upload_photo) == false )
//{
//	return false;	
//}
	img = form.upload_photo.value.toLowerCase();
if ( img.indexOf('.gif') < 0 &&	 img.indexOf('.jpg') < 0 )
{
	fixElement(	form.upload_photo, "Image format must be  .gif or .jpg");
	return false;	
}	 

return true;
}

function validate_contact_box(form)
{
if ( valid_no_empty(form.note) == false )
{	
	fixElement(form.note,"Please enter something ");
	return false;
}
if ( form.note.value.length > 3500 )
{
	fixElement(	form.note, "Message limit is 3500 characters. Yours is " + form.note.value.length);
	return false;
}
if ( form.note.value.indexOf('@') > -1 ||
	 form.note.value.indexOf('http://') > -1 )
{
	fixElement(	form.note, "Violation on 'No email address policy' will lock your profile!");
	return false;	
}	 
return true;
}


function validate_contact_box_premium(form)
{
if ( valid_no_empty(form.note) == false )
{	
	fixElement(form.note,"Please enter something ");
	return false;
}
if ( form.note.value.length > 3500 )
{
	fixElement(	form.note, "Message limit is 3500 characters. Yours is " + form.note.value.length);
	return false;
}

return true;
}

function validate_personal_info(form)
{
	
if ( check_select(form.height)  == false) 
{
	fixElement(form.height,"Please select Height ");
	return false;	
}

if ( check_select(form.weight)  == false) 
{
	fixElement(form.weight,"Please select Weight ");
	return false;	
}

return true;
}

function validate_new_user(form)
{

if ( validate_description(form) == false ) 
{
	return false;	
}
if ( validate_personal_info(form) == false ) 
{
	return false;	
}

if ( validate_contact_info(form) == false ) 
{
	return false;	
}


return true;
}
// -->

