// JScript source code


function fEspGerais(){
    tabGeral.src="images/tabs/detail/tab_geral_activ.gif";
    tabDetail.src="images/tabs/detail/tab_detalhadas_off.gif";
    tabGaleria.src="images/tabs/detail/tab_galeria_off.gif";
    
    espGerais.style.display ="block";
    espDetalhadas.style.display ="none";
    espGaleria.style.display ="none";
    
    
}

function fEspDetalhada(){
    tabGeral.src="images/tabs/detail/tab_geral_off.gif";
    tabDetail.src="images/tabs/detail/tab_detalhadas_activ.gif";
    tabGaleria.src="images/tabs/detail/tab_galeria_off.gif";
    
    espGerais.style.display ="none";
    espDetalhadas.style.display ="block";
    espGaleria.style.display ="none";
    bigProd01.style.display ="none";
}

function fEspGaleria(){
    tabGeral.src="images/tabs/detail/tab_geral_off.gif";
    tabDetail.src="images/tabs/detail/tab_detalhadas_off.gif";
    tabGaleria.src="images/tabs/detail/tab_galeria_activ.gif";
    
    espGerais.style.display ="none";
    espDetalhadas.style.display ="none";
    espGaleria.style.display ="block";
    
}

// GALERIA DE FOTOS 

function fThProd01(){

    bigProd01.style.display ="block";
    bigProd02.style.display ="none";
    //bigProd03.style.display ="none";
}

function fThProd02(){

    bigProd01.style.display ="none";
    bigProd02.style.display ="block";
    //bigProd03.style.display ="none";
}

function fThProd03(){

    bigProd01.style.display ="none";
    bigProd02.style.display ="block";
    //bigProd03.style.display ="block";
}

function limparCampo(id_campo, texto){

var campo = document.getElementById(id_campo);

if (campo.value == texto)
{
    campo.value = '';
}

}

function repoeCampo(id_campo, texto){

var campo = document.getElementById(id_campo);

if (campo.value == '')
{
    campo.value = texto;
}

}
//function to display or hide a given element
function showHideItems(myItem){

//this is the ID of the hidden item
//var mydropdown = document.getElementById(mydropdown);
var myItemTransf = document.getElementById("TRANS");
var myItemMbnet = document.getElementById("MBNET");

myItemTransf.style.display = "none";
myItemMbnet.style.display = "none";

if (myItem== "3"){
myItemTransf.style.display="block";
}

if (myItem== "1"){
myItemMbnet.style.display="block";
}
}
//LIMITA O INPUT SÓ A NÚMEROS

var numbersonly = "()- 0123456789";
var numb = "0123456789";
var alpha = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ";

function res(t,v){
	var w = "";
	for (i=0; i < t.value.length; i++) {
		x = t.value.charAt(i);
		if (v.indexOf(x,0) != -1)
			w += x; 
	}
	t.value = w;
}

// function NumberCardCheck(source, arguments)
// {
  // even number?
 //  if (arguments.Value == "")
  //  arguments.IsValid = true;
//   else
  //  arguments.IsValid = false;
// }
function openCTT (){

var guia_numero = document.getElementById('txt_procurar').value

if (guia_numero != '')
{
    window.open(ctt + guia_numero, 'ctt');
}
}
function menu_goto( control, url )
{
    // see http://www.thesitewizard.com/archive/navigation.shtml
    // for an explanation of this script and how to use it on your
    // own site

    var baseurl = url;
    newurl = control.options[ control.selectedIndex ].value ;
    if (newurl.length != 0) {
      location.href = baseurl + newurl ;
    }
}

function openPopup(url, name, width, height)
{
    var left = (screen.availWidth / 2) - (width / 2);
    var top = (screen.availHeight / 2) - (height / 2);

    window.open(url, name, 'width=' + width + ', height=' + height + ', top=' + top + ', left=' + left + ', scrollbars=yes, resizable=no');
}