
/*
	Função que cria a coleção de itens do menu
	
	Criada em 25/04/2007 por Rafael Gomes Alcantara
	Email: rafael.gomes@ithink.com.br
	iThink Professional Services
	www.ithink.com.br
*/

// Coleção Menu
function Menus(){
	this.arrayItems = new Array();
	this.Add = _Add;
	this.Items = _Items;
	this.Count = _Count;
	this.Selec = _Selec;
	
	// Adiciona um novo objeto Destaque ao array
	function _Add(objDestaque){
		if(this.arrayItems){
			this.arrayItems[this.arrayItems.length] = objDestaque;
		}
	}
	
	// Retorna o array de itens da coleção
	function _Items(){
		if(this.arrayItems){
			return this.arrayItems;
		}
	}

	// Retorna o número de objetos atualmente nesta coleção
	function _Count(){
		if(this.arrayItems){
			return this.arrayItems.length;
		}
	}
	
	// Retorna um objeto da coleção
	function _Selec(strURL){
		if(this.arrayItems){
			for(var i=0; i<this.arrayItems.length; i++){
				var tmpItems = this.arrayItems[i];
				//
				if(tmpItems.Url == strURL){
					return tmpItems.Pai;					
				}				
			}
		}
	}	
}

// Objeto Menu
function Menu(strPai, strNome, strURL){
	if(strPai && strNome && strURL){
		this.Pai = strPai;
		this.Nome = strNome;		
		this.Url = strURL;
	}
}

//Inclusão do Menu
var objMenus = new Menus();

// Soluções de Dados
objMenu = new Menu("menu2", "Monitora", "prodDadosMonitora.shtml");
objMenus.Add(objMenu);

// Soluções Convergentes
objMenu = new Menu("menu2", "Posto de Trabalho", "prodConvPostoTrab.shtml");
objMenus.Add(objMenu);

//

var arrCaminho = document.location.href.split("/");
var arrArquivo = arrCaminho[arrCaminho.length-1].split("?");
var strArquivo = arrArquivo[0];
strArquivo = strArquivo.replace("#","");
var itemMenu = objMenus.Selec(strArquivo);
var totMenu = 18;

function abrirSelect1()
{
    location.href=document.fcombo.combo1[document.fcombo.combo1.selectedIndex].value;
}

function abrirSelect2()
{
    location.href=document.fcombo.combo2[document.fcombo.combo2.selectedIndex].value;
}

function abrirSelect3()
{
    location.href=document.fcombo.combo3[document.fcombo.combo3.selectedIndex].value;
}

function abrirSelect4()
{
    location.href=document.fcombo.combo4[document.fcombo.combo4.selectedIndex].value;
}