var cbox;
var win;
var wins;
var checkland1;
var checkland2;
var kpc=new Array();
function ac(box){

if (win =="1")
	{
		for (i=1;i<6;i++)
		  	{
				if (i == box)
					{
					
						Effect.SlideUp('space'+box);
						win = "2";
						
						return;
				 
					}
					
			}
	}
	
cbox=box;

for (i=1;i<8;i++)
  {
    if (i == box)
		{
		
			Effect.SlideDown('space'+box);
			win = "1";
			new Ajax.Updater('error_box','./statistik.php',
					{ 	
						method: 'post'
					});			
			
			document.getElementById('ma').style.color='#FF0';
			
	
		}
document.getElementById('m'+i).style.color='#FFFFFF';
document.getElementById('mfa').style.color='#FFFFFF';
document.getElementById('ye'+i).style.color='#FFFFFF';
  	}


}

function winner(box){



cbox=box;
  for (i=1;i<10;i++)
  {
    if (i == box)
	{	document.getElementById('ye'+box).style.color='#FF0';
		$('aa'+i).show();
		$('as').style.display='none';
		//Effect.Appear('aa'+box);
	
	}
	else
	{	document.getElementById('ye'+i).style.color='#FFFFFF';
		$('aa'+i).hide();
		//Effect.Squish('aa'+$i);
	}

  }; 
}

/*function winner(box){


cbox=box;
for (i=1;i<8;i++)
  {
    if (i == box)
		{
			$('aa'+box).show();	
			wins = "1";
			$('as').style.display='none';
			return;
		}
	
			
  	}
	
if (wins =="1")
	{
					
						$('aa'+box).hide();
						wins = "2";
	}

}*/


function child_tab(box){
cbox=box;

for (i=0;i<Math.round($F('child'));i++)
  {
    if (i == box)
		{	
				$('children'+box).show();
				$('li'+box).className='current';		
				//Effect.SlideDown('children'+box);

		
		} 
	else {
			$('children'+i).hide();
			$('li'+i).className='';
			//Effect.SlideUp('children'+i);
		}
	

  	}; 
	


}
function vorwahl_country(){
if($('vorland ') != 'select')
{ 
	sas = $F('vorland');
	$('vor_phon').value= sas;

}}
function check_land_1(){
checkland1=true;

if(trim($F('bland'))=='175'||trim($F('bland'))=='221'||trim($F('bland'))=='61'||trim($F('bland'))=='177'||trim($F('bland'))=='181'||trim($F('bland'))=='182'||trim($F('bland'))=='183'||trim($F('bland'))=='185'||trim($F('bland'))=='187'||trim($F('bland'))=='65'||trim($F('bland'))=='189'||trim($F('bland'))=='190'||trim($F('bland'))=='81'||trim($F('bland'))=='82'||trim($F('bland'))=='194'||trim($F('bland'))=='147'||trim($F('bland'))=='86'||trim($F('bland'))=='165'||trim($F('bland'))=='91'||trim($F('bland'))=='223'||trim($F('bland'))=='261'||trim($F('bland'))=='95'||trim($F('bland'))=='102'||trim($F('bland'))=='104'||trim($F('bland'))=='106'||trim($F('bland'))=='112'||trim($F('bland'))=='120'||trim($F('bland'))=='140'||trim($F('bland'))=='146'||trim($F('bland'))=='163')
	{
		checkland1=false;
	}
	
}

function check_land_2(){
checkland2=true;	

if(trim($F('bland_s'))=='175'||trim($F('bland_s'))=='221'||trim($F('bland_s'))=='61'||trim($F('bland_s'))=='177'||trim($F('bland_s'))=='181'||trim($F('bland_s'))=='182'||trim($F('bland_s'))=='183'||trim($F('bland_s'))=='185'||trim($F('bland_s'))=='187'||trim($F('bland_s'))=='65'||trim($F('bland_s'))=='189'||trim($F('bland_s'))=='190'||trim($F('bland_s'))=='81'||trim($F('bland_s'))=='82'||trim($F('bland_s'))=='194'||trim($F('bland_s'))=='147'||trim($F('bland_s'))=='86'||trim($F('bland_s'))=='165'||trim($F('bland_s'))=='91'||trim($F('bland_s'))=='223'||trim($F('bland_s'))=='261'||trim($F('bland_s'))=='95'||trim($F('bland_s'))=='102'||trim($F('bland_s'))=='104'||trim($F('bland_s'))=='106'||trim($F('bland_s'))=='112'||trim($F('bland_s'))=='120'||trim($F('bland_s'))=='140'||trim($F('bland_s'))=='146'||trim($F('bland_s'))=='163')
	{
		checkland2=false;
	}
	
}

function native_country(){
check_land_1();
check_land_2();	
if($F('marry')=='Unmarried' || $F('marry')=='Divorced' || $F('marry')=='Widowed' || $F('marry')=='Legally Separated' || $F('marry')=='Select'  ){	
if (!checkland1){
		$('app_native').show();
		$('place_native-e').style.display='';
		$('bland_nat_e').style.display='';
		$('bland_nat_e').innerHTML='شما در یکی از کشورهایی متولد شدید که اجازه شرکت در قرعه کشی را ندارد ( برای مثال انگلیس یا کانادا). اگر همسر شما یا یکی از والدین شما در کشور دیگه ای متولد شدند که اجازه شرکت در قرعه کشی را دارد لطفأ آن کشور را در سمت راست به عنوان کشور دوم انتخاب کنید در غیر این صورت اجازه شرکت در قرعه کشی را ندارید!';
		$('bland-se').innerHTML='*';
		$('bland-se').style.display='';
		$('bland_native_se').innerHTML='*';
		$('bland_native_se').style.display='';
		$('place-e').style.display='';
		$('native_erkl').style.display='';
		if(trim($F('bland_native'))== ''){
			
				$('bland-e').innerHTML='لطفأ&nbsp;کشور&nbsp;دوم&nbsp;را&nbsp;انتخاب&nbsp;نمایید';
				$('bland-e').style.display='';
				$('place-e').style.display='';
				$('bland_native_se').innerHTML='*';
				$('bland_native_se').style.display='';
			}
		if(trim($F('bland_native'))!= ''){
			
				$('bland_nat_e').style.display='none';
				$('bland-se').style.display='none';
				$('bland_native_se').style.display='none';
				$('bland-e').style.display='none';
			}	
		
		isok=false;
		error_is=false;
		
			 
		} 
		else{
			$('app_native').hide();
			$('place_native-e').style.display='none';
			$('bland_nat_e').style.display='none';
			$('bland_native_se').style.display='none';
			$('bland-e').style.display='none';
			$('bland-se').style.display='none';
			$('bland_w-e').style.display='none';
			$('bland_se_f_na').style.display='none';
			$('native_erkl').style.display='none';
			}
	
		
	}

if($F('marry')=='Married'){


	if (!checkland1 && !checkland2){

			$('app_native').show();
			$('spo_native').show();		
			$('place_native-e').style.display='';
			$('bland_nat_e').style.display='';
			$('bland_nat_e').innerHTML='شما در یکی از کشورهایی متولد شدید که اجازه شرکت در قرعه کشی را ندارد ( برای مثال انگلیس یا کانادا). اگر همسر شما یا یکی از والدین شما در کشور دیگه ای متولد شدند که اجازه شرکت در قرعه کشی را دارد لطفأ آن کشور را در سمت راست به عنوان کشور دوم انتخاب کنید در غیر این صورت اجازه شرکت در قرعه کشی را ندارید!';

			$('bland_se_f_na').innerHTML='*';
			$('bland_se_f_na').style.display='';
			$('bland_native_se').innerHTML='*';
			$('bland_native_se').style.display='';
			$('bland-e').innerHTML='لطفأ&nbsp;کشور&nbsp;دوم&nbsp;را&nbsp;انتخاب&nbsp;نمایید';
			$('bland-e').style.display='';
			$('place-e').style.display='';
			$('place_native_se-e').style.display='';
			$('bland_nat_se_e').style.display='';
			$('bland_nat_se_e').innerHTML='همسر شما در یکی از کشورهایی متولد شده است که اجازه شرکت در قرعه کشی را ندارد ( برای مثال انگلیس یا کانادا). اگر شما یا یکی از والدین همسرتون در کشور دیگه ای متولد شدند که اجازه شرکت در قرعه کشی را دارد لطفأ آن کشور را در سمت راست به عنوان کشور دوم انتخاب کنید در غیر این صورت اجازه شرکت در قرعه کشی را ندارید!';
			$('bland_s-se').innerHTML='*';
			$('bland_s-se').style.display='';
			$('bland_native_spo_se').innerHTML='*';
			$('bland_native_spo_se').style.display='';
			$('bland_s-e').innerHTML='لطفأ&nbsp;کشور&nbsp;دوم&nbsp;را&nbsp;انتخاب&nbsp;نمایید';
			$('bland_s-e').style.display='';
			$('place_s-e').style.display='';
			$('native_erkl').style.display='';
			
			isok=false;
			error_is=false;
			 
		}
		else{
			$('app_native').hide();
			$('place_native-e').style.display='none';
			$('bland_nat_e').style.display='none';
			$('bland-e').style.display='none';
			$('bland-se').style.display='none';
			$('spo_native').hide();
			$('bland_native_se').style.display='none';
			$('bland_nat_se_e').style.display='none';
			$('bland_s-e').style.display='none';
			$('bland_s-se').style.display='none';
			$('bland_se_f_na').style.display='none';
			$('bland_w-e_s').style.display='none';
			$('bland_se_f_na_s').style.display='none';
			$('bland_w-e').style.display='none';
			$('native_erkl').style.display='none';
		}
		
	if (trim($F('bland_native')) != ''){
			

			$('bland_nat_e').style.display='none';
			$('bland-e').style.display='none';
			$('bland-se').style.display='none';
			$('bland_se_f_na').style.display='none';
			$('bland_native_se').style.display='none';
	}
	if (trim($F('bland_native_spo')) != 'select'){
			
			$('bland_s-e').style.display='none';
			$('bland_s-se').style.display='none';
			$('bland-se').style.display='none';
			$('bland_se_f_na').style.display='none';
			$('bland_native_spo_se').style.display='none';
			$('bland_nat_se_e').style.display='none';
	}	

	}
}

