// JavaScript Document
var as_swf_name = "SiteSedal";

function fbInit(pAsSwfName,pApi_key,pReceiver){
  as_swf_name = pAsSwfName;
  FB.init(pApi_key,pReceiver);
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


function LumiaTwitter(mensaje){
	MM_openBrWindow("http://twitter.com/home?status="+mensaje,"Publicar",'width=800,height=450');	
}

function flashCallBack ( func ) {
  if( arguments.length > 1 ){
    document[as_swf_name][func]( Array.prototype.slice.call(arguments).slice(1)[0]);
  }else{
    document[as_swf_name][func]();
  }
}
function test(){
 
 var attachment={'name':'QUILMES RALLY ARGENTINA 2010.','href':'http://www.quilmesrally.com.ar/','description':'Volá junto a los que saben correr. Disfrutá de la experiencia más adrenalínica del Rally Mundial ingresando aquí. ','media':[{'type':'image','src':'http://www.quilmesrally.com.ar/imagenes/facebook.jpg','href':'http://www.quilmesrally.com.ar/'}]};
LumiaStreamPublish(attachment);
}
function test2(){
 LumiaTwitter("¿Conocés el estado de tu cabello? Respondé este sencillo test y averigualo. Ingresá en  www.sedal.com.ar/sedal/test.php");
}
 
function LumiaStreamPublish(attachment) {
 // FB.Connect.requireSession( onLoginHandler );
 FB.ensureInit(function () {
    FB.Connect.streamPublish('', attachment, null);
  });
  function onLoginHandler(){
	 window.location.reload(true); 
  }
}
function login(){
  FB.Connect.requireSession( onLoginHandler2 );
}
function onLoginHandler2(){
  flashCallBack( "onLogIn" );

}
