
//CAMBIO COLOR DE LAS CELDAS
function mOvr(src,clrOver) {
if (!src.contains(event.fromElement)) {
src.style.cursor = 'hand';
src.bgColor = clrOver;
}
}
function mOut(src,clrIn) {
if (!src.contains(event.toElement)) {
src.style.cursor = 'default';
src.bgColor = clrIn;
}
}
function mClk(src) {
if(event.srcElement.tagName=='TD'){
src.children.tags('A')[0].click();
}
}


//MENUS DESPLEGABLES
var old;
 var memold;
 var subold;
 if(document.layers)
 {
  window.captureEvents(Event.MOUSEDOWN);
  window.onmousedown=do_out;
 } else                                                                                                                                        
 {
document.onmouseup=do_out;       
}
function show_layer(x)
{
 if(document.layers)
  document.layers[x].visibility="show";
 else
  document.all[x].style.visibility="visible";
}
function hide_layer(x)
{
 if(document.layers)
  document.layers[x].visibility="hide";
 else
  document.all[x].style.visibility="hidden";
}
function do_menu(x)
{
 if(!old)
  old=memold;
 if(old!=x)
 {
  show_layer(x);
  old=x;
 } else
  old="";
}
function do_check(x)
{
 if(old && old!=x)
 {
  hide_layer(old);
  show_layer(x);
  old=x;
 }
 do_submenu();
}
function do_out()
{
 if(old)
  hide_layer(old);
 memold=old; old="";
 do_submenu();
}
function do_submenu(x)
{
 if(subold)
 {
  hide_layer(subold);
  subold="";
 }
 if(x)
 {
  show_layer(x);
  subold=x;
 }
}



// SCROLLS
function verifyCompatibleBrowser(){ 
    this.ver=navigator.appVersion 
    this.dom=document.getElementById?1:0 
    this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0; 
    this.ie4=(document.all && !this.dom)?1:0; 
    this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0; 
 
    this.ns4=(document.layers && !this.dom)?1:0; 
    this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5) 
    return this 
} 
bw=new verifyCompatibleBrowser() 
 
 
var speed=90
 
var loop, timer 
 
function ConstructObject(obj,nest){ 
    nest=(!nest) ? '':'document.'+nest+'.' 
    this.el=bw.dom?document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?eval(nest+'document.'+obj):0; 
    this.css=bw.dom?document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?eval(nest+'document.'+obj):0; 
    this.scrollHeight=bw.ns4?this.css.document.height:this.el.offsetHeight 
    this.clipHeight=bw.ns4?this.css.clip.height:this.el.offsetHeight 
    this.up=MoveAreaUp;this.down=MoveAreaDown; 
    this.MoveArea=MoveArea; this.x; this.y; 
    this.obj = obj + "Object" 
    eval(this.obj + "=this") 
    return this 
} 
function MoveArea(x,y){ 
    this.x=x;this.y=y 
    this.css.left=this.x 
    this.css.top=this.y 
} 
 
function MoveAreaDown(move){ 
	if(this.y>-this.scrollHeight+objContainer.clipHeight){ 
    this.MoveArea(0,this.y-move) 
    if(loop) setTimeout(this.obj+".down("+move+")",speed) 
	} 
} 
function MoveAreaUp(move){ 
	if(this.y<0){ 
    this.MoveArea(0,this.y-move) 
    if(loop) setTimeout(this.obj+".up("+move+")",speed) 
	} 
} 
 
function PerformScroll(speed){ 
	if(initialised){ 
		loop=true; 
		if(speed>0) objScroller.down(speed) 
		else objScroller.up(speed) 
	} 
} 
 
function CeaseScroll(){ 
    loop=false 
    if(timer) clearTimeout(timer) 
} 
var initialised; 
function InitialiseScrollableArea(){ 
    objContainer=new ConstructObject('divMovil') 
    objScroller=new ConstructObject('divArea','divMovil') 
    objScroller.MoveArea(0,0) 
    objContainer.css.visibility='visible' 
    initialised=true; 
} 