function native_country_sec(){
if (trim($F('bland_native'))== ''){
		$('place_native-e').style.display='';
		$('bland_nat_er').style.display='none';
		$('bland_nat_e').style.display='';
		$('bland_nat_e').innerHTML='شما در یکی از کشورهایی متولد شدید که اجازه شرکت در قرعه کشی را ندارد ( برای مثال انگلیس یا کانادا). اگر همسر شما یا یکی از والدین شما در کشور دیگه ای متولد شدند که اجازه شرکت در قرعه کشی را دارد لطفأ آن کشور را در سمت راست به عنوان کشور دوم انتخاب کنید در غیر این صورت اجازه شرکت در قرعه کشی را ندارید!';
		$('bland_native_se').innerHTML='*';
		$('bland_native_se').style.display='';
		$('bland-e').innerHTML='لطفأ&nbsp;کشور&nbsp;دوم&nbsp;را&nbsp;انتخاب&nbsp;نمایید';
		$('bland-e').style.display='';
		$('bland-se').innerHTML='*';
		$('bland-se').style.display='';
		isok=false;
		error_is=false;
		
		
		
}
else {
		$('app_native').show();
		$('place_native-e').style.display='';
		$('bland_native_se').innerHTML='';
		$('bland_native_se').style.display='none';
		$('bland_nat_er').style.display='';
		$('bland_nat_er').innerHTML='کشور&nbsp;دوم&nbsp;با&nbsp;موفقیت&nbsp;انتخاب&nbsp;شد';
		$('bland-e').style.display='none';
		$('bland-se').style.display='none';
		$('bland_se_f_na').style.display='none';
		$('bland_w-e').style.display='none';
	 }
}
function native_country_spo(){
check_land_1();
check_land_2();
if($F('marry')=='Married'){
if (!checkland1 && !checkland2){

			$('app_native').show();
			$('spo_native').show();		
			$('place_native-e').style.display='';
			$('bland_nat_e').style.display='';
			$('bland_nat_e').innerHTML='شما در یکی از کشورهای متولد شدید که اجازه شرکت در قرعه کشی را ندارد ( برای مثال انگلیس یا کانادا). اگر همسر شما یا یکی از والدینتون در کشور دیگه ای متولد شدند که اجازه شرکت در قرعه کشی را دارد لطفأ آن کشور را در سمت راست به عنوان کشور دوم انتخاب کنید در غیر این صورت اجازه شرکت در قرعه کشی را ندارید';
			$('bland_se_f_na').innerHTML='*';
			$('bland_se_f_na').style.display='';
			$('bland-e').innerHTML='لطفأ&nbsp;کشور&nbsp;دوم&nbsp;را&nbsp;انتخاب&nbsp;نمایید';
			$('bland-e').style.display='';
			$('bland_native_se').innerHTML='*';
			$('bland_native_se').style.display='';			
			$('place-e').style.display='';
			$('place_native_se-e').style.display='';
			$('bland_nat_se_e').style.display='';
			$('bland_nat_se_e').innerHTML='همسر شما در یکی از کشورهایی متولد شده است که اجازه شرکت در قرعه کشی را ندارد ( برای مثال انگلیس یا کانادا). اگر شما یا یکی از والدین همسرتون در کشور دیگه ای متولد شدند که اجازه شرکت در قرعه کشی را دارد لطفأ آن کشور را در سمت راست به عنوان کشور دوم انتخاب کنید در غیر این صورت اجازه شرکت در قرعه کشی را ندارید!';
			$('bland_s-se').innerHTML='*';
			$('bland_s-se').style.display='';
			$('bland_native_spo_se').innerHTML='*';
			$('bland_native_spo_se').style.display='';
			$('bland_s-e').innerHTML='لطفأ&nbsp;کشور&nbsp;دوم&nbsp;را&nbsp;انتخاب&nbsp;نمایید';
			$('bland_s-e').style.display='';
			$('place_s-e').style.display='';	
			isok=false;
			error_is=false;
			 
		}
		else{
			$('spo_native').hide();
			$('bland_native_se').style.display='none';
			$('bland_nat_se_e').style.display='none';
			$('bland_s-e').style.display='none';
			$('bland_s-se').style.display='none';
			$('app_native').hide();
			$('place_native-e').style.display='none';
			$('bland_nat_e').style.display='none';
			$('bland-e').style.display='none';
			$('bland-se').style.display='none';
			$('bland_se_f_na').style.display='none';
			$('bland_w-e').style.display='none';
			$('bland_se_f_na_s').style.display='none';
			$('bland_w-e_s').style.display='none';
			$('native_erkl').style.display='none';
		}
	
if (trim($F('bland_native_spo')) != 'select'){
			
			$('bland_nat_se_e').style.display='none';
			$('bland_s-e').style.display='none';
			$('bland_s-se').style.display='none';
			$('bland_native_spo_se').style.display='none';
			$('bland_w-e').style.display='none';
	}
		if (trim($F('bland_native')) != ''){
			

			$('bland_nat_e').style.display='none';
			$('bland-e').style.display='none';
			$('bland-se').style.display='none';
			$('bland_se_f_na').style.display='none';
			$('bland_native_se').style.display='none';
	}
	
	}
}

function native_country_spo_sec(){
if (trim($F('bland_native_spo'))== 'select'){
		$('place_native_se-e').style.display='';
		$('bland_nat_se_er').style.display='none';
		$('bland_nat_se_e').style.display='';
		$('bland_nat_se_e').innerHTML='همسر شما در یکی از کشورهایی متولد شده است که اجازه شرکت در قرعه کشی را ندارد ( برای مثال انگلیس یا کانادا). اگر شما یا یکی از والدین همسرتون در کشور دیگه ای متولد شدند که اجازه شرکت در قرعه کشی را دارد لطفأ آن کشور را در سمت راست به عنوان کشور دوم انتخاب کنید در غیر این صورت اجازه شرکت در قرعه کشی را ندارید!';
		$('bland_native_spo_se').innerHTML='*';
		$('bland_native_spo_se').style.display='';
		$('bland_s-e').innerHTML='لطفأ&nbsp;کشور&nbsp;دوم&nbsp;را&nbsp;انتخاب&nbsp;نمایید';
		$('bland_s-e').style.display='';
		$('bland_s-se').innerHTML='*';
		$('bland_s-se').style.display='';
		isok=false;
		error_is=false;
		
		
		
}
else {
		$('spo_native').show();
		$('place_native_se-e').style.display='';
		$('bland_native_spo_se').innerHTML='';
		$('bland_native_spo_se').style.display='none';
		$('bland_nat_se_er').style.display='';
		$('bland_nat_se_er').innerHTML='کشور&nbsp;دوم&nbsp;با&nbsp;موفقیت&nbsp;انتخاب&nbsp;شد';
		$('bland_s-e').style.display='none';
		$('bland_s-se').style.display='none';
		$('bland_w-e_s').style.display='none';
		$('bland_se_f_na_s').style.display='none';
	 }
}

function spouse(){

var getid = document.getElementById('marry');
var getid1 = document.getElementById('sex_s');
var getid2 = document.getElementById('sex');
	if($F('marry')=='Married'){
		$('app_native').hide();
		$('bland-se').style.display='none';
		$('bland_native_se').style.display='none';
		$('bland-e').style.display='none';
		

			
		}

if ($F('spo_si')=='Married' && $F('spo_si')!=$F('marry')){
		 alert ("لطفأ اول فرم همسر خود را پاک کنید");
		 $('marry').value = marry_teda;
		
	 }
	 
	if(getid.value == "Married")
		{ 
			$('spo').show();
			
			if(getid2.value == "Man")
				{
					getid1.value = "Woman";
				}
			else
				{
					getid1.value = "Man";
				}
			if(getid2.value == "select")
				{
					getid1.value = "select";
				}	
		}
	else
		{
			$('spo').hide();
		}
}

function children5(){
 


	if ($F('childanzahl')>Math.round($F('child'))){
		 alert ("لطفأ فرم فرزند را پاک کنید");
		 $('child').value = child_teda;
		
	 }
	 
	new Ajax.Updater('chi','./child-profile_1.php',
				{ 	
					method: 'post',
					parameters: { child: $F('child')}
				});
	$('chi').innerHTML='<div style="background-color:#333333;margin-right:28px;width:742px;border-left:1px #333333 solid;border-right:1px #333333 solid; border-top:1px #FFFFFF solid; height:50px;" ><img src="pic/ajax-loader3.gif" style=margin-top:10px;margin-right:375px;/></div>  ';
/*	
if(getid_ch.value != "0")
		{
			Effect.Appear('chi');
			$('email_e').style.display='none';
		}
	else
		{
			Effect.Fade('chi');
		}
		
*/
}



function logout(url){
	
	new Ajax.Updater('logoutbox','./logout.php',
		{ 	
			method: 'post'
		} 	
		
		)
	
	}
	


	
function trim(str, chars) {
    return ltrim(rtrim(str, chars), chars);
}

function ltrim(str, chars) {
    chars = chars || "\\s";
    return str.replace(new RegExp("^[" + chars + "]+", "g"), "");
}
function rtrim(str, chars) {
    chars = chars || "\\s";
    return str.replace(new RegExp("[" + chars + "]+$", "g"), "");
}	


function isValidEmail(email, required) {
    if (required==undefined) {   
        required=true;
    }
    if (email==null) {
        if (required) {
$('email_e').innerHTML='لطفأ&nbsp;آدرس&nbsp;ایمیل&nbsp;خود&nbsp;را&nbsp;وارد&nbsp;کنید';
$('email').style.border='solid 1px #FF0000';
$('email_e').style.display='';
return false;
        }
        
		return true;
    }
    if (email.length==0) {  
        if (required) {
           $('email_e').innerHTML='لطفأ&nbsp;آدرس&nbsp;ایمیل&nbsp;خود&nbsp;را&nbsp;وارد&nbsp;کنید';
		   $('email').style.border='solid 1px #FF0000';
		   $('email_e').style.display='';
		   return false;
        }
        return true;
    }
    if (! allValidChars(email)) {  
       $('email_e').innerHTML='آدرس&nbsp;ایمیل&nbsp;شما&nbsp;اشتباه&nbsp;میباشد';
	   $('email').style.border='solid 1px #FF0000';
	    $('email_e').style.display='';
	   return false;
    }
    if (email.indexOf("@") < 1) { 
       $('email_e').innerHTML='آدرس&nbsp;ایمیل&nbsp;شما&nbsp;اشتباه&nbsp;میباشد';
	   $('email').style.border='solid 1px #FF0000';
	   $('email_e').style.display='';
	   return false;
    } else if (email.lastIndexOf(".") <= email.indexOf("@")) { 
$('email_e').innerHTML='آدرس&nbsp;ایمیل&nbsp;شما&nbsp;اشتباه&nbsp;میباشد';
$('email').style.border='solid 1px #FF0000';
 $('email_e').style.display='';
return false;
    } else if (email.indexOf("@") == email.length) {  
$('email_e').innerHTML='آدرس&nbsp;ایمیل&nbsp;شما&nbsp;اشتباه&nbsp;میباشد';
$('email').style.border='solid 1px #FF0000';
 $('email_e').style.display='';
return false;
    } else if (email.indexOf("..") >=0) { 
	$('email_e').innerHTML='آدرس&nbsp;ایمیل&nbsp;شما&nbsp;اشتباه&nbsp;میباشد';
	$('email').style.border='solid 1px #FF0000';
	 $('email_e').style.display='';
	return false;
    }
	else if (email.indexOf(".ir") >=0) { 
	$('email_e').innerHTML='آدرس&nbsp;ایمیل&nbsp;شما&nbsp;اشتباه&nbsp;میباشد';
	$('email').style.border='solid 1px #FF0000';
	 $('email_e').style.display='';
	return false;
    } else if (email.indexOf(".") == email.length) { 
$('email_e').innerHTML='آدرس&nbsp;ایمیل&nbsp;شما&nbsp;اشتباه&nbsp;میباشد';
$('email').style.border='solid 1px #FF0000';
 $('email_e').style.display='';
return false;
    }
    return 'ok';
}
function allValidChars(email) {
  var parsed = true;
  var validchars = "abcdefghijklmnopqrstuvwxyz0123456789@.-_";
  for (var i=0; i < email.length; i++) {
    var letter = email.charAt(i).toLowerCase();
    if (validchars.indexOf(letter) != -1)
      continue;
    parsed = false;
    break;
  }
  return parsed;
}


function chekemail(){
	myurl='checkmail.php?type=2&email='+$F('email');
	new Ajax.Request(myurl,{method: 'get',asynchronous:false,onSuccess:function(transport){
															
		 if(transport.responseText=='no'){																																					
				myps1=false;
				
			return false;
			}	else {
																											
				myps1=true;
				return true;
				
			}																				
																										
		 }});
	return myps1;
	}
