﻿function getElementPosition(el){ var x=0; var y=0; while(el.offsetParent){ x+=el.offsetLeft; y+=el.offsetTop; el=el.offsetParent; } x+=el.offsetLeft; y+=el.offsetTop; return { x:x, y:y }; }
function showSocialMedia(abrir){
	var obj=document.getElementById("socialMediaIframe");
	if(abrir){
		var pos=getElementPosition(document.getElementById("_socialMediaBox")).y;
		obj.style.top=(pos-322)+"px";
		obj.style.display="block";
		//window.scrollTo(0, pos-232);
	}else{
		obj.style.display="none";
	}
}

var smUrl=window.location;
var smT=document.title;
var urlDelicious="http://del.icio.us/post?title="+encodeURIComponent(smT)+"&url="+encodeURIComponent(smUrl);
var urlDigg="http://www.digg.com/submit?phase=2&url="+escape(smUrl);
var urlTechnoratti="http://www.technorati.com/search/"+escape(smUrl);
var urlYahoo="http://myweb2.search.yahoo.com/myresults/bookmarklet?t="+escape(smT)+"&u="+smUrl;
var urlMeneame="http://meneame.net/submit.php?url="+escape(smUrl);
var urlFresqui="http://tec.fresqui.com/post?title="+encodeURIComponent(smT)+"&url="+encodeURIComponent(smUrl);
var urlFaceBook="http://www.facebook.com/share.php?u="+encodeURIComponent(smUrl);

document.write("<iframe id=\"socialMediaIframe\" name=\"socialMediaIframe\" width=\"500\" height=\"350\" marginwidth=\"0\" marginheight=\"0\" frameborder=\"0\" scrolling=\"no\"></iframe>");


document.write("<link href=\"http://homeweb.entelchile.net/home_img/internet/portal2008/libreria/css/style_boxrss.css\" type=\"text/css\" rel=\"stylesheet\" />\
<div class=\"socialMedia_box_rss\" id=\"_socialMediaBox\">\
<div class=\"socialMedia_topo\"><div class=\"socialMedia_botoes\"><a href=\"#\" onclick=\"showSocialMedia(true); return false;\"></a></div>\
<div class=\"socialMedia_topobox\">Compartir éste artículo</div>\
</div>\
<div class=\"socialMedia_info\">\
<div class=\"socialMedia_canal\"><img src=\"http://homeweb.entelchile.net/home_img/internet/portal2008/libreria/js/ico_delicious.gif\"/><a href=\""+urlDelicious+"\" target=\"_blank\">&nbsp;&nbsp;del.icio.us</a></div>\
<div class=\"socialMedia_canal\"><img src=\"http://homeweb.entelchile.net/home_img/internet/portal2008/libreria/js/ico_facebook.gif\"/><a href=\""+urlFaceBook+"\" target=\"_blank\">&nbsp;&nbsp;Facebook</a></div>\
<div class=\"socialMedia_canal\"><img src=\"http://homeweb.entelchile.net/home_img/internet/portal2008/libreria/js/ico_technorati.gif\"/><a href=\""+urlTechnoratti+"\" target=\"_blank\">Technorati</a></div>\
<div class=\"socialMedia_canal\"><img src=\"http://homeweb.entelchile.net/home_img/internet/portal2008/libreria/js/ico_yahoo.gif\"/><a href=\""+urlYahoo+"\" target=\"_blank\">My Yahoo!</a></div>\
<div class=\"socialMedia_canal\"><img src=\"http://homeweb.entelchile.net/home_img/internet/portal2008/libreria/js/ico_meneame.gif\"/><a href=\""+urlMeneame+"\" target=\"_blank\">&nbsp;Men&eacute;ame</a></div>\
<div class=\"socialMedia_canal\"><img src=\"http://homeweb.entelchile.net/home_img/internet/portal2008/libreria/js/ico_fresqui.gif\"/><a href=\""+urlFresqui+"\" target=\"_blank\">Fresqui</a></div>\
</div>\
</div></div>");
var boxHTML="";

try{
	var win=document.frames.socialMediaIframe;
}catch(e){
	var win=window.socialMediaIframe;
}
win.document.open();
win.document.write(boxHTML);
win.document.close();