﻿	// Centralizo a div principal	
	function setPosition(who) {
		var item = document.getElementById(who).style;
		item.top = "50%";
		item.left = "50%";
		item.width = "1000px";
		item.height = "620px";
		item.margin = "-310px auto auto -500px";				
	}	    
	function setPosition2(who) {
		var item = document.getElementById(who).style;
		//item.backgroundColor = "#000000";
		item.top = "0%";
		item.left = "0%";
		item.width = document.documentElement.clientWidth;
		item.height = document.documentElement.clientHeight;
		item.margin = "0";				
	}

	function setDivMargin(who,marginW,marginL) {
	    document.getElementById(who).style.top = marginW;
	    document.getElementById(who).style.left = marginL;
	}
	
	function getWidth(){
		//document.getElementById('debug').innerHTML = w;
		//var timer = setTimeout(getWidth(),5);
	}

	function AtivaMenu1() {
	    document.getElementById('imgAba').style.visibility = 'hidden';
		document.getElementById('menu1_content').style.visibility='visible';
		$('menu1').morph('background:#ffffff; width:167px;');
	}
	function AtivaMenu2() {
	    document.getElementById('imgAba').style.visibility = 'hidden';
	    document.getElementById('menu2').style.visibility='visible';
	    document.getElementById('menu2_content').style.visibility='visible';
		$('menu2').morph('background:#ffffff; width:167px;');		
	}
	function AtivaMenu3() {
	    document.getElementById('imgAba').style.visibility = 'hidden';
	    document.getElementById('menu3').style.visibility='visible';
	    document.getElementById('menu3_content').style.visibility='visible';
		$('menu3').morph('background:#ffffff; width:167px;');
    }
    function AtivaTodosMenus() {
        document.getElementById('imgAba').style.visibility = 'hidden';
        document.getElementById('menu3').style.visibility = 'visible';
        document.getElementById('menu3_content').style.visibility = 'visible';        
    }	

	function RecolheMenu1() {
	    document.getElementById('imgAba').style.visibility = 'visible';
		$('menu1').morph('background:#ffffff; width:10px;');
		document.getElementById('menu1_content').style.visibility = 'hidden';
		//window.alert(readCookie("ImagemAtiva"));
		//RestoreimgCentral();
	}

	function RecolheMenu2() {
	    document.getElementById('imgAba').style.visibility = 'visible';
		$('menu2').morph('background:#ffffff; width:0px;');
		document.getElementById('menu2_content').style.visibility = 'hidden'
		//RestoreimgCentral();
	}

	function RecolheMenu3() {
	    document.getElementById('imgAba').style.visibility = 'visible';
		$('menu3').morph('background:#ffffff; width:0px;');
		document.getElementById('menu3_content').style.visibility = 'hidden';
		//RestoreimgCentral();
    }	
	
	function RecolheTodos(){		
		$('menu1').morph('background:#ffffff; width:10px;');
		$('menu2').morph('background:#ffffff; width:0px;');
		$('menu3').morph('background:#ffffff; width:0px;');		
		document.getElementById('menu1_content').style.visibility='hidden';
		document.getElementById('menu2_content').style.visibility='hidden';
		document.getElementById('menu3_content').style.visibility = 'hidden';
		//RestoreimgCentral();
	}
	
	function HideFullContent(){
		document.getElementById('fullContent').style.visibility='hidden';
		//document.getElementById('bg').style.backgroundColor = "#ffffff";
    }
    function HideFullContentFlash() {
        document.getElementById('fullContentFlash').style.visibility = 'hidden';
        //document.getElementById('bg').style.backgroundColor = "#ffffff";		
    }
	
	function ShowFullContent(){
		//document.getElementById('bg').style.backgroundColor = "#000000";		
		document.getElementById('fullContent').style.visibility='visible';
	}
	function ShowTopBotton() {
	    document.getElementById('RecolheMenusCentroTop').style.visibility = 'visible';
	    document.getElementById('RecolheMenusCentroBotton').style.visibility = 'visible';
	    document.getElementById('RecolheMenusMidle').style.visibility = 'hidden';
	}

	function ShowMiddle() {
	    document.getElementById('RecolheMenusCentroTop').style.visibility = 'hidden';
	    document.getElementById('RecolheMenusCentroBotton').style.visibility = 'hidden';
	    document.getElementById('RecolheMenusMidle').style.visibility = 'visible';
	    //document.getElementById('internalContentImageTransp').style.visibility = 'hidden';
	    //document.getElementById('modeloTexto1').style.visibility = 'hidden';	  	    
	    RecolheMenu1();
	    RecolheMenu2();
	    RecolheMenu3();
	    HideFullContentFlash()
	}
	function ShowTransp() {
	    document.getElementById('internalContentImageTransp').style.visibility = 'visible';
	    document.getElementById('modeloTexto1').style.visibility = 'visible';
	    document.getElementById('btFecharFichaTec').style.visibility = 'visible';
	    
	}
	function HideTransp() {
	    document.getElementById('internalContentImageTransp').style.visibility = 'hidden';
	    document.getElementById('modeloTexto1').style.visibility = 'hidden';
	    document.getElementById('btFecharFichaTec').style.visibility = 'hidden';
	}

	function RestoreimgCentral() {
	    var b = document.cookie.valueOf("ImagemAtiva");
	    //temp = b.split('ImagemAtiva=');
	    //window.alert(temp[1]);
	    var temp = new Array();
	    temp = b.split('ImagemAtiva=');
	    //window.alert(temp[1]);
	    document.images['imgCentral'].src = 'associacoes/imagens/' + temp[1];
	    //window.alert(temp[2]);
	}
	
	
	
	
	// Preload and play audio files with event handler (MouseOver sound)
	// designed by JavaScript Archive, (c)1999
	// Get more free javascripts at http://jsarchive.8m.com

	var aySound = new Array();
	// Below: source for sound files to be preloaded
	aySound[0] = "beep.wav";
	aySound[1] = "beep.wav";
	// DO NOT edit below this line

	IE = (navigator.appVersion.indexOf("MSIE") != -1 && document.all) ? 1 : 0;
	NS = (navigator.appName == "Netscape" && navigator.plugins["LiveAudio"]) ? 1 : 0;
	ver4 = IE || NS ? 1 : 0;
	onload = auPreload;

	function auPreload() {
	    if (!ver4) return;
	    if (NS) auEmb = new Layer(0, window);
	    else {
	        Str = "<DIV ID='auEmb' STYLE='position:absolute;'></DIV>";
	        document.body.insertAdjacentHTML("BeforeEnd", Str);
	    }
	    var Str = '';
	    for (i = 0; i < aySound.length; i++)
	        Str += "<EMBED SRC='" + aySound[i] + "' AUTOSTART='FALSE' HIDDEN='TRUE'>"
	    if (IE) auEmb.innerHTML = Str;
	    else {
	        auEmb.document.open();
	        auEmb.document.write(Str);
	        auEmb.document.close();
	    }
	    auCon = IE ? document.all.auIEContainer : auEmb;
	    auCon.control = auCtrl;
	}
	function auCtrl(whSound, play) {
	    if (IE) this.src = play ? aySound[whSound] : '';
	    else eval("this.document.embeds[whSound]." + (play ? "play()" : "stop()"))
	}
	function playSound(whSound) { if (window.auCon) auCon.control(whSound, true); }
	function stopSound(whSound) { if (window.auCon) auCon.control(whSound, false); }	
	