function connect(){
	myurl='checkconnect.php';
	new Ajax.Request(myurl,{method: 'get',asynchronous:false,onSuccess:function(transport){
															
		 if(transport.responseText=='no'){																																					
				myps1=false;
				
			return false;
			}	else {
																											
				myps1=true;
				return true;
				
			}																				
																										
		 }});
	return myps1;
	}
	conn = connect();
	

	
	



function login(url){
	if (conn){
		
		
		new Ajax.Updater('loginbox','./login.php',
			{ 	
				
				method: 'post',
				parameters: { login: $F('login'), password: $F('password')}
			});
		
		$('loginbox').innerHTML='<img src="pic/ajax-loader.gif" style=margin-top:50px;margin-bottom:50px;margin-right:85px;/>  ';
		}
	else	{	//setTimeout('wait1("error_box");',60);
	
				
				new Ajax.Updater('error_box','./error.php',
					{ 	
						method: 'post'
					});
				$('loginbox').innerHTML='<img src="pic/ajax-loader.gif" style=margin-top:50px;margin-bottom:50px;margin-left:85px;/>  ';
				return false;
			}
		//$('error_box').innerHTML='<img src="pic/ajax-loader.gif" style=margin-top:50px;margin-bottom:50px;margin-left:85px;/>  ';
		
		
		}
		


function rf(name){
			$(name).style.border='solid 1px #0099FF';
			$(name).style.background='white';
			$(name).style.height='17px';
			$(name).style.width='71%';
		}
function rb(name){
			$(name).style.border='solid 1px #7F9DB9';
			$(name).style.background='white';
			$(name).style.height='17px';
			$(name).style.width='70.8%';
		}
function rfs(name){
			$(name).style.border='solid 1px #0099FF';
			$(name).style.background='white';
			$(name).style.height='17px';
		}
function rbs(name){
			$(name).style.border='solid 1px #7F9DB9';
			$(name).style.background='white';
			$(name).style.height='17px';
		}		
