
      FB.logout(function(response){
		
	});
      if((navigator.userAgent.match(/iPhone/i)) || 
    	   (navigator.userAgent.match(/iPod/i)) || 
    	   (navigator.userAgent.match(/iPad/i))) {
  	    
//  	    alert("This site is viewable on a mobile device, however it is not optimized and not all functionalities will work.")
  	    
  	}
      

      $(document).ready(function(){
			$( "#register-dialog" ).dialog({
				width: 630,
				height: 300,
				modal: true,
				autoOpen:false
			});
			$('.fb_button').click(function(){
				//$( "#register-dialog" ).dialog( "open" );
				var w = 450;
				var h = 350;
				var left = (window.width/2)-(w/2);
				var top = (window.height/2)-(h/2);
				//var mywindow = window.open("https://www.facebook.com/dialog/oauth?type=user_agent&client_id=<?php echo FACEBOOK_APP_ID; ?>&redirect_uri=<?php echo base_url(); ?>doaction/register&scope=email,user_online_presence,publish_stream",
					//			"Request for Permission", "location=1,height="+h+",width="+w+", top="+top+", left="+left);
				window.location = "https://www.facebook.com/dialog/oauth?client_id="+FACEBOOK_APP_ID+"&redirect_uri="+BASE_URL+"doaction/register&scope=email,user_online_presence,offline_access,publish_stream,user_interests";
				//alert($(window).x());
				//mywindow.moveTo($(window).x(), $(window).y());
				return false;
			});
		});
