//
// ANILINA para MUTUA INTERCOMARCAL
//
var tagsvalidos = new Array('TD','A','P','SPAN');

/*
function AccesoDirecto(id){
	 tipo = id.substring(0,1);
   if (tipo=='T' || tipo=='P' || tipo=='F') {
	 		id = id.substring(2,id.length);    
	 		location.href=id;
	 }
}
*/

function AccesoDirecto(id){						 //Ej: T#cami#textos/textos.php?id..#iref
	 aid = id.split('#');
	 tipo = aid[0];
   if (tipo=='T' || tipo=='P' || tipo=='F') {
			Ref(aid[1],aid[2],'_top','AD',aid[3]);
	 }
}

function Ref(cami,enlace,ventana,tref,iref) {
	 if (tref!='' && iref!=0) {
	 		stats.location.href = cami+'/stats/stathome.php?tref='+tref+'&iref='+iref;
	 }	 
	 if (enlace.search(/www.+/)==-1) {
	 	 enlace2 = cami+'/'+enlace; 
	 } else {
	 	 enlace2 = enlace; 
	 }
	 if (ventana == '_blank') {
      ventana = window.open(enlace2,'VentanaAbrirWebMutua');
	 } else {
	 	 location.href = enlace2;
	 }
}
function Reff(cami,nform,tref,iref) {
	 if (tref!='' && iref!=0) {
	 		stats.location.href = cami+'/stats/stathome.php?tref='+tref+'&iref='+iref;
	 }	 
	 eval("document.forms['"+nform+"'].submit();");
}


//.... JOAN: 15-06-2004 ... Cambio temporal de pruebas

function CambioLetra(tipo) {
		switch (tipo) {
			case 1: tamany = 9; break;
			case 2: tamany = 11; break;
			case 3: tamany = 13; break;
		}
		myDocumentElements=document.getElementsByTagName("*");
		bactivo = false;
		for (i = 0; i < myDocumentElements.length; i++) {
        myTag=myDocumentElements.item(i);
				if (myTag.tagName=='CAMBIOLETRA') { bactivo = true; }
				if (myTag.tagName=='/CAMBIOLETRA') { bactivo = false; break; }
				if (bactivo && ValidarTag(myTag.tagName)) {
					 myTag.style.fontSize = tamany + 'pt';
				}
		}
}

function ValidarTag(nombretag) {
		for (j = 0; j < tagsvalidos.length; j++) {
				if (tagsvalidos[j]==nombretag) { return true; }
		}
		return false;
}

function CambioZoom(tipo) {
		switch (tipo) {
			case 1: tamany = 100; break;
			case 2: tamany = 110; break;
			case 3: tamany = 120; break;
		}
		document.all.tags('body')[0].style.setAttribute('zoom',tamany+'%','false');
}


/*
function CambioA() {
		for (i = 0; i < document.getElementsByTagName("p").length; i++) {
				//document.getElementsByTagName("p").item(i).style.font = '9pt verdana,arial,helvetica';
				document.getElementsByTagName("p").item(i).style.fontSize = '9pt';
		}
		for (i = 0; i < document.getElementsByTagName("td").length; i++) {
				document.getElementsByTagName("td").item(i).style.fontSize = '9pt';
		}
}
function CambioAA() {
		for (i = 0; i < document.getElementsByTagName("p").length; i++) {
				document.getElementsByTagName("p").item(i).style.fontSize = '11pt';
		}
		for (i = 0; i < document.getElementsByTagName("td").length; i++) {
				document.getElementsByTagName("td").item(i).style.fontSize = '11pt';
		}
}
function CambioAAA() {
		for (i = 0; i < document.getElementsByTagName("p").length; i++) {
				document.getElementsByTagName("p").item(i).style.fontSize = '13pt';
		}
		for (i = 0; i < document.getElementsByTagName("td").length; i++) {
				document.getElementsByTagName("td").item(i).style.fontSize = '13pt';
		}
}
*/

/*
function CambioA1() {
		for (i = 0; i < document.getElementsByTagName("p").length; i++) {
				document.getElementsByTagName("p").item(i).style.fontSize = '9pt';
		}
}
function CambioAA1() {
		for (i = 0; i < document.getElementsByTagName("p").length; i++) {
				document.getElementsByTagName("p").item(i).style.fontSize = '11pt';
		}
}
function CambioAAA1() {
		for (i = 0; i < document.getElementsByTagName("p").length; i++) {
				document.getElementsByTagName("p").item(i).style.fontSize = '13pt';
		}
}
*/

/*
function CambioZ() {
		document.all.tags('body')[0].style.setAttribute('zoom','100%','false');
}
function CambioZZ() {
		document.all.tags('body')[0].style.setAttribute('zoom','110%','false');
}
function CambioZZZ() {
		document.all.tags('body')[0].style.setAttribute('zoom','120%','false');

		//document.getElementsByTagName("body").item(0).style.setAttribute('zoom','110%','false');  //Funciona sólo en IE

    //s = document.body.style;																																	//Funciona sólo en IE
    //z=s.getAttribute('zoom');
    //s.setAttribute('zoom','120%');

}

*/


//...

function Browserr() {
	var b=navigator.appName;
	if (b.indexOf('Netscape')!=-1) this.b="ns";
	else if ((b=="Opera") || (navigator.userAgent.indexOf("Opera")>0)) this.b = "opera";
	else if (b=="Microsoft Internet Explorer") this.b="ie";
	if (!b) alert('Unidentified browser.\nThis browser is not supported,');
	this.version=navigator.appVersion;
	this.v=parseInt(this.version);
	this.ns=(this.b=="ns" && this.v>=4);
	this.ns4=(this.b=="ns" && this.v==4);
	this.ns6=(this.b=="ns" && this.v==5);
	this.ie=(this.b=="ie" && this.v>=4);
	this.ie4=(this.version.indexOf('MSIE 4')>0);
	this.ie5=(this.version.indexOf('MSIE 5')>0);
	this.ie55=(this.version.indexOf('MSIE 5.5')>0);
	this.ie6=(this.version.indexOf('MSIE 6.0')>0);
	this.opera=(this.b=="opera");
	this.dom=(document.createElement && document.appendChild && document.getElementsByTagName)?true:false;
	this.def=(this.ie||this.dom); // most used browsers, for faster if loops
	var ua=navigator.userAgent.toLowerCase();
	if (ua.indexOf("win")>-1) this.platform="win32";
	else if (ua.indexOf("mac")>-1) this.platform="mac";
	else this.platform="other";
}
is=new Browserr();