function vorwahl_country(){
if($('vorland ') != 'select')
{ 
	sas = $F('vorland');
	$('vor_phon').value= sas;

}}		
function doregister(){
	 isok=true;

	if (trim($F('vorname'))!='' && $F('vorname').length<2 ){
		$('vorname-e').innerHTML='نام&nbsp;شما&nbsp;باید&nbsp;بیشتر&nbsp;از&nbsp;2&nbsp;کاراکتر&nbsp;داشته&nbsp;باشد';
		$('vorname').style.border='solid 1px #FF0000';
		$('vorname-e').style.display='';
		isok=false;
		} else {
			$('vorname-e').innerHTML='';
			$('vorname').style.border='solid 1px #00CC00';
			$('vorname-e').style.display='none';
			
			}
	if (trim($F('vorname'))==''){
		$('vorname-e').innerHTML='لطفأ&nbsp;نام&nbsp;خود&nbsp;را&nbsp;وارد&nbsp;کنید';
		$('vorname').style.border='solid 1px #FF0000';
		$('vorname-e').style.display='';
		isok=false;
		} 
		
	if (trim($F('nachname'))!='' && $F('nachname').length<2 ){
		$('nachname-e').innerHTML='نام&nbsp;خانوادگی&nbsp;شما&nbsp;باید&nbsp;بیشتر&nbsp;از&nbsp;2&nbsp;کاراکتر&nbsp;داشته&nbsp;باشد';
		$('nachname').style.border='solid 1px #FF0000';
		$('nachname-e').style.display='';
		isok=false;
		} else {
			$('nachname-e').innerHTML='';
			$('nachname').style.border='solid 1px #00CC00';
			$('nachname-e').style.display='none';
			
			}
	if (trim($F('nachname'))==''){
		$('nachname-e').innerHTML='لطفأ&nbsp;نام&nbsp;خانوادگی&nbsp;خود&nbsp;را&nbsp;وارد&nbsp;کنید';
		$('nachname').style.border='solid 1px #FF0000';
		$('nachname-e').style.display='';
		isok=false;
		} 	
		
		ps=isValidEmail($F('email'))
		if (!ps){
		//$('email_e').innerHTML=' باید تکمیل  شود ';
		isok=false;
		
		} else {
			$('email_e').innerHTML='';
			ps1=chekemail();
			
			if (ps1 && conn){
				isok=false;
				$('email_e').innerHTML='این&nbsp;آدرس&nbsp;ایمیل&nbsp;قبلا&nbsp;در&nbsp;سایت&nbsp;ثبت&nbsp;نام&nbsp;کرده&nbsp;است';
				$('email').style.border='solid 1px #FF0000';
				$('email_e').style.display='';
				} else {
					
					$('email_e').innerHTML='';
					$('email').style.border='solid 1px #00CC00';
					$('email_e').style.display='none';
				
					}
			
			}
			
	if (trim($F('email'))!=trim($F('email_confirm'))){
		$('email_confirm_e').innerHTML='دو&nbsp;آدرس&nbsp;ایمیل&nbsp;یکسان&nbsp;نیستند';
		$('email_confirm').style.border='solid 1px #FF0000';
		$('email_confirm_e').style.display='';
		isok=false;
		} else {
			$('email_confirm_e').innerHTML='';
			$('email_confirm').style.border='solid 1px #00CC00';
			$('email_confirm_e').style.display='none';
		
			}
	if (trim($F('email_confirm'))==''){
		$('email_confirm_e').innerHTML='لطفأ&nbsp;آدرس&nbsp;ایمیل&nbsp;خود&nbsp;را&nbsp;دوباره&nbsp;وارد&nbsp;کنید';
		$('email_confirm').style.border='solid 1px #FF0000';
		$('email_confirm_e').style.display='';
		isok=false;
		} 		
		
	if (trim($F('password_first')) !='' && $F('password_first').length<8 ){
		$('pass_e').innerHTML='کلمه&nbsp;عبور&nbsp;باید&nbsp;بیشتر&nbsp;از&nbsp;8&nbsp;کاراکتر&nbsp;داشته&nbsp;باشد';
		$('password_first').style.border='solid 1px #FF0000';
		$('pass_e').style.display='';
		isok=false;
		} else {
			$('pass_e').innerHTML='';
			$('password_first').style.border='solid 1px #00CC00';
			$('pass_e').style.display='none';
			
			}
	if (trim($F('password_first'))==''){
		$('pass_e').innerHTML='لطفأ&nbsp;کلمه&nbsp;عبور&nbsp;خود&nbsp;را&nbsp;وارد&nbsp;کنید';
		$('password_first').style.border='solid 1px #FF0000';
		$('pass_e').style.display='';
		isok=false;
		} 	
	if (trim($F('phon_city'))=='' || trim($F('phon'))==''){
		$('phon_e').innerHTML='لطفأ&nbsp;کد&nbsp;شهر&nbsp;و&nbsp;شماره&nbsp;تماس&nbsp;را&nbsp;وارد&nbsp;کنید';
		$('phon_city').style.border='solid 1px #FF0000';
		$('phon').style.border='solid 1px #FF0000';
		$('phon_e').style.display='';
		isok=false;
		}	
	else {
			$('phon_e').innerHTML='';
			$('phon').style.border='solid 1px #00CC00';
			$('phon_city').style.border='solid 1px #00CC00';
			$('phon_e').style.display='none';
			
		}
	if ($F('phon_city').charAt(0)=='0' ){
		$('phon_e3').innerHTML='لطفأ&nbsp;0&nbsp;را&nbsp;از&nbsp;جلوی&nbsp;کد&nbsp;شهر&nbsp;بردارید';
		$('phon_city').style.border='solid 1px #FF0000';
		$('phon').style.border='solid 1px #FF0000';
		$('phon_e3').style.display='';
		isok=false;
		}	
	else {
			$('phon_e3').innerHTML='';
			$('phon').style.border='solid 1px #00CC00';
			$('phon_city').style.border='solid 1px #00CC00';
			$('phon_e3').style.display='none';
			
		}	
	if (trim($F('vorland'))=='select'){
		$('phon_e2').innerHTML='لطفأ&nbsp;کد&nbsp;کشور&nbsp;را&nbsp;انتخاب&nbsp;کنید';
		$('vorland').style.border='solid 1px #FF0000';
		$('phon_e2').style.display='';
		isok=false;
		}
	else {
			$('phon_e2').innerHTML='';
			$('vorland').style.border='solid 1px #00CC00';
			$('phon_e2').style.display='none';
			
		}			
	if (trim($F('confirm'))!=trim($F('password_first'))){
		$('confirm_e').innerHTML='دو&nbsp;کلمه&nbsp;عبور&nbsp;یکسان&nbsp;نیستند';
		$('confirm').style.border='solid 1px #FF0000';
		$('confirm_e').style.display='';
		isok=false;
		} else {
			$('confirm_e').innerHTML='';
			$('confirm').style.border='solid 1px #00CC00';
			$('confirm_e').style.display='none';
			
			}
	if (trim($F('confirm'))==''){
		$('confirm_e').innerHTML='لطفأ&nbsp;کلمه&nbsp;عبور&nbsp;خود&nbsp;را&nbsp;دوباره&nbsp;وارد&nbsp;کنید';
		$('confirm_e').style.display='';
		$('confirm').style.border='solid 1px #FF0000';
		isok=false;
		} 
		
	if (!$('accept').checked){		
		$('accept_e').innerHTML='لطفا&nbsp;تیک&nbsp;بزنید';
		
		isok=false;
		} else {
			$('accept_e').innerHTML='';
			
			}
			
	if(isok)
		{
			
		new Ajax.Updater('form_reg','./register_fo.php',
		{ 	
			method: 'post',
			parameters: { vorname: $F('vorname'), nachname: $F('nachname'), email: $F('email'), email_confirm: $F('email_confirm'),
			password_first: $F('password_first'), confirm1: $F('confirm'), accept: $F('accept'),vor_phon: $F('vor_phon'),phon_city: $F('phon_city'),phon: $F('phon')}	
		
		});
		
		function login_reg(){
			if (conn){
				new Ajax.Updater('loginbox','./login-reg.php',
					{ 	
						method: 'post',
						parameters: { email: $F('email'), password_first: $F('password_first')}
					});
				$('loginbox').innerHTML='<img src="pic/ajax-loader.gif" style=margin-top:50px;margin-bottom:50px;margin-right:85px;/>';
				}
		
			}
		login_reg();
		}
		
	else{
			
		}	
}
function send(){
	 isok3=true;
	 isok=true;
	 isok2=true;	
	 error_is=true;
	if (trim($F('sex'))=='select'){
		$('sex-e').innerHTML='لطفأ&nbsp;جنسیت&nbsp;خود&nbsp;را&nbsp;انتخاب&nbsp;نمایید';
		$('sex-e').style.display='';
		isok=false;
		error_is=false;
		
		} else {
			$('sex-e').innerHTML='';
			$('sex-e').style.display='none';
			
			}
	if (trim($F('vorname'))!='' && $F('vorname').length<2 ){
		$('vorname-e').innerHTML='نام&nbsp;شما&nbsp;باید&nbsp;بیشتر&nbsp;از&nbsp;2&nbsp;کاراکتر&nbsp;داشته&nbsp;باشد';
		$('vorname').style.border='solid 1px #FF0000';
		$('vorname-e').style.display='';
		$('name-e').style.display='';
		isok=false;
		error_is=false;
		} else {
			$('vorname-e').innerHTML='';
			$('vorname').style.border='solid 1px #00CC00';
			$('vorname-e').style.display='none';	
			}
	if (trim($F('vorname'))==''){
		$('vorname-e').innerHTML='لطفأ&nbsp;نام&nbsp;خود&nbsp;را&nbsp;وارد&nbsp;کنید';
		$('vorname').style.border='solid 1px #FF0000';
		$('vorname-e').style.display='';
		$('name-e').style.display='';
		isok=false;
		error_is=false;
		} 
		
	if (trim($F('nachname'))!='' && $F('nachname').length<2 ){
		$('nachname-e').innerHTML='نام&nbsp;خانوادگی&nbsp;شما&nbsp;باید&nbsp;بیشتر&nbsp;از&nbsp;2&nbsp;کاراکتر&nbsp;داشته&nbsp;باشد';
		$('nachname').style.border='solid 1px #FF0000';
		$('nachname-e').style.display='';
		$('name-e').style.display='';
		isok=false;
		error_is=false;
		} else {
			$('nachname-e').innerHTML='';
			$('nachname').style.border='solid 1px #00CC00';
			$('nachname-e').style.display='none';

			}
	if (trim($F('nachname'))==''){
		$('nachname-e').innerHTML='لطفأ&nbsp;نام&nbsp;خانوادگی&nbsp;خود&nbsp;را&nbsp;وارد&nbsp;کنید';
		$('nachname').style.border='solid 1px #FF0000';
		$('nachname-e').style.display='';
		$('name-e').style.display='';
		isok=false;
		error_is=false;
		} 	
if (trim($F('day'))=='select'){
		$('day-e').innerHTML='لطفأ&nbsp;روز&nbsp;تولد&nbsp;خود&nbsp;را&nbsp;انتخاب&nbsp;نمایید';
		$('day-e').style.display='';
		$('day-se').innerHTML='*';
		$('day-se').style.display='';
		$('date-e').style.display='';
		isok=false;
		error_is=false;
		} else {
			$('day-e').innerHTML='';
			$('day-e').style.display='none';
			$('day-se').style.display='none';
		
			}

			
if (trim($F('month'))=='select'){
		$('month-e').innerHTML='لطفأ&nbsp;ماه&nbsp;تولد&nbsp;خود&nbsp;را&nbsp;انتخاب&nbsp;نمایید';
		$('month-e').style.display='';
		$('month-se').innerHTML='*';
		$('month-se').style.display='';
		$('date-e').style.display='';
		isok=false;
		error_is=false;
		} else {
			$('month-e').innerHTML='';
			$('month-e').style.display='none';
			$('month-se').style.display='none';
			

			
			}			
if (trim($F('year'))=='select'){
		$('year-e').innerHTML='لطفأ&nbsp;سال&nbsp;تولد&nbsp;خود&nbsp;را&nbsp;انتخاب&nbsp;نمایید';
		$('date-e').style.display='';
		$('year-e').style.display='';
		$('year-se').innerHTML='*';
		$('year-se').style.display='';
	isok=false;
	error_is=false;
		} else {
			$('year-e').innerHTML='';
			$('year-e').style.display='none';
			$('year-se').style.display='none';
			
			
			}			
if (trim($F('bcity'))!='' && $F('bcity').length<2 ){
		$('bcity-e').innerHTML='شهر&nbsp;باید&nbsp;بیشتر&nbsp;از&nbsp;2&nbsp;کاراکتر&nbsp;داشته&nbsp;باشد';
		$('place-e').style.display='';
		$('bcity').style.border='solid 1px #FF0000';
		$('bcity-e').style.display='';
		isok=false;
		error_is=false;
		} else {
			$('bcity-e').innerHTML='';
			$('bcity').style.border='solid 1px #00CC00';
			$('bcity-e').style.display='none';
			
			}
	if (trim($F('bcity'))==''){
		$('bcity-e').innerHTML='لطفأ&nbsp;شهری&nbsp;که&nbsp;در&nbsp;آن&nbsp;متولد&nbsp;شدید&nbsp;را&nbsp;وارد&nbsp;کنید';
		$('bcity').style.border='solid 1px #FF0000';
		$('bcity-e').style.display='';
		$('place-e').style.display='';
		isok=false;
		error_is=false;
		} 
			


if (trim($F('bland'))=='select'){
		$('bland-e').innerHTML='لطفأ&nbsp;کشور&nbsp;محل&nbsp;تولد&nbsp;خود&nbsp;را&nbsp;انتخاب&nbsp;نمایید';
		$('place-e').style.display='';
		$('bland-e').style.display='';
		$('bland-se').innerHTML='*';
		$('bland-se').style.display='';
		isok=false;
		error_is=false;
		} else {
			$('bland-e').innerHTML='';
			$('bland-e').style.display='none';
			$('bland-se').style.display='none';
			
			
			}
if (trim($F('marry'))=='Select'){
		$('marry-e').innerHTML='لطفأ&nbsp;وضعيت&nbsp;تاهل&nbsp;خود&nbsp;را&nbsp;انتخاب&nbsp;نمایید';
		$('marry-e').style.display='';
		$('marry-se').style.display='';
		$('marry-se').innerHTML='*';
		isok=false;
		error_is=false;
		} else {
			$('marry-e').innerHTML='';
			$('marry-e').style.display='none';
			$('marry-se').style.display='none';
			}			
if (trim($F('edu'))=='select'){
		$('edu-e').innerHTML='لطفأ&nbsp;آخرین&nbsp;مدرک&nbsp;تحصیلی&nbsp;خود&nbsp;را&nbsp;انتخاب&nbsp;نمایید';
		$('edu-e').style.display='';
		isok=false;
		error_is=false;
		} else {
			$('edu-e').innerHTML='';
			$('edu-e').style.display='none';
			
			}
		
var getid = document.getElementById('marry');

if(getid.value=='Married')
{
var getidsex = document.getElementById('sex');	
var getidsex_s = document.getElementById('sex_s');	
	if (getidsex.value=='Man' && getidsex_s.value=='Man' || getidsex.value=='Woman' && getidsex_s.value=='Woman' ){
			$('sex_s-e').innerHTML='جنسیت&nbsp;درخواست&nbsp;کننده&nbsp;و&nbsp;همسرش&nbsp;نمیتواند&nbsp;یکی&nbsp;باشد';
			$('sex_s-e').style.display='';
			isok=false;
			error_is=false;
			} else {
				$('sex_s-e').innerHTML='';
				$('sex_s-e').style.display='none';
				
				}
	if (trim($F('sex_s'))=='select'){
		$('sex_s-e').innerHTML='لطفأ&nbsp;جنسیت&nbsp;همسر&nbsp;خود&nbsp;را&nbsp;انتخاب&nbsp;نمایید';
		$('sex_s-e').style.display='';
			isok=false;
			error_is=false;
		
		}
		if (trim($F('vorname_s'))!='' && $F('vorname_s').length<2 ){
			$('vorname_s-e').innerHTML='نام&nbsp;همسر&nbsp;شما&nbsp;باید&nbsp;بیشتر&nbsp;از&nbsp;2&nbsp;کاراکتر&nbsp;داشته&nbsp;باشد';
			$('vorname_s').style.border='solid 1px #FF0000';
			$('vorname_s-e').style.display='';
			$('name_s-e').style.display='';
			isok=false;
			error_is=false;
			} else {
				$('vorname_s-e').innerHTML='';
				$('vorname_s').style.border='solid 1px #00CC00';
				$('vorname_s-e').style.display='none';	
				}
		if (trim($F('vorname_s'))==''){
			$('vorname_s-e').innerHTML='لطفأ&nbsp;نام&nbsp;همسر&nbsp;خود&nbsp;را&nbsp;وارد&nbsp;کنید';
			$('vorname_s').style.border='solid 1px #FF0000';
			$('vorname_s-e').style.display='';
			$('name_s-e').style.display='';
			isok=false;
			error_is=false;
			} 
			
		if (trim($F('nachname_s'))!='' && $F('nachname_s').length<2 ){
	$('nachname_s-e').innerHTML='نام&nbsp;خانوادگی&nbsp;همسر&nbsp;شما&nbsp;باید&nbsp;بیشتر&nbsp;از&nbsp;2&nbsp;کاراکتر&nbsp;داشته&nbsp;باشد';
			$('nachname_s').style.border='solid 1px #FF0000';
			$('nachname_s-e').style.display='';
			$('name_s-e').style.display='';
			isok=false;
			error_is=false;
			} else {
				$('nachname_s-e').innerHTML='';
				$('nachname_s').style.border='solid 1px #00CC00';
				$('nachname_s-e').style.display='none';
	
				}
		if (trim($F('nachname_s'))==''){
			$('nachname_s-e').innerHTML='لطفأ&nbsp;نام&nbsp;خانوادگی&nbsp;همسر&nbsp;خود&nbsp;را&nbsp;وارد&nbsp;کنید';
			$('nachname_s').style.border='solid 1px #FF0000';
			$('nachname_s-e').style.display='';
			$('name_s-e').style.display='';
			isok=false;
			error_is=false;
			} 	
	if (trim($F('day_s'))=='select'){
			$('day_s-e').innerHTML='لطفأ&nbsp;روز&nbsp;تولد&nbsp;همسر&nbsp;خود&nbsp;را&nbsp;انتخاب&nbsp;نمایید';
			$('day_s-e').style.display='';
			$('day_s-se').innerHTML='*';
			$('day_s-se').style.display='';
			$('date_s-e').style.display='';
			isok=false;
			error_is=false;
			} else {
				$('day_s-e').innerHTML='';
				$('day_s-e').style.display='none';
				$('day_s-se').style.display='none';
			
				}	
	if (trim($F('month_s'))=='select'){
			$('month_s-e').innerHTML='لطفأ&nbsp;ماه&nbsp;تولد&nbsp;همسر&nbsp;خود&nbsp;را&nbsp;انتخاب&nbsp;نمایید';
			$('month_s-e').style.display='';
			$('month_s-se').innerHTML='*';
			$('month_s-se').style.display='';
			$('date_s-e').style.display='';
			isok=false;
			error_is=false;
			} else {
				$('month_s-e').innerHTML='';
				$('month_s-e').style.display='none';
				$('month_s-se').style.display='none';
				
	
				
				}			
	if (trim($F('year_s'))=='select'){
			$('year_s-e').innerHTML='لطفأ&nbsp;سال&nbsp;تولد&nbsp;همسر&nbsp;خود&nbsp;را&nbsp;انتخاب&nbsp;نمایید';
			$('date_s-e').style.display='';
			$('year_s-e').style.display='';
			$('year_s-se').innerHTML='*';
			$('year_s-se').style.display='';
		isok=false;
		error_is=false;
			} else {
				$('year_s-e').innerHTML='';
				$('year_s-e').style.display='none';
				$('year_s-se').style.display='none';
				
				
				}			
	if (trim($F('bcity_s'))!='' && $F('bcity_s').length<2 ){
			$('bcity_s-e').innerHTML='شهر&nbsp;باید&nbsp;بیشتر&nbsp;از&nbsp;2&nbsp;کاراکتر&nbsp;داشته&nbsp;باشد';
			$('place_s-e').style.display='';
			$('bcity_s').style.border='solid 1px #FF0000';
			$('bcity_s-e').style.display='';
			isok=false;
			error_is=false;
			} else {
				$('bcity_s-e').innerHTML='';
				$('bcity_s').style.border='solid 1px #00CC00';
				$('bcity_s-e').style.display='none';
				
				}
		if (trim($F('bcity_s'))==''){
	$('bcity_s-e').innerHTML='لطفأ&nbsp;شهری&nbsp;که&nbsp;همسر&nbsp;شما&nbsp;در&nbsp;آن&nbsp;متولد&nbsp;شده&nbsp;را&nbsp;وارد&nbsp;کنید';
			$('bcity_s').style.border='solid 1px #FF0000';
			$('bcity_s-e').style.display='';
			$('place_s-e').style.display='';
			isok=false;
			error_is=false;
			} 
				
	if (trim($F('bland_s'))=='select'){
			$('bland_s-e').innerHTML='لطفأ&nbsp;کشور&nbsp;محل&nbsp;تولد&nbsp;همسر&nbsp;خود&nbsp;را&nbsp;انتخاب&nbsp;نمایید';
			$('place_s-e').style.display='';
			$('bland_s-e').style.display='';
			$('bland_s-se').innerHTML='*';
			$('bland_s-se').style.display='';
			isok=false;
			error_is=false;
			} else {
				$('bland_s-e').innerHTML='';
				$('bland_s-e').style.display='none';
				$('bland_s-se').style.display='none';
				
				
				}					
	if (trim($F('edu_s'))=='select'){
			$('edu_s-e').innerHTML='لطفأ&nbsp;آخرین&nbsp;مدرک&nbsp;تحصیلی&nbsp;همسر&nbsp;خود&nbsp;را&nbsp;انتخاب&nbsp;نمایید';
			$('edu_s-e').style.display='';
			isok=false;
			error_is=false;
			} else {
				$('edu_s-e').innerHTML='';
				$('edu_s-e').style.display='none';
				
				}	
}

var getid_chi = document.getElementById('child');
totaler=false;


for (z=0;z<Math.round($F('child'));z++)
  {
isok2=true;
if(getid_chi.value!='0')
{	
	if (trim($F('sex_ch'+z))=='select'){
		$('sex_ch-e'+z).innerHTML='لطفأ&nbsp;جنسیت&nbsp;فرزند&nbsp;خود&nbsp;را&nbsp;انتخاب&nbsp;نمایید';
		$('sex_ch-e'+z).style.display='';
		isok=false;
		isok2=false;
		isok3=false;
		} else {
			$('sex_ch-e'+z).innerHTML='';
			$('sex_ch-e'+z).style.display='none';
			
			}

		if (trim($F('vorname_ch'+z))!='' && $F('vorname_ch'+z).length<2 ){
			$('vorname_ch-e'+z).innerHTML='نام&nbsp;فرزند&nbsp;شما&nbsp;باید&nbsp;بیشتر&nbsp;از&nbsp;2&nbsp;کاراکتر&nbsp;داشته&nbsp;باشد';
			$('vorname_ch'+z).style.border='solid 1px #FF0000';
			$('vorname_ch-e'+z).style.display='';
			$('name_ch-e'+z).style.display='';
			isok=false;
			isok2=false;
			isok3=false;
			} else {
				$('vorname_ch-e'+z).innerHTML='';
				$('vorname_ch'+z).style.border='solid 1px #00CC00';
				$('vorname_ch-e'+z).style.display='none';	
				}
		if (trim($F('vorname_ch'+z))==''){
			$('vorname_ch-e'+z).innerHTML='لطفأ&nbsp;نام&nbsp;فرزند&nbsp;خود&nbsp;را&nbsp;وارد&nbsp;کنید';
			$('vorname_ch'+z).style.border='solid 1px #FF0000';
			$('vorname_ch-e'+z).style.display='';
			$('name_ch-e'+z).style.display='';
			isok=false;
			isok2=false;
			isok3=false;
			} 
			
		if (trim($F('nachname_ch'+z))!='' && $F('nachname_ch'+z).length<2 ){
$('nachname_ch-e'+z).innerHTML='نام&nbsp;خانوادگی&nbsp;فرزند&nbsp;شما&nbsp;باید&nbsp;بیشتر&nbsp;از&nbsp;2&nbsp;کاراکتر&nbsp;داشته&nbsp;باشد';
			$('nachname_ch'+z).style.border='solid 1px #FF0000';
			$('nachname_ch-e'+z).style.display='';
			$('name_ch-e'+z).style.display='';
			isok=false;
			isok2=false;
			isok3=false;
			} else {
				$('nachname_ch-e'+z).innerHTML='';
				$('nachname_ch'+z).style.border='solid 1px #00CC00';
				$('nachname_ch-e'+z).style.display='none';
	
				}
		if (trim($F('nachname_ch'+z))==''){
			$('nachname_ch-e'+z).innerHTML='لطفأ&nbsp;نام&nbsp;خانوادگی&nbsp;فرزند&nbsp;خود&nbsp;را&nbsp;وارد&nbsp;کنید';
			$('nachname_ch'+z).style.border='solid 1px #FF0000';
			$('nachname_ch-e'+z).style.display='';
			$('name_ch-e'+z).style.display='';
			isok=false;
			isok2=false;
			isok3=false;
			} 	
			
				
	if (trim($F('day_ch'+z))=='select'){
			$('day_ch-e'+z).innerHTML='لطفأ&nbsp;روز&nbsp;تولد&nbsp;فرزند&nbsp;خود&nbsp;را&nbsp;انتخاب&nbsp;نمایید';
			$('day_ch-e'+z).style.display='';
			$('day_ch-se'+z).innerHTML='*';
			$('day_ch-se'+z).style.display='';
			$('date_ch-e'+z).style.display='';
			isok=false;
			isok2=false;
			isok3=false;
			} else {
				$('day_ch-e'+z).innerHTML='';
				$('day_ch-e'+z).style.display='none';
				$('day_ch-se'+z).style.display='none';
			
				}	
	if (trim($F('month_ch'+z))=='select'){
			$('month_ch-e'+z).innerHTML='لطفأ&nbsp;ماه&nbsp;تولد&nbsp;فرزند&nbsp;خود&nbsp;را&nbsp;انتخاب&nbsp;نمایید';
			$('month_ch-e'+z).style.display='';
			$('month_ch-se'+z).innerHTML='*';
			$('month_ch-se'+z).style.display='';
			$('date_ch-e'+z).style.display='';
			isok=false;
			isok2=false;
			isok3=false;
			} else {
				$('month_ch-e'+z).innerHTML='';
				$('month_ch-e'+z).style.display='none';
				$('month_ch-se'+z).style.display='none';
				
	
				
				}			
	if (trim($F('year_ch'+z))=='select'){
			$('year_ch-e'+z).innerHTML='لطفأ&nbsp;سال&nbsp;تولد&nbsp;فرزند&nbsp;خود&nbsp;را&nbsp;انتخاب&nbsp;نمایید';
			$('year_ch-e'+z).style.display='';
			$('year_ch-se'+z).innerHTML='*';
			$('year_ch-se'+z).style.display='';
			$('date_ch-e'+z).style.display='';
		isok=false;
		isok2=false;
		isok3=false;
			} else {
				$('year_ch-e'+z).innerHTML='';
				$('year_ch-e'+z).style.display='none';
				$('year_ch-se'+z).style.display='none';
				
				
				}	
				
var d = new Date();
var dat = d.getUTCFullYear()-20;

		if (trim($F('month_ch'+z))<=10 && trim($F('year_ch'+z))<=dat){		
			$('child_bday-e'+z).innerHTML='فرزند&nbsp;شما&nbsp;بالای&nbsp;21&nbsp;سال&nbsp;میباشد&nbsp;و&nbsp;اجازه&nbsp;شرکت&nbsp;در&nbsp;قرعه&nbsp;کشی&nbsp;به&nbsp;همراه&nbsp;والدین&nbsp;را&nbsp;ندارد<br>اما&nbsp;میتواند&nbsp;جداگانه&nbsp;در&nbsp;قرعه&nbsp;کشی&nbsp;شرکت&nbsp;کند&nbsp;و&nbsp;باید&nbsp;به&nbsp;صورت&nbsp;جداگانه&nbsp;در&nbsp;سایت&nbsp;ثبت&nbsp;نام&nbsp;نماید';
			$('child_bday-e'+z).style.display='';
			$('day_ch-se'+z).innerHTML='*';
			$('day_ch-se'+z).style.display='';	
			$('month_ch-se'+z).innerHTML='*';
			$('month_ch-se'+z).style.display='';
			$('year_ch-se'+z).innerHTML='*';
			$('year_ch-se'+z).style.display='';	
			$('date_ch-e'+z).style.display='';			
			isok=false;
			isok2=false;
			isok3=false;
		}
		else {
			
				$('child_bday-e'+z).innerHTML='';
				/*$('child_bday-e'+z).style.display='none';
				$('day_ch-se'+z).style.display='none';
				$('month_ch-se'+z).style.display='none';
				$('year_ch-se'+z).style.display='none';
				$('date_ch-e'+z).style.display='none';*/
				
		   }			
	if (trim($F('bcity_ch'+z))!='' && $F('bcity_ch'+z).length<2 ){
			$('bcity_ch-e'+z).innerHTML='شهر&nbsp;باید&nbsp;بیشتر&nbsp;از&nbsp;2&nbsp;کاراکتر&nbsp;داشته&nbsp;باشد';
			$('bcity_ch-e'+z).style.display='';
			$('bcity_ch'+z).style.border='solid 1px #FF0000';
			$('bcity_ch-e'+z).style.display='';
			isok=false;
			isok2=false;
			isok3=false;
			} else {
				$('bcity_ch-e'+z).innerHTML='';
				$('bcity_ch'+z).style.border='solid 1px #00CC00';
				$('bcity_ch-e'+z).style.display='none';
				
				}
		if (trim($F('bcity_ch'+z))==''){
			$('bcity_ch-e'+z).innerHTML='لطفأ&nbsp;شهری&nbsp;که&nbsp;فرزند&nbsp;شما&nbsp;در&nbsp;آن&nbsp;متولد&nbsp;شده&nbsp;را&nbsp;وارد&nbsp;کنید';
			$('bcity_ch'+z).style.border='solid 1px #FF0000';
			$('bcity_ch-e'+z).style.display='';
			$('place_ch-e'+z).style.display='';
			isok=false;
			isok2=false;
			isok3=false;
			} 
				
	if (trim($F('bland_ch'+z))=='select'){
			$('bland_ch-e'+z).innerHTML='لطفأ&nbsp;کشور&nbsp;محل&nbsp;تولد&nbsp;فرزند&nbsp;خود&nbsp;را&nbsp;انتخاب&nbsp;نمایید';
			$('bland_ch-e'+z).style.display='';
			$('bland_ch-se'+z).innerHTML='*';
			$('bland_ch-se'+z).style.display='';
			$('place_ch-e'+z).style.display='';
			isok=false;
			isok2=false;
			isok3=false;
			} else {
				$('bland_ch-e'+z).innerHTML='';
				$('bland_ch-e'+z).style.display='none';
				$('bland_ch-se'+z).style.display='none';
				
				
				}					

}

texterr='';
texterrfehl='';
if(isok2 == false){
totaler=true;
kpc[z]=1;	

} else {
	kpc[z]=0;	
	totaler=false;
	}


  }




	
for (wz=0;wz<Math.round($F('child'));wz++)
  {	

	thetab=Math.round(wz);
	theaction="child_tab("+thetab+")";
	 if (kpc[wz]==1){texterr=texterr+"<link><a style='text-decoration:none;color:#006699;' href='javascript:void(0);' onclick='"+theaction+"'><span dir='rtl'>فرزند&nbsp;<span dir='rtl'>"+(Math.round(wz+1))+"</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></link>"}
	
	// alert(texterr);
	}	
if (isok3 != true){	
$('child_hinweis').style.display='';
	$('child_hinweis_e').innerHTML='<div dir="rtl" align="right" style="text-align:right; margin-right=25px;">فرم فرزندانی که شماره آنها در زیر درج شده است ایراد دارند. لطفأ فرم را کنترل کرده و ایرادها را بر طرف نمایید<img style="margin:8px;" align="absmiddle" src="pic/ch_ac.gif"/><div align="right" dir="rtl"  style="margin-right:20px;">'+texterr+'</div></div>';
	$('child_hinweis_e').style.display='';
	
}
//else { $('child_hinweis').style.display='none'; }


if (trim($F('tel'))!='' && $F('tel').length<2 ){
		$('tel-e').innerHTML='تلفن&nbsp;باید&nbsp;بیشتر&nbsp;از&nbsp;2&nbsp;کاراکتر&nbsp;داشته&nbsp;باشد';
		$('tel').style.border='solid 1px #FF0000';
		$('tel-e').style.display='';
		$('add-up').style.display='';
		isok=false;
		error_is=false;
		} else {
			$('tel-e').innerHTML='';
			$('tel').style.border='solid 1px #00CC00';
			$('tel-e').style.display='none';
			
			
			}
	if (trim($F('tel'))==''){
		$('tel-e').innerHTML='لطفأ&nbsp;شماره&nbsp;تلفن&nbsp;خود&nbsp;را&nbsp;وارد&nbsp;کنید';
		$('tel').style.border='solid 1px #FF0000';
		$('tel-e').style.display='';
		$('add-up').style.display='';
		isok=false;
		error_is=false;
		} 	
if (trim($F('str'))!='' && $F('str').length<5 ){
		$('str-e').innerHTML='آدرس&nbsp;خيابان&nbsp;و&nbsp;پلاک&nbsp;باید&nbsp;بیشتر&nbsp;از&nbsp;5&nbsp;کاراکتر&nbsp;داشته&nbsp;باشد';
		$('str').style.border='solid 1px #FF0000';
		$('add-up').style.display='';
		$('str-e').style.display='';
		isok=false;
		error_is=false;
		} else {
			$('str-e').innerHTML='';
			$('str').style.border='solid 1px #00CC00';
			$('str-e').style.display='none';
			
			
			}
	if (trim($F('str'))==''){
		$('str-e').innerHTML='لطفأ&nbsp;آدرس&nbsp;خيابان&nbsp;و&nbsp;پلاک&nbsp;خود&nbsp;را&nbsp;وارد&nbsp;کنید';
		$('str').style.border='solid 1px #FF0000';
		$('add-up').style.display='';
		$('str-e').style.display='';
		isok=false;
		error_is=false;
		}
if (trim($F('plz'))!='' && $F('plz').length<3 ){
		$('plz-e').innerHTML='کد&nbsp;پستي&nbsp;باید&nbsp;بیشتر&nbsp;از&nbsp;3&nbsp;کاراکتر&nbsp;داشته&nbsp;باشد';
		$('plz').style.border='solid 1px #FF0000';
		$('add-up').style.display='';
		$('plz-e').style.display='';
		isok=false;
		error_is=false;
		} else {
			$('plz-e').innerHTML='';
			$('plz').style.border='solid 1px #00CC00';
			$('plz-e').style.display='none';
			
			
			}
	if (trim($F('plz'))==''){
		$('plz-e').innerHTML='لطفأ&nbsp;کد&nbsp;پستي&nbsp;خود&nbsp;را&nbsp;وارد&nbsp;کنید';
		$('plz').style.border='solid 1px #FF0000';
		$('plz-e').style.display='';
		$('add-up').style.display='';
		isok=false;
		error_is=false;
		}		
		
if (trim($F('acity'))!='' && $F('acity').length<2 ){
		$('acity-e').innerHTML='شهر&nbsp;باید&nbsp;بیشتر&nbsp;از&nbsp;2&nbsp;کاراکتر&nbsp;داشته&nbsp;باشد';
		$('acity').style.border='solid 1px #FF0000';
		$('add-up').style.display='';
		$('acity-e').style.display='';
		isok=false;
		error_is=false;
		} else {
			$('acity-e').innerHTML='';
			$('acity').style.border='solid 1px #00CC00';
			$('acity-e').style.display='none';
			
			
			}
	if (trim($F('acity'))==''){
		$('acity-e').innerHTML='لطفأ&nbsp;شهر&nbsp;محل&nbsp;سکونت&nbsp;خود&nbsp;را&nbsp;وارد&nbsp;کنید';
		$('acity').style.border='solid 1px #FF0000';
		$('add-up').style.display='';
		$('acity-e').style.display='';
		isok=false;
		error_is=false;
		}
if (trim($F('aland'))=='select'){
		$('aland-e').innerHTML='لطفأ&nbsp;کشور&nbsp;محل&nbsp;سکونت&nbsp;خود&nbsp;را&nbsp;انتخاب&nbsp;نمایید';
		$('aland-se').innerHTML='*';
		$('aland-se').style.display='';
		$('add-up').style.display='';
		$('aland-e').style.display='';
		error_is=false;
		isok=false;
		} else {
			$('aland-e').innerHTML='';
			$('aland-e').style.display='none';
			$('aland-se').style.display='none';
			
			
			}
/*			
if (trim($F('bland_native'))== 'select' && trim($F('bland'))=='76'||trim($F('bland'))=='124'||trim($F('bland'))=='156'||trim($F('bland'))=='170'||trim($F('bland'))=='214'||trim($F('bland'))=='222'||trim($F('bland'))=='826'||trim($F('bland'))=='332'||trim($F('bland'))=='356'||trim($F('bland'))=='388'||trim($F('bland'))=='484'||trim($F('bland'))=='586'||trim($F('bland'))=='616'||trim($F('bland'))=='608'||trim($F('bland'))=='604'||trim($F('bland'))=='643'||trim($F('bland'))=='410'||trim($F('bland'))=='704'){
		$('place_native-e').style.display='';
		$('bland_nat_e').style.display='';
		$('bland_nat_e').innerHTML='Sie sind in einem der ausgeschlossenen Länder (z. B. Pakistan, England etc.) geboren. Wenn Ihr Ehepartner oder Ihre Eltern aber aus einem anderen Land stammen, so wählen Sie dieses bitte links, sonst können Sie nicht teilnehmen.';
		$('bland-se').innerHTML='*';
		$('bland-se').style.display='';
		$('bland_native_se').innerHTML='*';
		$('bland_native_se').style.display='';
		$('bland-e').innerHTML='native land wählen.';
		$('bland-e').style.display='';
		$('place-e').style.display='';
		isok=false;
		error_is=false;
		
			 
		} 
		else
		{
			$('place_native-e').style.display='none';
			$('bland_nat_e').style.display='none';
			$('bland-se').style.display='none';
		}*/
		
			
if($F('marry')=='Unmarried' || $F('marry')=='Divorced' || $F('marry')=='Widowed' || $F('marry')=='Select'){
check_land_1();
if (trim($F('bland_native'))== '' && !checkland1){
		$('place_native-e').style.display='';
		$('bland_nat_e').style.display='';
		$('bland_nat_e').innerHTML='شما در یکی از کشورهای متولد شدید که اجازه شرکت در قرعه کشی را ندارد ( برای مثال انگلیس یا کانادا). اگر همسر شما یا یکی از والدینتون در کشور دیگه ای متولد شدند که اجازه شرکت در قرعه کشی را دارد لطفأ آن کشور را در سمت راست به عنوان کشور دوم انتخاب کنید در غیر این صورت اجازه شرکت در قرعه کشی را ندارید';
		$('bland-se').innerHTML='*';
		$('bland_native_se').style.display='';

		$('place-e').style.display='';		
		$('bland-se').style.display='';
		$('bland_native_se').innerHTML='*';
		$('bland_se_f_na').style.display='';
		$('bland_se_f_na').innerHTML='*';		
		$('bland_w-e').innerHTML='لطفأ&nbsp;کشور&nbsp;دوم&nbsp;را&nbsp;انتخاب&nbsp;نمایید';
		$('bland_w-e').style.display='';
		isok=false;
		error_is=false;
		 
	} 
		else
		{
			$('place_native-e').style.display='';
			$('bland_nat_e').style.display='none';
			$('bland-se').style.display='none';
			$('bland_native_se').style.display='none';
/*			$('bland_w-e').style.display='none';
			$('bland_se_f_na').style.display='none';*/
			
		}
					
		if(trim($F('bland_native'))!= '' )
			{			
				$('bland_nat_er').style.display='';
				$('bland_nat_er').innerHTML='کشور&nbsp;دوم&nbsp;با&nbsp;موفقیت&nbsp;انتخاب&nbsp;شد';
				$('bland_w-e').style.display='none';
				$('bland_se_f_na').style.display='none';
				
			}
	}
if($F('marry')=='Married'){
check_land_1();
check_land_2();	
	if (!checkland1 && !checkland2 && (trim($F('bland_native')) == '' || trim($F('bland_native_spo')) == 'select' )){
		
		$('place_native-e').style.display='';
		
		$('place_native_se-e').style.display='';
		
		$('bland_nat_e').style.display='';
		$('bland_nat_e').innerHTML='شما در یکی از کشورهای متولد شدید که اجازه شرکت در قرعه کشی را ندارد ( برای مثال انگلیس یا کانادا). اگر همسر شما یا یکی از والدینتون در کشور دیگه ای متولد شدند که اجازه شرکت در قرعه کشی را دارد لطفأ آن کشور را در سمت راست به عنوان کشور دوم انتخاب کنید در غیر این صورت اجازه شرکت در قرعه کشی را ندارید';
		
		$('bland_nat_se_e').style.display='';
		$('bland_nat_se_e').innerHTML='همسر شما در یکی از کشورهایی متولد شده است که اجازه شرکت در قرعه کشی را ندارد ( برای مثال انگلیس یا کانادا). اگر شما یا یکی از والدین همسرتون در کشور دیگه ای متولد شدند که اجازه شرکت در قرعه کشی را دارد لطفأ آن کشور را در سمت راست به عنوان کشور دوم انتخاب کنید در غیر این صورت اجازه شرکت در قرعه کشی را ندارید!';
		
if(trim($F('bland_native')) == '' && !checkland1 && !checkland2)
		{
			$('bland_w-e').style.display='';
			$('bland_se_f_na').style.display='';
			$('bland_se_f_na').innerHTML='*';		
			$('bland_w-e').innerHTML='لطفأ&nbsp;کشور&nbsp;دوم&nbsp;را&nbsp;انتخاب&nbsp;نمایید';
			isok=false;
			error_is=false;
		}

if(trim($F('bland_native_spo')) == 'select' && !checkland1 && !checkland2)
		{
			
			$('bland_se_f_na_s').innerHTML='*';		
			$('bland_w-e_s').innerHTML='لطفأ&nbsp;کشور&nbsp;دوم&nbsp;را&nbsp;انتخاب&nbsp;نمایید';
			$('bland_w-e_s').style.display='';
			$('bland_se_f_na_s').style.display='';
		}
		
		$('bland_native_se').innerHTML='*';
		$('bland_native_se').style.display='';
		
		$('bland_native_spo_se').innerHTML='*';
		$('bland_native_spo_se').style.display='';		
		
		$('place-e').style.display='';
		
		$('bland-se').innerHTML='*';
		$('bland-se').style.display='';
				
		$('place_s-e').style.display='';
		
/*		$('bland_se_f_na').style.display='';
		$('bland_se_f_na').innerHTML='*';		
		$('bland_w-e').innerHTML='native land wählen.';
		$('bland_w-e').style.display='';*/
		
		isok=false;
		error_is=false;
		
			 
		} 	
	
	else
		{	
			$('bland_w-e').style.display='none';
			$('bland_se_f_na').style.display='none';
			$('bland_native_spo_se').style.display='none';
			$('bland_nat_se_e').style.display='none';
			$('bland_nat_e').style.display='none';
			$('bland-se').style.display='none';
			$('bland_native_se').style.display='none';
			
			
			
		}	
		
		if($F('bland_native')!= '' )
			{			
				$('bland_nat_er').style.display='';
				$('bland_nat_er').innerHTML='کشور&nbsp;دوم&nbsp;با&nbsp;موفقیت&nbsp;انتخاب&nbsp;شد';
				$('bland_nat_e').style.display='none';
				$('bland-se').style.display='none';
				$('bland_native_se').style.display='none';
				$('bland_w-e').style.display='none';
				$('bland_se_f_na').style.display='none';				
			}
		if($F('bland_native_spo')!= 'select' )
			{			
				$('bland_nat_se_er').style.display='';
				$('bland_nat_se_er').innerHTML='کشور&nbsp;دوم&nbsp;با&nbsp;موفقیت&nbsp;انتخاب&nbsp;شد';
				$('bland_native_spo_se').style.display='none';
				$('bland_nat_se_e').style.display='none';
				$('bland_w-e_s').style.display='none';
				$('bland_se_f_na_s').style.display='none';
				
			}			
			

	}	
if (trim($F('bland'))=='select'){
		$('bland-e').innerHTML='لطفأ&nbsp;کشور&nbsp;محل&nbsp;تولد&nbsp;خود&nbsp;را&nbsp;انتخاب&nbsp;نمایید';
		$('place-e').style.display='';
		$('bland-e').style.display='';
		$('bland-se').innerHTML='*';
		$('bland-se').style.display='';

		
		isok=false;
		error_is=false;
		} else {
			$('bland-e').innerHTML='';
			$('bland-e').style.display='none';
			$('bland-se').style.display='none';
			
			
	}	
/*if (trim($F('bland'))!='76'||trim($F('bland'))!='124'||trim($F('bland'))!='156'||trim($F('bland'))!='170'||trim($F('bland'))!='214'||trim($F('bland'))!='222'||trim($F('bland'))!='826'||trim($F('bland'))!='332'||trim($F('bland'))!='356'||trim($F('bland'))!='388'||trim($F('bland'))!='484'||trim($F('bland'))!='586'||trim($F('bland'))!='616'||trim($F('bland'))!='608'||trim($F('bland'))!='604'||trim($F('bland'))!='643'||trim($F('bland'))!='410'||trim($F('bland'))!='704'){
		$('bland_native').value = 'select';

}	*/
			
	if (error_is == false ){	

$('fehl_hinweis').style.display='';
	$('fehl_hinweis_e').innerHTML='<div dir=rtl style="text-align:right;margin-right=30px; padding:15px 20px 0px 0px ;list-style:none; float:right; display:block;">لطفأ فیلد هایی که به رنگ قرمز نشان داده شد ه اند را کنترل کرده و ایرادها را بر طرف نمایید<img style="margin-right:10px;" align="absmiddle" src="pic/ch_ac.gif"/></div>';
	$('fehl_hinweis_e').style.display='';
	scroll(0,0);
	
	}
	else {  $('fehl_hinweis_e').style.display='none';
			$('fehl_hinweis').style.display='none';}
			
if(isok)
		{
$('send_hide').style.display='none';			
		sex_ch=new Array();
		vorname_ch=new Array();
		nachname_ch=new Array();
		day_ch=new Array();
		month_ch=new Array();
		year_ch=new Array();
		bcity_ch=new Array();
		bland_ch=new Array();
		id_ch=new Array();
		pso=new Array();
			for (ws=0;ws<Math.round($F('child'));ws++){
				sex_ch[ws]= $F('sex_ch'+ws);
				vorname_ch[ws]= $F('vorname_ch'+ws);
				nachname_ch[ws]= $F('nachname_ch'+ws);
				day_ch[ws]= $F('day_ch'+ws);
				month_ch[ws]= $F('month_ch'+ws);
				year_ch[ws]= $F('year_ch'+ws);
				bcity_ch[ws]= $F('bcity_ch'+ws);
				bland_ch[ws]= $F('bland_ch'+ws);
				id_ch[ws]= $F('id_ch'+ws);
			}	

			var box_accept_form=window.confirm("آیا اطلاعات وارد شده ذخیره شوند ؟")
			if(box_accept_form==true){document.form_up.submit();}
			else if(box_accept_form==false){ $('send_hide').style.display=''; } 			
		
		}
		
}	
/*new Ajax.Updater('form_pro','./profile_up.php',
		{ 	
			method: 'post',
			parameters: { vorname: $F('vorname'), nachname: $F('nachname'), day: $F('day'), month: $F('month'),
			year: $F('year'), bcity: $F('bcity'), bland_native: $F('bland_native'), bland: $F('bland'), edu: $F('edu'), 
			marry: $F('marry'),	child: $F('child'),	tel: $F('tel'), mobi: $F('mobi'), str: $F('str'), plz: $F('plz'), acity: $F('acity'),
			astate: $F('astate'),aland: $F('aland'), sex: $F('sex'), sex_s: $F('sex_s'),vorname_s: $F('vorname_s'), 
			nachname_s: $F('nachname_s'),day_s: $F('day_s'), month_s: $F('month_s'),year_s: $F('year_s'), bcity_s: $F('bcity_s'),
			bland_s: $F('bland_s'),edu_s: $F('edu_s'), sex_ch: sex_ch.toString(),vorname_ch: vorname_ch.toString(), 
			nachname_ch: nachname_ch.toString(),day_ch: day_ch.toString(), month_ch: month_ch.toString(),year_ch: year_ch.toString(), 
			bcity_ch: bcity_ch.toString(), bland_ch:bland_ch.toString()}	
		
		});*/
