
function check_form(){
	var obj_Form		= document.memberform;
	var obj_Agreement	= obj_Form.agreement;
	var obj_Gender		= obj_Form.gender;
	var n_CountryID		= obj_Form.country.options[obj_Form.country.options.selectedIndex].value;
	var n_CityID		= obj_Form.city.options[obj_Form.city.options.selectedIndex].value;
	var n_NonFilled		= 0;
	var arr_ReqFields	= new Array(11);
	var day				= obj_Form.day_birthday.value.Trim();
	var month			= obj_Form.month_birthday.value.Trim();	
	var year			= obj_Form.year_birthday.value.Trim();
	var checkdate		= 0;
	
	for (i = 0; i < arr_ReqFields.length; i++){
		arr_ReqFields[i] = new Array(2);
	}
	
	arr_ReqFields[0][0] = obj_Form.name.value.Trim();
	arr_ReqFields[0][1] = 'itName';
	arr_ReqFields[1][0] = obj_Form.surname.value.Trim();
	arr_ReqFields[1][1] = 'itSurname'
	arr_ReqFields[2][0] = obj_Form.e_mail.value.Trim();
	arr_ReqFields[2][1] = 'itEmail'
	arr_ReqFields[3][0] = obj_Form.address_1.value.Trim();
	arr_ReqFields[3][1] = 'itAddress1'
	arr_ReqFields[4][0] = obj_Form.country.options[obj_Form.country.options.selectedIndex].value.Trim();
	arr_ReqFields[4][1] = 'itCountry'
	arr_ReqFields[5][0] = obj_Form.phone_1.value.Trim();
	arr_ReqFields[5][1] = 'itPhone1'
	arr_ReqFields[6][0] = obj_Form.user_name.value.Trim();
	arr_ReqFields[6][1] = 'itUsername'
	arr_ReqFields[7][0] = obj_Form.password.value.Trim();
	arr_ReqFields[7][1] = 'itPassword'
	arr_ReqFields[8][0] = obj_Form.confirm_password.value.Trim();
	arr_ReqFields[8][1] = 'itConfirmPassword'
	arr_ReqFields[9][0] = obj_Form.mobile_ac.value.Trim();
	arr_ReqFields[9][1] = 'itmobile';
	arr_ReqFields[10][0] = obj_Form.phone_2.value.Trim();
	arr_ReqFields[10][1] = 'itPhone2'
	
	if (month < 1 || month > 12) checkdate=1;
    if (day < 1 || day > 31) checkdate=1;
    if ((month == 4 || month == 6 || month==9 || month == 11) && day == 31) checkdate=1;
    if (month == 2) {
          var isleap = (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0));

          if (day > 29 || (day == 29 && !isleap)) checkdate=1;
     }
	
	for (i = 0; i < arr_ReqFields.length; i++){
		if (arr_ReqFields[i][0] == ''){
			set_marker(arr_ReqFields[i][1]);
			n_NonFilled++;
		}else{
			unset_marker(arr_ReqFields[i][1]);
		}
	}
	
	if (obj_Gender[0].checked != true && obj_Gender[1].checked != true){
		set_marker('itGender');
		n_NonFilled++;
	}else{
		unset_marker('itGender');
	}
	
	if (n_CountryID == 'TR' && n_CityID == 0){
		set_marker('itCity');
		n_NonFilled++;
	}else{
		unset_marker('itCity');
	}
	
	if (arr_ReqFields[7][0] != arr_ReqFields[8][0] || arr_ReqFields[7][0].length < 5 ){
		set_marker('itPassword');
		set_marker('itConfirmPassword');
		n_NonFilled++;
	}else{
		unset_marker('itPassword');
		unset_marker('itConfirmPassword');
	}
	
	if (obj_Agreement.checked != true){
		set_marker('itAgree');
		n_NonFilled++;
	}else{
		unset_marker('itAgree');
	}
	
	if (n_NonFilled > 0 || checkdate > 0){
		if (checkdate == 1)
			alert('Lütfen Tarihi kontrol ediniz');
		else
			alert('Lütfen \'*\' ile işaretlanan alanları tekrar kontrol ediniz !!!\t');
	}
	else
	{
		obj_Form.submit();
	}
}

function set_marker(str_SpanID){
	var obj_Span = eval(str_SpanID);
	obj_Span.innerText = '*';
}

