$(document).ready( function(){ 

	if( pop != '' ){ 
		$.fancybox({href:pop,type:'iframe', width:550, height:280, centerOnScroll:true,scrolling:false});
	}

});

function popDialog( title, dialog, height ){

	var html = '<div id="pop"><h1>'+title+'</h1><div id="subhead">'+dialog+'</div></div>';
	
	html += '<div style="margin:0px auto;width:66px"><fieldset><a href="#" onclick="$.fancybox.close();return false;" class="btn_black" id="btn_ok"><span>OK</span></a></fieldset></div>'; //button

	$.fancybox({content:html, width:550, height:height,scrolling:false, centerOnScroll:true});

}

function launchReport(){

	$.fancybox({href:'/pop_report.php?page='+escape(window.location),type:'iframe', width:550, height:400, centerOnScroll:true});

}

function launchCity( cityName ){

	$.fancybox({href:'/pop_comingsoon.php?city='+cityName,type:'iframe', width:550, height:400, centerOnScroll:true});
	
}

function toggleLocationsDrawer(){

	var el = $('#locations_drawer');
	
	if( el.css('display') == 'none'){
	
		//open
	
		el.slideDown('fast',function(){
			$(document).bind('mouseup', toggleLocationsDrawer );
		});
	
	}else{
	
		//closed
	
		el.slideUp('fast');
		$(document).unbind('mouseup', toggleLocationsDrawer );
	
	}

}

function launchFacebookSignUp(){

	$.fancybox({href:'/pop_signupfacebook.php',type:'iframe', width:550, height:400, centerOnScroll:true});

}

function launchFacebookMerge(user_id){

	$.fancybox({href:'/pop_mergefacebook.php?user_id='+user_id,type:'iframe', width:550, height:400, centerOnScroll:true});

}

function launchSignUp(){

	$.fancybox({href:'/pop_signup.php',type:'iframe', width:550, height:400, centerOnScroll:true});

}

function launchLogin(){

	$.fancybox({href:'/pop_login.php',type:'iframe', width:550, height:400, centerOnScroll:true});

}

function launchListYourBusiness(){

	$.fancybox({
				'width'			: 550,
				'height'			: 400,
				'centerOnScroll' 	: true,
				'type'			: 'iframe',
				'href'			: '/pop_listyourbusiness.php'
			});

}

function launchUserAgreement(){

	$.fancybox({href:'/pop_useragreement.php',type:'iframe', width:550, height:400, centerOnScroll:true});

}

function launchFAQ(){

	$.fancybox({href:'/pop_faq.php',type:'iframe', width:550, height:400, centerOnScroll:true});

}

function launchAdvertise(){

	$.fancybox({href:'/pop_advertise.php',type:'iframe', width:550, height:200, centerOnScroll:true, scrolling:false});

}

function launchPrivacyPolicy(){

	$.fancybox({href:'/pop_privacypolicy.php',type:'iframe', width:550, height:400, centerOnScroll:true});

}

function launchAbout(){

	$.fancybox({href:'/pop_about.php',type:'iframe', width:550, height:400, centerOnScroll:true});

}

function launchAffiliates(){

	$.fancybox({href:'/pop_affiliates.php',type:'iframe', width:550, height:400, centerOnScroll:true});

}

function launchCharities(){

	$.fancybox({href:'/pop_charities.php',type:'iframe', width:550, height:400, centerOnScroll:true});

}

function launchContact(){

	$.fancybox({href:'/pop_contact.php',type:'iframe', width:550, height:400, centerOnScroll:true});

}

function launchPress(){

	$.fancybox({href:'/pop_press.php',type:'iframe', width:550, height:400, centerOnScroll:true});

}

function launchGamePlanHelp(){

	$.fancybox({href:'/pop_gameplanhelp.php',type:'iframe', width:550, height:130, centerOnScroll:true,scrolling:false});

}

function logout(){
	
	FB.logout(function(response) {
	  // user is now logged out
	});
		
	window.location = "/Logout/";
	
}

