
if (screen.width <= "800")
    document.write("<link rel=\"stylesheet\" href=\"/util/css/css800v5.css\" type=\"text/css\" />");
else if ((screen.width > "800") && (screen.width <= "1024"))
    document.write("<link rel=\"stylesheet\" href=\"/util/css/css1024v5.css\" type=\"text/css\" />");
else if (screen.width > "1024")
    document.write("<link rel=\"stylesheet\" href=\"/util/css/css1280v5.css\" type=\"text/css\" />");          

        
function fls(nome,w,h) {
    wm = "transparent";
    document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" WIDTH=' + w + ' HEIGHT=' + h + '><PARAM NAME=movie VALUE="' + nome + '"><param name="wmode" value="transparent"><PARAM NAME=quality VALUE=high><EMBED src="' + nome + '" quality=high swLiveConnect=TRUE WIDTH=' + w + ' HEIGHT=' + h + ' TYPE="application/x-shockwave-flash" WMODE="transparent" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED></OBJECT>');
}

function AbreJanela(file,window, h, w) {
    childWindow=open(file,window,'height=' + h + ',width=' + w + ',left=50,status=yes,toolbar=no,menubar=no,location=no,scrollbars=yes;resizable=yes');
    if (childWindow.opener == null) childWindow.opener = self;
}

/**
 * FusionCharts: Flash Player detection and Chart embed 
 * 
 * Morphed from SWFObject (http://blog.deconcept.com/swfobject/) under MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 */
if(typeof infosoftglobal == "undefined") var infosoftglobal = new Object();
if(typeof infosoftglobal.FusionChartsUtil == "undefined") infosoftglobal.FusionChartsUtil = new Object();
infosoftglobal.FusionCharts = function(swf, id, w, h, debugMode, registerWithJS, c, scaleMode, lang){
	if (!document.getElementById) { return; }
	
	//Flag to see whether data has been set initially
	this.initialDataSet = false;
	
	//Create container objects
	this.params = new Object();
	this.variables = new Object();
	this.attributes = new Array();
	
	//Set attributes for the SWF
	if(swf) { this.setAttribute('swf', swf); }
	if(id) { this.setAttribute('id', id); }
	if(w) { this.setAttribute('width', w); }
	if(h) { this.setAttribute('height', h); }
	
	//Set background color
	if(c) { this.addParam('bgcolor', c); }
	
	//Set Quality	
	this.addParam('quality', 'high');
	
	//Add scripting access parameter
	this.addParam('allowScriptAccess', 'always');
	
	//Pass width and height to be appended as chartWidth and chartHeight
	this.addVariable('chartWidth', w);
	this.addVariable('chartHeight', h);

	//Whether in debug mode
	debugMode = debugMode ? debugMode : 0;
	this.addVariable('debugMode', debugMode);
	//Pass DOM ID to Chart
	this.addVariable('DOMId', id);
	//Whether to registed with JavaScript
	registerWithJS = registerWithJS ? registerWithJS : 0;
	this.addVariable('registerWithJS', registerWithJS);
	
	//Scale Mode of chart
	scaleMode = scaleMode ? scaleMode : 'noScale';
	this.addVariable('scaleMode', scaleMode);
	//Application Message Language
	lang = lang ? lang : 'EN';
	this.addVariable('lang', lang);
}

