
function showEmailForm(){
	$('float_div').setStyle('top', window.getScrollTop() );
	$('float_div').setStyle('height', window.getHeight() );
	$('float_div').setStyle('display','block');
	$('float_content').setStyle('top', (window.getScrollTop()+(window.getHeight()/15)) );
	$('float_content').setStyle('display','block');
	$$('div.swf_container').setStyle('display','none');
	$('eCheck_fly').set('html', '');
	$('email_fly').set('value', '');
}


function hideEmailForm(){
	$('float_div').setStyle('display','none');
	$('float_content').setStyle('display','none');
	$$('div.swf_container').setStyle('display','block');
	$('eCheck_fly').set('html', '');
	$('email_fly').set('value', '');
}

function sendCheckEmail (email, id, emailnotvalid, header_text){

	if(email.search("@")>=0) {
		var checkEmail = new Request.HTML({
		url: 'checkEmail.php',
		method: 'post',
		data: "email=" + email,	
		
			onComplete: function  (tree, elements, html, js){
				
				//alert ('uboxDisconnect Request Completed!');
			},
			onFailure: function (){
				//alert ('uboxDisconnect Request failed!');
			},
			
			onSuccess: function (html){
		
				$('email_chek_response').set('html','');
				$('email_chek_response').adopt('html',html);
				
				//alert ('uboxDisconnect Request success!');
				if( $('email_chek_response').get('html') == 'ok'){
					
					window.location = 'form.php?email=' + email + '&idpage=' +header_text;
					
				} else if( $('email_chek_response').get('html') == 'redirect'){
					
				
					//window.location = 'http://www.one2one.com/?fpass=1&mail=' + email ;
				
					
				} else {
					
					if(id == 'fly'){
						showEmailForm();
					}
					
					$('eCheck_' + id).set('html', $('email_chek_response').get('html') );
					
					window.fireEvent('AjaxSync');
				}
				
			}
		
		});	
	
		checkEmail.send();
	} else {
		
		var response = emailnotvalid;
		
		if(id == 'fly'){
			showEmailForm();
		}

		$('eCheck_' + id).set('html', response );
	}
	return false;
}

