$(document).ready(function() {
$('#fb_pop_up_email').focus(function() {
	if($.trim($('#fb_pop_up_email').val())=='Enter your email address here')
	{
		$('#fb_pop_up_email').val('');
	}
});
$('#fb_pop_up_email').blur(function() {
	if($.trim($('#fb_pop_up_email').val())=='')
	{
		$('#fb_pop_up_email').val('Enter your email address here');
	}
});
$('#pop_close').click(function(){
		$('#light1').html('');
});



/*$('.dialogue_box').css({
	        position:'absolute',
	        left: ($(window).width()/2 - 240)+'px',
			top:'200px'
	    });

$('#light1').css({position:'absolute',left: ($(window).width()/2 - 240)+'px', top : '210px'});
*/
});

function t_newsletter()
{
	
   var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,8})$/;
   var address = $.trim($('#fb_pop_up_email').val());
	
   if(reg.test(address) == false) {
   
     	$('#newsletter_subscripton_pop_up1').html('Please enter a valid email address');
      	//$('#fb_pop_up_email').val('Enter your email address here');
   }
   else
   {
	
		//$('#newsletter_subscripton_pop_up1').load('ajax_email.php?email='+address+'&sub=www.global-storage.com.au : Property Managers play a vital role in the commercial income property marketfeedback');
		$.ajax({
		   type: "GET",
		   url: "ajax_email1.php",
		   data: 'email='+address+'&sub=www.forbescommercialservices.com: Property Managers play a vital role in the commercial income property market- feedback',
		   success: function(msg){
		   	$('#newsletter_subscripton_pop_up1').html(msg);
			$('#light1').fadeOut(5000) ;

		   }	
		 });

	 
   }
   
	return false;
}

function pop_email_msg(){
	if(document.getElementById("fb_pop_up_email").value=="Enter your email address here")
	{	
		document.getElementById("fb_pop_up_email").value='';
	}
	return false;
}
function pop_email_msg_re(){
	if(document.getElementById("fb_pop_up_email").value=="")
	{	
		document.getElementById("fb_pop_up_email").value='Enter your email address here';
	}
	return false;
}
function hide_close_pop_up(){
	document.getElementById('light1').style.display='none';

	
}