function delete_s(url){
var box_del_s=window.confirm("آیا مطمئن هستید که میخواهید فرم همسر خود را پاک کنید ؟")

if(box_del_s==true){ 	
	new Ajax.Updater('form_pro','./delete_s.php',
		{ 	
			method: 'post'
		}); 	
		
	} 
else if(box_del_s==false){ } 


	}
	
function delete_ch(url){


var box_del_ch=window.confirm("آیا مطمئن هستید که میخواهید فرم این فرزند را پاک کنید ؟")
if(box_del_ch==true){ 

	new Ajax.Updater('form_pro','./delete_ch.php',
			{ 	
				method: 'post',
				parameters: { url: url}
			});
	} 
else if(box_del_ch==false){ } 

} 

function chekemail2(){
	myurl='checkmail2.php?type=2&email='+$F('email');
	new Ajax.Request(myurl,{method: 'get',asynchronous:false,onSuccess:function(transport){
															
		 if(transport.responseText=='no'){																																					
				myps1=false;
				
			return false;
			}	else {
																											
				myps1=true;
				return true;
				
			}																				
																										
		 }});
	return myps1;
	}

function doaccount(){
	 isok=true;

	if (trim($F('vorname'))!='' && $F('vorname').length<2 ){
		$('vorname-e').innerHTML='نام&nbsp;شما&nbsp;باید&nbsp;بیشتر&nbsp;از&nbsp;2&nbsp;کاراکتر&nbsp;داشته&nbsp;باشد';
		$('vorname').style.border='solid 1px #FF0000';
		$('vorname-e').style.display='';
		isok=false;
		} else {
			$('vorname-e').innerHTML='';
			$('vorname').style.border='solid 1px #00CC00';
			$('vorname-e').style.display='none';
			
			}
	if (trim($F('vorname'))==''){
		$('vorname-e').innerHTML='لطفأ&nbsp;نام&nbsp;خود&nbsp;را&nbsp;وارد&nbsp;کنید';
		$('vorname').style.border='solid 1px #FF0000';
		$('vorname-e').style.display='';
		isok=false;
		} 
		
	if (trim($F('nachname'))!='' && $F('nachname').length<2 ){
		$('nachname-e').innerHTML='نام&nbsp;خانوادگی&nbsp;شما&nbsp;باید&nbsp;بیشتر&nbsp;از&nbsp;2&nbsp;کاراکتر&nbsp;داشته&nbsp;باشد';
		$('nachname').style.border='solid 1px #FF0000';
		$('nachname-e').style.display='';
		isok=false;
		} else {
			$('nachname-e').innerHTML='';
			$('nachname').style.border='solid 1px #00CC00';
			$('nachname-e').style.display='none';
			
			}
	if (trim($F('nachname'))==''){
		$('nachname-e').innerHTML='لطفأ&nbsp;نام&nbsp;خانوادگی&nbsp;خود&nbsp;را&nbsp;وارد&nbsp;کنید';
		$('nachname').style.border='solid 1px #FF0000';
		$('nachname-e').style.display='';
		isok=false;
		} 	
		
		ps=isValidEmail($F('email'))
		if (!ps){
		//$('email_e').innerHTML=' باید تکمیل  شود ';
		isok=false;
		
		} else {
			$('email_e').innerHTML='';
			ps1=chekemail2();
			
			if (ps1 && conn){
				isok=false;
				$('email_e').innerHTML='این&nbsp;آدرس&nbsp;ایمیل&nbsp;قبلا&nbsp;در&nbsp;سایت&nbsp;ثبت&nbsp;نام&nbsp;کرده&nbsp;است';
				$('email').style.border='solid 1px #FF0000';
				$('email_e').style.display='';
				} else {
					
					$('email_e').innerHTML='';
					$('email').style.border='solid 1px #00CC00';
					$('email_e').style.display='none';
				
					}
			
			}
			
	if (trim($F('email'))!=trim($F('email_confirm'))){
		$('email_confirm_e').innerHTML='دو&nbsp;آدرس&nbsp;ایمیل&nbsp;یکسان&nbsp;نیستند';
		$('email_confirm').style.border='solid 1px #FF0000';
		$('email_confirm_e').style.display='';
		isok=false;
		} else {
			$('email_confirm_e').innerHTML='';
			$('email_confirm').style.border='solid 1px #00CC00';
			$('email_confirm_e').style.display='none';
		
			}
	if (trim($F('email_confirm'))==''){
		$('email_confirm_e').innerHTML='لطفأ&nbsp;آدرس&nbsp;ایمیل&nbsp;خود&nbsp;را&nbsp;دوباره&nbsp;وارد&nbsp;کنید';
		$('email_confirm').style.border='solid 1px #FF0000';
		$('email_confirm_e').style.display='';
		isok=false;
		} 		
		
	if ((trim($F('password_first')) !='' && $F('password_first').length<8) && $F('password_first').length>0 ){
		$('pass_e').innerHTML='کلمه&nbsp;عبور&nbsp;باید&nbsp;بیشتر&nbsp;از&nbsp;8&nbsp;کاراکتر&nbsp;داشته&nbsp;باشد';
		$('password_first').style.border='solid 1px #FF0000';
		$('pass_e').style.display='';
		isok=false;
		} else {
			$('pass_e').innerHTML='';
			$('password_first').style.border='solid 1px #00CC00';
			$('pass_e').style.display='none';
			
			}
	/*if (trim($F('password_first'))==''){
		$('pass_e').innerHTML='Das Feld Password ist leer.';
		$('password_first').style.border='solid 1px #FF0000';
		$('pass_e').style.display='';
		isok=false;
		}*/ 	
		
	if (trim($F('confirm'))!=trim($F('password_first'))){
		$('confirm_e').innerHTML='دو&nbsp;کلمه&nbsp;عبور&nbsp;یکسان&nbsp;نیستند';
		$('confirm').style.border='solid 1px #FF0000';
		$('confirm_e').style.display='';
		isok=false;
		} else {
			$('confirm_e').innerHTML='';
			$('confirm').style.border='solid 1px #00CC00';
			$('confirm_e').style.display='none';
			
			}
	/*if (trim($F('confirm'))==''){
		$('confirm_e').innerHTML='Das Feld Password-wiederholen ist leer.';
		$('confirm_e').style.display='';
		$('confirm').style.border='solid 1px #FF0000';
		isok=false;
		} */
		
			
	if(isok)
		{
			
		new Ajax.Updater('form_reg','./account-fo.php',
		{ 	
			method: 'post',
			parameters: { vorname: $F('vorname'), nachname: $F('nachname'), email: $F('email'), email_confirm: $F('email_confirm'),
			password_first: $F('password_first'), confirm1: $F('confirm')}	
		
		});
		
	function login_reg(){
			if (conn){
				
				new Ajax.Updater('loginbox','./login-reg.php',
					{ 	
						method: 'post',
						parameters: { email: $F('email'), password_first: $F('password_first')}
					});
				
		
				}
			}
			
		login_reg();
		}
		
	else{
			
		}	
}

