<!-- 

//************************************************************
//***         ANUNZIA SOLUCIONS TECNOLÒGIQUES, S.L.        ***
//*** /t. 937 259 390                      /f. 937 254 146 ***
//*** /c. Sant Pau, 177.       08201 Sabadell( Barcelona ) ***
//*** /e. anunzia@anunzia.com          /w. www.anunzia.com ***
//************************************************************

//FUNCION PARA ABRIR UNA VENTANA CENTRADA EN LA PANTALLA.

//Si las opciones por defecto no nos gustan las podemos cambiar, no poner espacios blancos 
//entre comas, sino le pasamos '' en opciones retorna el apuntador a esa ventana.

function obrir_win(source,ancho, alto,nombre,opciones)
{
 var win_opt, xposition=0, yposition=0;
 if(parseInt(navigator.appVersion)>=4){xposition=(screen.width-ancho)/2;yposition=((screen.height-alto)/2)-25;}
 if (opciones==""){
  win_opt= "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=no,resizable=0,copyhistory=0,";
 } else {win_opt=opciones;}
 win_opt += "width=" + ancho + ",height=" + alto;
 win_opt += "screenx=" + xposition + "," + "screeny=" + yposition + "," + "left=" + xposition + "," + "top=" + yposition;
 return window.open(source,nombre,win_opt);
}

//FUNCION PARA HACER EL PRELOAD DE LAS IMAGENES
function preload(imgObj,imgSrc) {
  eval(imgObj+' = new Image()')
  eval(imgObj+'.src = "'+imgSrc+'"')
}

//FUNCION PARA REALIZAR EL DESPLAZAMIENTO DE CUALQUIER OBJETO DIV EN LA DIRECCION QUE SE QUIRA
function slide(obj,initx,inity,finx,finy,dir,inc) {
  if (document.layers) {
    eval("document."+obj+".top =" + parseInt(inity));
    eval("document."+obj+".left =" + parseInt(initx));
  }
  else { 
    if (document.all) {
      eval(obj+".style.pixelTop=" + parseInt(inity));
      eval(obj+".style.pixelLeft=" + parseInt(initx));
    }
 }
 if (dir=='directo') return true;
 if (dir=='arriba'){
  if (parseInt(inity)>parseInt(finy)){
    setTimeout("slide('"+obj+"',"+finx+","+(parseInt(inity)-parseInt(inc))+","+finx+","+finy+",'"+dir+"',"+inc+")",10)
  } 
 }
 if (dir=='abajo'){
  if (parseInt(inity)<parseInt(finy)){
    setTimeout("slide('"+obj+"',"+finx+","+(parseInt(inity)+parseInt(inc))+","+finx+","+finy+",'"+dir+"',"+inc+")",10)
  } 
 }
 if (dir=='izquierda'){
  if (parseInt(initx)>parseInt(finx)){
   setTimeout("slide('"+obj+"',"+(parseInt(initx)-parseInt(inc))+","+finy+","+finx+","+finy+",'"+dir+"',"+inc+")",10)
  } 
 }
 if (dir=='derecha'){
  if (parseInt(initx)<parseInt(finx)){
   setTimeout("slide('"+obj+"',"+(parseInt(initx)+parseInt(inc))+","+finy+","+finx+","+finy+",'"+dir+"',"+inc+")",10)
  } 
 }
 return true;
}

//FUNCION PARA DESPLAZAR DIVS EN LA DIRECCION QUE SE QUIERA A PARTIR DE DONDE ESTÁ
var salida=true;
function sliderel(obj,incx,incy,inc) {
  if (document.layers) {
    if (incy!=0) {
      eval("document."+obj+".top = document."+obj+".top + " + parseInt(inc));
      incy=incy-(Math.abs(inc));
    }
    if (incx!=0){
      eval("document."+obj+".left = document."+obj+".left +" + parseInt(inc));
      incx=incx-(Math.abs(inc));
    }
    if ((incx==0)&&(incy==0)) salida=true;
     else {salida=false;setTimeout("sliderel('"+obj+"',"+incx+","+incy+","+inc+")",10);}
  }
  else { 
    if (document.all) {
     if (incy!=0) {
      eval(obj+".style.pixelTop=" + obj + ".style.pixelTop +" + parseInt(inc));
      incy=incy-(Math.abs(inc));
     }
     if (incx!=0) {
      eval(obj+".style.pixelLeft=" + obj + ".style.pixelLeft +" + parseInt(inc));
      incx=incx-(Math.abs(inc));
     }
    if ((incx==0)&&(incy==0)) salida=true;
     else {salida=false;setTimeout("sliderel('"+obj+"',"+incx+","+incy+","+inc+")",10);}
   }
  }
}

// FUNCIONS PER CAMBIAR IMATGES SI TE LAYER.

function changeimg (img1,img2)
{
	if (document.all)
	{
		eval("document.images['imgdiv"+ img1 + "'].src="+ img2 +".src");
	}
	else if (document.layers)
	{
		eval("document."+ img1 +".document['imgdiv"+ img1 + "'].src="+ img2 +".src");
	}
}

// FUNCIO PER CAMBIAR IMATGES CUAN NO TE LAYER.

function changeimg2 (img1,img2)
{
	eval("document.images['"+ img1 + "'].src="+ img2 +".src");
}

// FUNCIO PER CAMBIAR EL TEXTE I TOT L'HTML SI ES VOL DE UN DIV.

function change_text(divname, newtext)
{
	if (document.layers)
	{
        document.layers[divname].document.write(newtext)
        document.layers[divname].document.close()
    }
    else if (document.all) document.all[divname].innerHTML = newtext
}

//-->
