//create an empty console.log function if firebug is not running to avoid errors.
if(typeof(window.console) == "undefined"){
	window.console = { log:function(){}};
};


window.onload = function()
{
	init();
};

var flashMovie;
		
function init()
{
	var isIE = navigator.appName.indexOf("Microsoft") != -1;
    flashMovie = (isIE) ? window['FlashID'] : document['FlashID'];
}
		
function login()
{
	FB.login(function(response)
	{
		if (response.session)
		{
			if (response.perms)
			{
				setAccessToken(response.session.access_token);
			}
                    
		}
	}, {perms:'publish_stream, user_photos, email'});
}
        
function setAccessToken(token)
{          
	flashMovie.loggedIn(token);
}
        
window.fbAsyncInit = function()
{
	FB.init({appId: 'ee025eee06a629e9f603177dd3c88765', status: true, cookie: true, xfbml: false});
};
            
/*(function()
{
	var e = document.createElement('script'); e.async = true;
	e.src = document.location.protocol + '//connect.facebook.net/es_ES/all.js';
	document.getElementById('fb-root').appendChild(e);
}());*/