function photo_upload_per(person,target){
as = document.body.offsetHeight;
asd = document.body.offsetWidth;
$('waitforup').style.width=asd+'px';
$('waitforup').style.height=as+'px';

$('waitforup').show(); 
$('wbox').show();
asd = document.forms[person].target;
document.forms[person].submit();

}

function pic_show(id){


document.getElementById('hide_fo'+id).style.display="";	
document.getElementById('hide_change'+id).style.display="none";	
document.getElementById('mess_2'+id).style.display="none";	
document.getElementById('mess_3'+id).style.display="";
}
/*function get_price(pack_name,id,ids){

if(pack_name == 'singlechane'){



	$(ids).style.display="";	
	
	new Ajax.Updater(ids,'./get_order.php',
		{ 	
			method: 'post',
			parameters: { id: $F(id)}
			
		} 	
		
		);
	
	}
	
if(pack_name == 'doublechane'){

	$(ids).style.display="";	
	
	new Ajax.Updater(ids,'./get_order.php',
		{ 	
			method: 'post',
			parameters: { id: $F(id)}
			
		} 	
		
		);
	
	}
}*/



var pak;
var total = 0;
var eltern;
var aktiv;
var wins;
var wind;
var gesamt;
var total_el = 0;
var rad_inp;



function testmai(id){
			$(id).style.display="";
			
			
}
function testo_xmai(id){
			$(id).style.display="none";
			
			
}	





