function popw(u,w,h){
	l = (screen.width-w)/2;
	t = (screen.height-h)/2;
	window.open(u,'popUpWin','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,width='+w+',height='+h+',left='+l+',top='+t+',screenX='+l+',screenY='+t+'');
}

function BackToTheHtml(node){
	if(node == null)
		this.node = document; 
	else
		this.node = node; 
};
BackToTheHtml.prototype.node = null;

BackToTheHtml.prototype.execute = function(){
	this.activateObject();
}

BackToTheHtml.prototype.activateObject = function(domObject){
	var aDomObject = this.node.getElementsByTagName('object');
	var activationObject;
	for(var i=0; i<aDomObject.length; i++)
		if(aDomObject[i].getAttributeNode('BackToTheHtml') == null && (activationObject = this.getActivationObject(aDomObject[i])) != null)
			activationObject.execute();
};

BackToTheHtml.prototype.getActivationObject = function(domObject){
	var classid = domObject.classid.toUpperCase().substr('clsid:'.length);
	var mimeType = domObject.type.toLowerCase();

	switch(true){
		case classid == 'D27CDB6E-AE6D-11CF-96B8-444553540000'  || mimeType == 'application/x-shockwave-flash' :
			return new ActivateObjectFlash(domObject);

		default :
			return null;
	}
};

BackToTheHtml.uniqueID = function(prefix){
	var sPrefix;
	if(prefix == null)
		sPrefix = 'uniqueId';
	else
		sPrefix = prefix;
		
	var i=0;
	while(document.getElementById(sPrefix + (i++)))
		;
	return sPrefix + (i-1);
};

BackToTheHtml.isParentOf = function(parent,child){
	var found = false;
	for(var i=0; i<parent.childNodes.length; i++)
		if(parent.childNodes[i] == child)
			return true;
		else
			found = arguments.callee(parent.childNodes[i],child);

	return found;
}

function ActivateObject(domObject){
	this.domObject = domObject;
}

ActivateObject.prototype.domObject = null;
ActivateObject.prototype.classid = null;
ActivateObject.prototype.aHtmlAttribute = ['accessKey','align','alt','archive','border','code','codeBase','codeType','declare','dir','height','hideFocus','hspace','lang','language','name','standby','tabIndex','title','useMap','vspace','width'];
ActivateObject.prototype.aObjectProperty = null;

ActivateObject.prototype.execute = function(){
	this.xndObjectId = BackToTheHtml.uniqueID();
	this.setTextHtml();
	this.writeObject();

	this.xndObject = document.getElementById(this.xndObjectId);
	this.setSpecialProperties();
	this.removeOriginalObject();
}

ActivateObject.prototype.setTextHtml = function(){
	var str = '';
	str += '<object BackToTheHtml ' + '\n';
	str += ' classid="clsid:' + this.classid + '" ' + '\n';

	for(var i=0; i<this.aHtmlAttribute.length; i++)	{
		var name = this.aHtmlAttribute[i];
		if(typeof this.domObject[name] != 'undefined' && this.domObject[name].toString() != '')
			str += '\t' + name + '="' + this.domObject[name].toString() + '" ' + '\n';
	}

	str += 'id="' + this.xndObjectId + '" ' + '\n';
	str += '>';

	for(var i=0; i<this.aObjectProperty.length; i++){
		var name = this.aObjectProperty[i];
		if(typeof this.domObject[name] != 'undefined' && this.domObject[name].toString() != '' )
			str += '\t<param name="' + name + '" value="' + this.domObject[name].toString() + '"></param>' + '\n';
	}
	str += '</object>';

	this.textHtml = str;
};

ActivateObject.prototype.writeObject = function(){
	this.domObject.insertAdjacentHTML("afterEnd",this.textHtml);
};

ActivateObject.prototype.setSpecialProperties = function(){
	if(typeof this.domObject.className != 'undefined' && this.domObject.className.toString() != '')
		this.xndObject.className = this.domObject.className

	if(typeof this.domObject.style.cssText != 'undefined' && this.domObject.style.cssText.toString() != '')
		this.xndObject.style.cssText = this.domObject.style.cssText;

	if(typeof this.domObject.SWRemote != 'undefined' && this.domObject.SWRemote.toString() != '')
		this.xndObject.FlashVars = this.domObject.SWRemote;

	if(typeof this.domObject.codebase == 'undefined' || this.domObject.codebase.toString() == '')
		this.xndObject.codebase = 'http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,24,0';

	if(typeof this.domObject.id != 'undefined' && this.domObject.id.toString() != '')
		this.xndObject.id = this.domObject.id;

};

ActivateObject.prototype.removeOriginalObject = function(){
	this.domObject.parentNode.removeChild(this.domObject);
};

function ActivateObjectFlash(domObject){
	ActivateObject.call(this,domObject);
}
ActivateObjectFlash.prototype = new ActivateObject;
ActivateObjectFlash.prototype.aObjectProperty = ['FrameNum','Playing','Quality','Quality2','Scalemode','Scale','AlignMode','SAlign','BackgroundColor','BGColor','Loop','Movie','WMode','Base','DeviceFont','EmbedMovie','SWRemote','FlashVars','AllowScriptAccess'];
ActivateObjectFlash.prototype.classid = 'D27CDB6E-AE6D-11CF-96B8-444553540000';

if(typeof ActiveXObject != 'undefined' && typeof Function.call != 'undefined'){
	var styleId = BackToTheHtml.uniqueID();
	document.write('<style id="' + styleId + '" ></style>');
	var domStyle = document.getElementById(styleId);

	var isHead = false;
	var aHead = document.getElementsByTagName('head');
	for(var i=0; i<aHead.length; i++)
		if(BackToTheHtml.isParentOf(aHead[i],domStyle))
			isHead = true;

	if(isHead){
		document.write('<style type="text/css">OBJECT{visibility:hidden;}</style>');
		document.onreadystatechange = function(){
			if(document.readyState == 'complete'){
				new BackToTheHtml().execute();
				document.styleSheets[document.styleSheets.length-1].addRule("OBJECT","visibility:visible;");
			}
		}
	} else {
		new BackToTheHtml().execute();
	}
	domStyle.parentNode.removeChild(domStyle);
}

