/* ** Framework Gabo V. 0.7 ** */
/* Gmancera   elgabo1@gmail.com*/

var myHeight=0, myWidth=0;

/* Efecto Formularios*/
function foc(o){o.className="foc";}
function blu(o){o.className="";}
function ove(o){if (o.className!="foc"){o.className="ove";}}
function out(o){if (o.className=="ove"){o.className="";}}

/* Validar Formularios */
function num(d){ var c=document.getElementById(d); if ((c.value.match(/^\d+$/)) && (c.value!=='')) {return true; } else {return false;}}
function let(d){ var c=document.getElementById(d); if ((c.value.match(/^[A-Za-záéíóúàèìòùÁÉÍÓÚÀÈÌÒÙ0-9]+$/)) && (c.value!=='')) {return true; } else {return false;}}
function alf(d){ var c=document.getElementById(d); if ((c.value.match(/^[A-Za-záéíóúàèìòùÁÉÍÓÚÀÈÌÒÙ0-9]+$/)) && (c.value!=='')) {return true; } else {return false;}}

function nuo(evt){	var nav4 = window.Event ? true : false;
	var key = nav4 ? evt.which : evt.keyCode; return (key <= 13 || (key >= 48 && key <= 57)); }

/* Accciones [Ocultar/Mostrar] */
function vis(d){return document.getElementById(d).style.visibility;}
function hid(d){var o=document.getElementById(d).style; o.visibility="hidden"; o.display="none";}
function sho(d){var o=document.getElementById(d).style; o.visibility="visible"; o.display="block";}
function mue(d){if (vis(d)=="visible" || vis(d)===""){hid(d);}else{sho(d);}}

/* Propiedades */
function pix(nu){if(String(nu).substring(nu.length, nu.length-1)!='%'){return nu+"px";}else{return nu;}}
function wid(d,nu){document.getElementById(d).style.width=pix(nu);}
function hei(d,nu){document.getElementById(d).style.height=pix(nu);}
function top(d,nu){document.getElementById(d).style.top=pix(nu);}
function lef(d,nu){document.getElementById(d).style.left=pix(nu);}

/* Habilitar/Deshabilitar */
function dis(d){document.getElementById(d).disabled=true;}
function ene(d){document.getElementById(d).disabled=false;}
function foco(div){document.getElementById(div).focus();}
function tol(div){div=document.getElementById(div); div.value=div.value.toLowerCase();}

/* Modificar */
function val(d,texto){document.getElementById(d).value=texto;}
function ine(d,texto){document.getElementById(d).innerHTML=texto;}

/*Limpiar valor*/
function ocl(d){vtmp=com(d.id); val(d.id,'');}
function obl(d){if (com(d.id)===""){val(d.id,vtmp);}}

/* Obtener Valor */
function com(d){return document.getElementById(d).value;}
function gin(d){return document.getElementById(d).innerHTML;}

/* Ajustar pagina a resolución */
function size() {var de=document.documentElement; if( typeof( window.innerWidth ) == 'number' ) {myWidth = window.innerWidth; myHeight = window.innerHeight;}else if(de && ( de.clientWidth || de.clientHeight)){myWidth = de.clientWidth; myHeight = de.clientHeight; }else if(document.body && ( document.body.clientWidth || document.body.clientHeight)){myWidth = document.body.clientWidth; myHeight = document.body.clientHeight;}if (myWidth<750){myWidth=750;} if(myHeight<500){myHeight=500;}  setTimeout('ajustadivs();',50);}

/* Ajax*/
function creajax(){ var g; try { g = new XMLHttpRequest();}catch (trymicrosoft){ try {g = new ActiveXObject("Msxml2.XMLHTTP");}catch (othermicrosoft) { try {g = new ActiveXObject("Microsoft.XMLHTTP");}catch (failed) { g = false;} } } if (!g) {alert("Su navegador no soporta nuestra aplicación.\n Le recomendamos utilizar Firefox 2.X o Internet Explorer"); return false;} return g;}