function pol(id,pri){
	kk = $('polv').innerHTML= pri;
	
	zz = $('check').value = 'yes';
	eltern = 'yes';
	total_price(kk,pri);
	$('dont_choose').style.display="none";
}	

function pol_ki(id,pri,i,pris,id_chi){
	rad_inp = id;	
	$('edu_ch'+i).style.display="";
	ww = $('pol'+i).innerHTML = pri;
	rr = $('polv').innerHTML;
	$('check_'+i).value = 'yes';
	id_kind = $('chil_'+i).value = id_chi;
	total_price(i,pri,ww,id,rr);
	$('dont_choose_ch'+i).style.display="none";
	$('pol'+i).style.display="";



}

function total_price(n,pri,ww,id,rr){
	
	if(id){ 
			aktiv = 'yes';
			if(ww == ww && wins == 'ok' ){
					total = Math.round(total)-Math.round($('h_price'+n).value);
			}	
			if(ww == ww ){
					total = Math.round(total)+Math.round(ww);
					gesamt = total;
					$('h_price'+n).value = pri; 
					wins = 'ok';
			}
												   
			$('pol').innerHTML = 'قیمت&nbsp;کل&nbsp;'+total+'&nbsp;تومان&nbsp;';	
			tot_preis = $('pol_tot').value = total;
	}
		
	if(eltern == 'yes' && aktiv != 'yes'){ 
			if($('polv').innerHTML == $('polv').innerHTML && wind == 'ok' ){
					total_el = Math.round(total_el)-Math.round($('h_price').value);
			}	
			if($('polv').innerHTML == $('polv').innerHTML){
				total_el = Math.round(total_el)+Math.round($('polv').innerHTML);
				wind = 'ok';
				$('h_price').value = pri; 
			}
			$('pol').innerHTML = 'قیمت&nbsp;کل&nbsp;'+total_el+'&nbsp;تومان&nbsp;';
			tot_preis2 = $('pol_tot').value = total_el;
	}
	if(eltern == 'yes' && aktiv == 'yes'){  
			if($('polv').innerHTML == $('polv').innerHTML){
					total_el = Math.round(gesamt)+Math.round($('polv').innerHTML);
					$('h_price').value = pri; 
			}
			$('pol').innerHTML = 'قیمت&nbsp;کل&nbsp;'+total_el+'&nbsp;تومان&nbsp;';	
			tot_preis3 = $('pol_tot').value = total_el;
	}	
}

