function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

OK=0;

function Ventana(url,destino,ancho,alto,top,left){
	window.open (url,destino,"location=no, status=no, top="+top+", left="+left+", height="+alto+", width="+ancho);
}

function  mover(menu) {

	if (OK==0){
	OK=1;
	switch (menu){
		case 1:
			lefto = 0;
			break;
		case 2:
			lefto = -440;
			break;
		case 3:
			lefto = -880;
			break;
		case 4:
			lefto = -1320;
			break;
		case 5:
			lefto = -1760;
			break;
		}
		
			
	
		if (parseInt(document.getElementById("Layer1").style.left) < lefto){
			moverIzq(lefto);
		}else{
			moverDer(lefto);
		}
	}
}

function moverDer(lefto){
	distancia = (lefto-parseInt(document.getElementById("Layer1").style.left));

	if (distancia < (-300)){
		acel=15;
	}else{
		if (distancia < (-200)){
			acel=10;
		}else{
			if (distancia < (-100)){
				acel=5;
			}else{
				acel=2;
			}
		}
	}

	if (parseInt(document.getElementById("Layer1").style.left) > lefto){
		document.getElementById("Layer1").style.left=parseInt(document.getElementById("Layer1").style.left)-acel+"px";
		setTimeout("moverDer('"+lefto+"')",20);
	}else{
		OK=0;
		if (lefto==(-1760)){
			document.frmLogin.Username.select();
		}
	}
	
}	

function moverIzq(lefto){
	
	distancia = (lefto-parseInt(document.getElementById("Layer1").style.left));
	if (distancia > 300){
		acel=15;
	}else{
		if (distancia >200){
			acel=10;
		}else{
			if (distancia >100){
				acel=5;
			}else{
				acel=2;
			}
		}
	}
	if (parseInt(document.getElementById("Layer1").style.left) < lefto){
		document.getElementById("Layer1").style.left=parseInt(document.getElementById("Layer1").style.left)+acel+"px";
		setTimeout("moverIzq('"+lefto+"')",20);
	}else{
		OK=0;
	}
}

function Login(){
	document.getElementById("Layer1").style.left=parseInt(-1760)+"px";;
	document.frmLogin.Username.select();
}

function PartnersDown(){
max=document.getElementById("Partners").offsetHeight-150;
if(parseInt(document.getElementById("Layer3").style.top)>-max){
	document.getElementById("Layer3").style.top=parseInt(document.getElementById("Layer3").style.top)-5+"px";
	desplazamiento=setTimeout("PartnersDown()",40);
	}
}

function PartnersUp(){
if (parseInt(document.getElementById("Layer3").style.top)<0){
	document.getElementById("Layer3").style.top=parseInt(document.getElementById("Layer3").style.top)+5+"px";
	desplazamiento=setTimeout("PartnersUp()",40);
	}
}

function PartnersStop() {
clearTimeout(desplazamiento);
}