//ABRIR VENTANA
function Migo(URL,ancho,alto,scroll) {
if (ancho==null){
	ancho=241;
	alto=197;
}
if (scroll==null){
scroll=0

}
ventana=window.open(URL,"Ventana","toolbars=0,scrollbars="+scroll+",location=0,statusbars=0,menubars=0,resizable=0,width="+ancho+",height="+alto+",left=250,top=310");
}

//ABRIR VENTANA MAPA
function Ver(URL,ancho,alto,scroll) {
if (ancho==null){
	ancho=300;
	alto=550;
}
if (scroll==null){
scroll=1

}
ventana=window.open(URL,"Ventana","toolbars=0,scrollbars="+scroll+",location=0,statusbars=0,menubars=0,resizable=0,width="+ancho+",height="+alto+",left=0,top=0");
}



//ABRIR VENTANA HIJA
function Win(URL,ancho,alto) {
if (ancho==null){
	ancho=350;
	alto=200;
}
if (scroll==null){
scroll=0
}
ventana=window.open(URL,"Win","toolbars=0,scrollbars="+scroll+",location=0,statusbars=0,menubars=0,resizable=0,width="+ancho+",height="+alto+",left=185,top=320");
}

//ENLACES EN LA VENTANA HIJA PARA ABRIR EN MADRE Y CERRAR AUTOMATICAMENTE
function get(url) {
  opener.location = url;
  self.close()
}

//ABRE A PANTALLA COMPLETA
var sx = 800-8;
var sy = 600-56;
	function Pantalla(URL){

	var posx=0;
	var posy=0;

main = window.open ("../mapacarreteras.asp", "Win", "resizable=no,scrollbars=1,status=0,location=no,toolbar=no,menubar=no,width="+sx+",height="+sy+",screenX="+posx+",screenY="+posy+",left="+posx+",top="+posy);

}


//callejero A PANTALLA COMPLETA

	function Calle(URL){
	var sx = (screen.width) -8;
	var sy = (screen.height)- 56;
	var posx=0;
	var posy=0;

main = window.open ("callejero.asp", "Win", "resizable=no,scrollbars=1,status=0,location=no,toolbar=no,menubar=no,width="+sx+",height="+sy+",screenX="+posx+",screenY="+posy+",left="+posx+",top="+posy);

}


//ABRIR VENTANA
function Ventana(URL) {
ventana=window.open(URL,"Win","toolbars=0,scrollbars=1,location=0,statusbars=0,menubars=0,resizable=0,width=530,height=550,left=0,top=0");
}

//ABRIR VENTANA PARA MAPAS
function See(foto) {
var ancho = (screen.width) -8;
var alto = (screen.height)- 56;
ventana=window.open("see.asp?f="+foto,"Win","toolbars=0,scrollbars=1,location=0,statusbars=0,menubars=0,resizable=0,width="+ancho+",height="+alto+",left=0,top=0");
}

//ABRIR VENTANA PARA MAPAS
function See2(foto) {
ventana=window.open("see2.asp?f="+foto,"Win","toolbars=0,scrollbars=0,location=0,statusbars=0,menubars=0,resizable=0,width=50,height=50,left=0,top=0");
ventana.focus();
}


//ABRIR VENTANA PARA MAPAS
function Mymap1(foto) {
ventana=window.open("mymap1.asp?f="+foto,"Win","toolbars=0,scrollbars=0,location=0,statusbars=0,menubars=0,resizable=0,width=50,height=50,left=0,top=0");
ventana.focus();
}


//MENSAJE
function msj(){
  texto= "Sección en breve disponible.\n\nDisculpen las molestias";
  alert (texto);
}

//RESIZA PAGINA

function resizePage(){
  x=document.images['foto'].width;
  y=document.images['foto'].height;
  x=x+25; // el margen que le doy de la foto al borde de la ventana
  y= y+ 135; // lo mismo que arriba
  window.resizeTo(x,y);  
  
}
