function removeHTMLTags(a){return a.replace(/<\/?[^>]+(>|$)/g,"")}function makeQS(a){return"from=AJAX&"+$("#"+a.name).serialize()}jQuery.fn.center=function(){this.css("position","absolute");this.css("top",($(window).height()-this.height())/2+$(window).scrollTop()+"px");this.css("left",($(window).width()-this.width())/2+$(window).scrollLeft()+"px");return this};var TimeOutError;function closeError(){$("#dialog").dialog("destroy")} function ShowTimePicking(a){$(function(){$("#dialog").html(AJAX("post","/includes/Time.Selection.asp","Time="+a.value+"&objId="+a.id));$("#dialog").dialog({closeOnEscape:true,title:"Seleccionar Hora",modal:true,width:320,height:"auto",close:function(){$("#dialog").dialog("destroy")}})})} function ShowErrorDelay(a,b){TimeOutError&&clearTimeout(TimeOutError);$(function(){$("#dialog").html(b);$("#dialog").dialog({closeOnEscape:true,title:a,modal:true,width:250,height:"auto",close:function(){$("#dialog").dialog("destroy")}})});TimeOutError=setTimeout("closeError()",5E3)}function setCookie(a,b){return AJAX("post","/xml/SetCookieFRM.asp","nombre="+a+"&valor="+b)}function setCookieFRM(a){return AJAX("post","/xml/SetCookieFRM.asp","nombre="+a.name+"&valor="+a.value)} function ShowStatus(a){if(a==true){$("#divPanel").css({display:"block"});$("#divLoading").css({display:"block"});$("#divLoading").html('
Cargando...
');$("#divLoading").center()}else{setTimeout("$('#divLoading').css({display: 'none'});", 10);setTimeout("$('#divPanel').css({display: 'none'});",10)}}function ShowError(a,b,c){var d="auto",e=a.toLowerCase();d=c?c:"auto";if(e.indexOf("error")>=0)a=''+a;TimeOutError&&clearTimeout(TimeOutError);if($.browser.msie)d=c?c:400;$(function(){$("#dialog").html(b);$("#dialog").dialog({closeOnEscape:true,title:a,modal:true,width:d,height:"auto",close:function(){$("#dialog").dialog("destroy")}})})} function AJAX(a,b,c,d,e){var k="POST",f=a.toUpperCase();if(a)if(f=="POST")k="POST";else if(f=="GET")k="GET";dataSend="";if(c)dataSend=c;if(dataSend.indexOf("fromAJAX")<0)dataSend="fromAJAX=true&"+dataSend;if(d){f=true;$("#"+d).html("")}else f=false;var m="";k=$.ajax({url:b,type:k,cache:false,data:dataSend,async:f,timeout:2E4,dataType:"html",beforeSend:function(){d&&ShowStatus(true)},success:function(g){if(d)if(isUndefined(document.getElementById(d).type))if(b.toLowerCase().indexOf("v2.0")>0){document.getElementById(d).style.display= "block";document.getElementById(d).style.visibility="visible";$("#"+d).html(g)}else{document.getElementById(d).style.display="none";$("#"+d).html(g);$("#"+d).slideDown("slow")}else{var l=document.getElementById(d).type.toLowerCase();if(l=="textarea"||l=="text"||l=="select-one")document.getElementById(d).value=g;else{document.getElementById(d).style.display="block";document.getElementById(d).style.visibility="visible";$("#"+d).html(g);alert(0)}}m=g;d&&ShowStatus(false)},error:function(g,l){ShowStatus(false); if(l=="timeout"){windowTimeOut(a,b,c,d,e);return false}else ShowError("Error de comunicación","CODIGO: "+l,350)}});if(!d)return k.responseText}function windowTimeOut(a,b,c,d,e){confirm("Ha ocurrido un error en la carga de la p\u00e1gina, por favor confirme el reintento")&&AJAX(a,b,c,d,e)}function getTime(){var a=new Date,b=a.getHours(),c=a.getMinutes();a=a.getSeconds();var d="";if(b==0)b=12;return d=(b>12?b-12:b)+":"+(c<10?"0":"")+c+":"+(a<10?"0":"")+a+" "+(b>12?"PM":"AM")} function SetLog(a){if(a.responseText!==undefined){if(a.status=="404"||a.status=="500")$("#dialog").dialog("destroy");if(document.getElementById("divStatusLog"))document.getElementById("divStatusLog").innerHTML="LOG: Time: "+getTime()+"; Code: "+a.status+"; Msg: "+a.statusText}}var AJXTimeOut;function ajaxTimeout(a){a.abort();if(document.getElementById("divStatusLog"))document.getElementById("divStatusLog").innerHTML="LOG: Time: "+getTime()+"; Code: TIMEOUT"} function isUndefined(a){return a===void 0}function CheckParentLink(a){if(parent.window.opener.closed==true)window.open(a).focus();else{window.opener.location=a;window.opener.focus()}}function ClearDIV(a){if(document.getElementById(a))document.getElementById(a).innerHTML=""}Date.prototype.string=function(a){var b=a.getDate().toString();if(b.length==1)b="0"+b;var c=a.getMonth()+1;c=c.toString();if(c.length==1)c="0"+c;a=a.getYear();if(a<2E3)a=1900+a;return a=b+"-"+c+"-"+a}; Date.prototype.add=function(a,b){if(!a||b==0)return this;switch(a.toLowerCase()){case "ms":this.setMilliseconds(this.getMilliseconds()+b);break;case "s":this.setSeconds(this.getSeconds()+b);break;case "mi":this.setMinutes(this.getMinutes()+b);break;case "h":this.setHours(this.getHours()+b);break;case "d":this.setDate(this.getDate()+b);break;case "mo":this.setMonth(this.getMonth()+b);break;case "y":this.setFullYear(this.getFullYear()+b);break}return this}; String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")};String.prototype.ltrim=function(){return this.replace(/^\s+/,"")};String.prototype.rtrim=function(){return this.replace(/\s+$/,"")};String.prototype.left=function(a){return this.length>a?this.substring(0,a):this};String.prototype.right=function(a){return this.length>a?this.substring(this.length-a,this.length):this};String.prototype.RemoveZero=function(){for(s=this;s.substr(0,1)=="0"&&s.length>1;)s=s.substr(1,9999);return s}; function urlencode(a){var b;a=a.split(/\r\n|\r|\n/).join("%0D");try{b=encodeURIComponent(a)}catch(c){b=escape(a)}return b.replace(/%20/g,"+")} function CreateQS(a){var b="";for(i=0;i=48&&c<=57)return true;else d=false;return d}function returnAlpha(a){var b=RegExp("[^a-zA-Z0-9]","g");return a.replace(b,"")} function isAlpha(a){a=typeof window.event!="undefined"?window.event:a;a=a.charCode?a.charCode:a.which?a.which:a.keyCode;var b=/[^A-Za-z0-9]/;if(a>31&&b.test(String.fromCharCode(a)))return false;return true}function isUserName(a){a=typeof window.event!="undefined"?window.event:a;a=a.charCode?a.charCode:a.which?a.which:a.keyCode;var b=/[^A-Za-z0-9\.\_\-]/;if(a>31&&b.test(String.fromCharCode(a)))return false;return true} function camelCaps(a,b){for(var c=a.value.toLowerCase().split(" "),d=0;d=12&&f.substring(0, 2)!="24"?" PM":" AM";c=f.substring(0,2)>12?f.substring(0,2)-12+":"+f.substring(3,f.length)+c:f.substring(0,2)<10?f.substring(1,f.length)+c:f+c}else if(b==4)c=f;return c}function isEmail(a){return/^[a-z][a-z-_0-9\.]+@[a-z-_=>0-9\.]+\.[a-z]{2,3}$/i.test(a)} function handleEnter(a,b,c){b=b.keyCode?b.keyCode:b.which?b.which:b.charCode;if(b==13){for(c=0;c31&&(b<48||b>57))return false;return true}return true}}function CheckMovil(a){if(a.value.length>8)a.value=a.value.substring(a.value.length-8,a.value.length);if(a.value.length==8)a.value=a.value;if(a.value.length==7)a.value="9"+a.value} function GetRadio(a){if(a.length>0)for(i=0;i0)for(i=0;i0)b=b.substring(0,b.length-2);return b}function checkAll(a,b){if(isArray(a))for(i=0;i31&&b.test(String.fromCharCode(a)))return false;return true} function ValidarRut(a){var b="";if(a.length>0){crut=a;largo=crut.length;if(largo<2)return false;for(i=0;i2?crut.substring(0,largo-1):crut.charAt(0);dv=crut.charAt(largo-1);if(rut==null||dv==null)return 0;a="0";suma=0;mul=2;for(i=rut.length-1;i>=0;i--){suma+=rut.charAt(i)*mul;if(mul==7)mul=2;else mul++}res=suma%11;if(res==1)a="k";else if(res==0)a="0";else{dvi=11- res;a=dvi+""}if(a!=dv.toLowerCase())return false;return true}}var Hour="",Minute="";function CheckTime(a){if(Hour!=""&&Minute!=""){var b=Hour+":"+Minute;if(document.getElementById(a))document.getElementById(a).value=b;$("#dialog").dialog("destroy");if(document.getElementById(a)){document.getElementById(a).focus();document.getElementById(a).select()}}} function setIntervalMinute(){if(document.getElementById("divMinuto5").style.display=="block"){document.getElementById("divMinuto5").style.display="none";document.getElementById("divMinuto1").style.display="block";document.getElementById("btnTimePicking").value="<<<"}else{document.getElementById("divMinuto5").style.display="block";document.getElementById("divMinuto1").style.display="none";document.getElementById("btnTimePicking").value=">>>"}} function setCellHour(a){for(j=0;j<24;j++){var b=j.toString();if(b.length<2)b="0"+b;document.getElementById("tdH"+b).style.backgroundColor="#E0E0E0";document.getElementById("tdHFont"+b).style.color="#000000";document.getElementById("tdHFont"+b).style.fontWeight="normal"}document.getElementById("tdH"+a).style.backgroundColor="#000099";document.getElementById("tdHFont"+a).style.color="#FFFFFF";document.getElementById("tdHFont"+a).style.fontWeight="bold";Hour=a} function setCellMinute(a,b){for(j=0;j<60;j+=5){var c=j.toString();if(c.length<2)c="0"+c;document.getElementById("tdM"+c).style.backgroundColor="#FFFFFF";document.getElementById("tdMFont"+c).style.color="#000000";document.getElementById("tdMFont"+c).style.fontWeight="normal"}document.getElementById("tdM"+a).style.backgroundColor="#000099";document.getElementById("tdMFont"+a).style.color="#FFFFFF";document.getElementById("tdMFont"+a).style.fontWeight="bold";Minute=a;CheckTime(b)} function setCellMinute2(a,b){for(j=0;j<60;j++){var c=j.toString();if(c.length<2)c="0"+c;document.getElementById("tdM2"+c).style.backgroundColor="#FFFFFF";document.getElementById("tdM2Font"+c).style.color="#000000";document.getElementById("tdM2Font"+c).style.fontWeight="normal"}document.getElementById("tdM2"+a).style.backgroundColor="#000099";document.getElementById("tdM2Font"+a).style.color="#FFFFFF";document.getElementById("tdM2Font"+a).style.fontWeight="bold";Minute=a;CheckTime(b)} function ExtractEmails(a,b){var c="",d=a.match(/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9._-]+)/gi);if(d){c="";for(var e=0;e0)for(var n=0;n"+RetweetJS.link_text+"";g.title="";g.href="http://twitter.com/home?status="+encodeURIComponent(RetweetJS.prefix+v+" http://bit.ly/");if(f[t])f[t].push(g);else{f[t]=[g];BitlyClient.shorten(t,"BitlyCB.shortenResponse")}}}}window.RetweetJS={bitly_user:"retweetjs", bitly_key:"R_6287c92ecaf9efc6f39e4f33bdbf80b1",link_text:(/windows/i.test(navigator.userAgent)?"►":"♻")+" Retweet",count_type:"clicks",prefix:"RT @Reservame ",styling:"a.retweet { font: 12px Helvetica,Arial; color: #000; text-decoration: none; border: 0px; }a.retweet span { color: #FFF; background: #94CC3D; margin-left: 2px; border: 1px solid #43A52A; -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; padding: 3px; }a.vert { display: block; text-align: center; font-size: 16px; float: left; margin: 4px; }a.retweet strong.vert { display: block; margin-bottom: 4px; background: #F5F5F5; border: 1px solid #EEE; -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; padding: 3px; }a.retweet span.vert { display: block; font-size: 12px; margin-left: 0px; }"}; var b=1;if(typeof BitlyClient==="undefined"){var c=document.getElementsByTagName("head")[0]||document.documentElement,d=document.createElement("script");d.src="http://bit.ly/javascript-api.js?version=latest&login="+RetweetJS.bitly_user+"&apiKey="+RetweetJS.bitly_key;d.charSet="utf-8";c.appendChild(d);var e=setInterval(function(){if(typeof BitlyCB!=="undefined"){clearInterval(e);c.removeChild(d);a()}},10);b=0}if(document.addEventListener)document.addEventListener("DOMContentLoaded",a,false);else window.attachEvent&& window.attachEvent("onload",a)})();