function gerarSWF($arquivo,$largura,$altura)
{
    document.writeln('    <object type="application/x-shockwave-flash" data="'+ $arquivo +'" width="'+ $largura +'" height="'+ $altura +'">');
    document.writeln('        <param name="movie" value="' + $arquivo + '" />');
    document.writeln('        <param name="menu" value="false" />');
    document.writeln('        <param name="quality" value="high" />');
	document.writeln('        <param name="wmode" value="transparent" />');
	document.writeln('        <embed src="swf/banner_topo.swf" quality="high" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" ></embed>');
    document.writeln('    </object>');
}

function fecha_div(){
	//document.getElementById('bg_case').style.display = "none";
	document.getElementById('lightbox').style.display = "none";
	document.getElementById('floater').style.display = "none";
}
function Esvazia(valor_campo){
	if (valor_campo.value == valor_campo.defaultValue)
		valor_campo.value='';
	}

function padrao(valor_campo){
	if (valor_campo.value == '')
		valor_campo.value=valor_campo.defaultValue;
	}
	
	
	/********************************/
	
	function info_view(){
		document.getElementById('info').style.visibility = 'visible';
	}
	function info_hidden(){
		document.getElementById('info').style.visibility = 'hidden';
	}
	
	function showEng(){
		document.getElementById('eua').style.visibility = 'visible';
		document.getElementById('overflow').style.visibility = 'visible';
	}
	
	function showEsp(){
		document.getElementById('spa').style.visibility = 'visible';
		document.getElementById('overflow').style.visibility = 'visible';
	}
	
	function showCatalogo(cod,linha)
	{
		i = 0;
		total = 500;
		while (i <= total){
			i++;
			if(document.getElementById('showinfo'+i)) {
				document.getElementById('showinfo'+i).style.display = 'none';
			}
		}
		//document.getElementById('overflow').style.visibility = 'visible';
		
		ajax = ajaxInit();
		if(ajax)
		{
			ajax.open("GET", "produto_show.php?cod="+cod+"&j="+linha, true);
			ajax.onreadystatechange = function()
		    {
		    	if(ajax.readyState == 4)
		    	{
		    		if(ajax.status == 200)
		    		{		    			
                        //alert(ajax.responseText);
                        //eval(ajax.responseText);
                        document.getElementById('showinfo'+linha).innerHTML = ajax.responseText;
						document.getElementById('showinfo'+linha).style.display = 'block';
		       		}
		       		else
		       		{
		         		alert(ajax.statusText);
		       		}
		     	}		     	
		   	}
		ajax.send(null);
		}
	}
	function fechaShow(valor){
		document.getElementById('showinfo'+valor).style.display = "none";	
	}
	function hiddenLang(){
		document.getElementById('spa').style.visibility = 'hidden';
		document.getElementById('eua').style.visibility = 'hidden';
		document.getElementById('catalogo').style.visibility = 'hidden';
		document.getElementById('overflow').style.visibility = 'hidden';
	}
	
function Tecla(e)
{
	if(document.all) // Internet Explorer
	{
		var tecla = event.keyCode;
	}	
	else
	{
		var tecla = e.which;
	}

	if(tecla > 47 && tecla < 58) // numeros de 0 a 9
	{
		return true;
	}
	else
	{
		if (tecla != 8) // backspace
		{
			if (tecla == 13)
			{
				return true;
			}
			else
			{
				return false;
			}	
		}
		Else
		{
			return true;
		}
	}	
}

