version=navigator.appVersion;
var b=navigator.appName;
if (b=="Netscape") this.b="ns";
else if (b=="Microsoft Internet Explorer") this.b="ie";
v=parseInt(this.version);
ns4=(this.b=="ns" && this.v==4);
ns6=(this.b=="ns" && this.v==5);
ie=(this.b=="ie" && this.v>=4);
/****************************** VISUALIZAR IMAGEN PNG PAR EXPLORER *************************************/
function ponpng(archivo,ancho,alto,titulo){
altern="";
if(titulo){
altern=titulo;
}
anchura="495px";
if(ancho){
anchura=ancho;
}
altura="350px";
if(alto){
altura=alto;
}
//if(b=='ie') document.write("
");
if(b=='ie') document.write(" | ");
else document.write(" | ");
}
function ponspan(){
//if(b=='ie') document.write("");
}
/****************************** FINVISUALIZAR IMAGEN PNG PAR EXPLORER **********************************/
/************************************** FUNCIONES GENERALES ********************************************/
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&ia.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&id.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
function MM_showHideLayers() { //v3.0
var i,p,v,obj,args=MM_showHideLayers.arguments;
for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
obj.visibility=v; }
}
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
function AbrirVentana(lugar, nombre, propiedades) {
var x=screen.width;
var pop_x=560;
var posx=Math.round((x-pop_x)/2);
var sprops="top=50,left="+posx+","+propiedades;
window.open(lugar, nombre, sprops);
}
function resize(){
window.resizeTo(400, 400)
window.moveTo(Math.round((screen.width-400)/2),Math.round((screen.height-400)/2) );
window.focus();
}
function trim(inputString) {
if (typeof inputString != "string") return inputString;
var retValue = inputString;
var ch = retValue.substring(0, 1);
while (ch == " ") { // Check for spaces at the beginning of the string
retValue = retValue.substring(1, retValue.length);
ch = retValue.substring(0, 1);
}
ch = retValue.substring(retValue.length-1, retValue.length);
while (ch == " ") { // Check for spaces at the end of the string
retValue = retValue.substring(0, retValue.length-1);
ch = retValue.substring(retValue.length-1, retValue.length);
}
while (retValue.indexOf(" ") != -1) { // Note that there are two spaces in the string - look for multiple spaces within the string
retValue = retValue.substring(0, retValue.indexOf(" ")) + retValue.substring(retValue.indexOf(" ")+1, retValue.length); // Again, there are two spaces in each of the strings
}
return retValue; // Return the trimmed string back to the user
} // Ends the "trim" function
/*********************************** FIN FUNCIONES GENERALES *******************************************/
/*************************************** VERIFICAR MAIL ************************************************/
function emailCheck (emailStr){
var emailPat=/^(.+)@(.+)$/;
var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]";
var validChars="\[^\\s" + specialChars + "\]";
var quotedUser="(\"[^\"]*\")";
var ipDomainPat=/^[(d{1,3}).(d{1,3}).(d{1,3}).(d{1,3})]$/;
var atom=validChars + '+';
var word="(" + atom + "|" + quotedUser + ")";
var userPat=new RegExp("^" + word + "(\\." + word + ")*$");
var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$");
var matchArray=emailStr.match(emailPat);
if (matchArray==null) {
//alert("La dirección de correo parece ser inválida (verifique las @ y .)")
return false
}
var user=matchArray[1]
var domain=matchArray[2]
if (user.match(userPat)==null) {
//alert("El nombre de usuario parece ser inválido.")
return false
}
var IPArray=domain.match(ipDomainPat)
if (IPArray!=null) {
for (var i=1;i<=4;i++) {
if (IPArray[i]>255) {
//alert("La dirección IP de destino es inválida!")
return false
}
}
return true
}
var domainArray=domain.match(domainPat)
if (domainArray==null) {
//alert("El dominio no parece ser válido.")
return false
}
var atomPat=new RegExp(atom,"g")
var domArr=domain.match(atomPat)
var len=domArr.length
if (domArr[domArr.length-1].length<2 ||
domArr[domArr.length-1].length>3) {
//alert("Las direcciones deben terminar con dominios de tres letras, o el código de país de dos letras.")
return false
}
if (len<2) {
var errStr="Dominio Inválido!";
//alert(errStr)
return false
}
return true;
}
/************************************ FIN VERIFICAR MAIL ***********************************************/
/******************************** FUNCIONES PROPIAS DE LA WEB ******************************************/
function cambiarNombre(idHref,sexo,doctor,doctora)
{
var nombre='';
if(sexo=='M'){
nombre=doctora;
}else{
nombre=doctor;
}
if (document.getElementById) { /* Navegadores con DOM- IE5.5,NS6*/
if(document.getElementById(idHref+doctor)){
document.getElementById(idHref+doctor).innerHTML=nombre;
}
}else if (document.all ) { /* Navegadores IE*/
if (document.all[idHref+doctor]){
MM_findObj(idHref+doctor).innerHTML=nombre;
}
}
}
function quironMail(nm)
{
dm = "quiron.es";
mailurl = "mailto:" + nm + "@" + dm;
window.location = mailurl;
}
/******************************** FIN FUNCIONES PROPIAS DE LA WEB ***************************************/ |