infosoftglobal.FusionCharts.prototype = {
	setAttribute: function(name, value){
		this.attributes[name] = value;
	},
	getAttribute: function(name){
		return this.attributes[name];
	},
	addParam: function(name, value){
		this.params[name] = value;
	},
	getParams: function(){
		return this.params;
	},
	addVariable: function(name, value){
		this.variables[name] = value;
	},
	getVariable: function(name){
		return this.variables[name];
	},
	getVariables: function(){
		return this.variables;
	},
	getVariablePairs: function(){
		var variablePairs = new Array();
		var key;
		var variables = this.getVariables();
		for(key in variables){
			variablePairs.push(key +"="+ variables[key]);
		}
		return variablePairs;
	},
	getSWFHTML: function() {
		var swfNode = "";
		if (navigator.plugins && navigator.mimeTypes && navigator.mimeTypes.length) { 
			// netscape plugin architecture			
			swfNode = '<embed type="application/x-shockwave-flash" src="'+ this.getAttribute('swf') +'" wmode="transparent" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') +'"  ';
			swfNode += ' id="'+ this.getAttribute('id') +'" name="'+ this.getAttribute('id') +'" ';
			var params = this.getParams();
			 for(var key in params){ swfNode += [key] +'="'+ params[key] +'" '; }
			var pairs = this.getVariablePairs().join("&");
			 if (pairs.length > 0){ swfNode += 'flashvars="'+ pairs +'"'; }
			swfNode += '/>';
		} else { // PC IE			
			swfNode = '<object id="'+ this.getAttribute('id') +'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') +'">';
			swfNode += '<param name="movie" value="'+ this.getAttribute('swf') +'" />';
			swfNode += '<param name="wmode" value="transparent" />';
			var params = this.getParams();
			for(var key in params) {
			 swfNode += '<param name="'+ key +'" value="'+ params[key] +'" />';
			}
			var pairs = this.getVariablePairs().join("&");			
			if(pairs.length > 0) {swfNode += '<param name="flashvars" value="'+ pairs +'" />';}
			swfNode += "</object>";
		}
		return swfNode;
	},
	setDataURL: function(strDataURL){
		//This method sets the data URL for the chart.
		//If being set initially
		if (this.initialDataSet==false){
			this.addVariable('dataURL',strDataURL);
			//Update flag
			this.initialDataSet = true;
		}else{
			//Else, we update the chart data using External Interface
			//Get reference to chart object
			var chartObj = infosoftglobal.FusionChartsUtil.getChartObject(this.getAttribute('id'));
			chartObj.setDataURL(strDataURL);
		}
	},
	setDataXML: function(strDataXML){
		//If being set initially
		if (this.initialDataSet==false){
			//This method sets the data XML for the chart INITIALLY.
			this.addVariable('dataXML',strDataXML);
			//Update flag
			this.initialDataSet = true;
		}else{
			//Else, we update the chart data using External Interface
			//Get reference to chart object
			var chartObj = infosoftglobal.FusionChartsUtil.getChartObject(this.getAttribute('id'));
			chartObj.setDataXML(strDataXML);
		}
	},
	render: function(elementId){
		var n = (typeof elementId == 'string') ? document.getElementById(elementId) : elementId;
		n.innerHTML = this.getSWFHTML();
		return true;		
	}
}

// ------------ Fix for Out of Memory Bug in IE in FP9 ---------------//
/* Fix for video streaming bug */
infosoftglobal.FusionChartsUtil.cleanupSWFs = function() {
	if (window.opera || !document.all) return;
	var objects = document.getElementsByTagName("OBJECT");
	for (var i=0; i < objects.length; i++) {
		objects[i].style.display = 'none';
		for (var x in objects[i]) {
			if (typeof objects[i][x] == 'function') {
				objects[i][x] = function(){};
			}
		}
	}
}
// Fixes bug in fp9
infosoftglobal.FusionChartsUtil.prepUnload = function() {
	__flash_unloadHandler = function(){};
	__flash_savedUnloadHandler = function(){};
	if (typeof window.onunload == 'function') {
		var oldUnload = window.onunload;
		window.onunload = function() {
			infosoftglobal.FusionChartsUtil.cleanupSWFs();
			oldUnload();
		}
	} else {
		window.onunload = infosoftglobal.FusionChartsUtil.cleanupSWFs;
	}
}
if (typeof window.onbeforeunload == 'function') {
	var oldBeforeUnload = window.onbeforeunload;
	window.onbeforeunload = function() {
		infosoftglobal.FusionChartsUtil.prepUnload();
		oldBeforeUnload();
	}
} else {
	window.onbeforeunload = infosoftglobal.FusionChartsUtil.prepUnload;
}

