function Is() {
agent = navigator.userAgent.toLowerCase();
this.major = parseInt(navigator.appVersion);
this.minor = parseFloat(navigator.appVersion);
this.ns = ((agent.indexOf('mozilla') != -1) && ((agent.indexOf('spoofer') == -1) && (agent.indexOf('compatible') == -1)));
this.ns4 = (this.ns && (this.major == 4));
this.ns6 = (this.ns && (this.major >= 5));
this.ie = (agent.indexOf("msie") != -1);
this.ie3 = (this.ie && (this.major < 4));
this.ie4 = (this.ie && (this.major == 4) && (agent.indexOf("msie 5.0") == -1));
this.ie5 = (this.ie && (this.major == 4) && (agent.indexOf("msie 5.0") != -1));
this.ie55 = (this.ie && (this.major == 4) && (agent.indexOf("msie 5.5") != -1));
this.ie6 = (this.ie && (agent.indexOf("msie 6.0")!=-1) );
}

var is = new Is();

var css;
var sty;
var vis;
	if(is.ns4) {
		css = "document.";
		sty = "";
		vis = "show";
	} else if(is.ns5||is.ns6) {
		css = "document.getElementById('";
		sty = "').style";
		vis = "visible";
	} else {
		css = "document.all.";
		sty = ".style";
		vis = "visible";
	}
    function ocultarCapa(nombreCapa) {
        eval(css + nombreCapa + sty + ".visibility = 'hidden'");
    }
    function mostrarCapa(nombreCapa) {
	eval(css + nombreCapa + sty + ".visibility = '" + vis + "'");
    }
    function ocultarCapas() {
	for(i = 0; i < capas.length; i++) {
		ocultarCapa(capas[i]);}
    }
    function cambiarCapa(nombreCapa) {
    ocultarCapas();
    mostrarCapa(nombreCapa);
    }
    
    
    
function Contact(ContactPars){
//var ancho = (screen.width)-(Math.round(screen.width)/5);

var ancho = 760;
var alto = 450;

if (ContactPars=="?Tipus=anunci") {alto=alto+75;}
if (is.ns){alto=alto+55;}
if (ContactPars==null) {ContactPars="";}

var pos = "left="+Math.round(screen.width-ancho)/2+",top="+Math.round(screen.height-alto)/2;

window.open("/Contactar.asp"+ContactPars,"Contacto","width="+ancho+",height="+alto+",scrollbars=yes,status=yes,"+pos);
setTimeout('startAni()',1500);
} 



function Info(thelocation){

var ancho = 680;
var alto = 400;
var pos = "left="+Math.round(screen.width-ancho)/2+",top="+Math.round(screen.height-alto)/2;



 if (thelocation.indexOf("ursos.asp")==1)
 { 
   ancho=590;
   pos = "left="+Math.round(screen.width-ancho)/2+",top="+Math.round(screen.height-alto)/2;
 }

temploc=thelocation
InfoWindow = window.open(thelocation,"Info","width="+ancho+",height="+alto+",scrollbars=yes,status=yes,"+pos);
InfoWindow.focus();
InfoWindow.status="Cambra Oficial de Comerç i Indústria de Lleida";
setTimeout('startAni()',1500);
}


function infov(thelocation){

var ancho = 680;
var alto = 400;
var pos = "left="+Math.round(screen.width-ancho)/2+",top="+Math.round(screen.height-alto)/2;



 if (thelocation.indexOf("ursos.asp")==1)
 { 
   ancho=590;
   pos = "left="+Math.round(screen.width-ancho)/2+",top="+Math.round(screen.height-alto)/2;
 }

temploc=thelocation
InfoWindow = window.open(thelocation,"Info","width="+ancho+",height="+alto+",scrollbars=yes,status=yes,"+pos);
InfoWindow.focus();
InfoWindow.status="Cambra Oficial de Comerç i Indústria de Lleida";
setTimeout('startAni()',1500);
}

function Ventana(thelocation,alto,ancho)
{
var win;

if (alto==0) {alto=(screen.height)-(Math.round(screen.height)/5);}
if (ancho==0) {ancho=(screen.width)-(Math.round(screen.width)/5);}

 if (thelocation.indexOf("jpg")>1 || thelocation.indexOf("gif")>1)
 { 
  win=window.open("","","left="+Math.round(screen.width-ancho)/2+",top="+Math.round(screen.height-alto)/2+",width="+ancho+",height="+alto+",scrollbars=yes,status=yes,resizable=yes");
  win.document.write("<HTML><TITLE>Cambra Oficial de Comerç i Indústria de Lleida</TITLE><body marginwidth='0' marginheight='0' topmargin='0' leftmargin='0' style='margin: 0; padding: 0; border-width: 0;'><IMG SRC="+thelocation+"></BODY></HTML>")
 }
 else if (thelocation.indexOf("municipi")>1)
 {
  win=window.open(thelocation,"","left="+Math.round(screen.width-ancho)/2+",top="+Math.round(screen.height-alto)/2+",width="+ancho+",height="+alto+",scrollbars=yes,status=yes,resizable=no");
 }
 else if (thelocation.indexOf("upload_clock.asp")>1)
 {
  win=window.open(thelocation,"","left="+Math.round(screen.width-ancho)/2+",top="+Math.round(screen.height-alto)/2+",width="+ancho+",height="+alto+",scrollbars=no,status=no,resizable=no");
 }
 else
 {
  win=window.open(thelocation,"","left="+Math.round(screen.width-ancho)/2+",top="+Math.round(screen.height-alto)/2+",width="+ancho+",height="+alto+",scrollbars=yes,status=yes,resizable=yes");
 }

win.focus();
win.status="Cambra Oficial de Comerç i Indústria de Lleida";
setTimeout('startAni()',1500);
if (thelocation=="") {return win;}
}


function startAni() {
if (document.anigif)
{
document.anigif.src = document.anigif.src
}
}
