/*
DOCUMENTACION:
	Documentedos por facebook en: http://developers.facebook.com/plugins
*/
function fbSocialPluginLikeButtom(id,x,y,href,layout,show_faces,width,height,action,colorscheme,font){
	/*
	Documentación:
		URL: http://developers.facebook.com/docs/reference/plugins/like
	*/	
	var html = "";
		html +='<div id="'+id+'" style="background:url(img/loading.gif) no-repeat;">'
		html +='	<iframe src="http://www.facebook.com/plugins/like.php?href='+href+'&amp;font='+font+'&amp;layout='+layout+'&amp;show_faces='+show_faces+'&amp;width='+width+'&amp;action='+action+'&amp;colorscheme='+colorscheme+'&amp;height='+height+'" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:80px;" allowTransparency="true"></iframe>';
		html +='</div>';
	$("#sp").append(html);
	//fbUbicar('#'+id,x,y);
}
function fbSocialPluginRecommendations(id,x,y,site,width,height,header,colorscheme,font,border_color){	
	/*
	Documentación:
		URL:http://developers.facebook.com/docs/reference/plugins/recommendations
	*/
	var html = "";
	html +='<div id="'+id+'" style="background:url(img/loading.gif) no-repeat;">'
	html +='	<iframe src="http://www.facebook.com/plugins/recommendations.php?site='+site+'&amp;width='+width+'&amp;height='+height+'&amp;header='+header+'&amp;colorscheme='+colorscheme+'&amp;font='+font+'&amp;border_color='+border_color+'" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:300px; height:300px;" allowTransparency="true"></iframe>';
	html +='</div>';
	$("#socialplugin_content").append(html);
	fbUbicar('#'+id,x,y);
}
function fbSocialPluginActivityFeed(id,x,y,site,width,height,header,colorscheme,font,border_color,recommendations){
	/*
	Documentación:
		URL: http://developers.facebook	/docs/reference/plugins/activity
	*/
	var html = "";
	html +='<div id="'+id+'" style="background:url(img/loading.gif) no-repeat;">'
	html +='	<iframe src="http://www.facebook.com/plugins/activity.php?site='+site+'&amp;width='+width+'&amp;height='+height+'&amp;header='+header+'&amp;colorscheme='+colorscheme+'&amp;font='+font+'&amp;border_color='+border_color+'&amp;recommendations='+recommendations+'" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:300px; height:300px;" allowTransparency="true"></iframe>';
	html +='</div>';
	$("#socialplugin_content").append(html);
	fbUbicar('#'+id,x,y);
}
function fbSocialPluginLikebox(id,x,y,url,width,connections,stream,header){
	/*
	Documentación:
		URL: http://developers.facebook.com/docs/reference/plugins/like-box
	*/
	var html = "";
	html +='<div id="'+id+'" style="background:url(img/loading.gif) no-repeat;">'
	html +='	<iframe src="http://www.facebook.com/plugins/likebox.php?href='+url+'&amp;width='+width+'&amp;connections='+connections+'&amp;stream='+stream+'&amp;header='+header+'&amp;" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:292px; height:587px;" allowTransparency="true"></iframe>';
	html +='</div>';
	$("#socialplugin_content").append(html);
	fbUbicar('#'+id,x,y);
}
function fbSocialPluginLiveStream(id,x,y,app_id,width,height,xid){
	/*
	Documentación:
		URL:http://developers.facebook.com/docs/reference/plugins/live-stream
	*/
	var html = "";
	html +='<div id="'+id+'" style="background:url(img/loading.gif) no-repeat;">'
	html +='	<iframe src="http://www.facebook.com/plugins/livefeed.php?app_id='+app_id+'&amp;width='+width+'&amp;height='+height+'&amp;xid='+xid+'" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:400px; height:500px;" allowTransparency="true"></iframe>';
	html +='</div>';
	$("#socialplugin_content").append(html);
	fbUbicar('#'+id,x,y);
}

function fbLoginButtom(){
	var html = '<fb:login-button show-faces="true"></fb:login-button>';
	$("#socialplugin_content").append(html);
	alert("ok");
}

function fb_remover(id){
	$("#"+id).remove();
}
function fb_remover_todos(){
	$('#socialplugin_content > *').each(function(){
		$("#"+this.id).remove();
	});
}
function fbUbicar(obj,x,y){
	//$(obj).css({'left':x,'top':y});
	$(obj).css({'right':x,'top':y});
}
function mover(obj,x,y,duracion){
	$(obj).animate({
		left: '+='+x,
		top: '+='+y
	}, duracion, function() {
		// Animación completada.
	});
}
function fb_socialplugins(){
	var html = "";
	html +='<div id="socialplugin_content" style="position:absolute;height:80px;border:display:block;z-index:20;right:0;"></div>';
	$('body').append(html);
}


/*function holamundo(){
	this.mensaje;
	this.saludar = function(){
		alert(this.mensaje);
	}
}
function fbSocialPluginLikeButtomProto(){
	this.contenedor;
	this.id;
	this.x;
	this.y;
	this.href;
	this.layout;
	this.show_faces;
	this.width;
	this.height;
	this.action;
	this.colorscheme;
	this.font;
	this.html="";
	this.cargarEnDiv = function(){
		this.html = "";
		this.html +='<div id="'+this.id+'" style="background:url(img/loading.gif) no-repeat;">'
		this.html +='	<iframe src="http://www.facebook.com/plugins/like.php?href='+this.href+'&amp;font='+this.font+'&amp;layout='+this.layout+'&amp;show_faces='+this.show_faces+'&amp;width='+this.width+'&amp;action='+this.action+'&amp;colorscheme='+this.colorscheme+'&amp;height='+this.height+'" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:80px;" allowTransparency="true"></iframe>';
		this.html +='</div>';		
		$(this.contenedor).append(this.html);	
	}
}*/
