

if(typeof deconcept == "undefined") var deconcept = new Object();
if(typeof deconcept.util == "undefined") deconcept.util = new Object();
if(typeof deconcept.SWFObjectUtil == "undefined") deconcept.SWFObjectUtil = new Object();
deconcept.SWFObject = function(swf, id, w, h, ver, c, useExpressInstall, quality, xiRedirectUrl, redirectUrl, detectKey){
	if (!document.createElement || !document.getElementById) { return; }
	this.DETECT_KEY = false;
	this.skipDetect = true;
	this.params = new Object();
	this.variables = new Object();
	this.attributes = new Array();
	if(swf) { this.setAttribute('swf', swf); }
	if(id) { this.setAttribute('id', id); }
	if(w) { this.setAttribute('width', w); }
	if(h) { this.setAttribute('height', h); }
	if(ver) { this.setAttribute('version', new deconcept.PlayerVersion(ver.toString().split("."))); }
	this.installedVer = deconcept.SWFObjectUtil.getPlayerVersion(this.getAttribute('version'), useExpressInstall);
	if(c) { this.addParam('bgcolor', c); }
	var q = quality ? quality : 'high';
	this.addParam('quality', q);
	this.setAttribute('useExpressInstall', useExpressInstall);
	this.setAttribute('doExpressInstall', false);
	var xir = (xiRedirectUrl) ? xiRedirectUrl : window.location;
	this.setAttribute('xiRedirectUrl', xir);
	this.setAttribute('redirectUrl', '');
	if(redirectUrl) { this.setAttribute('redirectUrl', redirectUrl); }
};

deconcept.SWFObject.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
			if (this.getAttribute("doExpressInstall")) this.addVariable("MMplayerType", "PlugIn");
			swfNode = '<embed type="application/x-shockwave-flash" src="'+ this.getAttribute('swf') +'" 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 { 
			if (this.getAttribute("doExpressInstall")) this.addVariable("MMplayerType", "ActiveX");
			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') +'" />';
			var params = this.getParams();
			for(var key in params) {
			 swfNode += '<param name="'+ key +'" value="'+ params[key] +'" />';
			}
			swfNode += '<param name="wmode" value="transparent" />';
			var pairs = this.getVariablePairs().join("&");
			if(pairs.length > 0) {swfNode += '<param name="flashvars" value="'+ pairs +'" />';}
			swfNode += "</object>";
		}
		return swfNode;
	},
	write: function(elementId){
		if(this.getAttribute('useExpressInstall')) {
			var expressInstallReqVer = new deconcept.PlayerVersion([6,0,65]);
			if (this.installedVer.versionIsValid(expressInstallReqVer) && !this.installedVer.versionIsValid(this.getAttribute('version'))) {
				this.setAttribute('doExpressInstall', true);
				this.addVariable("MMredirectURL", escape(this.getAttribute('xiRedirectUrl')));
				document.title = document.title.slice(0, 47) + " - Flash Player Installation";
				this.addVariable("MMdoctitle", document.title);
			}
		}
		if(this.skipDetect || this.getAttribute('doExpressInstall') || this.installedVer.versionIsValid(this.getAttribute('version'))){
			var n = (typeof elementId == 'string') ? document.getElementById(elementId) : elementId;
			n.innerHTML = this.getSWFHTML();
			return true;
		}else{
			if(this.getAttribute('redirectUrl') != "") {
				document.location.replace(this.getAttribute('redirectUrl'));
			}
		}
		return false;
	}
}

