function displayPopup()
{
	
	var documentHeight = jQuery(document).height();	
	var WindowHeight = jQuery(document).height();
	var WindowWidth = jQuery(window).width();
	
	jQuery('#dark').css({'width':WindowWidth,'height':WindowHeight});
	jQuery('#dark').fadeTo(1000,0.75);
	
	jQuery('#popup').css('top',  WindowHeight/2-jQuery('#popup').height()/2);
	jQuery('#popup').css('left', WindowWidth/2-jQuery('#popup').width()/2);	
	
	jQuery('#popup').fadeIn(1000); 	
	
	
	jQuery('img').click(function() {
	jQuery('#dark').fadeOut();
	jQuery('#popup').fadeOut();
	
});		
	jQuery('#dark').click(function () {
	jQuery('#dark').fadeOut();
	jQuery('#popup').fadeOut();
});	
	
	
}

jQuery(document).ready(function(e) {	

	
	if (location.href.indexOf("?facebook") != -1)
	{
		
		displayPopup();
	}
	else
	{
		//("Our new address is http://come.to/......");
	}	
	
});
jQuery(window).resize(function(e) {	
	
	if (location.href.indexOf("?facebook") != -1)
	{	
		
		//select all the a tag with name equal to modal
		
		//Cancel the link behavior
		e.preventDefault();
		
		
	
		//Get the screen height and width
		var maskHeight = jQuery(document).height()-5;
		var maskWidth = jQuery(window).width();
	
		//Set heigth and width to mask to fill up the whole screen
		jQuery('#dark').css({'width':maskWidth,'height':maskHeight});
		
		
	
		//Get the window height and width
		var winH = document.documentElement.clientHeight;
		var winW = jQuery(window).width();
              
		//Set the popup window to center
		jQuery('#popup').css('top',  winH/2-jQuery('#popup').height()/2);
		jQuery('#popup').css('left', winW/2-jQuery('#popup').width()/2);
	}
	else
	{
		//("Our new address is http://come.to/......");
	}	
	
});