/* Add Array.push if needed (ie5) */
if (Array.prototype.push == null) { Array.prototype.push = function(item) { this[this.length] = item; return this.length; }}

/* Function to return Flash Object from ID */
infosoftglobal.FusionChartsUtil.getChartObject = function(id)
{
  if (window.document[id]) {
      return window.document[id];
  }
  if (navigator.appName.indexOf("Microsoft Internet")==-1) {
    if (document.embeds && document.embeds[id])
      return document.embeds[id]; 
  } else {
    return document.getElementById(id);
  }
}
/* Aliases for easy usage */
var getChartFromId = infosoftglobal.FusionChartsUtil.getChartObject;
var FusionCharts = infosoftglobal.FusionCharts;    





var isDOM = (document.getElementById ? true : false);
var isIE4 = ((document.all && !isDOM) ? true : false);
var isNS4 = (document.layers ? true : false);
var isNS = navigator.appName == "Netscape";

function getRef(id) {
    if (isDOM) return document.getElementById(id);
    if (isIE4) return document.all[id];
    if (isNS4) return document.layers[id];
}

function getSty(id) {
    x = getRef(id);
    return (isNS4 ? getRef(id) : getRef(id).style);
}

var scrollerHeight = 0;
var puaseBetweenImages = 2000;
var imageIdx = 0;

function moveRightEdge() {
    var yMenuFrom, yMenuTo, yOffset, timeoutNextCheck;
    if (isNS4) {
        yMenuFrom   = divMenu.top;
        yMenuTo     = windows.pageYOffset + 5;
    } else if (isDOM) {
        if (document.documentElement && !document.documentElement.scrollTop)
        {
            // IE6 +4.01 but no scrolling going on
            yMenuFrom   = parseInt (divMenu.style.top, 10);
            yMenuTo     = (isNS ? window.pageYOffset : document.body.scrollTop) + 0;
        }
        else if (document.documentElement && document.documentElement.scrollTop)
        {
            // IE6 +4.01 and user has scrolled
                                 
            yMenuFrom   = parseInt (divMenu.style.top, 10);
            yMenuTo     = (isNS ? window.pageYOffset : document.documentElement.scrollTop) + 0;
             
        }
        else if (document.body && document.body.scrollTop)
        {
            // IE5 or DTD 3.2
            yMenuFrom   = parseInt (divMenu.style.top, 10);
            yMenuTo     = (isNS ? window.pageYOffset : document.body.scrollTop) + 0;
        }
        else
        {
            yMenuFrom   = parseInt (divMenu.style.top, 10);
            yMenuTo     = (isNS ? window.pageYOffset : document.body.scrollTop) + 0;
        }
         
    }   
    timeoutNextCheck = 2000;
    
    if (yMenuFrom != yMenuTo) {

        yOffset = Math.ceil(Math.abs(yMenuTo - yMenuFrom) / 20);
        if (yMenuTo < yMenuFrom)
            yOffset = -yOffset;
        if (isNS4)
            divMenu.top += yOffset;
        else if (isDOM)
        {
          //  divMenu.style.top = parseInt(divMenu.style.top, 10) + yOffset;
            timeoutNextCheck = 30;
            divMenu.style.top = parseInt(divMenu.style.top, 10) + yOffset + "px";
        }
    }
    //setTimeout ("moveRightEdge()", timeoutNextCheck);
}






var curpage=0;
var timer=null;
var imagesWidth=null;
var imagesHeight=null;
var slideHeight=0;
var stopped = false;
var numpages = 0;
var arraySlides;
var obj;