deconcept.SWFObjectUtil.getPlayerVersion = function(reqVer, xiInstall){
	var PlayerVersion = new deconcept.PlayerVersion([0,0,0]);
	if(navigator.plugins && navigator.mimeTypes.length){
		var x = navigator.plugins["Shockwave Flash"];
		if(x && x.description) {
			PlayerVersion = new deconcept.PlayerVersion(x.description.replace(/([a-z]|[A-Z]|\s)+/, "").replace(/(\s+r|\s+b[0-9]+)/, ".").split("."));
		}
	}else{
		try{
			var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
			for (var i=3; axo!=null; i++) {
				axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+i);
				PlayerVersion = new deconcept.PlayerVersion([i,0,0]);
			}
		}catch(e){}
		if (reqVer && PlayerVersion.major > reqVer.major) return PlayerVersion; 
		if (!reqVer || ((reqVer.minor != 0 || reqVer.rev != 0) && PlayerVersion.major == reqVer.major) || PlayerVersion.major != 6 || xiInstall) {
			try{
				PlayerVersion = new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));
			}catch(e){}
		}
	}
	return PlayerVersion;
};
deconcept.PlayerVersion = function(arrVersion){
	this.major = parseInt(arrVersion[0]) != null ? parseInt(arrVersion[0]) : 0;
	this.minor = parseInt(arrVersion[1]) || 0;
	this.rev = parseInt(arrVersion[2]) || 0;
};
deconcept.PlayerVersion.prototype.versionIsValid = function(fv){
	if(this.major < fv.major) return false;
	if(this.major > fv.major) return true;
	if(this.minor < fv.minor) return false;
	if(this.minor > fv.minor) return true;
	if(this.rev < fv.rev) return false;
	return true;
};
deconcept.util = {
	getRequestParameter: function(param){
		var q = document.location.search || document.location.hash;
		if(q){
			var startIndex = q.indexOf(param +"=");
			var endIndex = (q.indexOf("&", startIndex) > -1) ? q.indexOf("&", startIndex) : q.length;
			if (q.length > 1 && startIndex > -1) {
				return q.substring(q.indexOf("=", startIndex)+1, endIndex);
			}
		}
		return "";
	}
};

if (Array.prototype.push == null) { Array.prototype.push = function(item) { this[this.length] = item; return this.length; };};

var getQueryParamValue = deconcept.util.getRequestParameter;
var FlashObject = deconcept.SWFObject; 
var SWFObject = deconcept.SWFObject;


function listagem(a){
	b = window.location.toString();
	if(b.indexOf('#') > -1){
		b = b.substring(0,b.indexOf('#'));
	}
	while(b.indexOf('&ordem=') > -1){
		for(i=1;i<10;i++){
			b = b.replace('&ordem='+i,'');
		}
	}
	if(b.indexOf('?') > -1){
		window.location = b + "&ordem="+a;
	}else{
		window.location = b + "?ordem="+a;
	}
}
function porPagina(a){
	b = window.location.toString();
	if(b.indexOf('#') > -1){
		b = b.substring(0,b.indexOf('#'));
	}
	while(b.indexOf('&porPagina=') > -1){
		for(i=1;i<100;i++){
			b = b.replace('&porPagina='+i,'');
		}
	}
	if(b.indexOf('?') > -1){
		window.location = b + "&porPagina="+a;
	}else{
		window.location = b + "?porPagina="+a;
	}
}




function abr(a){
		window.location = a;
		$('*').hover(function(){return false;},function(){return false;});
	}

