var activoCont = -1;
function marco(){
	wW = (is.ns)? window.innerWidth-15 : document.body.offsetWidth-20
	wH = (is.ns)? window.innerHeight : document.body.offsetHeight-4

	if(is.ns){
	origWidth=innerWidth;
	origHeight=innerHeight;
	onresize=function(){
		if(innerWidth!=origWidth||innerHeight!=origHeight)
		location.reload()
		}
	}
	Lmarco = new DynLayer("LmarcoDiv");
	Lmarco.clipTo(0,310,263,0);
	Lmarcocont = new DynLayer('LmarcocontDiv','LmarcoDiv');
	Lmarcocont.moveTo(0,0)
	Lcont = new DynLayer("LcontDiv");
	Lcont.moveTo(32,57)
	Bscroll = new DynLayer("BscrollDiv");
	Bscroll.clipTo(0,13,150,0);
	Ltodas = new DynLayer("LtodasDiv");
	Ltodas.moveTo(160,110)
	Lfondmarco = new DynLayer("LfondmarcoDiv");
	Lfondmarco.moveTo(wW-300,188)
	for(var a=1; a<=52; a++){
		eval("Lcity"+a+" = new DynLayer('Lay"+a+"');");
		eval("Lpunto"+a+" = new DynLayer('Lpunto"+a+"Div');");
			if(wW/2 < 400){
			eval("Lcity"+a+".moveTo(wW-250,115)");
			Lfondmarco.moveTo(wW-280,99)
			}
		else{
			eval("Lcity"+a+".moveTo(wW-310,220)");
			Lfondmarco.moveTo(wW-340,200)
		}
	}
//	if(wW/2 < 400){
//		Lmarco.moveTo(wW-289,169)
//		Bscroll.moveTo(wW-33,203)
//	}
//	else{
		Lmarco.moveTo(wW-472,168)
		Bscroll.moveTo(wW-33,198)

//	}
	InitialiseScrollableArea();
	if(location.reload){
		Lnada.hide();
	}
	if(document.all){
		Lnada.hide();
	}
}
function aCtiva(a){
	if(activoCont!=-1){
		eval("Lcity"+activoCont+".hide(); Bscroll.show(); Lmarco.show(); Ltodas.hide();");
		}
	eval("Lcity"+a+".show(); Bscroll.hide(); Lmarco.hide(); Ltodas.show();");
	activoCont = a;
	hideTr("ayuda");
/*	if(wW/2 < 400){
		eval("Lcity"+a+".moveTo(wW-289,169)");
		Ltodas.moveTo(100,369)
		Lmarco.moveTo(wW-289,169)
		Bscroll.moveTo(wW-33,183)

	}
	else{
*/
		eval("Lcity"+a+".moveTo(wW-472,168)");
		Ltodas.moveTo(100,369)
		Lmarco.moveTo(wW-472,168)
		Bscroll.moveTo(wW-213,198)

//	}
}
function reGresan(){
	eval("Lcity"+activoCont+".hide(); Bscroll.show(); Lmarco.show(); Ltodas.hide();");
}
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=50
 
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+objmarcoB.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) objltextoB.down(speed) 
		else objltextoB.up(speed) 
	} 
}
function CeaseScroll(){ 
    loop=false 
    if(timer) clearTimeout(timer) 
} 
var initialised; 
function InitialiseScrollableArea(){ 
    objmarcoB=new ConstructObject('LmarcoDiv')
	objltextoB=new ConstructObject('LmarcocontDiv','LmarcoDiv')
	objltextoB.MoveArea(0,0)
    objmarcoB.css.visibility='visible'
    initialised=true; 
}

function hideTr(p_tr){
	var e = document.getElementById(p_tr);
	if (e.className != "hidden") e.className = "hidden";
}
function posicionDiv(v_id){
	var top = document.getElementById(v_id).style.top;
	var left = document.getElementById(v_id).style.left;
	alert('LEFT: ' +left +'\nTOP: ' +top);
}