function testo(id,cod,as,aw,id_ch){

	if(aw){
			
			
			if ($(aw).checked == true)
				{	
					$(id).style.display="";
					$('pol'+as).innerHTML= $('h_price'+as).value;
					total = Math.round(total)+Math.round($('h_price'+as).value);
					totali = Math.round(total)+Math.round($('polv').innerHTML);
					$('pol').innerHTML = 'قیمت&nbsp;کل&nbsp;'+totali+'&nbsp;تومان&nbsp;';
					tot_price6 = $('pol_tot').value = totali;
					

				}
				
		
			if ($(aw).checked == false)
				{	
					$(id).style.display="none";
					$('pol'+as).innerHTML= '';
					$('dont_choose_ch'+as).style.display="none";
					total = Math.round(total)-Math.round($('h_price'+as).value);
					totali = Math.round(total)+Math.round($('polv').innerHTML);
					$('pol').innerHTML = 'قیمت&nbsp;کل&nbsp;'+totali+'&nbsp;تومان&nbsp;';
					tot_price = $('pol_tot').value = totali;

				}	
	
	}	
	
		
}
function package_acc(){
alles_klar = true;

if($F('check') != 'yes'){	
alles_klar = false;	
$('dont_choose_error').style.display="";
$('dont_choose').style.display="";
}
else{
		$('dont_choose').style.display="none";
	}
	
for (z=0;z<Math.round($F('child_anz'));z++)	
{
	if($F('check_'+z) != 'yes' && $('chil_'+z).checked ){	
		if($('kid_'+z).checked == false){
			$('dont_choose_ch'+z).style.display="";
			$('dont_choose_error').style.display="";
			alles_klar = false;
			}
		if($('kid_'+z).checked == true){
				$('dont_choose_ch'+z).style.display="none";
			}
		}	
	if($('chil_'+z).checked ){		
		if($F('edu_ch'+z) == 'select'){
			alles_klar = false;
			$('edu_set'+z).style.display="";
			$('dont_choose_error').style.display="";
			}
	
			if($F('edu_ch'+z) == 'select' && $('chil_'+z).checked){
				$('edu_set'+z).style.display="none";
				
			}	
			
			if($F('edu_ch'+z) == 'select' && $F('check_'+z) == 'yes'){
				$('edu_set'+z).style.display="";
				$('dont_choose_ch'+z).style.display="none";
			}
			
			else{
				$('edu_set'+z).style.display="none";
			}
			
			}
	

	
}
if(alles_klar){

			
		document.form_pac.submit();

			
		}
	
}
function isValidEmail_for(email, required) {
    if (required==undefined) {   
        required=true;
    }
    if (email==null) {
        if (required) {
$('email_for').innerHTML='<font color="red">لطفأ&nbsp;آدرس&nbsp;ایمیل&nbsp;خود&nbsp;را&nbsp;وارد&nbsp;کنید!</font>';
$('email_for').style.display='';
return false;
        }
        
		return true;
    }
    if (email.length==0) {  
        if (required) {
           $('email_for').innerHTML='<font color="red">لطفأ&nbsp;آدرس&nbsp;ایمیل&nbsp;خود&nbsp;را&nbsp;وارد&nbsp;کنید!</font>';
		   $('email_for').style.display='';
		   return false;
        }
        return true;
    }
    if (! allValidChars(email)) {  
       $('email_for').innerHTML='<font color="red">آدرس&nbsp;ایمیل&nbsp;شما&nbsp;اشتباه&nbsp;میباشد!</font>';
	    $('email_for').style.display='';
	   return false;
    }
    if (email.indexOf("@") < 1) { 
       $('email_for').innerHTML='<font color="red">آدرس&nbsp;ایمیل&nbsp;شما&nbsp;اشتباه&nbsp;میباشد!</font>';
	   $('email_for').style.display='';
	   return false;
    } else if (email.lastIndexOf(".") <= email.indexOf("@")) { 
$('email_for').innerHTML='<font color="red">آدرس&nbsp;ایمیل&nbsp;شما&nbsp;اشتباه&nbsp;میباشد!</font>';
 $('email_for').style.display='';
return false;
    } else if (email.indexOf("@") == email.length) {  
$('email_for').innerHTML='<font color="red">آدرس&nbsp;ایمیل&nbsp;شما&nbsp;اشتباه&nbsp;میباشد!</font>';
 $('email_for').style.display='';
return false;
    } else if (email.indexOf("..") >=0) { 
	$('email_for').innerHTML='<font color="red">آدرس&nbsp;ایمیل&nbsp;شما&nbsp;اشتباه&nbsp;میباشد!</font>';
	 $('email_for').style.display='';
	return false;
    } else if (email.indexOf(".") == email.length) { 
$('email_for').innerHTML='<font color="red">آدرس&nbsp;ایمیل&nbsp;شما&nbsp;اشتباه&nbsp;میباشد!</font>';
 $('email_for').style.display='';
return false;
    }
    return 'ok';
}	

function chekemail3(){
	myurl='checkmail.php?type=2&email='+$F('em_forgot');
	new Ajax.Request(myurl,{method: 'get',asynchronous:false,onSuccess:function(transport){
															
		 if(transport.responseText=='no'){																																					
				myps1=false;
				
			return false;
			}	else {
																											
				myps1=true;
				return true;
				
			}																				
																										
		 }});
	return myps1;
	}	
function for_email(){
		isokf=true;
		ps=isValidEmail_for($F('em_forgot'))
		if (!ps){
		//$('email_e').innerHTML=' باید تکمیل  شود ';
		isokf=false;
		} 
			else{
			$('email_for').innerHTML='';
				pse=chekemail3();
			if (pse && conn){
				$('email_for').innerHTML='<font color="green">اطلاعات تکمیلی به آدرس ایمیل شما ارسال شد</font>';
				$('email_for').style.display='';
				
				} else {
					
					$('email_for').innerHTML='<font color="red">آدرس&nbsp;ایمیل&nbsp;وارد&nbsp;شده&nbsp;صحیح&nbsp;نمیباشد!</font>';
					$('email_for').style.display='';
					isokf=false;
					}
			}
if(isokf)
		{

		new Ajax.Updater('email_for','./af_sendpw.php',
		{ 	
			method: 'post',
			parameters: { email_forgot: $F('em_forgot'), send : 'yes'}	
		
		});			
		$('pwsub').style.display='none';
		$('em_forgot').disabled= true;			
}}	


function des_order(obj){
	id = obj;
	$(id+'-s').style.display="";
	
	}
function des_clo(obj){
	id = obj;
	$(id+'-s').style.display="none";
	
	}
function send_conf(){
	
	new Ajax.Updater('send_conf','./send_conf.php',
		{ 		
				
			method: 'post'
		});
	return false;
	}	
