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

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

for (i=1;i<10;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('m10').style.color='#FF6600';
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 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='You are born in an excluded country! If your spouse (husband or wife) was born in a qualifying country or if your parents have only temporarily lived in the country of your birth, please select the birth country of your spouse or parents here. Otherwise you may not take part in the lottery!';
		$('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='Please select the native  country';
				$('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='You are born in an excluded country! If your spouse (husband or wife) was born in a qualifying country or if your parents have only temporarily lived in the country of your birth, please select the birth country of your spouse or parents here. Otherwise you may not take part in the lottery!';

			$('bland_se_f_na').innerHTML='*';
			$('bland_se_f_na').style.display='';
			$('bland_native_se').innerHTML='*';
			$('bland_native_se').style.display='';
			$('bland-e').innerHTML='Please select the native  country';
			$('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='Your spouse is born in an excluded country! If your spouse (husband or wife) was born in a qualifying country or if your parents have only temporarily lived in the country of your birth, please select the birth country of your spouse or parents here. Otherwise you may not take part in the lottery!';
			$('bland_s-se').innerHTML='*';
			$('bland_s-se').style.display='';
			$('bland_native_spo_se').innerHTML='*';
			$('bland_native_spo_se').style.display='';
			$('bland_s-e').innerHTML='Please select the native  country';
			$('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='You are born in an excluded country! If your spouse (husband or wife) was born in a qualifying country or if your parents have only temporarily lived in the country of your birth, please select the birth country of your spouse or parents here. Otherwise you may not take part in the lottery!';
		$('bland_native_se').innerHTML='*';
		$('bland_native_se').style.display='';
		$('bland-e').innerHTML='Please select the native  country';
		$('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='Choice of 2nd country was successful';
		$('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='You are born in an excluded country! If your spouse (husband or wife) was born in a qualifying country or if your parents have only temporarily lived in the country of your birth, please select the birth country of your spouse or parents here. Otherwise you may not take part in the lottery!';
			$('bland_se_f_na').innerHTML='*';
			$('bland_se_f_na').style.display='';
			$('bland-e').innerHTML='Please select the native  country';
			$('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='Your spouse is born in an excluded country! If your spouse (husband or wife) was born in a qualifying country or if your parents have only temporarily lived in the country of your birth, please select the birth country of your spouse or parents here. Otherwise you may not take part in the lottery!';
			$('bland_s-se').innerHTML='*';
			$('bland_s-se').style.display='';
			$('bland_native_spo_se').innerHTML='*';
			$('bland_native_spo_se').style.display='';
			$('bland_s-e').innerHTML='Please select the native  country';
			$('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='Your spouse is born in an excluded country! If your spouse (husband or wife) was born in a qualifying country or if your parents have only temporarily lived in the country of your birth, please select the birth country of your spouse or parents here. Otherwise you may not take part in the lottery!';
		$('bland_native_spo_se').innerHTML='*';
		$('bland_native_spo_se').style.display='';
		$('bland_s-e').innerHTML='Please select the native  country';
		$('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='Choice of 2nd country was successful';
		$('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 ("Please delete first the form of your spouse!");
		 $('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 ("Please delete first the form of your child!");
		 $('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-left:28px;width:742px;border-right:1px #333333 solid;border-left:1px #333333 solid; border-top:1px #FFFFFF solid; height:50px;" ><img src="pic/ajax-loader3.gif" style=margin-top:12px;margin-left:370px;/></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='Please enter your e-mail address';
$('email').style.border='solid 1px #FF0000';
$('email_e').style.display='';
return false;
        }
        
		return true;
    }
    if (email.length==0) {  
        if (required) {
           $('email_e').innerHTML='Please enter your e-mail address';
		   $('email').style.border='solid 1px #FF0000';
		   $('email_e').style.display='';
		   return false;
        }
        return true;
    }
    if (! allValidChars(email)) {  
       $('email_e').innerHTML='Please enter a valid E-mail Address';
	   $('email').style.border='solid 1px #FF0000';
	    $('email_e').style.display='';
	   return false;
    }
    if (email.indexOf("@") < 1) { 
       $('email_e').innerHTML='Please enter a valid E-mail Address';
	   $('email').style.border='solid 1px #FF0000';
	   $('email_e').style.display='';
	   return false;
    } else if (email.lastIndexOf(".") <= email.indexOf("@")) { 
$('email_e').innerHTML='Please enter a valid E-mail Address';
$('email').style.border='solid 1px #FF0000';
 $('email_e').style.display='';
return false;
    } else if (email.indexOf("@") == email.length) {  
$('email_e').innerHTML='Please enter a valid E-mail Address';
$('email').style.border='solid 1px #FF0000';
 $('email_e').style.display='';
return false;
    } else if (email.indexOf("..") >=0) { 
	$('email_e').innerHTML='Please enter a valid E-mail Address';
	$('email').style.border='solid 1px #FF0000';
	 $('email_e').style.display='';
	return false;
    } else if (email.indexOf(".") == email.length) { 
$('email_e').innerHTML='Please enter a valid E-mail Address';
$('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:65px;margin-bottom:50px;margin-left: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:65px;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='71%';
		}
		
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 dopayment(){
	
	new Ajax.Updater('pay_cho','./pay_fee.php',
		{ 	
			method: 'post',
			parameters: {methode: $F('pays'),methode2: $F('pays2'),methode3: $F('pays3')}	
			
		});
		$('pay_cho').innerHTML='<img src="pic/ajax-loader_pay.gif" style=margin-top:45px;margin-bottom:50px;margin-left:395px;/>  ';

	
}
function dopayment_2(method){
	
	
	
	new Ajax.Updater('pay_cho','./pay_fee.php',
		{ 	
			method: 'post',
			parameters: {methodes: method}	
			
		});
		$('pay_cho').innerHTML='<img src="pic/ajax-loader_pay.gif" style=margin-top:45px;margin-bottom:50px;margin-left:395px;/>  ';

if(method=='paypals'){$('pays').checked = true}
if(method=='ccp'){$('pays2').checked = true}
if(method=='wris'){$('pays3').checked = true}
	
}
function doregister(){
	 isok=true;

	if (trim($F('vorname'))!='' && $F('vorname').length<2 ){
		$('vorname-e').innerHTML='Your first name must be more that 2 characters';
		$('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='Please enter your first name';
		$('vorname').style.border='solid 1px #FF0000';
		$('vorname-e').style.display='';
		isok=false;
		} 
		
	if (trim($F('nachname'))!='' && $F('nachname').length<2 ){
		$('nachname-e').innerHTML='Your surname must be more that 2 characters';
		$('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='Please enter your surname';
		$('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='This e-mail address is already registered with us';
				$('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='The e-mail address do not match';
		$('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='Please confirm your e-mail address';
		$('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='Password must be more that 8 characters';
		$('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='Please enter your password';
		$('password_first').style.border='solid 1px #FF0000';
		$('pass_e').style.display='';
		isok=false;
		} 	
	if (trim($F('phon_city'))=='' || trim($F('phon'))==''){
		$('phon_e').innerHTML='Please enter your telephone number';
		$('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 (trim($F('vorland'))=='select'){
		$('phon_e2').innerHTML='Please select a country';
		$('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='Your Passwords do not match';
		$('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='Please confirm your Password';
		$('confirm_e').style.display='';
		$('confirm').style.border='solid 1px #FF0000';
		isok=false;
		} 
		
	if (!$('accept').checked){		
		$('accept_e').innerHTML='Please check the box labeled I Agree';
		
		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:65px;margin-bottom:50px;margin-left:85px;/>';
				}
		
			}
		login_reg();
		}
		
	else{
			
		}	
}
function send(){
	 isok3=true;
	 isok=true;
	 isok2=true;	
	 error_is=true;
	if (trim($F('sex'))=='select'){
		$('sex-e').innerHTML='Please enter your sex';
		$('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='First name must be more that 2 characters';
		$('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='Please enter your first name';
		$('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='Surname must be more that 2 characters';
		$('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='Please enter your surname';
		$('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='Please enter your Day of birth';
		$('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='Please enter your Month of birth';
		$('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='Please enter your Year of birth';
		$('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='Please enter your City of birth';
		$('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='Please enter your City of birth';
		$('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='Please enter your Country of birth';
		$('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='Please enter marital status';
		$('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='Please enter details of your last Educational certificate';
		$('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='The sex of applicant and spouse can not be the same';
			$('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='Please enter your spouse sex';
		$('sex_s-e').style.display='';
			isok=false;
			error_is=false;
		
		}
		if (trim($F('vorname_s'))!='' && $F('vorname_s').length<2 ){
			$('vorname_s-e').innerHTML='Your spouse first name must be more that 2 characters';
			$('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='Please enter your spouse first name';
			$('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='Your spouse surname must be more that 2 characters';
			$('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='Please enter your spouse surname';
			$('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='Please enter your spouse Day of birth';
			$('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='Please enter your spouse Month of birth';
			$('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='Please enter your spouse Year of birth';
			$('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='Please enter your spouse City of birth';
			$('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='Please enter your spouse City of birth';
			$('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='Please enter your spouse Country of birth';
			$('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='Please enter details of spouse last Educational certificate';
			$('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='Please enter your child sex';
		$('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='Your child first name must be more that 2 characters';
			$('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='Please enter your child first name';
			$('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='Your child surname must be more that 2 characters';
			$('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='Please enter your child surname';
			$('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='Please enter your child Day of birth';
			$('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='Please enter your child Month of birth';
			$('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='Please enter your child Year of birth';
			$('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='Your child is over 21 years old and is not allowed to participate with you in DV lottery programme. However, your child can participate in the programme independently and must be registered separately.';
			$('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='Please enter your child City of birth';
			$('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='Please enter your child City of birth';
			$('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='Please enter your child Country of birth';
			$('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='ltr'>child&nbsp;<span dir='ltr'>"+(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="ltr" align="left" style="text-align:left; padding-left=25px;padding-top:5px;">The application of children whose numbers are shown below are not complete.<img style="margin:8px;" align="absmiddle" src="pic/ch_ac.gif"/><br>Please check the form and amend accordingly<div align="left" dir="ltr"  style="margin-left:5px;margin-top:7px;">'+texterr+'</div></div>';
	$('child_hinweis_e').style.display='';
	
}
//else { $('child_hinweis').style.display='none'; }


if (trim($F('tel'))!='' && $F('tel').length<10 ){
		$('tel-e').innerHTML='Telephone number must have more than 10 characters';
		$('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='Please enter your telephone number';
		$('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='Street name and house no. must have more than 5 characters';
		$('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='Please enter your street name and house number';
		$('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='Postcode must have more than 3 characters';
		$('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='Please enter your postcode';
		$('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='City of residence must have more than 2 characters';
		$('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='Please enter your city of residence';
		$('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='Please enter your country of residence';
		$('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='You are born in an excluded country! If your spouse (husband or wife) was born in a qualifying country or if your parents have only temporarily lived in the country of your birth, please select the birth country of your spouse or parents here. Otherwise you may not take part in the lottery!';
		$('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='Please select the native  country';
		$('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='Choice of 2nd country was successful';
				$('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='You are born in an excluded country! If your spouse (husband or wife) was born in a qualifying country or if your parents have only temporarily lived in the country of your birth, please select the birth country of your spouse or parents here. Otherwise you may not take part in the lottery!';
		
		$('bland_nat_se_e').style.display='';
		$('bland_nat_se_e').innerHTML='Your spouse is born in an excluded country! If your spouse (husband or wife) was born in a qualifying country or if your parents have only temporarily lived in the country of your birth, please select the birth country of your spouse or parents here. Otherwise you may not take part in the lottery!';
		
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='Please select the native  country';
			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='Please select the native  country';
			$('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='Choice of 2nd country was successful';
				$('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='Choice of 2nd country was successful';
				$('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='Please enter your Country of birth';
		$('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=ltr style="text-align:left;margin-left=30px; padding:15px 0px 0px 20px ;list-style:none; float:left; display:block;"><img style="margin-right:10px;" align="absmiddle" src="pic/ch_ac.gif"/>Please re-check those fields shown in RED and re-enter correct information</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("Should your information be saved?")
			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("Are you sure that you want to delete the form of your spouse?")

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("Are you sure that you want to delete the form of your child?")
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='First name must be more that 2 characters';
		$('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='Please enter your first name';
		$('vorname').style.border='solid 1px #FF0000';
		$('vorname-e').style.display='';
		isok=false;
		} 
		
	if (trim($F('nachname'))!='' && $F('nachname').length<2 ){
		$('nachname-e').innerHTML='Surname must be more that 2 characters';
		$('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='Please enter your surname';
		$('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='This e-mail address is already registered with us';
				$('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='The e-mail address do not match';
		$('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='Please confirm your e-mail address';
		$('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='Password must be more that 8 characters';
		$('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='Your passwords do not match';
		$('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="";



}
// Greencard Script Copyright (c) 2008 - 2011, Amin SEPEHRI
// All rights reserved.
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 = 'Your&nbsp;Price&nbsp;'+total+'&nbsp;USD&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 = 'Your&nbsp;Price&nbsp;'+total_el+'&nbsp;USD&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 = 'Your&nbsp;Price&nbsp;'+total_el+'&nbsp;USD&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 = 'Your&nbsp;Price&nbsp;'+totali+'&nbsp;USD&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 = 'Your&nbsp;Price&nbsp;'+totali+'&nbsp;USD&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">Please enter your e-mail address!</font>';
$('email_for').style.display='';
return false;
        }
        
		return true;
    }
    if (email.length==0) {  
        if (required) {
           $('email_for').innerHTML='<font color="red">Please enter your e-mail address!</font>';
		   $('email_for').style.display='';
		   return false;
        }
        return true;
    }
    if (! allValidChars(email)) {  
       $('email_for').innerHTML='<font color="red">Please enter a valid E-mail Address</font>';
	    $('email_for').style.display='';
	   return false;
    }
    if (email.indexOf("@") < 1) { 
       $('email_for').innerHTML='<font color="red">Please enter a valid E-mail Address</font>';
	   $('email_for').style.display='';
	   return false;
    } else if (email.lastIndexOf(".") <= email.indexOf("@")) { 
$('email_for').innerHTML='<font color="red">Please enter a valid E-mail Address</font>';
 $('email_for').style.display='';
return false;
    } else if (email.indexOf("@") == email.length) {  
$('email_for').innerHTML='<font color="red">Please enter a valid E-mail Address</font>';
 $('email_for').style.display='';
return false;
    } else if (email.indexOf("..") >=0) { 
	$('email_for').innerHTML='<font color="red">Please enter a valid E-mail Address</font>';
	 $('email_for').style.display='';
	return false;
    } else if (email.indexOf(".") == email.length) { 
$('email_for').innerHTML='<font color="red">Please enter a valid E-mail Address</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">The new Password have been mailed to the email address you provided</font>';
				$('email_for').style.display='';
				
				} else {
					
					$('email_for').innerHTML='<font color="red">Sorry, e-mailing of the password was unsuccessful. There is no record of your e-mail address in our database</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;
	}	

function pay_help_sh (url) {
 fenster = window.open(url, "_blank", "width=500,height=600,status=yes,scrollbars=yes,resizable=yes");
 fenster.focus();
}

