function swf(file, loop, classid, width, height) {
	var mostra_flash = '<OBJECT CLASSID="' + classid + '"'
	+ 'WIDTH="' + width + '" HEIGHT="' + height + '"'
	+ 'CODEBASE="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0">'
	+ '<PARAM NAME="MOVIE" VALUE="' + file + '">'
	+ '<PARAM NAME="PLAY" VALUE="true">'
	+ '<PARAM NAME="LOOP" VALUE="' + loop + '">'
	+ '<PARAM NAME="QUALITY" VALUE="best">'
	+ '<PARAM NAME="MENU" VALUE="false">'
	+ '<param name=wmode value=transparent>'
	+ '<EMBED SRC="' + file + '"'
	+ 'WIDTH="' + width + '" HEIGHT="' + height + '"'
	+ 'PLAY="true"'
	+ 'LOOP="' + loop + '"'
	+ 'QUALITY="best"'
	+ 'MENU="false"'
	+ 'TYPE="application/x-shockwave-flash"'
	+ 'PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer" wmode="transparent">'
	+ '</EMBED>'
	+ '</OBJECT>';
	document.write(mostra_flash);
}


function txtSHidden() {
	if(document.getElementById("query").value == "Digite aqui...") {
		document.getElementById("query").style.color = "#FFFFFF";
		document.getElementById("query").value = "";
	}
}
function txtSShow() {
	if(document.getElementById("query").value == "") {
		document.getElementById("query").style.color = "#CCCCCC";
		document.getElementById("query").value = "Digite aqui...";
	}
}

		function validaSendMail() {
			if(document.getElementById("nome").value == "") {
				alert("Informe seu nome!");
				document.getElementById("nome").focus();
			} else if(document.getElementById("mensagem").value == "") {
				alert("Informe uma mensagem!");
				document.getElementById("mensagem").focus();
			} else if(document.getElementById("confirmacao").value == "") {
				alert("Digite o código de confirmação!");
				document.getElementById("confirmacao").focus();
			} else {
				var nome = document.getElementById("nome").value;
				var email = document.getElementById("email").value;
				var telefone = document.getElementById("telefone").value;
				var mensagem = document.getElementById("mensagem").value;
				var id_usuario = document.getElementById("id_usuario").value;
				var confirmacao = document.getElementById("confirmacao").value;
				var news = document.getElementById("news").checked;
				sendPageMail(id_usuario,nome,email,telefone,mensagem,confirmacao,news);
			}
				

		}

		function sendMail(id_conteudo) {
			var objetoX,objetoY;

			objetoX = 500; // Largura do quadro
			objetoY = 380; // Altura do quadro

			var xScroll, yScroll;
			if (window.innerHeight && window.scrollMaxY) {	
				xScroll = document.body.scrollWidth;
				yScroll = window.innerHeight + window.scrollMaxY;
			} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
				xScroll = document.body.scrollWidth;
				yScroll = document.body.scrollHeight;
			} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
				xScroll = document.body.offsetWidth;
				yScroll = document.body.offsetHeight;
			}
	
			var windowWidth, windowHeight;
			if (self.innerHeight) {	// all except Explorer
				windowWidth = self.innerWidth;
				windowHeight = self.innerHeight;
			} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
				windowWidth = document.documentElement.clientWidth;
				windowHeight = document.documentElement.clientHeight;
			} else if (document.body) { // other Explorers
				windowWidth = document.body.clientWidth;
				windowHeight = document.body.clientHeight;
			}

			var yTScroll;

			if (self.pageYOffset) {
				yTScroll = self.pageYOffset;
			} else if (document.documentElement && document.documentElement.scrollTop){	 // Explorer 6 Strict
				yTScroll = document.documentElement.scrollTop;
			} else if (document.body) {// all other Explorers
				yTScroll = document.body.scrollTop;
			}

			meioX = Math.round((windowWidth/2));
			meioY = Math.round(((windowHeight/2)+yTScroll));
			
			var wS, lS, wF, lF;

			wS = meioX - (objetoX/2);
			lS = objetoX;

			wF = meioY - (objetoY/2);
			lF = objetoY;



			conservar = Math.round(((windowHeight/2) - (objetoY/2)));


			document.getElementById("travaPage").style.height = document.body.scrollHeight;
			document.getElementById("travaPage").style.visibility = "visible";
			document.getElementById("ajaxPage").style.visibility = "visible";
			document.getElementById("ajaxPage").innerHTML = "";
			w3Opacity.fading('travaPage',0,90,600);
			$(document).ready(function() {
				document.getElementById(('ajaxPage')).style.left = meioX;
				document.getElementById(('ajaxPage')).style.top = meioY;
				$("#ajaxPage").animate({top: wF, height: lF}, 1500,function() {  

					document.getElementById(('ajaxPage')).style.left = meioX;

					$(this).animate( {width: lS, left: wS}, 500, function() { 
						loadPageMail(id_conteudo);

						// flutuarProduto(wS,conservar,'ajaxPage','ativar').Fm(); 
					});
				});
			});



		}




		function openPage(id_conteudo) {
			var objetoX,objetoY;

			objetoX = 770; // Largura do quadro
			objetoY = 300; // Altura do quadro

			var xScroll, yScroll;
			if (window.innerHeight && window.scrollMaxY) {	
				xScroll = document.body.scrollWidth;
				yScroll = window.innerHeight + window.scrollMaxY;
			} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
				xScroll = document.body.scrollWidth;
				yScroll = document.body.scrollHeight;
			} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
				xScroll = document.body.offsetWidth;
				yScroll = document.body.offsetHeight;
			}
	
			var windowWidth, windowHeight;
			if (self.innerHeight) {	// all except Explorer
				windowWidth = self.innerWidth;
				windowHeight = self.innerHeight;
			} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
				windowWidth = document.documentElement.clientWidth;
				windowHeight = document.documentElement.clientHeight;
			} else if (document.body) { // other Explorers
				windowWidth = document.body.clientWidth;
				windowHeight = document.body.clientHeight;
			}

			var yTScroll;

			if (self.pageYOffset) {
				yTScroll = self.pageYOffset;
			} else if (document.documentElement && document.documentElement.scrollTop){	 // Explorer 6 Strict
				yTScroll = document.documentElement.scrollTop;
			} else if (document.body) {// all other Explorers
				yTScroll = document.body.scrollTop;
			}

			meioX = Math.round((windowWidth/2));
			meioY = Math.round(((windowHeight/2)+yTScroll));
			
			var wS, lS, wF, lF;

			wS = meioX - (objetoX/2);
			lS = objetoX;

			wF = meioY - (objetoY/2);
			lF = objetoY;



			conservar = Math.round(((windowHeight/2) - (objetoY/2)));


			document.getElementById("travaPage").style.height = document.body.scrollHeight;
			document.getElementById("travaPage").style.visibility = "visible";
			document.getElementById("ajaxPage").style.visibility = "visible";
			document.getElementById("ajaxPage").innerHTML = "";
			w3Opacity.fading('travaPage',0,90,600);
			$(document).ready(function() {
				document.getElementById(('ajaxPage')).style.left = meioX;
				document.getElementById(('ajaxPage')).style.top = meioY;
				$("#ajaxPage").animate({top: wF, height: lF}, 1500,function() {  

					document.getElementById(('ajaxPage')).style.left = meioX;

					$(this).animate( {width: lS, left: wS}, 500, function() { 
						loadPage(id_conteudo);

						// flutuarProduto(wS,conservar,'ajaxPage','ativar').Fm(); 
					});
				});
			});



		}







		function flutuarProduto(iX,iY,id,tipo){

			document.getElementById("ajaxPage").top = iY;

			if(tipo == "desativar") {
				window.clearTimeout();
			}

			var nn=(navigator.appName.indexOf("Netscape")!=-1);
			var dD=document,dH=dD.html,dB=document.body,px=dD.layers?'':'px';

		
			var L=dD.getElementById?dD.getElementById(id):dD.all?dD.all[id]:dD.layers[id];		
			this[id+'O']=L;if(dD.layers)L.style=L;L.nX=L.iX=iX;L.nY=L.iY=iY;
			L.P=function(x,y){this.style.left=x+px;this.style.top=y+px;};


			L.Fm=function(){



	
				var pX, pY;	
				pX=(this.iX >=0)?0:nn?innerWidth:nn&&dH.clientWidth?dH.clientWidth:dB.clientWidth;	
				pY=nn?pageYOffset:nn&&dH.scrollTop?dH.scrollTop:dB.scrollTop;	
				if(this.iY<0)pY+=nn?innerHeight:nn&&dH.clientHeight?dH.clientHeight:dB.clientHeight;


				this.nX+=.1*(pX+this.iX-this.nX);this.nY+=.1*(pY+this.iY-this.nY);this.P(this.nX,this.nY);
				if(tipo == "ativar") {
					window.setTimeout(this.id+'O.Fm()',50);
				}

	

			};


			return L;

		}

		function loadPageMail(id_conteudo) {

			if(Ajax) {
				Ajax.open("GET","ajax/getFormMail.php?id_usuario="+id_conteudo, true);

				Ajax.onreadystatechange = function() {
					if(Ajax.readyState == 4) {
						if(Ajax.status == 200) {
							document.getElementById("ajaxPage").innerHTML = Ajax.responseText;

						}
					}
				}
			} 
			Ajax.send(null);

		}


		function sendPageMail(id_conteudo,nome,email,telefone,mensagem,confirmacao,news) {

			if(Ajax) {
				Ajax.open("GET","ajax/getFormMail.php?acao=enviar&id_usuario="+id_conteudo+"&nome="+nome+"&email="+email+"&telefone="+telefone+"&mensagem="+mensagem+"&confirmacao="+confirmacao+"&news="+news, true);

				Ajax.onreadystatechange = function() {
					if(Ajax.readyState == 4) {
						if(Ajax.status == 200) {
							document.getElementById("ajaxPage").innerHTML = Ajax.responseText;

						}
					}
				}
			} 
			Ajax.send(null);

		}



		function loadPage(id_conteudo) {

			if(Ajax) {
				Ajax.open("GET","ajax/getProduct.php?id_produto="+id_conteudo, true);

				Ajax.onreadystatechange = function() {
					if(Ajax.readyState == 4) {
						if(Ajax.status == 200) {
							document.getElementById("ajaxPage").innerHTML = Ajax.responseText;

						}
					}
				}
			} 
			Ajax.send(null);

		}

		function closeDetalhes(objeto) {
			var objetoX = 770;
			var objetoY = 300;
	
			var windowWidth, windowHeight;
			if (self.innerHeight) {	// all except Explorer
				windowWidth = self.innerWidth;
				windowHeight = self.innerHeight;
			} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
				windowWidth = document.documentElement.clientWidth;
				windowHeight = document.documentElement.clientHeight;
			} else if (document.body) { // other Explorers
				windowWidth = document.body.clientWidth;
				windowHeight = document.body.clientHeight;
			}


			var xScroll, yScroll;
			if (window.innerHeight && window.scrollMaxY) {	
				xScroll = document.body.scrollWidth;
				yScroll = window.innerHeight + window.scrollMaxY;
			} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
				xScroll = document.body.scrollWidth;
				yScroll = document.body.scrollHeight;
			} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
				xScroll = document.body.offsetWidth;
				yScroll = document.body.offsetHeight;
			}


			wS = meioX - (objetoX/2);
			lS = objetoX;

			wF = meioY - (objetoY/2);
			lF = objetoY;

			var yTScroll;

			if (self.pageYOffset) {
				yTScroll = self.pageYOffset;
			} else if (document.documentElement && document.documentElement.scrollTop){	 // Explorer 6 Strict
				yTScroll = document.documentElement.scrollTop;
			} else if (document.body) {// all other Explorers
				yTScroll = document.body.scrollTop;
			}

			conservar = Math.round(((windowHeight/2) - (objetoY/2)));


				desY = (((windowHeight/2)+yTScroll) -  (objetoY/2));

			desX = Math.round((windowWidth/2) - (objetoX/2));

			meioX = Math.round((windowWidth/2));
			meioY = Math.round((yScroll/2) + (windowHeight/2));


			// flutuarProduto(desX,desY,'ajaxPage','desativar').Fm(); 


			document.getElementById(('ajax'+objeto)).innerHTML = "";
			$(document).ready(function() {
				$("#ajaxPage").animate({width: 1, left: meioX}, 500, function() {

					w3Opacity.fading('travaPage',90,0,600);
					document.getElementById(('ajax'+objeto)).style.left = meioX;

					$(this).animate({top: meioY, height: 1}, 500,function() { 
						document.getElementById(('ajax'+objeto)).style.left = meioX;

						document.getElementById(('trava'+objeto)).style.visibility = "hidden";
						document.getElementById(('ajax'+objeto)).style.visibility = "hidden";
					});
				});
			});

		}


		function confirmar(url) {
			if(confirm("Deseja realmente excluir?")) {
				window.top.location.href = url;
			}
		}