
function YY_TogLay(yytl) { //v1.2
//copyright (c)1998 Yaromat, Jaro von Flocken
  if ((document.layers)||(document.all)){
    if (document.layers){
      yytl=eval(yytl);
          yytl.visibility=(yytl.visibility=="hide")?"show":"hide";
    }
    if (document.all){
      eval("yytl=yytl.replace(/.layers/gi, '.all')");
      yytl=eval(yytl);
          yytl.style.visibility=(yytl.style.visibility=="hidden")?"visible":"hidden";
    }
  }
}

function takeFocusBack() {
    window.focus();
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

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_findObj(n, d) { //v3.0
  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&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

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 hideall() {
MM_showHideLayers('vClick0','','hide','vClick1','','hide','vClick2','','hide','vClick3','','hide')
}


function MM_openBrWindowCentrada(theURL,winName,ancho,alto) { //v2.0
	// Variables para la definicion y centrado de la ventana del popup
	var x,y,x0,y0;
	var anchopopup=ancho,altopopup=alto;
	ver_int = parseInt(navigator.appVersion);
	if (ver_int>=4) {
		// Dimensiones de la pantalla
  		x0=screen.availWidth
   		y0=screen.availHeight
		// Posicion de la ventana
		x=parseInt((x0-anchopopup)/2)
   		y=parseInt((y0-altopopup)/2)
}
	features='width='+anchopopup+',height='+altopopup+',left='+x+',top='+y
	window.open(theURL,winName,features);
}



n6=(document.getElementById)?true:false
n4=(document.layers)?true:false
ie=(document.all)?true:false
function Rdeclare(obj){ 
  val=false;
  val2=false;
  this.boundUnder=new Array()
  this.boundBy=false
  this.nested=false;
  if(ie||n6)this.nested=true;
  if(lib.isArray(obj)){
    lib.divList[lib.divList.length]=obj[obj.length-1]
    this.obj=obj[obj.length-1]
    if(n4){
      root=new Array()
      for(wCOUNT=0;wCOUNT!=obj.length;wCOUNT++){
        root[wCOUNT]="document."+obj[wCOUNT]
      }
      div(obj[0]).nested=true
      div(obj[0]).boundBy=this.obj
      div(obj[0]).boundUnder[0]=this.obj
      this.nested=true;
      val=root.join(".")
      val2=val
    }
  } else {
    this.obj=obj
    lib.divList[lib.divList.length]=this.obj
    val=false;
    val2=false;
    if(n4){
      val="document.layers['"+this.obj+"']"
      val2="document.layers['"+this.obj+"']"
    }
  }
/*  if(n6&&!ie){
    val="document.getElementById('"+this.obj+"').style"
    val2="document.getElementById('"+this.obj+"')"
  }*/
  if(n6){
    val="document.getElementById('"+this.obj+"').style"
	val2="document.getElementById('"+this.obj+"')"
  }
  else if(ie){
    val="document.all['"+this.obj+"'].style"
    val2="document.all['"+this.obj+"']"
  }
  this.style=eval(val)
  this.dom=eval(val2)
  this.reInit=RreInit
  this.x=Rleft;this.y=Rtop;this.z=RzIndex;
  this.move=Rmove;
  this.show=Rshow;
  this.hide=Rhide;
  this.syncHide=syncHide;
  this.syncShow=syncShow;
  this.toggle=Rtoggle;
  this.shown=Rshown;
  this.clip=Rclip;
  this.resize=Rresize;
  this.width=Rwidth;this.height=Rheight;this.write=Rwrite;
  this.xe=(isNaN(parseInteger(this.style.left)))?0:parseInteger(this.style.left);
  this.ye=(isNaN(parseInteger(this.style.top)))?0:parseInteger(this.style.top);
  this.ze=this.style.zIndex;
  this.xabs=this.xe;
  this.count=0;
  this.temp=new Array();
  this.yabs=this.ye;
  this.he=parseInteger(this.style.height);
  this.we=parseInteger(this.style.width);	
  visible=this.style.visibility;
  if(visible=='show'||visible=='inherit'||visible=='visible'||visible==''){this.ve=true}
  
  this.relV=this.ve;
  if(ie||n6){
    var vals=this.style.clip.substring(5,this.style.clip.length-3).split(lib.clipSpacer);
    this.stoT=parseInteger((!parseInteger(vals[0])&&parseInteger(vals[0])!=0)?"x":vals[0]);
    this.stoR=parseInteger((!parseInteger(vals[1])&&parseInteger(vals[1])!=0)?"x":vals[1]);
    this.stoB=parseInteger((!parseInteger(vals[2])&&parseInteger(vals[2])!=0)?"x":vals[2]);
    this.stoL=parseInteger((!parseInteger(vals[3])&&parseInteger(vals[3])!=0)?"x":vals[3]);
  }
  if(n4){
     this.stoT=parseInteger((isNaN(parseInteger(this.style.clip.top))||parseInteger(this.style.clip.top)==0)?"x":this.style.clip.top);
     this.stoR=parseInteger((isNaN(parseInteger(this.style.clip.right))||parseInteger(this.style.clip.right)==0)?"x":this.style.clip.right);
     this.stoB=parseInteger((isNaN(parseInteger(this.style.clip.bottom))||parseInteger(this.style.clip.bottom)==0)?"x":this.style.clip.bottom);
     this.stoL=parseInteger((isNaN(parseInteger(this.style.clip.left))||parseInteger(this.style.clip.left)==0)?"x":this.style.clip.left);
  }
  this.relT=this.stoT
  this.relR=this.stoR
  this.relB=this.stoB
  this.relL=this.stoL
  this.clip(this.relT,this.relR,this.relB,this.relL);
  for(u=0;u!=lib.elements.length;u++){
    lib.elements[u](this)
  }
}
function declareLibrary(){ 
  this.browserHeight=0;
  this.browserWidth=0;
  this.divList=new Array()
  this.oldbrowserHeight=0
  this.oldbrowserWidth=0
  this.drager=false
  this.CHARtopone="";
  this.CHARstoreDiv=""
  this.CHARcross=""
  this.leftAx=0
  this.topAx=0
  this.populate=Rpopulate
  this.del=deleter
  this.isArray=RisArray
  this.clipSpacer="px "
  this.elements=new Array()
}
lib=new declareLibrary();
loaded=new Function()
function Rinit(){ 
  if(n4){
   lib.browserHeight=parseInteger(window.innerHeight)-15
   lib.browserWidth=parseInteger(window.innerWidth)-15
  }
  if(ie){

   lib.browserHeight=parseInteger(document.body.clientHeight)
   lib.browserWidth=parseInteger(document.body.clientWidth)
  } else {
   if(n6){
     lib.browserHeight=parseInteger(window.innerHeight)-15
     lib.browserWidth=parseInteger(window.innerWidth)-15
   }
  }
  lib.oldbrowserHeight=lib.browserHeight
  lib.oldbrowserWidth=lib.browserWidth
  var object;
  if(ie)size=document.all.tags('div').length;
  if(n4)size=document.layers.length;
  if(n6)size=document.getElementsByTagName('div').length;
  for(count=0;count!=size;count++){
    if(ie)object=document.all.tags('div')(count).id;
    if(n4)object=document.layers[count].id;
    if(n6)object=document.getElementsByTagName('div').item(count).id;
    if(object!=""){
      eval(object+"Obj=new Rdeclare('"+object+"')");
    }
  }
  loaded()
}
resize=new Function()
function RDem(){ 
  lib.browserHeight=parseInteger((n4)?window.innerHeight:document.body.clientHeight)
  lib.browserWidth=parseInteger((n4)?window.innerWidth:document.body.clientWidth)
  resize(lib.browserWidth,lib.browserHeight);
  if(n4&&(lib.browserHeight!=lib.oldbrowserHeight||lib.browserWidth!=lib.oldbrowserWidth)){history.go(0)}
}
function parseInteger(text){ 
  num="";
  neg=false
  if(isNaN(text)){
    eval("text2='"+text+"'");
    for(aCOUNT=0;aCOUNT!=text2.length;aCOUNT++){
      if(!isNaN(text2.charAt(aCOUNT))||text2.charAt(aCOUNT)=='-'){
        num+=text2.charAt(aCOUNT);
      }
    }
    return((!num)?"x":parseInt(num));
  } else {
    return(parseInt(text));
  }
  return(-1);
}
if (n4){window.captureEvents(Event.ONLOAD|Event.RESIZE)}
if(n4||ie||n6){
  window.onload=Rinit
  window.onresize=RDem
}
function div(which){
  if(isNaN(which)){
    eval("one="+which+"Obj");
  } else {
    eval("one="+lib.divList[parseInteger(which)]+"Obj");
  }
  if(one){
    return(one)
  } else {
    window.status="Error:Div '"+which+"' is undefined";
  }
}

function RreInit(obj){  
  val=false;
  val2=false;
  this.obj=obj;
  if(lib.isArray(obj)){
    this.obj=obj[obj.length-1]
    if(n4){
      root=new Array()
      for(wCOUNT=0;wCOUNT!=obj.length;wCOUNT++){
        root[wCOUNT]="document."+obj[wCOUNT]
      }
      val=root.join(".")
      val2=val
    }
  } else {
    this.obj=obj
    val=false;
    val2=false;
    if(n4){
      val="document.layers['"+this.obj+"']"
      val2="document.layers['"+this.obj+"']"
    }
  }
  if(n6&&!ie){
    val="document.getElementById('"+this.obj+"').style"
    val2="document.getElementById('"+this.obj+"')"
  }
  if(ie){
    val="document.all['"+this.obj+"'].style"
    val2="document.all['"+this.obj+"']"
  }
  this.dom=eval(val2)
  this.style=eval(val)
  if(ie||n4){
    this.dom.onmouseover=new Function("mouseOv('"+this.obj+"')")
    this.dom.onmouseout=new Function("mouseOu('"+this.obj+"')")
  } else {
    if(n6){
      this.dom.removeEventListener("mouseover",mouseOv,true);
      this.dom.removeEventListener("mouseout",mouseOu,true);
      this.dom.addEventListener("mouseover",mouseOv,true);
      this.dom.addEventListener("mouseout",mouseOu,true);
    }
  }
}

function Rtop(y){ 
  if(arguments.length==0){
    return(this.ye)
  } else {
    if(!isNaN(parseInteger(y))){
      y=(isNaN(parseInteger(y)))?this.ye:Math.round(parseInteger(y));
      if(!this.nested&&this.boundBy){
         this.yabs=y+div(this.boundBy).yabs
         this.style.top=y+div(this.boundBy).yabs
      } else {
         this.yabs=y
         this.style.top=y
      }
      this.ye=y
      if(!this.nested&&this.boundUnder){this.oldy=this.ye}
      for(this.w1=0;!this.nested&&this.w1!=this.boundUnder.length;this.w1++){
        div(this.boundUnder[this.w1]).y(div(this.boundUnder[this.w1]).ye);
      }
      if(!this.nested&&this.boundBy){
        this.clip(null,null,null,null);
      }
    }
  }
  return true;
}
function Rleft(x){ 
  if(arguments.length==0){
    return(this.xe)
  } else {
    if(!isNaN(parseInteger(x))){
      x=(isNaN(parseInteger(x)))?this.xe:Math.round(parseInteger(x));
      if(!this.nested&&this.boundBy){
        this.xabs=x+div(this.boundBy).xabs
        this.style.left=x+div(this.boundBy).xabs
      } else {
        this.xabs=x
        this.style.left=x
      }
      this.xe=x
      if(!this.nested&&this.boundUnder){this.oldx=this.xe;}
      for(this.w2=0;!this.nested&&this.w2!=this.boundUnder.length;this.w2++){
        div(this.boundUnder[this.w2]).x(div(this.boundUnder[this.w2]).xe);
      }
      if(!this.nested&&this.boundBy){
        this.clip(null,null,null,null);
      }
    }
  }
  return true;
}
function RzIndex(z){ 
  if(arguments.length==0){
    return(this.ze)
  } else {
    z=(isNaN(parseInteger(z)))?this.ze:Math.round(parseInteger(z));
    this.style.zIndex=z
    for(this.w3=0;!this.nested&&this.w3!=this.boundUnder.length;this.w3++){
      div(this.boundUnder[this.w3]).z(z+div(this.boundUnder[this.w3]).ze-this.ze);
    }
    this.ze=z
    return(false);
  }
  return true;
}
function Rwidth(width){
  if(arguments.length>0){
    this.style.width=width
    this.we=width
    this.clip(null,null,null,null);
    return(false);
  } else {
    val=0;
    if(isNaN(this.we)){
      this.style.width=""
      if(ie||n6){
        val=parseInteger(this.dom.offsetWidth)
      }
      if(n4){
        val=this.dom.document.width
      }
    } else {
      val=this.we
    }
  return(val);
  }
  return true;
}
function Rheight(height){
  if(arguments.length>0){
    this.style.height=height
    this.he=height
    this.clip(null,null,null,null);
    return(false);
  } else {
    val=0;
    if(isNaN(this.he)){
      this.style.height=""
      if(ie||n6){
        val=parseInteger(this.dom.offsetHeight)
      }
      if(n4){
        val=this.dom.document.height
      }
    } else {
      val=this.he
    }
  return(val);
  }
  return true;
}

function Rmove(x,y){
  x=(isNaN(parseInteger(x)))?this.xe:Math.round(parseInteger(x));
  y=(isNaN(parseInteger(y)))?this.ye:Math.round(parseInteger(y));
  this.x(x)
  this.y(y)
  return true;
}
function Rwrite(textline){
  temp=false
  if(!n4&&this.boundUnder.length>=1){
    temp=this.boundUnder
    for(re=0;re!=temp.length;re++){
      tempDrag=lib.dragList
      this.release(temp[re]);
    }
  }
  if(ie){
    this.dom.innerHTML=textline;
  }
  if(n6&&!ie){
    this.dom.innerHTML=textline
  }
  if(n4){
    this.dom.document.open()
    this.dom.document.write(textline);
    this.dom.document.close()
  }
  this.clip(null,null,null,null);
  if(!n4&&temp){
    for(er=0;er!=temp.length;er++){
      this.contain(temp[er]);
      lib.dragList=tempDrag
    }
  }
  return true;
}
function RisArray(text){
  vus=false
  eval("var text='"+text+"'");
  for(this.countbArrayig=0;this.countbArrayig!=text.length&&vus!=true;this.countbArrayig++){
    if(text.charAt(this.countbArrayig)==","){vus=true}
  }
  return(vus)
  return true;
}
function Rhide(){
  this.style.visibility="hidden"
  this.ve=false
  this.relV=false
  if(this.boundUnder){
    this.syncHide()
  }
  return true;
}
function syncShow(){
  for(this.w6=0;this.w6!=this.boundUnder.length;this.w6++){
    if(div(this.boundUnder[this.w6]).relV){
      div(this.boundUnder[this.w6]).style.visibility="visible"
      this.ve=true
    }
    div(this.boundUnder[this.w6]).syncShow()
  }
}
function syncHide(){
  for(this.w5=0;this.w5!=this.boundUnder.length;this.w5++){
    div(this.boundUnder[this.w5]).style.visibility="hidden"
    this.ve=false
    div(this.boundUnder[this.w5]).syncHide()
  }
}
function Rshow(){
  if(!this.boundBy||div(this.boundBy).ve){
    this.style.visibility="visible"
    this.ve=true
  }
  this.relV=true
  if(this.boundUnder){
    this.syncShow()
  }
  return true;
}
function Rtoggle(){
  if(this.shown()){this.hide()} else {this.show()}
  return true;
}
function Rshown(){
  if(this.relV){return(true)} else {return(false)}
}
function Rresize(width,height){
  this.width(width)
  this.height(height)
  return true;
}
function Rclip(top,right,bottom,left){
  if(arguments.length==1){
      switch(top.toLowerCase()){
        case 't':val=(isNaN(parseInteger(this.relT)))?0:parseInteger(this.relT);break;
        case 'r':val=(isNaN(parseInteger(this.relR)))?this.width():parseInteger(this.relR);break;
        case 'b':val=(isNaN(parseInteger(this.relB)))?this.height():parseInteger(this.relB);break;
        case 'l':val=(isNaN(parseInteger(this.relL)))?0:parseInteger(this.relL);break;
      }
    return(val);
  } else {
    top=(isNaN(parseInteger(top)))?this.relT:parseInteger(top);
    right=(isNaN(parseInteger(right)))?this.relR:parseInteger(right);
    bottom=(isNaN(parseInteger(bottom)))?this.relB:parseInteger(bottom);
    left=(isNaN(parseInteger(left)))?this.relL:parseInteger(left);
    this.relT=top
    this.relR=right
    this.relB=bottom
    this.relL=left
    top=(isNaN(parseInteger(this.relT)))?0:parseInteger(this.relT);
    right=(isNaN(parseInteger(this.relR)))?this.width():parseInteger(this.relR);
    bottom=(isNaN(parseInteger(this.relB)))?this.height():parseInteger(this.relB);
    left=(isNaN(parseInteger(this.relL)))?0:parseInteger(this.relL);
    if(!this.nested&&this.boundBy){
      t=-this.ye+((isNaN(parseInteger(div(this.boundBy).stoT)))?0:parseInteger(div(this.boundBy).stoT));
      r=-this.xe+((isNaN(parseInteger(div(this.boundBy).stoR)))?div(this.boundBy).clip('r'):parseInteger(div(this.boundBy).stoR));
      b=-this.ye+((isNaN(parseInteger(div(this.boundBy).stoB)))?div(this.boundBy).clip('b'):parseInteger(div(this.boundBy).stoB));
      l=-this.xe+((isNaN(parseInteger(div(this.boundBy).stoL)))?0:parseInteger(div(this.boundBy).stoL));
      if(t>=top){top=t}
      if(r<=right){right=r}
      if(b<=bottom){bottom=b}
      if(l>=left){left=l}
    }
    if(ie||n6){
      this.style.clip="rect("+Math.round(top)+lib.clipSpacer+Math.round(right)+lib.clipSpacer+Math.round(bottom)+lib.clipSpacer+Math.round(left)+"px)"
    }
    if(n4){
      this.style.clip.left=Math.round(left)
      this.style.clip.right=Math.round(right)
      this.style.clip.bottom=Math.round(bottom)
      this.style.clip.top=Math.round(top)
    }
    this.stoT=top;
    this.stoR=right;
    this.stoB=bottom;
    this.stoL=left;
    for(this.w4=0;!this.nested&&this.w4!=this.boundUnder.length;this.w4++){
      div(this.boundUnder[this.w4]).clip(null,null,null,null);
    }
    return(false);
  }
  return true;
}
function Rpopulate(st,valx,len){
  if(st){stores=st} else {stores=new Array()}
  for(q=stores.length;q<=len;q++){stores[q]=valx}
  return(stores)
  return true;
}
function Rpos(object){
  for(sz=0;object!=lib.divList[sz]&&sz<lib.divList.length;sz++){}
  return(sz)
  return true;
}
function deleter(val,stringArray){
  var tempn=new Array()
  var temps=new Array()
  counter2=0
  for(counter=0;counter!=stringArray.length;counter++){
    if(stringArray[counter]!=val){
      tempn[counter2]=stringArray[counter]
      counter2++
    }
  }
  stringArray=new Array()
  for(countup=0;countup!=tempn.length;countup++){stringArray[countup]=tempn[countup];}
  return(stringArray)
}
//Create Div Functions------------------------------------------
function create(name,props,code,nested){
  test=0
  test2=0
  storeVal=false
  propArray=new Array()
  propArray=props.split(";");
  for(zCOUNT=0;zCOUNT!=propArray.length;zCOUNT++){
    propArray[zCOUNT]=propArray[zCOUNT].split(":")
    value=propArray[zCOUNT][1]
    if(propArray[zCOUNT][0].toLowerCase()=="width"){storeVal=value}
  }
  if(n4){
    if(arguments.length>3){
      var layer=document.layers[nested].document.layers[name] = new Layer(((storeVal)?storeVal:0), document.layers[nested])
      eval("document."+nested+".document."+name+"=layer")
    } else {
      var layer=document.layers[name]=new Layer(((storeVal)?storeVal:0))
      eval("document."+name+"=layer")
    }
  }
  if(ie) {
    if(arguments.length>3){
      div(nested).dom.innerHTML=div(nested).dom.innerHTML+"<div id='"+name+"' style='position:absolute;"+props+"'></div>";
    } else {
      document.body.insertAdjacentHTML("BeforeEnd","<div id='"+name+"' style='position:absolute;clip:rect( Xpx Xpx Xpx Xpx);"+props+"'></div>")
    }
  }
  if(n6&&!ie){
    newDiv=document.createElement('DIV');
    newDiv.setAttribute('style',"position:absolute;"+props);
    newDiv.setAttribute('id',name);
    if(arguments.length>3){
      div(nested).dom.appendChild(newDiv);
    } else {
      document.body.appendChild(newDiv);
    }
  }
  if(arguments.length>3){
    eval(name+"Obj=new Rdeclare(new Array('"+nested+"','"+name+"'))");
  } else {
    eval(name+"Obj=new Rdeclare('"+name+"')");
  }
 if(n6||ie&&code!="")div(name).write(code);
  if(n4){
    for(zCOUNT=0;zCOUNT!=propArray.length;zCOUNT++){
      value=propArray[zCOUNT][1]
      switch(propArray[zCOUNT][0].toLowerCase()){
        case "top":div(name).y(value);break;
        case "left":div(name).x(value);break;
        case "width":div(name).width(value);break;
        case "height":div(name).height(value);break;
        case "clip":test2=1;cliper=value.substring(5,value.length-3).split(lib.clipSpacer);div(name).clip(cliper[0],cliper[1],cliper[2],cliper[3]);break;
        case "z-index":div(name).z(value);break;
        case "visibility":test=1;if(value=="hidden"||value=="hide"){div(name).hide()} else {div(name).show()};break;
      }
    }
    if(code!=""){div(name).write(code)}
    if(!test){div(name).show()}
    if(!test2){
      div(name).relT="x"
      div(name).relR="x"
      div(name).relB="x"
      div(name).relL="x"
      div(name).clip("x","x","x","x")
    }
  }
  return true;
}
function Rremove(){
  this.write('');
  if(n4){
    this.hide();
    this.z(-100);
    this.move(-this.width()-100,-this.height()-100)
  }
  if(n6&&!ie){
    if(!this.boundBy){
      document.body.removeChild(this.dom)
    } else {
      div(this.boundBy).dom.removeChild(this.dom)
    }
  }
  if(ie){
    this.dom.outerHTML=''
  }
  if(this.boundBy){
    div(this.boundBy).boundUnder=lib.del(this.obj,div(this.boundBy).boundUnder)
    this.boundBy=false
  }
  lib.dragList=lib.del(this.obj,lib.dragList)
  lib.divList=lib.del(this.obj,lib.divList)
  this.mouseOverCom=""
  this.mouseOutCom=""
  eval(this.obj+"Obj=false");
  return true;
}
function createINIT(object){
  object.remove=Rremove
}
lib.elements[lib.elements.length]=createINIT

//Event Capture Functions------------------------------------------
mouseDown=new Function()
mouseMove=new Function()
mouseUp=new Function()
keyDown=new Function()
keyUp=new Function()
keyPress=new Function()
mouseOver=new Function()
mouseOut=new Function()
function mouseOv(e){
  if(ie){
    evName=e
    lib.overList[lib.overList.length]=evName
    eval(div(evName).mouseOverCom);
    mouseOver(evName);
  } else {
    if(n6){
      evName=e.currentTarget.id
      lib.overList[lib.overList.length]=evName
      eval(div(evName).mouseOverCom);
      mouseOver(evName);
    }
    if(n4){
      evName=e
      lib.overList[lib.overList.length]=evName
      eval(div(evName).mouseOverCom);
      mouseOver(evName);
      tempNm=evName
      while(tempNm){
        if(div(tempNm).boundBy){
          tempNm=div(tempNm).boundBy
          lib.overList[lib.overList.length]=tempNm
          mouseOver(tempNm);
          eval(div(tempNm).mouseOverCom);
        } else {
          tempNm=false;
        }
      }
    }
  }
}
function mouseOu(e){
  if(ie){
    evName=e
    lib.overList=lib.del(evName,lib.overList)
    eval(div(evName).mouseOutCom);
    mouseOut(evName);
  } else {
    if(n6){
      evName=e.currentTarget.id
      lib.overList=lib.del(evName,lib.overList)
      eval(div(evName).mouseOutCom);
      mouseOut(evName);
    }
    if(n4){
      evName=e
      lib.overList=lib.del(evName,lib.overList)
      eval(div(evName).mouseOutCom);
      mouseOut(evName);
      tempNm=evName
      while(tempNm){
        if(div(tempNm).boundBy){
          tempNm=div(tempNm).boundBy
          lib.overList=lib.del(tempNm,lib.overList)
          eval(div(tempNm).mouseOutCom);
          mouseOut(tempNm);
        } else {
          tempNm=false;
        }
      }
    }
  }
}
function RmouseOver(com){
  this.mouseOverCom=com
}

function RmouseOut(com){
  this.mouseOutCom=com
}
function RmouseDown(com){
  this.mouseDownCom=com
}

function RmouseUp(com){
  this.mouseUpCom=com
}

function selectedDiv(name){
  retVal=false;
  for(xCOUNT=0;xCOUNT!=lib.overList.length;xCOUNT++){
    if(lib.overList[xCOUNT].toLowerCase()==name.toLowerCase()){
      retVal=true;
      break;
    }
  }
  return(retVal);
}

//LoadPage Functions------------------------------------------
loadedPage=new Function()
function RloadPage(url){
  if(n4){
    this.dom.load(url,this.width());
    window.setTimeout("div('"+this.obj+"').clip(null,null,null,null);loadedPage('"+this.obj+"')",1000);
  }
  if(n6||ie){
     pageRef=(ie)?document.pageloaderBuffer:document.getElementById('pageloaderBuffer');
     lib.CHARstoreDiv=this.obj
     if(n6&&!ie){
      pageRef.src="about:blank"
      eval("lib.CHARcross='"+((pageRef.contentDocument==null)?"":pageRef.contentDocument.location.href)+"'");
      pageRef.src=url
     } else {
      document.frames['pageloaderBuffer'].location.href='about:blank'
      lib.CHARcross=document.frames['pageloaderBuffer'].location.href
      document.frames['pageloaderBuffer'].location.href=url
     }
     Rcheckload(url)
  }
  return true;
}
function Rcheckload(url){
  if(n6&&!ie){
    val=((pageRef.contentDocument==null)?"":pageRef.contentDocument.location.href)
  } else {
    val=document.frames['pageloaderBuffer'].location.href
  }
  if(lib.CHARcross==val){
    window.setTimeout("Rcheckload('"+url+"')",100)
  } else {
    if(ie){
      window.setTimeout("div('"+lib.CHARstoreDiv+"').write(document.frames['pageloaderBuffer'].document.body.innerHTML);loadedPage('"+lib.CHARstoreDiv+"');",1000);
    } else {
      if(n6){
        window.setTimeout("div('"+lib.CHARstoreDiv+"').write(pageRef.contentDocument.body.innerHTML);loadedPage('"+lib.CHARstoreDiv+"');",1000)
      }
    }
  }
  return true;
}

/*
Se ha comentado el iframe porque las páginas que hacer referencia a este script y están bajo HTTPS muestran el mensaje 
que dice que hay elementos no seguros.
IMM 30/07/2004
*/
if(ie){
  //document.write('<iframe style="position:absolute;left:-10;top:-10;visibility:hidden;" width=100 height=100 id="pageloaderBuffer"></iframe>');
  //document.frames['pageloaderBuffer'].location.href='about:blank'
} else {
  if(n6){
  //  document.write('<iframe style="position:absolute;left:-10;top:-10;visibility:hidden;" width=0 height=0 id="pageloaderBuffer"></iframe>');
  }
}
function loadPageINIT(object){
  object.loadPage=RloadPage
}
lib.elements[lib.elements.length]=loadPageINIT
//moveTo Functions------------------------------------------
function RmoveStop(){
  if(this.pointloopArray){
    window.clearTimeout(this.pointloopArray)
  }
}
function RmoverPoints(which){
  if(which!=this.moveToX.length){
    this.move(this.moveToX[which],this.moveToY[which])
    this.pointloopArray=window.setTimeout("div('"+this.obj+"').RmoverPoints("+(which+1)+")",this.moveToSpeed[which])
  } else {
    eval(this.pointcommandsArray)
  }
  return true;
}
function RmovePoints(x,y,speed,command){
  multi=0
  this.pointcommandsArray=command
  if(lib.isArray(x)){
    eval("var CHARx='"+x+"'");
    this.moveToX=new Array;
    this.moveToX=CHARx.split(",");
    multi=(multi<this.moveToX.length)?this.moveToX.length:multi
  }
  if(lib.isArray(y)){
    eval("var CHARy='"+y+"'");
    this.moveToY=new Array;
    this.moveToY=CHARy.split(",");
    multi=(multi<this.moveToY.length)?this.moveToY.length:multi
  }
  if(lib.isArray(speed)){
    eval("var speed='"+speed+"'");
    this.moveToSpeed=new Array;
    this.moveToSpeed=speed.split(",");
    multi=(multi<this.moveToSpeed.length)?this.moveToSpeed.length:multi
  }
  if(!this.moveToX||this.moveToX<multi){
    if(!this.moveToX){
      x=parseInteger(x);
    } else {
      x=parseInteger(this.moveToX[this.moveToX.length-1])
    }
    this.moveToX=lib.populate(this.moveToX,x,multi)
  }
  if(!this.moveToY||this.moveToY<multi){
    if(!this.moveToY){
      y=parseInteger(y);
    } else {
      y=parseInteger(this.moveToY[this.moveToY.length-1])
    }
    this.moveToY=lib.populate(this.moveToY,y,multi)
  }
  if(!this.moveToSpeed||this.moveToSpeed<multi){
    if(!this.moveToSpeed){
      speed=parseInteger(speed);
    } else {
      speed=parseInteger(this.moveToSpeed[this.moveToSpeed.length-1])
    }
    this.moveToSpeed=lib.populate(this.moveToSpeed,speed,multi)
  }
  this.RmoverPoints(0);
  return true;
}
function moveToINIT(object){
  object.moveTo=RmovePoints
  object.moveStop=RmoveStop
  object.RmoverPoints=RmoverPoints
}
lib.elements[lib.elements.length]=moveToINIT
//Scroll Functions------------------------------------------
function RscrollStop(){
  window.clearTimeout(this.CHARscroller)
}
function Rcheck(){
  if(this.scrollX<0){this.scrollX=0}
  wval=div(this.divName+"_INNERBOX").width()-div(this.divName+"_OUTERBOX").width()
  if(this.scrollX>wval){this.scrollX=(wval>0)?wval:0}
  if(this.scrollY<0){this.scrollY=0}
  hval=div(this.divName+"_INNERBOX").height()-div(this.divName+"_OUTERBOX").height()
  if(this.scrollY>hval){this.scrollY=(hval>0)?hval:0}
  return true;
}
function RscrollDown(amt){
  this.scrollY+=parseInteger(amt);
  this.Rcheck()
  this.scroll(this.scrollX,this.scrollY)
  if(this.CHARscroller){window.clearTimeout(this.CHARscroller)}
  this.CHARscroller=window.setTimeout(this.divName+".down("+amt+")",10);
  return true;
}
function RscrollUp(amt){
  this.scrollY-=parseInteger(amt);
  this.Rcheck()
  this.scroll(this.scrollX,this.scrollY)
  if(this.CHARscroller){window.clearTimeout(this.CHARscroller)}
  this.CHARscroller=window.setTimeout(this.divName+".up("+amt+")",10);
  return true;
}
function RscrollLeft(amt){
  this.scrollX-=parseInteger(amt);
  this.Rcheck()
  this.scroll(this.scrollX,this.scrollY)
  if(this.CHARscroller){window.clearTimeout(this.CHARscroller)}
  this.CHARscroller=window.setTimeout(this.divName+".left("+amt+")",10);
  return true;
}
function RscrollRight(amt){
  this.scrollX+=parseInteger(amt);
  this.Rcheck()
  this.scroll(this.scrollX,this.scrollY)
  if(lib.CHARscroller){window.clearTimeout(this.CHARscroller)}
  this.CHARscroller=window.setTimeout(this.divName+".right("+amt+")",10);
  return true;
}
function scrollBox(obj){
  this.scrollX=0
  this.scrollY=0
  this.up=RscrollUp
  this.down=RscrollDown
  this.left=RscrollLeft
  this.right=RscrollRight
  this.stop=RscrollStop
  this.scroll=Rscroll
  this.Rcheck=Rcheck
  this.divName=obj
  create(obj+"_OUTERBOX","overflow:hidden;","");
  create(obj+"_INNERBOX","overflow:hidden;","",obj+"_OUTERBOX");
  this.outerDiv=div(obj+"_OUTERBOX")
  this.innerDiv=div(obj+"_INNERBOX")
  this.CHARscroller=false;
  return true;
}
function Rscroll(x,y){
  this.scrollX=x
  this.scrollY=y
  this.Rcheck()
  div(this.divName+"_INNERBOX").move(-x,-y)
  scrolling(this,x,y)
}
scrolling=new Function()
function scrollINIT(object){
}
lib.elements[lib.elements.length]=scrollINIT


function VerAyudaGPViajes (indice,pais,idioma)
{
  window.open("/SO/gpviajes/ayuda/ayuda.aspx?PaginaID=" + indice+ "&codIdioma="+idioma+"&codPortal="+pais,"new","width=450,height=500,top=25,left=180,scrollbars=1");
}

function ImprimirGPViajes() 
{
  if (navigator.appName == "Microsoft Internet Explorer")
  {
    window.print();
  }
}

function cambiarObjetos()
{
  var iContador, iElementos, arrArgumentos, objElemento, sElemento;

  iElementos = 0;
  arrArgumentos = cambiarObjetos.arguments;
  document.newObj = new Array;

  for (iContador=0; iContador < arrArgumentos.length; iContador+=2)
  {
    if ((objElemento = encontrarObjetos(arrArgumentos[iContador])) != null)
    {
      document.newObj[iElementos++] = objElemento;

      if (objElemento.src)
      {
	if (!objElemento.oSrc)
        {
          objElemento.oSrc = objElemento.src;
        }
	
        objElemento.src = arrArgumentos[iContador + 1];
      }
      else
      {
	sElemento = arrArgumentos[iContador + 1];

	if (objElemento.style)
        {
	  objElemento = objElemento.style;

	  sElemento = (sElemento == 'show')?'visible':sElemento;
	  sElemento = (sElemento == 'hide')?'hidden':sElemento;
	}
	
        objElemento.visibility = sElemento;
      }
    }
  }
}
function restaurarObjetos()
{
  var iContador, sArgumento, objElemento, arrElementos;

  arrElementos = document.newObj;

  for (iContador = 0; (arrElementos) && (iContador < arrElementos.length) && (objElemento = arrElementos[iContador]); iContador++)
  {
    if (objElemento.src)
    {
      objElemento.src = objElemento.oSrc;
    }
    else
    {
      sArgumento = 'hide';

      if (objElemento.style)
      {
	objElemento = objElemento.style;
	sArgumento = 'hidden'
      }

      objElemento.visibility = sArgumento;
    }
  }
}

function encontrarObjetos(sNombre, objDocumento)
{
  var iPosicion, iContador, objElemento;  

  if(!objDocumento)
  {
    objDocumento = document;
  }

  if (((iPosicion = sNombre.indexOf("?")) > 0) && (parent.frames.length))
  {
  
    objDocumento = parent.frames[sNombre.substring(iPosicion + 1)].document; 
    sNombre = sNombre.substring(0, iPosicion);
  }
  
  if ((!(objElemento = objDocumento[sNombre])) && (objDocumento.all))
  {
    objElemento = objDocumento.all[sNombre];
  }

  for (iContador = 0; (!objElemento) && (iContador < objDocumento.forms.length); iContador++)
  {
    objElemento = objDocumento.forms[iContador][sNombre];
  }

  for (iContador = 0; (!objElemento) && (objDocumento.layers) && (iContador < objDocumento.layers.length); iContador++)
  {
    objElemento = cambiarObjetos(sNombre, objDocumento.layers[iContador].document); 
  }

  return objElemento;
}

function cambiarObjetos()
{
  var iContador, iElementos, arrArgumentos, objElemento, sElemento;

  iElementos = 0;
  arrArgumentos = cambiarObjetos.arguments;
  document.newObj = new Array;

  for (iContador=0; iContador < arrArgumentos.length; iContador+=2)
  {
    if ((objElemento = encontrarObjetos(arrArgumentos[iContador])) != null)
    {
      document.newObj[iElementos++] = objElemento;

      if (objElemento.src)
      {
	if (!objElemento.oSrc)
        {
          objElemento.oSrc = objElemento.src;
        }
	
        objElemento.src = arrArgumentos[iContador + 1];
      }
      else
      {
	sElemento = arrArgumentos[iContador + 1];

	if (objElemento.style)
        {
	  objElemento = objElemento.style;

	  sElemento = (sElemento == 'show')?'visible':sElemento;
	  sElemento = (sElemento == 'hide')?'hidden':sElemento;
	}
	
        objElemento.visibility = sElemento;
      }
    }
  }
}
