jQuery().ready(function(){
		// simple accordion
		jQuery('#menu').accordion({
			autoheight: false,
			//animated: "bounceslide", //"easeslide", 
			alwaysOpen: false,
			active: true    
		});
		
				// second simple accordion with special markup
		jQuery('#navigation').accordion({
			active: true,
			animated: "bounceslide", //"easeslide", 
			header: '.head',
			navigation: true,
			autoheight: false,
			animated: 'easeslide'
		});
		
	
	});


function flash_topo() {
  var obj_str = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="778" height="230" id="topo" align="middle">';
  obj_str += '<param name="allowScriptAccess" value="sameDomain" />';
  obj_str += '<param name="movie" value="topo.swf" />';
  obj_str += '<param name="quality" value="high" />';
  obj_str += '<param name="wmode" value="transparent" />';
  obj_str += '<param name="bgcolor" value="#f8f8f8" />';
  obj_str += '<embed src="topo.swf" quality="high" bgcolor="#ffffff" width="778" height="230" name="topo" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
  obj_str += '</object>';
  document.write(obj_str);
}

function base() {
	window.defaultStatus = document.title;
	}

function menu(x) {

	if (document.all(x).style.display == "inline") {

		document.all(x).style.display = "none";

	} else {

		document.all(x).style.display = "inline";

	}

}
//------------------- JUMP MENU --------------------

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

//------------------- POPUP  -----------------------
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

//------------------- POPUP MENU -------------------

var IE = document.all ? true : false;
if (!IE) document.captureEvents(Event.MOUSEMOVE)

var tempX   = 100;
var tempY   = 100;
var idImg   = "img-pequena-2"; // id da imagem a ampliar
var moveDiv = "img-popup-2";
var idImgG  = "img-grande-2";
var idPremios = "premios-0";
var divPremios = "premios0";
var onDrag  = false;

function mudaId(id){
    stopDrag(moveDiv);
    onDrag = false;

    idImg = "img-pequena-" + id;
    moveDiv = "img-popup-" + id;
    idImgG  = "img-grande-" + id;
}

function mudaPremiosId(id){
    idPremios = "premios-" + id;
    divPremios = "premios" + id;
}

function getOffsetLeft (el) {
    var ol = el.offsetLeft;
    while ((el = el.offsetParent) != null)
        ol += el.offsetLeft;
    return ol;
}
function getOffsetTop (el) {
    var ot = el.offsetTop;
    while((el = el.offsetParent) != null)
        ot += el.offsetTop;
    return ot;
}

function getMouseXY(e) {

    if (IE) { // grab the x-y pos.s if browser is IE
        tempX = event.clientX + document.body.scrollLeft;
        tempY = event.clientY + document.body.scrollTop;
    } else {  // grab the x-y pos.s if browser is NS
        tempX = e.pageX;
        tempY = e.pageY;
    }
    if (tempX < 0){tempX = 0;}
    if (tempY < 0){tempY = 0;}

    dragExec(e);

    return true;
}

function dragExec(e) {
    var el = IE ? event.srcElement : e.target;
    var top, left;

    if( el.id == idImg ) { // se o id corresponder a ao da imagem a ampliar entao mostra popup
        startDrag(moveDiv);
        dMove = document.getElementById(moveDiv);
        dImgG = document.getElementById(idImgG);

        if(IE && document.body.clientHeight) hgt = document.body.clientHeight;
        else hgt = (IE)?document.documentElement.clientHeight:window.innerHeight;

        hgt = hgt / 2;

        if(IE && document.body.scrollTop) sclTop = document.body.scrollTop;
        else sclTop = (IE)?document.documentElement.scrollTop:window.pageYOffset;

        dMove.style.top = tempY;

        if(IE && document.body.clientWidth) wdt = document.body.clientWidth;
        else wdt = (IE)?document.documentElement.clientWidth:window.innerWidth;

        wdt = wdt / 6;

        if((tempX) < wdt)
            dMove.style.left  = (tempX + 20) + "px";
        else
            dMove.style.left  = (tempX - 20 - (dImgG.width)) + "px";

        onDrag = true;
    } else {
        stopDrag(moveDiv);
        onDrag = false;
    }

    // div premios
    if(el.id == idPremios) {
        startDrag(divPremios);
        dMove = document.getElementById(divPremios);
        dImgG = document.getElementById(idPremios);

        if(IE && document.body.clientHeight) hgt = document.body.clientHeight;
        else hgt = (IE)?document.documentElement.clientHeight:window.innerHeight;

        if(IE && document.body.scrollTop) sclTop = document.body.scrollTop;
        else sclTop = (IE)?document.documentElement.scrollTop:window.pageYOffset;

        top = getOffsetTop(dImgG) + (parseInt(dImgG.height)/2);
        if(parseInt(top-sclTop+100) > hgt){
            top = top - 100;
        }
        dMove.style.top = top + "px";

        if(IE && document.body.clientWidth) wdt = document.body.clientWidth;
        else wdt = (IE)?document.documentElement.clientWidth:window.innerWidth;

        //dMove.style.left = tempX + (parseInt(dImgG.width)/2) + "px";
        left = tempX + (parseInt(dImgG.width)/2);
        if(parseInt(left+100+20) > wdt){
            left = left - 100 - (parseInt(dImgG.width));
        }
        dMove.style.left = left + "px";

        onDrag = true;
    } else {
        stopDrag(divPremios);
        onDrag = false;
    }
}

function startDrag(div) {
    if(!onDrag) {
        var elMove = document.getElementById(div);

        if(elMove){
            elMove.style.display    = "block";
            elMove.style.visibility = "visible";
        }
    }
    return false;
}


function stopDrag(div) {
    var elMove = document.getElementById(div);

    if(elMove){
        elMove.style.display    = "none";
        elMove.style.visibility = "hidden";
    }

    return false;
}

document.onmousemove = getMouseXY;
//if(!IE) document.onscroll = getMouseXY;
//else window.onscroll = getMouseXY;


function hideRow(id){
    var obj = document.getElementById(id);

    if(obj){
        obj.style.visibility = 'hidden';
        obj.style.display = 'none';
    }

}

