var  TopDivs = 110;
var LeftDivs = [];
var totalMenuItens = 6;
var discount = 0;
var Active = false;
var Menu = false;
var Third = false;
function ShowMenu(obj) {
	Menu = true;
	Active = false;
	for(x=1;x<=totalMenuItens;x++) {
		Item = eval("sub0"+x);
		Item.style.visibility = "hidden";
	}
	obj.style.cursor = "hand";
	obj.style.visibility = "visible";
}
function HideMenu(obj) {
	setTimeout(function(){ 
		if(!Active) {
			if(!Menu) {
				if(!Third) {
					obj.style.visibility = "hidden"
				}
			}
		}
	},500);
	Menu = false;
}
function ShowSubMenu(obj) {
	Active = true;
	for(x=1;x<=totalMenuItens;x++) {
		Item = eval("sub0"+x);
		Item.style.visibility = "hidden";
	}
	obj.style.cursor = "hand";
	obj.style.visibility = "visible";
}
function HideSubMenu(obj) {
	Active = false;
	if(!Active) {
		setTimeout(function(){ 
			if(!Active) {
				if(!Third) {
					if(!Menu) {obj.style.visibility = "hidden"}
				}
			}
//			alert('chamando...')
			},500);
	}
}

/*******************************************/
function ShowThird(obj,vars) {
	Third = true;
	obj.style.cursor = "hand";
	obj.style.visibility = "visible";
	switch(screen.width) {
		case 800:
			obj.style.left = "110";
			break;
		case 1024:
			obj.style.left = "140";
			break;
		case 1152:
			obj.style.left = "210";
			break;
		case 1280:
			obj.style.left = "270";
			break;
		default:
			discount = 160 + 20  + desconto;
			break;
	}	
}
function HideThird(obj) {
	Third = false;
	obj.style.visibility = "hidden"
}
function ShowThird2(obj) {
	Third = true;
	obj.style.cursor = "hand";
	obj.style.visibility = "visible";
	switch(screen.width) {
		case 800:
			obj.style.left = "300";
			break;
		case 1024:
			obj.style.left = "340";
			break;
		case 1152:
			obj.style.left = "400";
			break;
		case 1280:
			break;
		default:
			discount = 160 + 20  + desconto;
			break;
	}	
}
function HideThird2(obj) {
	Third = false;
	obj.style.visibility = "hidden"
}
function ShowThird3(obj) {
	Third = true;
	obj.style.cursor = "hand";
	obj.style.visibility = "visible";
	switch(screen.width) {
		case 800:
			obj.style.left = "240";
			break;
		case 1024:
			obj.style.left = "280";
			break;
		case 1152:
			obj.style.left = "340";
			break;
		case 1280:
			obj.style.left = "410";
			break;
		default:
			discount = 160 + 20  + desconto;
			break;
	}	
}
function HideThird3(obj) {
	Third = false;
	obj.style.visibility = "hidden"
}
/******************************************/


function initDivs() {
	if(navigator.appName == "Microsoft Internet Explorer") {
		desconto = 0;
	} else {
		desconto = -10;
	}

	switch(screen.width) {
		case 800:
			discount = 160 + 20 + desconto;
			break;
		case 1024:
			discount = 128 + 20  + desconto;
			break;
		case 1152:
			discount = 64 + 20  + desconto;
			break;
		case 1280:
			discount = 0 + 20  + desconto;
			break;
		default:
			discount = 160 + 20  + desconto;
			break;
	}
	LeftDivs = [(180-discount),(264-discount),(370-discount),(530-discount),(626-discount),(770-discount)];				
	for(x=1;x<=totalMenuItens;x++) {
		Item = eval("sub0"+x);
		with(Item.style) {
		visibility = "hidden";
		position = "absolute";
		left = LeftDivs[x-1];
		top = TopDivs;
		}
	}
}
function SwapOn(obj) {
	obj.style.color = "#FFFFFF";
	obj.style.backgroundColor = "#81C4E4";
}
function SwapOff(obj) {
	obj.style.color = "#164556";
	obj.style.backgroundColor = "#C4E3F2";
}
function GoPage(href) {
	location.href = href;
}