/* MENU JAVASCRIPT */

//<![CDATA[ // Serve para manter não mostrar o script nos browsers; 

	jumpy = 1;
	IdsForIE5 = new Array ()
	SubIds = new Array ()
	nums = new Array (0)

	function Open(Sub) {
		if (jumpy == 1) {
			for (var i=0 ; i<SubIds.length ; i++) {
				a = document.getElementById(SubIds[i]).style
				if (SubIds[i] == Sub) { 
					if (a.display == 'block') { 
						a.display = 'none' 
					} else { 
						a.display = 'block' 
					} 
				} else { 
					a.display = 'none' 
					}		 
				} 
			} else {
			a = document.getElementById(Sub).style
			if (a.display == 'block') {
				a.display = 'none'
			} else {
			a.display = 'block'
			}
		}
	}


	IE5 =(parseInt(navigator.appVersion) == 4 && navigator.userAgent.toLowerCase().indexOf('msie 5.0') != -1);
	FIREFOX =(parseInt(navigator.appVersion) == 4 && navigator.userAgent.toLowerCase().indexOf('Firefox') != -1);

	onload = function() {
	
	
		document.getElementById("d2").onclick = slideIt;    // DESTAQUE
	document.getElementById("d3").onclick = slideIn;      // DESTAQUE
	
	
		while (nums.length < 50) {
			nums[nums.length] = nums.length + 1
		}
		for (var i=0;i<nums.length;i++) {
			if (document.getElementById('sub-' + nums[i])) {
				SubIds[SubIds.length] = 'sub-' + nums[i]
			}
			if (document.getElementById('open-' + nums[i])) {
				IdsForIE5[IdsForIE5.length] = 'open-' + nums[i]
			}
		}
		if (IE5) {
			for (var i=0;i<IdsForIE5.length;i++) {
				document.getElementById(IdsForIE5[i]).style.cursor = 'hand'
			}
		}
		
		if (FIREFOX==1) {
			for (var i=0;i<IdsForIE5.length;i++) {
				document.getElementById(IdsForIE5[i]).style.cursor = 'hand'
			}
		}
		
		
		
		if (document.getElementById('flag')) {
			str = document.getElementById('flag').innerHTML
			SubId = 'sub-' + str.slice(str.indexOf('flag-')+5,str.indexOf('-menu'))
			if (document.getElementById(SubId)) {
				Open(SubId)
			}
		}
	}

//alert (navigator.userAgent.toLowerCase())

//]]>


//#############################################################
// DESTAQUE

//<![CDATA[



function slideIt() {

	var slidingDiv = document.getElementById("d1");
	var stopPosition = 50;

	if (parseInt(slidingDiv.style.left) < stopPosition ){
		slidingDiv.style.left = parseInt(slidingDiv.style.left) + 2 + "px";
		setTimeout(slideIt, 1);
	}
}

function slideIn(){ 
	
	var slidingDiv = document.getElementById("d1");
	var stopPosition = -250;

	if (parseInt(slidingDiv.style.left) > stopPosition ){ 
		slidingDiv.style.left = parseInt(slidingDiv.style.left) - 2 + "px";
		setTimeout(slideIn, 1);
	}
}
//]]>

