/*
    ============================================================================
    DHTML DaVinci - Versión 3.0 Mini (IE5++,NS6+,OP6+)
    Componente: DHTML y controles para el portal mediempleo.net - mediempleo.js
    Tamaño: 7352 bytes (7.18 Kb)
    Copyright (c) 2005 - Francisco Vida (info@pacovida.com)
    www.espirituDaVinci.com - info@espirituDaVinci.com
    ============================================================================
*/
    window.defaultStatus=':: Mediempleo - Empleo medico en España'
//    window.onerror=function(){return true}

    // =========================================================================
    // = DHTML DaVinci: Funciones de control                                   =
    // =========================================================================

    // === Precarga de imágenes
    preload=new Array()
    preload[0]=new Array('menu','../web/img/botonmaxon.gif','../web/img/botonmaxof.gif')
    preload[1]=new Array('login','../web/img/accederon.gif','../web/img/accederof.gif')
    preload[2]=new Array('power','../web/img/poweron.gif','../web/img/powerof.gif')
    preload[3]=new Array('imgsubmit','../web/img/submiton.gif','../web/img/submitof.gif')
    preload[4]=new Array('enviar','../web/img/enviaron.gif','../web/img/enviarof.gif')
    preload[5]=new Array('continuar','../web/img/continuaron.gif','../web/img/continuarof.gif')
    preload[6]=new Array('modificar','../web/img/modificaron.gif','../web/img/modificarof.gif')
    preload[7]=new Array('volver','../web/img/volveron.gif','../web/img/volverof.gif')
    preload[8]=new Array('imgizq','../web/img/izqon.gif','../web/img/izqof.gif')
    preload[9]=new Array('imgder','../web/img/deron.gif','../web/img/derof.gif')

    precargarImagen(preload)

    // === Control del cambio de imágenes del menú
    function menu(id,modo)
    {
      if(id!='00'){cambiarImagen('menu'+id,document.imgBook['menu'][modo].src)}
    }

    // === Función para centrar la capa con el banner publicitario
    function centrarBanner()
    {
      var x=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;x=(x<=1024)? 500 : 500+(x-998)/2
      publicidad=new DaVinci('bannerSup',x,40,478,70,true)
    }

    // === Función para mostrar/ocultar la capa de alerta
    function openAlert()
    {
      var x=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;x=(x<=1024)? 240 : 240+(x-998)/2
      alerta=new DaVinci('alert',x,200,704,184,true)
    }
    function closeAlert(){alerta.ver(0)}

    // === Funciones para la apertura de popUp's
    var popUp=0
    function abrirPopUp(url,id,ancho,alto,scroll)
    {
      if(arguments.length==4||scroll==0){scroll=0}else{scroll=1}
      var cfg='left='+Math.round((screen.width-ancho)/2)+',top='+Math.round((screen.height-alto)/2)+',width='+ancho+',height='+alto+',resizable=0,status=0,location=0,toolbar=0,menubar=0,scrollbars='+scroll
      if(!popUp||popUp.closed){popUp=window.open(url,id,cfg)}else{popUp.close();popUp=window.open(url,id,cfg)}
      popUp.focus()
    }

    // === Funciones de inicio
    function mediempleo(){centrarBanner()}
    function alCargar(){}
    window.onload=alCargar

    // === Funciones para el mapa de imagen
    var dataImg=new Array('espana','pontevedra','acoruna','lugo','ourense','asturias','cantabria','araba','bizkaia','gipuzkoa','navarra','la-rioja','leon','palencia','burgos','zamora','valladolid','segovia','soria','salamanca','avila','madrid','guadalajara','cuenca','toledo','ciudad-real','albacete','caceres','badajoz','huesca','zaragoza','teruel','girona','barcelona','tarragona','lleida','castellon','valencia','alicante','murcia','huelva','sevilla','cordoba','jaen','cadiz','malaga','granada','almeria','islas-baleares','canarias-santa-cruz-de-tenerife','canarias-las-palmas','ceuta','melilla')
    var imgAlbum=new Array()
    function preloadMapa(){path='./img/';for(i=0;i<dataImg.length;i++){imgAlbum[i]=new Image;imgAlbum[i].src=path+dataImg[i]+'.gif'}}
    function mapaOn(img)
    {
      if(imgAlbum.length==0){preloadMapa()}
      document.images['mapa'].src=imgAlbum[img].src
    }
    function mapaOf()
    {
      if(imgAlbum.length==0){preloadMapa()}
      document.images['mapa'].src=imgAlbum[0].src
    }

    // =========================================================================
    // = DHTML DaVinci: Versión 3.0 mini (IE5++,NS6+,OP6+)                     =
    // =========================================================================

    function DaVinci(id,x,y,ancho,alto,visible,transparencia,cursor)
    {
      this.id=id
      this.ele=(document.getElementById)? document.getElementById(id) : document.all[id]
      this.css=this.ele.style
      this.obj=this.id+'DV'
      this.doc=document
      eval(this.obj+'=this')
      this.x=x || 0
      this.y=y || 0
      this.ancho=ancho || 0
      this.alto=alto || 0
      this.visible=(visible==false)? 0 : visible || 1
      this.cursor=cursor || 'auto'
      this.transparencia=transparencia || 0

      this.css.cursor=this.cursor
      this.css.clip='rect(0px '+this.ancho+'px '+this.alto+'px 0px)'
      this.moverHasta(this.x,this.y)
      if(this.transparencia){this.transparentar(this.transparencia)}
      this.ver(this.visible)
      return this
    }

    function DaVinciVer()
    {
      var ver=arguments[0],exe=(arguments.length>1)? arguments[1] : null
      this.css.visibility=(ver==0)? 'hidden' : (ver==1)? 'inherit' : (this.visible)? 'hidden' : 'inherit'
      this.visible=(ver==0||this.visible)? false : true
      DaVinciEvaluar(exe,this)
    }

    function DaVinciMoverHasta()
    {
      var exe=(arguments.length==3)? arguments[2] : null
      this.x=(arguments[0]=='actual')? this.x : arguments[0]
      this.y=(arguments[0]=='actual')? this.y : arguments[1]
      this.css.left=this.x+'px'
      this.css.top=this.y+'px'
      this.css.pixelLeft=this.x
      this.css.pixelTop=this.y
      this.onMover(this)
      DaVinciEvaluar(exe,this)
    }

    function DaVinciMoverDesde()
    {
      var exe=(arguments.length==3)? arguments[2] : null
      this.moverHasta(this.x+arguments[0],this.y+arguments[1],exe)
    }

    function DaVinciTransparentar()
    {
      var exe=(arguments.length>1)? arguments[1] : null
      this.css.filter="alpha(opacity="+(100-arguments[0])+")"
      this.css.MozOpacity=(100-arguments[0])*0.01
      this.transparencia=arguments[0]
      this.onTransparentar(this)
      DaVinciEvaluar(exe,this)
    }

    function DaVinciEvaluar(exe,argumento){if(exe==null){return}else if(typeof(exe)=='function'){exe(argumento)}else {eval(exe)}}

    function cambiarImagen(imgName,imgSrc)
    {
      var img=document.images[imgName]
      imgSrc=(imgSrc.indexOf('.')!=-1)? imgSrc : document.imgBook[imgName][imgSrc].src
      if(document.getElementById){img.setAttribute('src',imgSrc)}else{img.src=imgSrc}
    }

    function precargarImagen(imgName,srcOut,srcOver)
    {
      if(arguments.length==1)
      {
        for(var f=0;f<imgName.length;f++){precargarImagen(imgName[f][0],imgName[f][1],imgName[f][2])}
      }
      else
      {
        if(!document.imgBook){document.imgBook=new Array()}
        var imgOut=new Image();imgOut.name=imgName+'Out';imgOut.src=srcOut
        var imgOver=new Image();imgOver.name=imgName+'Over';imgOver.src=srcOver
        document.imgBook[imgName]=new Array()
        document.imgBook[imgName][0]=imgOver
        document.imgBook[imgName][1]=imgOut
        document.imgBook[imgName]['out']=imgOver
        document.imgBook[imgName]['over']=imgOut
      }
    }

    function info()
    {
      var txt=''
      txt+='Mediempleo.com (versión 1.0)\n\n'
      txt+='Proyecto desarrollado por Francisco Vida.\n'
      txt+='Web: www.pacovida.com\nE-mail: info@pacovida.com\n\n'
      txt+='Incluye DHTML DaVinci 3.0:\n'
      for(var f=0;f<DVPlugins.length;f++){txt+='  - '+DVPlugins[f]+'\n'}
      txt+='Powered by: DHTML DaVinci.\n'
      txt+='Web: www.espirituDaVinci.com\nE-mail: leonardo@espirituDaVinci.com\n\n'
      txt+='Todos los códigos HTML, PHP, CSS, y JavaScript\n'
      txt+='han sido programados por Francisco Vida. Queda\n'
      txt+='prohibido todo uso sin autorización expresa del\n'
      txt+='autor de los códigos.\n\n'
      txt+='Copyright: 2005 © Francisco Vida.\n'
      alert(txt)
    }

    DaVinci.prototype.ver=DaVinciVer
    DaVinci.prototype.moverHasta=DaVinciMoverHasta
    DaVinci.prototype.moverDesde=DaVinciMoverDesde
    DaVinci.prototype.transparentar=DaVinciTransparentar
    DaVinci.prototype.onMover=new Function()
    DaVinci.prototype.onTransparentar=new Function()
    DVPlugins=new Array()
    DVPlugins[DVPlugins.length]='Nucleo (mini)'

//  === DHTML DaVinci (c) 2005 =================================================
