$(document).ready(function(){document.oncontextmenu=function(){return false};Compartir.ini($(document).find("title").html(),$(location).attr('href'),'');if($("#sendcomment").length>0&&$("#comentarios form").length>0){setAttrForm($(document).find("base").attr("href"),"commentsrep",$("#comentarios form"),"","");$("#sendcomment").click(function(){var xmlForm="";var Resultado=validarForm($("#comentarios form"));if(Resultado[0]){xmlForm="<idform>"+$("#comentarios form").attr("id").replace("frmCom-","")+"</idform>"+Resultado[1];saveFormEx($(document).find("base").attr("href"),'genericSaveFormEx',xmlForm,$("#comentarios form"));}else{jAlert(MENSAJES[1]+" <br>"+Resultado[2]);}})}})
function createEnvironment(){if($("script").length>0){var jsPlat="";var haswgral=false;var haswctrls=false;var i=0;while(jsPlat==""){if($("script:eq("+i+")").attr("src").indexOf("jquery.ws.js")>0){jsPlat=$("script:eq("+i+")").attr("src").substring(0,$("script:eq("+i+")").attr("src").indexOf("jquery.ws.js"));}
if($("script:eq("+i+")").attr("src").indexOf("wgral.js")>0){haswgral=true;}
if($("script:eq("+i+")").attr("src").indexOf("wctrls.js")>0){haswctrls=true;}
i++;if(i==$("script").length)jsPlat="no";}
if(jsPlat!="no"&&jsPlat!=""){(function(){if(!haswctrls){var ga=document.createElement('script');ga.type='text/javascript';ga.src=jsPlat+'wctrls.js';var s=document.getElementsByTagName('script')[i];s.parentNode.insertBefore(ga,s);}})();(function(){if(!haswctrls){var ga=document.createElement('script');ga.type='text/javascript';ga.src=jsPlat+'wgral.js';var s=document.getElementsByTagName('script')[i];s.parentNode.insertBefore(ga,s);}})();(function(){var fileref=document.createElement("link");fileref.setAttribute("rel","stylesheet");fileref.setAttribute("type","text/css");fileref.setAttribute("href",jsPlat.replace('/js/','/styles/')+'general.css');if(typeof fileref!="undefined")document.getElementsByTagName("head")[0].appendChild(fileref);})();}
setTimeout('createUserMenu("'+$(document).find("base").attr("href")+'");',5000);}}
function centrarimg(i,mw,mh){var lt=0;lt=(mh-$(i).height())/2;if(lt>0)$(i).css("top",lt);else $(i).css("top",0);var lw=0;lw=(mw-$(i).width())/2;if(lw>=0)$(i).css("left",lw);else $(i).css("left",0)}
function colocasoloimagencli(){var iw=$('#image_wrap img:first').width();if(iw>590){$('#image_wrap img:first').css({"width":"590px","padding-left":"0px"});}else{$('#image_wrap img:first').css({"padding-left":(590-iw)/2+"px"});}
var ih=$('#image_wrap img:first').height();if(ih>360){$('#image_wrap img:first').css({"height":"360px","padding-top":"0px"});}else{$('#image_wrap img:first').css({"padding-top":(360-ih)/2+"px"});}}
function colocatextoimagencli(){var iw=$('#image_wrap img:first').width();if(iw>440){$('#image_wrap img:first').css({"width":"440px","padding-left":"0px"});iw=440;}
var ih=$('#image_wrap img:first').height();if(ih>360){$('#image_wrap img:first').css({"height":"360px","padding-top":"0px"});}else{$('#image_wrap img:first').css({"padding-top":((360-ih)/2)+"px"});}
$('#image_wrap div:first').css({"width":(580-iw)+"px","overflow":"auto"});var th=$('#image_wrap div:first').innerHeight();if(th>360){$('#image_wrap div:first').css({"height":"360px","overflow":"auto"});}else{$('#image_wrap div:first').css({"padding-top":((360-th)/2)+"px"});}}
var Compartir={ini:function(t,l,d){Titulo=t;Link=l;Descripcion=d;},Facebook:function(){window.open('http://www.facebook.com/share.php?u='+Texto.encode(Link)+'&t='+Texto.encode(Titulo));return false;},Twitter:function(){window.open('http://twitter.com/home?status='+Texto.encode(Titulo)+' - '+Texto.encode(Link));return false;},LinkedIn:function(){window.open('http://www.linkedin.com/shareArticle?mini=true&url='+Texto.encode(Link)+'&title='+Texto.encode(Titulo)+'&source=BLOGNAME&summary='+Texto.encode(Descripcion));return false;},Delicious:function(){window.open('http://delicious.com/post?url='+Texto.encode(Link)+'&title='+Texto.encode(Titulo)+'&notes='+Texto.encode(Descripcion));return false;},Digg:function(){window.open('http://digg.com/submit?phase=2&url='+Texto.encode(Link)+'&title='+Texto.encode(Titulo)+'&bodytext='+Texto.encode(Descripcion));return false;},BarraPunto:function(){window.open('http://barrapunto.com/submit.pl?subj='+Texto.encode(Titulo)+'&story='+Texto.encode(Link));return false;},Bitacoras:function(){window.open('http://bitacoras.com/anotaciones/'+Texto.encode(Link));return false;},Connotea:function(){window.open('http://www.connotea.org/addpopup?continue=confirm&uri='+Texto.encode(Link)+'&title='+Texto.encode(Titulo)+'&description='+Texto.encode(Descripcion));return false;},Meneame:function(){window.open('http://meneame.net/submit.php?url='+Texto.encode(Link));return false;},Google:function(){window.open('http://www.google.com/bookmarks/mark?op=edit&bkmk='+Texto.encode(Link)+'&title='+Texto.encode(Titulo)+'&annotation='+Texto.encode(Descripcion));return false;},email:function(){window.open('mailto:?subject='+Texto.encode(Titulo)+'&body='+Texto.encode(Link));return false;}}
var Texto={encode:function(string){return escape(this._utf8_encode(string));},decode:function(string){return this._utf8_decode(unescape(string));},_utf8_encode:function(string){string=string.replace(/\r\n/g,"\n");var utftext="";for(var n=0;n<string.length;n++){var c=string.charCodeAt(n);if(c<128){utftext+=String.fromCharCode(c);}else if((c>127)&&(c<2048)){utftext+=String.fromCharCode((c>>6)|192);utftext+=String.fromCharCode((c&63)|128);}else{utftext+=String.fromCharCode((c>>12)|224);utftext+=String.fromCharCode(((c>>6)&63)|128);utftext+=String.fromCharCode((c&63)|128);}}
return utftext;},_utf8_decode:function(utftext){var string="";var i=0;var c=c1=c2=0;while(i<utftext.length){c=utftext.charCodeAt(i);if(c<128){string+=String.fromCharCode(c);i++;}else if((c>191)&&(c<224)){c2=utftext.charCodeAt(i+1);string+=String.fromCharCode(((c&31)<<6)|(c2&63));i+=2;}else{c2=utftext.charCodeAt(i+1);c3=utftext.charCodeAt(i+2);string+=String.fromCharCode(((c&15)<<12)|((c2&63)<<6)|(c3&63));i+=3;}}
return string;}}
