// JavaScript Document
function carregaVideo(pag,id){
		http.open("GET",pag+"?id="+id,true);
		http.onreadystatechange=function (){
			if(http.readyState==4){
				document.getElementById('changeVideo').innerHTML=http.responseText;	
			}
		}
		http.send(null);
}

function carregaFilme(pag,id){
		http.open("GET",pag+"?id="+id,true);
		http.onreadystatechange=function (){
			if(http.readyState==4){
				document.getElementById('changeFilme').innerHTML=http.responseText;	
			}
		}
		http.send(null);
}

function changeDiretor(pag,id){
		http.open("GET",pag+"?id="+id,true);
		http.onreadystatechange=function (){
			if(http.readyState==4){
				document.getElementById('area_geral').innerHTML=http.responseText;	
			}
		}
		http.send(null);
}
function changeCombo(pag,id){
		http.open("GET",pag+"?id="+id,true);
		http.onreadystatechange=function (){
			if(http.readyState==4){
				document.getElementById('combo').innerHTML=http.responseText;	
			}
		}
		http.send(null);
}
function getProdutora(pag,id){
		http.open("GET",pag+"?id="+id,true);
		http.onreadystatechange=trocaProd;
		http.send(null);
}
function trocaProd(){
		if(http.readyState==4){
			document.getElementById('area_geral').innerHTML=http.responseText;	
		}
}

function apagafoto(logo,id){
		http.open("GET","delfoto.php?logo="+logo+"&id="+id,true);
		http.onreadystatechange=troca;
		http.send(null);
}

function troca(){
		if(http.readyState==4){
			var resp = http.responseText.split('|');
			document.getElementById('ccampo').style.display=resp[1];
			document.getElementById('clogo').style.display=resp[0];
		}
}

function getAjax(){
	ajax = null;
	try{
		ajax = new XMLHttpRequest();
		}catch(e){
			try{
				ajax = new ActiveXObject("Microsoft.XMLHttp");
			}catch(e){
				try{
					ajax = new ActiveXObject("MSXML2.XMLHttp");
				}catch(e){
					alert("Seu navegador não suporta Ajax");
				}
			}
	    }
	return ajax;
}

var http = getAjax();