function unset_marker(str_SpanID){
	var obj_Span = eval(str_SpanID);
	obj_Span.innerText = '';
}


function check_form_kocailem(){
	var obj_Form		= document.memberform;
	var obj_Agreement	= obj_Form.agreement;
	var obj_Gender		= obj_Form.gender;
	var n_CountryID		= obj_Form.country.options[obj_Form.country.options.selectedIndex].value;
	var n_CityID		= obj_Form.city.options[obj_Form.city.options.selectedIndex].value;
	var n_NonFilled		= 0;
	var arr_ReqFields	= new Array(9);
	var day				= obj_Form.day_birthday.value.Trim();
	var month			= obj_Form.month_birthday.value.Trim();	
	var year			= obj_Form.year_birthday.value.Trim();
	var checkdate		= 0;
	
	for (i = 0; i < arr_ReqFields.length; i++){
		arr_ReqFields[i] = new Array(2);
	}
	
	arr_ReqFields[0][0] = obj_Form.name.value.Trim();
	arr_ReqFields[0][1] = 'itName';
	arr_ReqFields[1][0] = obj_Form.surname.value.Trim();
	arr_ReqFields[1][1] = 'itSurname'
	arr_ReqFields[2][0] = obj_Form.e_mail.value.Trim();
	arr_ReqFields[2][1] = 'itEmail'
	
	arr_ReqFields[3][0] = obj_Form.user_name.value.Trim();
	arr_ReqFields[3][1] = 'itUsername'
	arr_ReqFields[4][0] = obj_Form.password.value.Trim();
	arr_ReqFields[4][1] = 'itPassword'
	arr_ReqFields[5][0] = obj_Form.confirm_password.value.Trim();
	arr_ReqFields[5][1] = 'itConfirmPassword'
	arr_ReqFields[6][0] = obj_Form.mobile_ac.value.Trim();
	arr_ReqFields[6][1] = 'itmobile';
	arr_ReqFields[7][0] = obj_Form.tckimlikno.value.Trim();
	arr_ReqFields[7][1] = 'itTCkimlik'
	arr_ReqFields[8][0] = obj_Form.country.options[obj_Form.country.options.selectedIndex].value.Trim();
	arr_ReqFields[8][1] = 'itCountry'
	
	if (month < 1 || month > 12) checkdate=1;
    if (day < 1 || day > 31) checkdate=1;
    if ((month == 4 || month == 6 || month==9 || month == 11) && day == 31) checkdate=1;
    if (month == 2) {
          var isleap = (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0));

          if (day > 29 || (day == 29 && !isleap)) checkdate=1;
     }
	
	for (i = 0; i < arr_ReqFields.length; i++){
		if (arr_ReqFields[i][0] == ''){
			set_marker(arr_ReqFields[i][1]);
			n_NonFilled++;
		}else{
			unset_marker(arr_ReqFields[i][1]);
		}
	}
	
	if (obj_Gender[0].checked != true && obj_Gender[1].checked != true){
		set_marker('itGender');
		n_NonFilled++;
	}else{
		unset_marker('itGender');
	}	
	
	if (n_CountryID == 'TR' && n_CityID == 0){
		set_marker('itCity');
		n_NonFilled++;
	}else{
		unset_marker('itCity');
	}
	
	if (arr_ReqFields[4][0] != arr_ReqFields[5][0] || arr_ReqFields[4][0].length < 5){
		set_marker('itPassword');
		set_marker('itConfirmPassword');
		n_NonFilled++;
	}else{
		unset_marker('itPassword');
		unset_marker('itConfirmPassword');
	}
	
	if (arr_ReqFields[7][0].length != 11 || arr_ReqFields[8][0]<1000000000){
		set_marker('itTCkimlik');
		n_NonFilled++;
	}else{
		unset_marker('itTCkimlik');
	}
	
	if (obj_Agreement.checked != true){
		set_marker('itAgree');
		n_NonFilled++;
	}else{
		unset_marker('itAgree');
	}
	
	if (n_NonFilled > 0 || checkdate > 0){
		if (checkdate == 1)
			alert('Lütfen Tarihi kontrol ediniz');
		else
			alert('Lütfen \'*\' ile işaretlanan alanları tekrar kontrol ediniz !\t');
	}
	else
	{
		obj_Form.submit();
	}
}