function checkInput()
{
	my_form=document.getElementById('step1F');
	
	if(my_form.email.value==='' || !validEmail(my_form.email.value))
	{
		alert(emValid);
		return false;
	}

	if(my_form.email2.value==='' || !validEmail(my_form.email2.value))
	{
		alert(emValid2);
		return false;

	}

	if(my_form.email.value!==my_form.email2.value)
	{
		alert(emMatch);
		return false;

	}

	if(my_form.passwd.value==='')
	{
		alert(passValid);
		return false;
	}

	if(my_form.passwd2.value==='')
	{
		alert(passValid2);
		return false;

	}

	if(my_form.passwd.value!==my_form.passwd2.value)
	{
		alert(passMutch);
		return false;

	}

	if(my_form.title.value==="0")
	{
		alert(titleValid);
		return false;

	}

	if(my_form.first_name.value==='')
	{
		alert(fNameValid);
		return false;

	}


	if(my_form.last_name.value==='')
	{
		alert(lNameValid);
		return false;

	}






	if(my_form.address.value==='')
	{
		alert(poBValid);
		return false;

	}

	if(my_form.country_of_residence.value===0)
	{
		alert(countrValid);
		return false;

	}

	if(document.getElementById('city').value===0 && 
			my_form.country_of_residence.value!=23 &&
			my_form.country_of_residence.value!=24 && 
			my_form.country_of_residence.value!=25)
	{
		alert(cityValid);
		return false;

	}
	if(my_form.mobile_number.value==='')
	{
		alert(mobValid);
		return false;

	}
	if(my_form.pref_lang.value==0)
	{
		alert(langValid);
		return false;

	}


	if(my_form.day.value==0)
	{
		alert(dayValid);
		return false;

	}

	if(my_form.month.value==0)
	{
		alert(monthValid);
		return false;

	}

	if(my_form.year.value==0)
	{
		alert(yearValid);
		return false;

	}
	if(my_form.nationality.value==0)
	{
		alert(natValid);
		return false;

	}
	if(my_form.agree.checked!=true)
	{
		alert(termValid);
		return false;
	}

	my_form.submit();

}


function regInitS1(cities, codes, countries, selectedCity){

	JQAJAX(cities, {country: document.getElementById('country').options[document.getElementById('country').selectedIndex].value, city: selectedCity}, 'cities', function(){
		var sPath = window.location.pathname;
		var sPage = sPath.substring(sPath.lastIndexOf('/') + 1);
		if (sPage == 'register.php'){
			$('#city').attr('class','selreg5');
			$('#city').css('width','139px');
			//document.getElementById('city_name').selectedIndex=document.getElementById('city').value;
		}
		});
	
	
	
	//TmakePostRequest(cities,document.getElementById('country'),document.getElementById('city'), selectedCity);
	
	JQAJAX(countries, {country: $('#country').val()}, 'country_code', checkCode);
	
	//CmakePostRequest(codes,document.getElementById('country'),document.getElementById('op_code'));
	//CCmakePostRequest(countries,document.getElementById('country'),document.getElementById('country_codes'));
	document.getElementById('opCode').value='0';


}
function checkCode(){
	if ($('#country_code').val() != ''){
		$('#country_code').attr('readonly', true);
	}
	else{
		$('#country_code').attr('readonly', false);

	}
}