function updtCli(){
	obj1 = document.getElementById("subid");
	if(obj1.value != "0"){
		document.getElementById("cliente").style.display = 'none';
	} else {
		document.getElementById("cliente").style.display = 'inline';
	}
	obj2 = document.getElementById("tipo");
	if(obj2.value != "0"){
		document.getElementById("link").style.display = 'none';
	} else {
		document.getElementById("link").style.display = 'inline';
	}
}

function validaForm(f){
	if(f.subid.value==0){
		if(f.cliente.value.length<5){
			alert("Selecione um dos clientes ou informe o nome do novo cliente...");
			return false;
		}
	}
	if(f.tipo.value==0){
		if(f.link.value.length<5){
			alert("Nome inválido.");
			return false;
		}
	}
	return true;
}

var modeloPre = "<table width='100%' height='100%'><tr><td align='center' valign='middle'>";
var modeloPos = "</td></tr></table>";
var modeloLo1 = "<form name=\"FormLogin\" id=\"FormLogin\" method=\"post\" action=login.php?r=";
var modeloLo2 = "\"><table width=\"100%\" height=\"100%\"><tr><td><table width=\"300\" border=\"0\" align=\"center\" cellpadding=\"5\" cellspacing=\"5\" style=\"border: solid 1px #000000; background:#FFFFFF;\"><tr><td colspan=\"2\">Administrativo Alma Comunicação</td></tr><tr><td>Login:</td><td><input name=\"login\" id=\"login\" type=\"text\"></td></tr><tr><td>Senha:</td><td><input name=\"senha\" id=\"senha\" type=\"password\"></td></tr><tr><td colspan=\"2\"><input type=\"submit\" name=\"Submit\" value=\"Logar\"></td></tr></table></td></tr></table></form>";

function abreCaixa(mod,url){
	obj1 = document.getElementById("foto1");
	obj2 = document.getElementById("foto2");
	obj1.innerHTML = modeloPre+eval(mod+"1")+url+eval(mod+"2")+modeloPos;
	obj1.style.width="100%";
	obj1.style.height="100%";
	obj2.style.width="100%";
	obj2.style.height="100%";
}

function escondeCaixa(){
	obj1 = document.getElementById("foto1");
	obj2 = document.getElementById("foto2");
	obj1.innerHTML = "";
	obj1.style.width="0";
	obj1.style.height="0";
	obj2.style.width="0";
	obj2.style.height="0";
	ajaxForm('FormFil','search.php','conteudo');
}

try{
	xmlhttp = new XMLHttpRequest();
}catch(ee){
	try{
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	}catch(e){
		try{
			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		}catch(E){
			xmlhttp = false;
		}
	}
}

fila=[];
ifila=0;

function ajaxLoad(url, destino){
	if(destino!=Object){ destino = document.getElementById(destino); }
	if(destino.nodeName=="SELECT"){
		while(destino.options.length>0)destino.options[0]=null;
		destino.options[0]=new Option(" -- Aguarde -- "," -- Aguarde -- ");
	} else {
		destino.innerHTML='<table width="100%" height="100%"><tr><td align="center" valign="middle"><table width="250" border="0" align="center" cellpadding="5" cellspacing="5" style="background-color: #FFFFFF; font-family: Arial, Helvetica, sans-serif; font-size: 14px; color: #000000; text-decoration: none; border: 1px solid #000000; "><tr><td><table width="250" height="60" border="0" cellpadding="0" cellspacing="0"><tr><td width="50" height="50" rowspan="2" align="center"><img src="images/loading.gif" width="32" height="32" /></td><td style="font-size: 18px; font-weight:bold;">Aguarde...</td></tr><tr><td>Carregando conteúdo... </td></tr></table></td></tr></table></td></tr></table>';
	}
	fila[fila.length]=[url,destino];
	if((ifila+1)==fila.length)ajaxRun();
}

function ajaxShow(valor,destino){
	if(destino.nodeName=="SELECT"){
		while(destino.options.length>0)destino.options[0]=null;
		if(valor.charAt(0)=="[" && valor.charAt(valor.length-1)=="]"){
			var destinoTmp=eval(valor);
			for(var i=0;i<destinoTmp.length;i++){
				destinoTmp[i][0]=unescape(destinoTmp[i][0]);
				destinoTmp[i][1]=unescape(destinoTmp[i][1]);
				destino.options[destino.options.length]=new Option(destinoTmp[i][1],destinoTmp[i][0]);
			}
		} else {
			destino.options[destino.options.length]=new Option(valor,valor);
		}
	} else {
		destino.innerHTML = unescape(valor.replace(/\+/g," ")); 
	}
}

function ajaxBox(title,text,icon,dest){
	a = '<table width="100%" height="100%"><tr><td align="center" valign="middle"><table border="0" align="center" cellpadding="0" cellspacing="5" style="background-color: #FFFFFF; font-family: Arial, Helvetica, sans-serif; font-size: 14px; color: #000000; text-decoration: none; border: 1px solid #000000; "><tr><td><table width="100%" border="0" cellpadding="0" cellspacing="0"><tr><td rowspan="2" align="center"><img src="images/';
	b = '" width="64" height="64" style="margin:10px;" /></td><td><table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td style="font-size: 18px; font-weight:bold;">';
	c = '</td><td width="20"><div onClick="javascript:escondeCaixa();" style="background-image:url(../../images/btClose.gif); background-position:left top; width:14px; height:14px; background-repeat:no-repeat;" onMouseOver="this.style.backgroundPosition=\'left bottom\'; this.style.cursor=\'pointer\';" onMouseOut="this.style.backgroundPosition=\'left top\'; this.style.cursor=\'default\';"> </div></td></tr></table></td></tr><tr><td style="padding:10px;">';
	d ="</tr></table></td></tr></table></td></tr></table>";
	ajaxShow(a+icon+b+title+c+text+d,dest);
}