function fnc_next()
{

	if (curpage > numpages-1)
	{
		curpage=0;
	}

	obj=arraySlides[curpage];
	obj.style.visibility = "hidden";
	obj.style.display = "none";
	obj.style.height = "1px";

	curpage++;

	if (curpage>numpages - 1) 
	{
		curpage = 0;
	}

	obj=arraySlides[curpage];
	obj.style.visibility = "visible";
	obj.style.display = "block";
	obj.style.height = (slAltura + 70) + "px";

	if(!stopped)
	{
		clearTimeout(timer);
		start();
	}

}

function fnc_prev()
{
	if (curpage>numpages)	curpage = 0;

	obj= arraySlides[curpage];

	if(obj)
	{
		obj.style.visibility = "hidden";
		obj.style.display = "none";
		obj.style.height = "1px";
	}
	
	curpage--;
	if (curpage<0)	curpage = numpages-1;

	obj=arraySlides[curpage];
	if(obj)
	{
		obj.style.visibility = "visible";
		obj.style.display = "block";
		obj.style.height = (slAltura + 70) + "px";
	}

	if(!stopped)
	{
		clearTimeout(timer);
		start();
	}
}

function stopstart(img) 
{
	if (stopped) {
		img.src="/app_themes/padrao/img/"+img.id+".gif";
		img.onmouseover="sgppnov(this);";
		img.onmouseout="sgppnou(this);";
		start();
	} else {
		img.src="/app_themes/padrao/img/"+img.id+"_over.gif";
		img.onmouseover="";
		img.onmouseout="";
		stop();
	}
}

function stop() 
{
	if (!(stopped)) 
	{
		clearTimeout(timer);
		stopped=true;
	}
}
function start() 
{
	timer=setTimeout('fnc_next()',tempo);
	stopped=false;
}

function firsthideImgs()
{
	arraySlides = document.getElementsByName("rota");

	numpages = arraySlides.length;
	for (i=0;i <= numpages;i++)
	{
		var obj=arraySlides[i];
		if(obj)
		{
			if(i==0) 
			{
				imagesWidth	 = document.getElementById('imgSlide').width;
				imagesHeight = document.getElementById('imgSlide').height;
			}
			
			slideHeight = slAltura;
			obj.style.visibility="hidden";
			obj.style.display = "none";
			obj.style.height = "1px";
			obj.style.overflow ="hidden";
			obj.style.top = "0px";
			obj.style.position = "relative";
			obj.style.border = "0px solid";
			obj.style.zIndex = 1;
		}
	}

	curpage = 0;
	var firstSlide = arraySlides[0];
	if(firstSlide)
	{
		firstSlide.style.visibility = "visible";
		start();
	}
}


function firsthide()
{
	document.getElementById("slideCapa").style.visibility = "visible";

	arraySlides = document.getElementsByName("rota");

	numpages = arraySlides.length;


	for (i=0;i < numpages ;  i ++)
	{
		obj=arraySlides[i];
		if(obj)
		{
			if(i==0) 
			{
				imagesWidth	 = document.getElementById('imgSlide').width;
				imagesHeight = document.getElementById('imgSlide').height;
			}

			slideHeight = imagesHeight + 83;
			obj.style.visibility="hidden";
			obj.style.display = "none";
			obj.style.height = "1px";
			obj.style.overflow ="hidden";
			obj.style.top = "0px";
			obj.style.position = "relative";
			obj.style.border = "0px solid";
			obj.style.zIndex = 1;
		}
	}



	curpage = 0;
	var firstSlide = arraySlides[0];
	if(firstSlide)
	{
		firstSlide.style.visibility = "visible";
		firstSlide.style.display = "block";
		firstSlide.style.height = (slAltura + 70) + "px";
		start();
	}
	

}

function sgppnov(img)
{
	img.src='/app_themes/padrao/img/'+img.id+'_over.gif';
}
function sgppnou(img)
{
	img.src='/app_themes/padrao/img/'+img.id+'.gif';
}




