var color_fondo = "#ffff99";
var color_original = "#FFFFFF";
//----------------------------------------------------------------
function SH(act,id) { var obj = getElems(id); if(obj) { if(act == "") { if(obj.style.visibility == "hidden" || obj.style.visibility == "") { obj.style.visibility = "visible"; if(obj.tagName != "TR") { obj.style.display = "block"; } else { obj.style.display = ""; } } else { obj.style.visibility = "hidden"; obj.style.display = "none"; } } else if(act.toUpperCase() == "S") { obj.style.visibility = "visible"; if(obj.tagName != "TR") { obj.style.display = "block"; } else { obj.style.display = ""; } } else if(act.toUpperCase() == "H") { obj.style.visibility = "hidden"; obj.style.display = "none"; } } }
//----------------------------------------------------------------
function getElems(id) { if (window.parent.document.getElementById) { return document.getElementById(id); } else if (window.parent.document.all) { return document.all(id); } else if (window.parent.document.layers) { return document.layers(id); } }
//----------------------------------------------------------------
function estaVacio(s,texto){
var len = s.value.length;
for (i=0;i<len;++i){if (s.value.charAt(i)!=" ") {cColor(s,false);return false;}}
alert(texto); cColor(s,true);s.focus();return true;
}
//----------------------------------------------------------------
function cColor(s,e){s.style.border="1px solid #999999";s.style.padding="1px"; if(e){s.style.background=color_fondo;}else{s.style.background=color_original;}}
//----------------------------------------------------------------
function trimJS(cadena) { cadena.value = cadena.value.replace(/^\s\s*/, '').replace(/\s\s*$/, ''); }
//----------------------------------------------------------------
function validaEmail(emails) {
trimJS(emails);emails.value = emails.value.toLowerCase();email = new String(emails.value);
if(email == "" || email.indexOf("@", 0) == -1 || email.indexOf(".", 0) == -1 || email.length <= 9) {
alert("E-mail inválido");cColor(emails,true);emails.focus();return false;
} else {var ok = 1;var validos = "abcdefghijklmnopqrstuvwxyz0123456789-_@.";
for (i=0;i<email.length;i++) {if (validos.indexOf(email.charAt(i)) == "-1") { ok = 0; }}
if (ok == 0) {alert("E-mail inválido"); cColor(emails,true);emails.focus(); return false;}}
cColor(emails,false);return true;
}
//----------------------------------------------------------------
function popImg(id) { var posTop = screen.availHeight / 2 - (580 / 2) - 30; var posLeft = screen.availWidth / 2 - (800 / 2); var ventana = window.open("galeria.asp?ido=" + id,"galeria","left=" + posLeft + ", top=" + posTop + ", toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, width=800, height=580"); ventana.focus(); }