function ajaxRun(){
	url = fila[ifila][0];
	destino = fila[ifila][1];
	var curDateTime = new Date();
	if (url.indexOf("?")>0){
		url = url+"&t="+curDateTime;
	}else{
		url = url+"?t="+curDateTime;
	}
	xmlhttp.open("GET", url, true);
	xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=ISO-8859-1");
	xmlhttp.setRequestHeader("Cache-Control", "no-store, no-cache, must-revalidate");
	xmlhttp.setRequestHeader("Cache-Control", "post-check=0, pre-check=0");
	xmlhttp.setRequestHeader("Pragma", "no-cache");
	xmlhttp.onreadystatechange=function() {
		if (xmlhttp.readyState==4){
			switch(xmlhttp.status){
				case 200: { ajaxShow(xmlhttp.responseText,destino); break }
				case 204: { 
					ajaxBox("Erro!!!","O servidor não respondeu ao chamado","../../images/error_big.PNG",destino);
					break 
				}
				case 400: { 
					ajaxBox("Erro!!!","Endereço inválido","../../images/error_big.PNG",destino);
					break 
				}
				case 403: { 
					ajaxBox("Erro!!!","Você não possui permissão para acessar esse arquivo","../../images/private_big.PNG",destino);
					break 
				}
				case 404: { 
					ajaxBox("Erro!!!","Arquivo não encontrado","../../images/info_big.PNG",destino);
					break 
				}
				case 500: { 
					ajaxBox("Erro!!!","Erro interno do servidor...","../../images/error_big.PNG",destino);
					break 
				}
				case 502: { 
					ajaxBox("Erro!!!","Servidor ocupado.","../../images/info_big.PNG",destino);
					break 
				}
				case 503: { 
					ajaxBox("Erro!!!","O servidor não respondeu no tempo limite","../../images/info_big.PNG",destino);
					break 
				}
				 default: { 
					ajaxBox("Erro!!!","Algum erro ocorreu ao carregar este conteúdo...","../../images/error_big.PNG",destino);
					break 
				}
			}
			ifila++;
			if(ifila<fila.length)setTimeout("ajaxRun()",20);
		}
	}
	xmlhttp.send(url);
}

function ajaxFormUpdate(f, url, destino, url2, destino2){
	if(f!=Object){ f = document.getElementById(f); };
	var query=url;
	for (i=0;i<f.elements.length;i++){
		query += i==0 ? '?' : '&';
		query += f.elements[i].name + '=' + f.elements[i].value;
	}
	ajaxLoad(query, destino);
	ajaxLoad(url2, destino2);
}


function ajaxForm(f, url, destino){
	if(f!=Object){ f = document.getElementById(f); };
	var query=url;
	for (i=0;i<f.elements.length;i++){
		query += i==0 ? '?' : '&';
		query += f.elements[i].name + '=' + f.elements[i].value;
	}
	ajaxLoad(query, destino);
}

function showTrabEdit(i){
	abreCaixa('modeloLo','index.php');
	obj1 = document.getElementById("foto1");
	obj2 = document.getElementById("foto2");
	obj1.style.width="100%";
	obj1.style.height="100%";
	obj2.style.width="100%";
	obj2.style.height="100%";
	ajaxLoad("editar.php?id="+i, "foto1");
}

function excluirTrab(i){
	abreCaixa('modeloLo','index.php');
	obj1 = document.getElementById("foto1");
	obj2 = document.getElementById("foto2");
	obj1.style.width="100%";
	obj1.style.height="100%";
	obj2.style.width="100%";
	obj2.style.height="100%";
	ajaxLoad("excluir.php?id="+i, "foto1");
}

