		function Loading(a,tab){
			if(a=='on'){
				document.getElementById(tab).innerHTML = "<div id='carregando'></div>";
			}else{
				document.getElementById(tab).innerHTML = "";
			}
		}
		
		function startAjax(){
			try { xmlhttp = new XMLHttpRequest(); } 
			catch(e) { 	try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } 
					catch(ee){	try {xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");} 
								catch(E){xmlhttp = false;}
							 }
				 } return xmlhttp;
		}
		
		function enviagenerico(todoscampos,enderecourl,getoupost,tab){
			var maiscampos=todoscampos;
			var ajax = startAjax();			
			if (ajax){
			     Loading('on', tab);
				ajax.open(getoupost,enderecourl,true)
				ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
				ajax.onreadystatechange = function()
				{
				
					if (ajax.readyState==4){
							Loading('off', tab);
							var get = ajax.responseText.replace(/\+/g," ");
							document.getElementById(tab).innerHTML = get;
							
						}
				}		

				ajax.send(maiscampos);
				javascript:urchinTracker(enderecourl);
				
			} 
		}
		
		
		
		function pagFilme(todoscampos,enderecourl,getoupost,tab,filme){
			var maiscampos=todoscampos;
			var ajax = startAjax();			
			if (ajax){
			     Loading('on', tab);
				ajax.open(getoupost,enderecourl,true)
				ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
				ajax.onreadystatechange = function()
				{
				
					if (ajax.readyState==4){
							Loading('off', tab);
							var get = ajax.responseText.replace(/\+/g," ");
							document.getElementById(tab).innerHTML = get;
							addPlayer(filme);
							
						}
				}		

				ajax.send(maiscampos);
				javascript:urchinTracker(enderecourl);
			} 
		}
		
		
		
		
		function addPlayer(filme){
		var so2 = new SWFObject("imgs/player320x240v4.swf", "sotester", "450", "365", "9", "#000000");
		so2.addParam("allowFullScreen", "true");
		so2.addVariable("kvideo", filme); // this line is optional, but this example uses the variable and displays this text inside the flash movie
		so2.write("flashcontent");
}







		function pagFotos(todoscampos,enderecourl,getoupost,tab,fotos){
			var maiscampos=todoscampos;
			var ajax = startAjax();			
			if (ajax){
			     Loading('on', tab);
				ajax.open(getoupost,enderecourl,true)
				ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
				ajax.onreadystatechange = function()
				{
				
					if (ajax.readyState==4){
							Loading('off', tab);
							var get = ajax.responseText.replace(/\+/g," ");
							document.getElementById(tab).innerHTML = get;
							addGaleria(fotos);
							
						}
				}		

				ajax.send(maiscampos);
				
			} 
		}
		
		
		
		
		function addGaleria(fotos){
		var so3 = new SWFObject("imgs/galeria.swf", "sotester", "450", "400", "9", "#000000");
		so3.addParam("allowFullScreen", "true");
		so3.addVariable("xml", fotos); // this line is optional, but this example uses the variable and displays this text inside the flash movie
		so3.write("flashcontent");
}