try{
    xmlhttp = new XMLHttpRequest();
}catch(ee){
    try{
        xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    }catch(e){
        try{
            xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
        }catch(E){
            xmlhttp = false;
        }
    }
}
 
var filme=0;
 
function carregaesq(n){
    //Exibe o texto carregando no div conteúdo
    document.getElementById("frame_left").innerHTML='<div class="carregando"><img src="ajax.gif" alt="Carregando..." /></div>';

    //Abre a url
    xmlhttp.open("GET", "funcoes.php?n="+n,true);
	
	//Executada quando o navegador obtiver o código
    xmlhttp.onreadystatechange=function() {

        if (xmlhttp.readyState==4){

            //Lê o texto
            var texto=xmlhttp.responseText;

            //Desfaz o urlencode
	
            document.getElementById("frame_left").innerHTML=texto;

        }
    }
    xmlhttp.send(null);
}

function carregadir(n){

	if(n==4){
		document.getElementById("right_conteudo").innerHTML=filme;
	}else if(n=5){
		//Exibe o texto carregando no div conteúdo
		document.getElementById("right_conteudo").innerHTML='<div class="carregando"><img src="ajax.gif" alt="Carregando..." /></div>';
	
		//Abre a url
		xmlhttp.open("GET", "funcoes.php?n="+3,true);	
		//Executada quando o navegador obtiver o código
		xmlhttp.onreadystatechange=function() {
	
			if (xmlhttp.readyState==4){
	
				//Lê o texto
				var texto=xmlhttp.responseText;
	
				//Desfaz o urlencode
		
				document.getElementById("right_conteudo").innerHTML=texto;
				
				
			}
		}
	    xmlhttp.send(null);
	}else{
		//Exibe o texto carregando no div conteúdo
		document.getElementById("right_conteudo").innerHTML='<div class="carregando"><img src="ajax.gif" alt="Carregando..." /></div>';
	
		//Abre a url
		xmlhttp.open("GET", "funcoes.php?n="+n,true);	
		//Executada quando o navegador obtiver o código
		xmlhttp.onreadystatechange=function() {
	
			if (xmlhttp.readyState==4){
	
				//Lê o texto
				var texto=xmlhttp.responseText;
	
				//Desfaz o urlencode
		
				document.getElementById("right_conteudo").innerHTML=texto;
				
				
			}
		}
  		xmlhttp.send(null);
	}
}


function carregadown(n){
    //Exibe o texto carregando no div conteúdo
    document.getElementById("catalogo").innerHTML='<div class="carregando"><img src="ajax.gif" alt="Carregando..." /></div>';

    //Abre a url
    xmlhttp.open("GET", "funcoes.php?n="+n,true);
	
	//Executada quando o navegador obtiver o código
    xmlhttp.onreadystatechange=function() {

        if (xmlhttp.readyState==4){

            //Lê o texto
            var texto=xmlhttp.responseText;

            //Desfaz o urlencode
	
            document.getElementById("catalogo").innerHTML=texto;

        }
    }
    xmlhttp.send(null);
}

function menuclick(e){	
	if(filme==0){
		filme =	document.getElementById("right_conteudo").innerHTML;
	}
	n=parseInt(e);
	if(n>1000){
		document.getElementById("aba1").style.background = "url(\'img/bt_off.png')"
		document.getElementById("aba1").style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='img/bt_off.png',sizingMethod='scale')";
		document.getElementById("aba2").style.background = "url(\'img/bt_on.png')";		
		document.getElementById("aba2").style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='img/bt_on.png',sizingMethod='scale')";
		carregaesq(n);
	}else if(n>250){
		if(n==301){
			document.getElementById("aba5").style.background = "url(\'img/bt_on.png')"
			document.getElementById("aba5").style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='img/bt_on.png',sizingMethod='scale')";
			document.getElementById("aba6").style.background = "url(\'img/bt_off.png')";
			document.getElementById("aba6").style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='img/bt_off.png',sizingMethod='scale')";
			document.getElementById("aba7").style.background = "url(\'img/bt_off.png')";
			document.getElementById("aba7").style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='img/bt_off.png',sizingMethod='scale')";
		}else if(n==302){
			document.getElementById("aba5").style.background = "url(\'img/bt_off.png')";
			document.getElementById("aba5").style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='img/bt_off.png',sizingMethod='scale')";
			document.getElementById("aba6").style.background = "url(\'img/bt_on.png')";
			document.getElementById("aba6").style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='img/bt_on.png',sizingMethod='scale')";
			document.getElementById("aba7").style.background = "url(\'img/bt_off.png')";
			document.getElementById("aba7").style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='img/bt_off.png',sizingMethod='scale')";
		}else{
			document.getElementById("aba5").style.background = "url(\'img/bt_off.png')"
			document.getElementById("aba5").style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='img/bt_off.png',sizingMethod='scale')";
			document.getElementById("aba6").style.background = "url(\'img/bt_off.png')";
			document.getElementById("aba6").style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='img/bt_off.png',sizingMethod='scale')";
			document.getElementById("aba7").style.background = "url(\'img/bt_on.png')";
			document.getElementById("aba7").style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='img/bt_on.png',sizingMethod='scale')";
		}
		carregadown(n);		
	}else if(n>5){		
		document.getElementById("aba1").style.background = "url(\'img/bt_on.png')";
		document.getElementById("aba1").style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='img/bt_on.png',sizingMethod='scale')";
		document.getElementById("aba2").style.background = "url(\'img/bt_off.png')";
		document.getElementById("aba2").style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='img/bt_off.png',sizingMethod='scale')";
		carregaesq(n);
	}else{
		if(n==4){
			document.getElementById("aba3").style.background = "url(\'img/bt_off.png')"
			document.getElementById("aba3").style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='img/bt_off.png',sizingMethod='scale')";
			document.getElementById("aba4").style.background = "url(\'img/bt_on.png')";
			document.getElementById("aba4").style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='img/bt_on.png',sizingMethod='scale')";
		}else{
			document.getElementById("aba3").style.background = "url(\'img/bt_on.png')"
			document.getElementById("aba3").style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='img/bt_on.png',sizingMethod='scale')";
			document.getElementById("aba4").style.background = "url(\'img/bt_off.png')";
			document.getElementById("aba4").style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='img/bt_off.png',sizingMethod='scale')";
		}
		carregadir(n);
	}
    return false
}

function iniciar(){
	document.getElementById("aba1").style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='img/bt_on.png',sizingMethod='scale')";
	document.getElementById("aba1").style.background = "url(\'img/bt_on.png')";
	document.getElementById("aba4").style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='img/bt_on.png',sizingMethod='scale')";
	document.getElementById("aba4").style.background = "url(\'img/bt_on.png')";
	document.getElementById("aba5").style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='img/bt_on.png',sizingMethod='scale')";
	document.getElementById("aba5").style.background = "url(\'img/bt_on.png')";
	
	
}