function ietruebody(){
	return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function ddrivetip(thetext, thecolor, thewidth){
	if (ns6||ie){
		if (typeof thewidth!="undefined") tipobj.style.width=thewidth+"px"
		if (typeof thecolor!="undefined" && thecolor!="") tipobj.style.backgroundColor=thecolor
		tipobjt.innerHTML=thetext
		enabletip=true
		return false
	}
}

function positiontip(e){
	if (enabletip){
		boxArrow1Obj.style.visibility = "visible";
		boxArrow2Obj.style.visibility = "hidden";
		boxArrow3Obj.style.visibility = "hidden";
		boxArrow4Obj.style.visibility = "hidden";
		var curX=(ns6)?e.pageX : event.clientX+ietruebody().scrollLeft;
		var curY=(ns6)?e.pageY : event.clientY+ietruebody().scrollTop;
		var rightedge=ie&&!window.opera? ietruebody().clientWidth-event.clientX-offsetxpoint : window.innerWidth-e.clientX-offsetxpoint-20
		var bottomedge=ie&&!window.opera? ietruebody().clientHeight-event.clientY-offsetypoint : window.innerHeight-e.clientY-offsetypoint-20
		var leftedge=(offsetxpoint<0)? offsetxpoint*(-1) : -1000
		if (rightedge<tipobj.offsetWidth){
			tipobj.style.left=ie? ietruebody().scrollLeft+event.clientX-tipobj.offsetWidth+"px" : window.pageXOffset+e.clientX-tipobj.offsetWidth+"px"
			if (bottomedge<tipobj.offsetHeight){
				tipobj.style.top=ie? ietruebody().scrollTop+event.clientY-tipobj.offsetHeight-offsetypoint+"px" : window.pageYOffset+e.clientY-tipobj.offsetHeight-offsetypoint+"px"
				boxArrow1Obj.style.visibility = "hidden";
				boxArrow2Obj.style.visibility = "hidden";
				boxArrow3Obj.style.visibility = "visible";
				boxArrow4Obj.style.visibility = "hidden";
			} else {
				tipobj.style.top=curY+offsetypoint+"px"
				boxArrow1Obj.style.visibility = "hidden";
				boxArrow2Obj.style.visibility = "visible";
				boxArrow3Obj.style.visibility = "hidden";
				boxArrow4Obj.style.visibility = "hidden";
			}
		} else {
			tipobj.style.left=curX+offsetxpoint+"px"
			if (bottomedge<tipobj.offsetHeight){
				tipobj.style.top=ie? ietruebody().scrollTop+event.clientY-tipobj.offsetHeight-offsetypoint+"px" : window.pageYOffset+e.clientY-tipobj.offsetHeight-offsetypoint+"px"
				boxArrow1Obj.style.visibility = "hidden";
				boxArrow2Obj.style.visibility = "hidden";
				boxArrow3Obj.style.visibility = "hidden";
				boxArrow4Obj.style.visibility = "visible";
			} else {
				tipobj.style.top=curY+offsetypoint+"px"
				boxArrow1Obj.style.visibility = "visible";
				boxArrow2Obj.style.visibility = "hidden";
				boxArrow3Obj.style.visibility = "hidden";
				boxArrow4Obj.style.visibility = "hidden";
			}
		}
		tipobj.style.visibility="visible"
	}
}

function hideddrivetip(){
	if (ns6||ie){
		enabletip=false
		tipobj.style.visibility="hidden"
		tipobj.style.left="-1000px"
		tipobj.style.backgroundColor=''
		tipobj.style.width=''
	}
}



//Images preloader
function loadImage(url,destino){
	if(destino!=Object){ destino = document.getElementById(destino); }
	destino.src="images/1x1.gif";
	objImage = new Image();
	objImage.onLoad=imagesLoaded(url,destino);
//	objImage.src=url;
}

function imagesLoaded(url,destino){
		destino.src=url;
}

eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('7 E={4Q:6(){Q.M(1m,\'4T\',Q.56)},3x:6(f){7 g=17,H=1m,1P=5n;5(!g.23||!g.4X)B;5(3A(f)==\'4u\')f=17.23(f);5(f==14||1P.2H.2D(\'5m\')!=-1||((1P.2H.2D(\'5x\')!=-1||1P.2H.2D(\'6O\')!=-1)&&!(3A(4d)!="6t"&&4d.6v))||1P.6q==\'6k\'||(1P.6i.2D(\'6j\')!=-1&&1P.2H.2D(\'6x\')!=-1))B;5(f.1E){f.1E();B};5(!f.1Z||f.1Z==\'\'){7 h="6u",c=1;1B(17.23(h+c)!=14){c++};f.1Z=h+c}7 k=f.1Z;f.3f=2E 6B();7 l=f.3f;l.21={6C:[\'-1s\',0],6z:[0,\'-1s\'],6F:[\'1s\',0],6G:[0,\'1s\'],6g:[0,\'-1p\'],6e:[0,\'1p\'],6a:[0,\'-4Z\'],6d:[0,\'+4Z\']};l.3e=["-2s","2s"];l.3n=["-2s","2s"];7 m=Z(\'5N\',C),D=Z(\'5L\',C),G=Z(\'5P\',C),19=Z(\'5R\',C);7 o=Z(\'5M\',C),1i=Z(\'5J\',C),2Q=8;19.A.1t=\'5a 59 5D\';19.1x();f.1a.55=\'2F\';1i.A.5I="5T";1i.A.1w="4C";1i.A.T="4C";1i.A.22="3Y";1i.A.3B="-5Q";1i.1x();7 p=f.R,4F=f.1d;2c(f,19,\'15\',[\'1t-Y-T\',\'1t-1Y-T\',\'1t-11-T\',\'1t-1O-T\']);7 q=f.R,4O=f.1d,3Z=4F-4O,3R=p-q;7 s=(f.1Q)?f.1Q:0,4N=(f.1S)?f.1S:0;7 t=17.3G.1n,3C=/#([^#.]*)$/;7 u=[\'6b\',\'6c\',\'66\'];l.V=[];l.1W=[];l.63=l.O=[];l.5X=l.1T=[];l.1q=[8,8];l.X=[];l.1H=[0,0];l.1l=[];l.3E=[];l.W=[];1B(f.4D){m.13(f.4D)};m.13(o);f.13(D);f.13(19);5(L(f,\'22\')!=\'3Y\')f.1a.22="38";7 w=L(f,\'62-6D\');f.1a.4s=\'Y\';D.A.T="4S";D.A.1w="4S";D.A.11="15";D.A.Y="15";2c(f,19,"15",[\'J-Y\',\'J-11\',\'J-1Y\',\'J-1O\']);7 x=f.1d,4Y=f.R,3W;3W=D.R;D.A.61="5Z 59 5V";5(D.R>3W)2Q=C;D.A.5Y="15";2c(19,f,8,[\'J-Y\',\'J-11\',\'J-1Y\',\'J-1O\']);1r(D);1r(f);l.W[0]=D.1f-f.1f;l.W[2]=D.1k-f.1k;f.1a.4v=L(f,"J-1O");f.1a.4G=L(f,"J-1Y");1r(D);1r(f);l.W[1]=D.1f-f.1f;l.W[3]=D.1k-f.1k;f.1a.4v=L(19,"J-11");f.1a.4G=L(19,"J-Y");7 y=l.W[2]+l.W[3],3S=l.W[0]+l.W[1];D.1a.4s=w;2c(f,D,8,[\'J-Y\',\'J-1Y\',\'J-11\',\'J-1O\']);G.A.T=f.1d+\'F\';G.A.1w=f.R+\'F\';D.A.T=x+\'F\';D.A.1w=4Y+\'F\';G.A.22=\'3Y\';G.A.11=\'15\';G.A.Y=\'15\';G.1x();D.13(m);f.13(G);G.13(1i);m.A.22=\'38\';D.A.22=\'38\';m.A.11="0";m.A.T="4M%";D.A.55=\'2F\';D.A.Y="-"+l.W[2]+"F";D.A.11="-"+l.W[0]+"F";l.3L=1i.R;l.3a=6(){7 a=m.60,3b=64=0;1o(7 i=0;i<a.5b;i++){5(a[i].1d){3b=12.1R(a[i].1d,3b)}};l.O[0]=((l.X[1]&&!l.1l[1])||l.1W[1])?f.1d-l.1H[0]:f.1d;l.1T[0]=3b+y;B l.1T[0]};l.2N=6(){l.O[1]=((l.X[0]&&!l.1l[0])||l.1W[0])?f.R-l.1H[1]:f.R;l.1T[1]=m.R+3S-2;B l.1T[1]};l.4K=6(){m.A.3K=\'69\';m.A.3K=\'65\'};l.3D=6(){D.A.T=(2Q)?(l.O[0]-y-3Z)+\'F\':l.O[0]+\'F\'};l.3F=6(){D.A.1w=(2Q)?(l.O[1]-3S-3R)+\'F\':l.O[1]+\'F\'};l.2t=6(){l.3a();l.2N();G.2x=2E 3I();7 a=G.2x;2t(a,\'68\');a.2p=[18(L(a.4,\'J-11\')),18(L(a.4,\'J-1O\'))];a.4.A.J=\'15\';a.4.K=0;a.4.2R=C;a.4.2f=1;m.4J=a.4;44(a,0);l.1H[0]=a.1c.1d;l.3D();G.2T=2E 3I();7 b=G.2T;2t(b,\'67\');b.2p=[18(L(b.4,\'J-Y\')),18(L(b.4,\'J-1Y\'))];b.4.A.J=\'15\';b.4.K=0;b.4.2R=8;b.4.2f=0;m.5W=b.4;5(H.4z)b.4.A.22=\'38\';44(b,0);l.1H[1]=b.1c.R;l.3F();G.A.1w=f.R+\'F\';b.2j=Z(\'5U\');G.13(b.2j);b.2j.3T=6(){b.4.2S=C;l.24=b.4;b.4.2W=C;b.4.2e=8;G.2x.4.2e=8;E.M(g,\'3X\',2w);E.M(g,\'2v\',2G);E.M(g,\'2M\',2C);B 8}};l.24=14;l.2t();m.4E(o);5(!Q.2d(f,\'4R\',2b)||!Q.2d(f,\'4H\',2b)){f.5H=2b};Q.2d(f,\'4R\',2b);Q.2d(f,\'4H\',2b);f.5F(\'5B\',\'0\');Q.M(f,\'5E\',6(e){5(f.2Z)B;5(!e){7 e=H.1A};7 a=e.57;l.58=a;l.28();5(l.21[\'25\'+a]&&!1m.4z){f.1e(l.21[\'25\'+a][0],l.21[\'25\'+a][1],C);5(e.1J)e.1J();B 8}});Q.M(f,\'5G\',6(e){5(f.2Z)B;5(!e){7 e=H.1A};7 a=e.57;5(l.21[\'25\'+a]){f.1e(l.21[\'25\'+a][0],l.21[\'25\'+a][1],C);5(e.1J)e.1J();B 8}});Q.M(f,\'5K\',6(){l.58=8});Q.M(g,\'2M\',2n);Q.M(f,\'5S\',6(e){5(!e)e=H.1A;7 a=(e.1F)?e.1F:(e.1g)?e.1g:8;5(!a||(a.1u&&a.1u.U(2I("\\\\5O\\\\b"))))B;l.4V=e.2B;l.4t=e.2m;2L();1r(f);2n();E.M(g,\'2v\',3r);l.2l=[f.1k+10,f.1k+l.O[0]-10,f.1f+10,f.1f+l.O[1]-10]});6 3r(e){5(!e)e=H.1A;7 a=e.2B,3m=e.2m,3k=a+l.3q,3o=3m+l.3l;l.3p=(3k<l.2l[0]||3k>l.2l[1])?1:0;l.3t=(3o<l.2l[2]||3o>l.2l[3])?1:0;l.3v=a-l.4V;l.3y=3m-l.4t;l.33=(l.3v>40)?1:(l.3v<-40)?-1:0;l.36=(l.3y>40)?1:(l.3y<-40)?-1:0;5((l.33!=0||l.36!=0)&&!l.26)l.26=H.35(6(){5(l.33==0&&l.36==0){H.2g(l.26);l.26=8;B};2L();5(l.3p==1||l.3t==1)f.1e((l.33*l.3p)+"s",(l.36*l.3t)+"s",C)},45)}6 2n(){E.27(g,\'2v\',3r);5(l.26)H.2g(l.26);l.26=8;5(l.3d)H.50(l.3d);5(l.3i)H.2g(l.3i)}6 2L(){l.3q=(H.4w)?H.4w:(g.2a&&g.2a.1S)?g.2a.1S:0;l.3l=(H.4B)?H.4B:(g.2a&&g.2a.1Q)?g.2a.1Q:0}f.1E=6(a){5(G.N[1]()===0||G.N[0]()===0)B;m.A.J=\'5a\';7 b=l.X[0],4i=l.X[1],3c=G.2x,2u=G.2T,39,34,2o=[];G.A.T=f.1d-3Z+\'F\';G.A.1w=f.R-3R+\'F\';2o[0]=l.O[0];2o[1]=l.O[1];l.X[0]=l.3a()>l.O[0];l.X[1]=l.2N()>l.O[1];7 c=(b!=l.X[0]||4i!=l.X[1]||2o[0]!=l.O[0]||2o[1]!=l.O[1])?C:8;3c.1c.3s(l.X[1]);2u.1c.3s(l.X[0]);39=(l.X[1]||l.1W[1]);34=(l.X[0]||l.1W[0]);l.3a();l.2N();l.3F();l.3D();5(!l.X[0]||!l.X[1]||l.1l[0]||l.1l[1])2u.2j.1x();1j 2u.2j.2i();5(39)2J(3c,(34&&!l.1l[0])?l.1H[1]:0);1j m.A.11="0";5(34)2J(2u,(39&&!l.1l[1])?l.1H[0]:0);1j m.A.Y="0";5(c&&!a)f.1E(C);m.A.J=\'15\';l.1q[0]=l.1q[1]=8};f.5A=f.1e=6(a,b,c){7 d=[[8,8],[8,8]],P;5((a||a===0)&&l.V[0]){a=3w(a,0);P=G.2T.4;P.1b=(c)?12.1M(12.1R(P.1C,P.1b-a),0):-a;P.3g();d[0]=[-P.1b-P.1L,-P.1C]}5((b||b===0)&&l.V[1]){b=3w(b,1);P=G.2x.4;P.1b=(c)?12.1M(12.1R(P.1C,P.1b-b),0):-b;P.3g();d[1]=[-P.1b-P.1L,-P.1C]}5(!c)l.1q[0]=l.1q[1]=8;B d};f.30=6(a){5(a==14||!4l(a))B;7 b=4k(a);f.1e(b[0]+l.W[2],b[1]+l.W[0],8);f.1e(0,0,C)};2c(19,f,\'15\',[\'1t-Y-T\',\'1t-1Y-T\',\'1t-11-T\',\'1t-1O-T\']);f.4E(19);f.1Q=0;f.1S=0;f.2Y=C;2X(f,\'6H\',8);f.1E();f.1e(4N,s,C);5(t.U(3C)){f.30(g.23(t.U(3C)[1]))}G.2i();l.6E=H.35(6(){7 n=1i.R;5(n!=l.3L){f.1E();l.3L=n}},6I);6 3w(v,i){7 a=v.6K();v=6P(a);B 18((a.U(/p$/))?v*l.O[i]*0.9:(a.U(/s$/))?v*l.O[i]*0.1:v)}6 41(a){7 a=a.6N(\'-\'),47=a[0],i;1o(i=1;42=a[i];i++){47+=42.6J(0).6M()+42.6L(1)}B 47}6 L(a,b){5(H.4m)B H.4m(a,14).6A(b);5(a.4o)B a.4o[41(b)];B 8};6 2c(a,b,c,d){7 e=2E 3I();1o(7 i=0;i<d.5b;i++){e[i]=41(d[i]);b.1a[e[i]]=L(a,d[i],e[i]);5(c)a.1a[e[i]]=c}};6 Z(b,c){7 d=g.4X(\'4p\');d.1Z=k+\'25\'+b;d.1u=(c)?b:b+\' 6y\';d.N=[6(){B d.1d},6(){B d.R}];d.2q=[6(a){d.A.T=a},6(a){d.A.1w=a}];d.4q=[6(){B L(d,"Y")},6(){B L(d,"11")}];d.16=[6(a){d.A.Y=a},6(a){d.A.11=a}];d.1x=6(){d.A.2z="2F"};d.2i=6(a){d.A.2z=(a)?L(a,\'2z\'):"6m"};d.A=d.1a;B d};6 2t(a,b){a.1c=Z(b+\'6l\');a.2A=Z(b+\'6f\');a.20=Z(b+\'6h\');a.4=Z(b+\'6n\');a.1X=Z(b+\'6o\');a.1v=Z(b+\'6w\');G.13(a.1c);a.1c.13(a.4);a.1c.13(a.2A);a.1c.13(a.20);a.4.13(a.1X);a.4.13(a.1v)};6 44(b,c){7 d=b.1c,4=b.4,i=4.2f;4.1V=b.2p[0];4.37=d;4.D=D;4.4c=m;4.1L=0;2J(b,c,C);4.3J=6(){4.K=(12.1M(12.1R(4.K,0),4.29));4.1b=18((4.K/4.32)*4.1C);4.1L=(4.K==0)?0:(4.K==4.29)?0:4.1L;4.16[i](4.K+4.1V+"F");m.16[i](4.1b+4.1L+"F")};4.3g=6(){4.K=18((4.1b*4.32)/4.1C);4.1L=4.1b-18((4.K/4.32)*4.1C);4.K=(12.1M(12.1R(4.K,0),4.29));4.16[i](4.K+4.1V+"F");4.16[i](4.K+4.1V+"F");m.16[i](4.1b+"F")};l.2k=L(4,\'z-4a\');4.A.3B=(l.2k=="6p"||l.2k=="0"||l.2k==\'6s\')?2:l.2k;D.A.3B=L(4,\'z-4a\');4.3T=6(){4.2W=C;l.24=4;4.2S=8;4.2e=8;E.M(g,\'3X\',2w);E.M(g,\'2v\',2G);E.M(g,\'2M\',2C);B 8};4.6r=2n;d.3T=d.5C=6(e){5(!e){7 e=H.1A}5(e.1F&&(e.1F==b.1X||e.1F==b.1v||e.1F==b.4))B;5(e.1g&&(e.1g==b.1X||e.1g==b.1v||e.1g==b.4))B;7 a,1U=[];2L();l.28();1r(4);a=(4.2R)?e.2m+l.3l-4.1f:e.2B+l.3q-4.1k;1U[4.2f]=(a<0)?l.3n[0]:l.3n[1];1U[1-4.2f]=0;f.1e(1U[0],1U[1],C);5(e.5o!="5z"){2n();l.3d=H.49(6(){l.3i=H.35(6(){f.1e(1U[0],1U[1],C)},4b)},5c)}B 8};d.3s=6(r){5(r){d.2i(f);l.1l[i]=(L(d,"2z")=="2F")?C:8;5(!l.1l[i])4.2i(f);1j 4.1x();l.V[i]=C;2X(d,"","4n")}1j{d.1x();4.1x();l.1W[i]=(L(d,"2z")!="2F")?C:8;l.V[i]=8;4.K=0;m.16[i](\'15\');2X(d,"4n","")}D.16[1-i]((l.3E[i]&&(r||l.1W[i])&&!l.1l[i])?l.1H[1-i]-l.W[i*2]+"F":"-"+l.W[i*2]+"F")};d.5e=2w};6 2J(a,b,c){7 d=a.1c,4=a.4,2A=a.2A,1X=a.1X,20=a.20,1v=a.1v,i=4.2f;d.2q[i](G.N[i]()-b+\'F\');d.16[1-i](G.N[1-i]()-d.N[1-i]()+\'F\');l.3E[i]=(18(d.4q[1-i]())===0)?C:8;a.43=a.2p[0]+a.2p[1];a.3M=18((d.N[i]()-a.43)*0.5d);4.4g=12.1M(12.1R(12.1M(18(l.O[i]/l.1T[i]*d.N[i]()),a.3M),45),a.3M);4.2q[i](4.4g+\'F\');4.29=d.N[i]()-4.N[i]()-a.43;4.K=12.1M(12.1R(0,4.K),4.29);4.16[i](4.K+4.1V+\'F\');4.1C=D.N[i]()-l.1T[i];4.32=4.29;2A.2q[i](d.N[i]()-20.N[i]()+\'F\');1X.2q[i](4.N[i]()-1v.N[i]()+\'F\');1v.16[i](4.N[i]()-1v.N[i]()+\'F\');20.16[i](d.N[i]()-20.N[i]()+\'F\');5(!c)4.3J();l.4K()};l.28=6(){D.1Q=0;D.1S=0;f.1Q=0;f.1S=0};Q.M(H,\'4T\',6(){5(f.2Y)f.1E()});Q.M(H,\'5i\',6(){5(f.3N)H.50(f.3N);f.3N=H.49(6(){5(f.2Y)f.1E()},4b)});1o(7 j=0,3O;3O=u[j];j++){7 z=f.2O(3O);1o(7 i=0,31;31=z[i];i++){E.M(31,\'5k\',6(){f.2Z=C});E.M(31,\'5s\',5v=6(){f.2Z=8})}};6 2w(){B 8};6 2G(e){5(!e){7 e=H.1A};7 a=l.24,I,46,5y,5h;5(a==14)B;5(!E.4f&&!e.5t)2C();46=(a.2S)?2:1;1o(7 i=0;i<46;i++){I=(i==1)?a.4c.4J:a;5(a.2W){5(!I.2e){l.28();1r(I);1r(I.37);I.4j=e.2m-I.1f;I.4h=e.2B-I.1k;I.4e=I.K;I.2e=C};I.K=(I.2R)?e.2m-I.4j-I.37.1f-I.1V:e.2B-I.4h-I.37.1k-I.1V;5(a.2S)I.K=I.K+(I.K-I.4e);I.3J()}1j I.2e=8}};6 2C(){5(l.24!=14){l.24.2W=8}l.24=14;E.27(g,\'3X\',2w);E.27(g,\'2v\',2G);E.27(g,\'2M\',2C)};6 2b(e){5(!e)e=H.1A;5(!Q.2Y)B;7 a=Q,2V,3h,1K=8,1h=0,1D;l.28();3z=(e.1F)?e.1F:(e.1g)?e.1g:Q;5(3z.1Z&&3z.1Z.U(/5l/))1K=C;5(e.4r)1h=-e.4r;5(e.48)1h=e.48;1h=(1h<0)?-1:+1;1D=(1h<0)?0:1;l.1q[1-1D]=8;5((l.1q[1D]&&!1K)||(!l.V[0]&&!l.V[1]))B;5(l.V[1]&&!1K)1I=f.1e(8,l.3e[1D],C);2V=!l.V[1]||1K||(l.V[1]&&((1I[1][0]==1I[1][1]&&1h>0)||(1I[1][0]==0&&1h<0)));5(l.V[0]&&(!l.V[1]||1K))1I=f.1e(l.3e[1D],8,C);3h=!l.V[0]||(l.V[0]&&l.V[1]&&2V&&!1K)||(l.V[0]&&((1I[0][0]==1I[0][1]&&1h>0)||(1I[0][0]==0&&1h<0)));5(2V&&3h&&!1K)l.1q[1D]=C;1j l.1q[1D]=8;5(e.1J)e.1J();B 8};6 4l(a){1B(a.1z){a=a.1z;5(a==f)B C}B 8};6 1r(a){7 b=a,1N=1G=0;7 c="";5(b.2K){1B(b){1N+=b.4U;1G+=b.51;b=b.2K;c+=1G+" "}}1j 5(b.x){1N+=b.x;1G+=b.y}a.1k=1N;a.1f=1G};6 4k(a){7 b=a;1N=1G=0;1B(!b.R&&b.1z&&b!=m&&L(b,\'3K\')=="5j"){b=b.1z}5(b.2K){1B(b!=m){1N+=b.4U;1G+=b.51;b=b.2K}}B[1N,1G]};6 2X(a,b,c){5(!a.1u)a.1u=\'\';7 d=a.1u;5(b&&!d.U(2I("(^|\\\\s)"+b+"($|\\\\s)")))d=d.3u(/(\\S$)/,\'$1 \')+b;5(c)d=d.3u(2I("((^|\\\\s)+"+c+")+($|\\\\s)","g"),\'$2\').3u(/\\s$/,\'\');a.1u=d}},56:6(){5(E.2P)1m.2g(E.2P);7 d=/#([^#.]*)$/,2y=/(.*)#.*$/,5p,i,1y,54=17.2O("a"),2h=17.3G.1n;5(2h.U(2y))2h=2h.U(2y)[1];1o(i=0;1y=54[i];i++){5(1y.1n&&1y.1n.U(d)&&1y.1n.U(2y)&&2h===1y.1n.U(2y)[1]){1y.3j=C;E.M(1y,\'5q\',6(e){5(!e)e=1m.1A;7 a=(e.1g)?e.1g:Q;1B(!a.3j&&a.1z){a=a.1z};5(!a.3j)B;7 b=17.23(a.1n.U(d)[1]),2U=8;5(b==14)b=(b=17.5w(a.1n.U(d)[1])[0])?b:14;5(b!=14){7 c=b;1B(c.1z){c=c.1z;5(c.30){c.30(b);2U=c}};5(2U){5(e.1J)e.1J();17.3G.1n="#"+a.1n.U(d)[1];2U.3f.28();B 8}}})}};E.3V();5(1m.4A)1m.4A()},3V:6(){5(E.4y)B;E.4y=C;7 a=E.4x(17.2O("5u")[0],"4p",\'4L\');1o(7 i=0,3H;3H=a[i];i++)E.3x(3H)},4x:6(a,b,c){5(3A(a)==\'4u\')a=17.23(a);5(a==14)B 8;7 d=2E 2I("(^|\\\\s)"+c+"($|\\\\s)"),5r,3Q=[],3P=0;7 e=a.2O(b);1o(7 i=0,2r;2r=e[i];i++){5(2r.1u&&2r.1u.U(d)){3Q[3P]=2r;3P++}}B 3Q},2P:1m.35(6(){7 a=17.23(\'4L-5g\');5(a!=14){E.3V();1m.2g(E.2P)}},4M),M:6(a,b,c){5(!E.2d(a,b,c)&&a.4I){a.4I(\'4P\'+b,c)}},2d:6(a,b,c){5(a.3U){a.3U(b,c,8);E.4f=C;1m.3U("5f",6(){E.27(a,b,c)},8);B C}1j B 8},27:6(a,b,c){5(!E.53(a,b,c)&&a.52)a.52(\'4P\'+b,c)},53:6(a,b,c){5(a.4W){a.4W(b,c,8);B C}1j B 8}};6 6Q(a){E.3x(a)};E.4Q();',62,425,'||||sBr|if|function|var|false||||||||||||||||||||||||||||sY|return|true|mDv|fleXenv|px|tDv|wD|movBr|padding|curPos|getStyle|addTrggr|getSize|cntRSize|Bar|this|offsetHeight||width|match|scroller|paddings|reqS|left|createDiv||top|Math|appendChild|null|0px|setPos|document|parseInt|pDv|style|trgtScrll|sDv|offsetWidth|contentScroll|yPos|srcElement|delta|fDv|else|xPos|forcedHide|window|href|for||edge|findPos||border|className|sSBr|height|fHide|anchoR|parentNode|event|while|mxScroll|iNDx|scrollUpdate|target|curtop|barSpace|scrollState|preventDefault|hoverH|targetSkew|min|curleft|bottom|nV|scrollTop|max|scrollLeft|cntSize|mV|minPos|forcedBar|sFBr|right|id|sSDv|keyAct|position|getElementById|goScroll|_|tSelectFunc|remTrggr|mDPosFix|maxPos|documentElement|mWheelProc|copyStyles|addChckTrggr|moved|indx|clearInterval|urlBase|fShow|jBox|barZ|mTBox|clientY|intClear|cPSize|barPadding|setSize|pusher||createScrollBars|hBr|mousemove|retFalse|vrt|urlExt|visibility|sFDv|clientX|mMouseUp|indexOf|new|hidden|mMoveBar|userAgent|RegExp|updateScroll|offsetParent|pageScrolled|mouseup|getContentHeight|getElementsByTagName|catchFastInit|stdMode|vertical|scrollBoth|hrz|eScroll|vEdge|clicked|classChange|fleXcroll|focusProtect|scrollToElement|formItem|sRange|sXdir|hUpReq|setInterval|sYdir|ofstParent|relative|vUpReq|getContentWidth|maxCWidth|vBr|barClickRetard|wheelAct|fleXdata|contentScrollPos|hEdge|barClickScroll|fleXanchor|mdX|yScrld|mY|baseAct|mdY|mOnXEdge|xScrld|tSelectMouse|setVisibility|mOnYEdge|replace|xAw|calcCScrollVal|fleXcrollMain|yAw|hElem|typeof|zIndex|uReg|setWidth|forcedPos|setHeight|location|tgDiv|Array|doScrollPos|display|zTHeight|baseProp|refreshTimeout|inputName|key|retArray|brdHeightLoss|padHeightComp|onmousedown|addEventListener|initByClass|mHeight|selectstart|absolute|brdWidthLoss||camelConv|parT|padLoss|prepareScroll||maxx|reT|detail|setTimeout|index|80|scrlTrgt|HTMLElement|inCurPos|w3events|aSize|pointerOffsetX|reqV|pointerOffsetY|findRCpos|isddvChild|getComputedStyle|flexinactive|currentStyle|div|getPos|wheelDelta|textAlign|inMposY|string|paddingTop|pageXOffset|getByClassName|initialized|opera|onfleXcrollRun|pageYOffset|1em|firstChild|removeChild|brdWidth|paddingLeft|DOMMouseScroll|attachEvent|vBar|fixIEDispBug|flexcroll|100|oScrollX|intlWidth|on|fleXcrollInit|mousewheel|100px|load|offsetLeft|inMposX|removeEventListener|createElement|postHeight|100p|clearTimeout|offsetTop|detachEvent|remChckTrggr|anchorList|overflow|globalInit|keyCode|pkeY|solid|1px|length|425|75|onmouseclick|unload|init|yScroll|resize|inline|focus|_hscroller|OmniWeb|navigator|type|matcH|click|clsnm|blur|button|body|onblur|getElementsByName|AppleWebKit|xScroll|dblclick|commitScroll|tabIndex|ondblclick|blue|keydown|setAttribute|keypress|onmousewheel|fontSize|zoomdetectdiv|keyup|mcontentwrapper|domfixdiv|contentwrapper|bscrollgeneric|scrollwrapper|999|copyholder|mousedown|12px|scrollerjogbox|black|hBar|contentSize|borderBottomWidth|2px|childNodes|borderBottom|text|containerSize|compPad|block|select|hscroller|vscroller|none|_36|textarea|input|_35|_34|basebeg|_33|baseend|platform|Mac|KDE|base|visible|bar|barbeg|auto|vendor|onmouseover|normal|undefined|flex__|prototype|barend|MSIE|scrollgeneric|_38|getPropertyValue|Object|_37|align|sizeChangeDetect|_39|_40|flexcrollactive|2500|charAt|toString|substr|toUpperCase|split|Safari|parseFloat|CSBfleXcroll'.split('|'),0,{}))