$(document).ready(function(){

	var zIndexNumber = 100000;
	$('div,table,tr,td,th,a,span').each(function() {
		$(this).css('zIndex', zIndexNumber);
			zIndexNumber -= 10;
	});
	
	$('.menui, .ds').each(function(){
		$(this).click(function(){
			abr('?categoria='+$(this).attr('hreflang'));
			return false;
		});
	});
	
	$('.dst').hover(function(){
		$(this).css('color','#fff');
	},function(){
		$(this).css('color','#1594b7');
	});
	
	$('.dst2').hover(function(){
		$(this).css('color','#fff');
	},function(){
		$(this).css('color','#222');
	});
	
	$('.lp a').hover(function(){
		$(this).animate({fontSize: "18px"},250,"linear");
	},function(){
		$(this).animate({fontSize: "12px"},150,"linear");
	});
	
	$('.mss').hover(function(){
			$('.pp2').attr('src','img/pp2_on.gif');				 
	}, function(){
			$('.pp2').attr('src','img/pp2.gif');
	});
	$('.mss').click(function(){
		$('.smD2:visible').slideUp("slow");
		$('.smD2').not(':visible').slideDown("slow");
	});
	
	$('.mss2').hover(function(){
			$('.pp4').attr('src','img/pp4_on.gif');
	},function(){
		$('.pp4').attr('src','img/pp4.gif');
	});
	
	$('.mss2').click(function(){
			$('.smD1:visible').slideUp("slow");				 
			$('.smD1').not(':visible').slideDown("slow");
	});


	$('.alteraImagem').hover(function(){
		if($(this).attr("rev") != "n"){
			$(this).find("img").toggle(0);
		}
	},function(){
		if($(this).attr("rev") != "n"){
			$(this).find("img").toggle(0);
		}
	});

	$('#menu_topo').css('width',(screen.width - 20) + "px");

	Input_Especial('todos');
	jsServidor();
	
	if (window.opera) {
		$p("cestaSubmenu").style.top = 110;
	}
	
	$('#img').mousemove(function(e){ 
		if(  $('#zImg>img:visible').width()  !=  null ){
			p = $(this).offset();
			xx = e.pageX - p.left;
			yy = e.pageY - p.top;
			mx = 0-parseInt(($('#zImg>img:visible').width()-512)*(xx/180));
			my = 0-parseInt(($('#zImg>img:visible').height()-384)*(yy/130));
			$('#zImg > img:visible').css('left',mx).css('top',my);
		}
		
	});
	
	
	$('#img').hover(function(){
		$('#zImg').show();
	},function(){
		$('#zImg').hide();
	});
	
	$('#menl a').hover(function(){
		
		clearTimeout($(document).data('timeout'));
		$('#menl a').css('background-position','top');
			$(this).css('background-position','bottom');
			$('#menl a div').hide();	
		if($(this).attr('alt') != 'n'){			
			$(this).find('div').show();
			$(this).find('div').mousemove(function(e){
				ss = $(window).scrollTop();
				yy = (e.pageY-ss);
				yy2 = $(window).height();
				
				al = $(this).offset();
				cm = (al.top - $(window).scrollTop());
				
				al2 = $(this).find('.in2').offset();
				if(al2 != null){
					vai = al2.top-$(window).height();

					if(yy < 120 && cm < 0){
						$('html, body').not(':animated').animate({scrollTop:al.top}, 1000);
					}
					if(yy > yy2-160 && $(window).scrollTop() < vai){
						if(vai>0){
							$('html, body').not(':animated').animate({scrollTop:(vai+10)}, 1000);
						}
					}
				}
		   });
		}
	},function(){
		var t = setTimeout(function() {
			if($(this).attr('alt') != 'n'){
				$('#menl a').find('div').hide();
				$('#menl a').find('div').mousemove(function(){});
			}
				$('#menl a').css('background-position','top');
		}, 1000);
		$(document).data('timeout', t);
	});
	
	if(screen.width > 1024){
		$("#area_principal").css('margin','25px');
		$("#area_principal").css('marginTop','0px');
	}else{
		$("#area_principal").css('margin','5px!important');
		$("#area_principal").css('marginTop','0px');
	}
	
	
	$('#ali > *').each(function (){
			$(this).css("float","left");
	});


});


function clImg(a){
	$('#zImg > img, #img > img').each(function(){
		$(this).hide();
	});
	$('#img > img:eq('+a+'), #zImg > img:eq('+a+')').each(function(){
		$(this).show();
	});
	
	for(i=1;i<5;i++){
		$('#z'+i).attr("rev","");
	}
	$('#z'+a).attr("rev","1");
}

function $p(a){
	return document.getElementById(a);
}

function rolaAte(a,d){
	b = $('a[name="'+a+'"]');
	if(a == 'opinioes' && b.offset() == null){
		rolaAte('opiniao','strNomeOpine');
		return;
	}
	c = b.offset();
	$('html, body').not(':animated').animate({scrollTop:c.top}, 2000,"swing",function(){
		window.location = "#"+$(document).data('ancora');
		if($(document).data('focar').length > 0){
			$('*[name="'+$(document).data('focar')+'"]').focus();
		}
	});
	$(document).data('ancora',a);
	$(document).data('focar',d);
}