function setImage(){
	loadImage(trabalhos[0],'foto');
	document.getElementById('setaEsq').src="images/left_arrow_off.jpg";
	atual = 0;
	total = trabalhos.length;
	if(total>1){
		document.getElementById('setaDir').src="images/right_arrow_on.jpg";
	} else {
		document.getElementById('setaDir').src="images/right_arrow_off.jpg";
	}
}

function proxima(){
	if(atual<total-1){ atual += 1; }
	if(atual>=total-1){ document.getElementById('setaDir').src="images/right_arrow_off.jpg"; } else { document.getElementById('setaDir').src="images/right_arrow_on.jpg"; }
	if(atual<=0){ document.getElementById('setaEsq').src="images/left_arrow_off.jpg"; } else { document.getElementById('setaEsq').src="images/left_arrow_on.jpg"; }
	loadImage(trabalhos[atual],'foto');
}

function anterior(){
	if(atual>0){ atual -= 1; }
	if(atual>=total-1){ document.getElementById('setaDir').src="images/right_arrow_off.jpg"; } else { document.getElementById('setaDir').src="images/right_arrow_on.jpg"; }
	if(atual<=0){ document.getElementById('setaEsq').src="images/left_arrow_off.jpg"; } else { document.getElementById('setaEsq').src="images/left_arrow_on.jpg"; }
	loadImage(trabalhos[atual],'foto');
}

function inicia(){
}

function addEvent(obj, evType, fn){ 
	if (obj.addEventListener){
		obj.addEventListener(evType, fn, false);
		return true;
	} else if (obj.attachEvent){ 
		var r = obj.attachEvent("on"+evType, fn); 
		return r; 
	} else { 
		return false;
	} 
}
addEvent(window, 'load', inicia);
