
/* ======================================================================================
                              ===== DOM Panels III =====
        script by Gerard Ferrandez - ge1doot - April 22, 2007
        Evolved from Phil Richard's Panels II: http://www.mgifos.demon.co.uk/panels2.htm
        http://www.dhteumeuleu.com
   ====================================================================================== */

var xm = 0;
var ym = 0;

document.onmousemove = function(e){
	if (window.event) e=window.event;
	xm = e.clientX;
	ym = e.clientY;
}

var panel = {
	speed : .006,
	t : 0,
	O : [],
	over : false,

	run : function() {
		panel.t += panel.speed;
		for (var i = 0, o; o = panel.O[i]; i++)
			o.anim(i + panel.t);
	},

	init : function(){
		for (var i = 0, o; o = document.images[i]; i++){
			if (o.className.indexOf('panel') >= 0) {
				if(o.parentNode.href != undefined) {
					var div = document.createElement("a");
					div.href = o.parentNode.href;
				} else {
					var div = document.createElement("div");
				}
				div.className = 'panel';
				var img = document.createElement("img");
				img.src = o.src;
				img.className = 'imgPanel';
				o.parentNode.replaceChild(div,o);
				div.appendChild(img);
				div.ims = img.style;
				div.iw = img.width;
				div.ih = img.height;
				div.cx = -div.iw / 2;
				div.cy = -div.ih / 2;
				div.anim = function(t) {
					nw = this.offsetWidth;
					nh = this.offsetHeight;
					if (panel.over == this){
						for (var nx = 0, ny = 0, o = this; o != null; o = o.offsetParent) nx += o.offsetLeft, ny += o.offsetTop;
						var x = Math.max(-this.iw + nw, Math.min(0, (-(xm - nx) * (this.iw - nw)) / nw));
						var y = Math.max(-this.ih + nh, Math.min(0, (-(ym - ny) * (this.ih - nh)) / nh));
						if (Math.abs(xm-nx-nw * .5) > nw || Math.abs(ym-ny-nh * .5) > nw ) panel.over = false;
					} else {
						var mx = (this.iw - nw) * .5;
						var my = (this.ih - nh) * .5;
						var x = -mx * (1 + Math.cos(t * 1.2));
						var y = -my * (1 + Math.sin(t));
					}
					this.cx += (x - this.cx) * .1;
					this.cy += (y - this.cy) * .1;
					this.ims.left = Math.round(this.cx) + 'px';
					this.ims.top  = Math.round(this.cy) + 'px';
				}

				div.onmouseover = function()
				{
					panel.over = this;
				}
				this.O.push(div);
			}
		}
		setInterval(panel.run, 32);
	}
}


onload = function ()
{
	panel.init();
}

// menu

	window.addEvent('domready', function(){
		var list = $$('#idList li');
		list.each(function(element) {
			
			var fx = new Fx.Styles(element, {duration:200, wait:false});
			
			element.addEvent('mouseenter', function(){
				fx.start({
					'margin-top': 20,
					/*'background-color': '#666',*/
					color: '#ff8'
				});
			});
			
			element.addEvent('mouseleave', function(){
				fx.start({
					'margin-top': 0,
					/*'background-color': '#333',*/
					'color': '#888'
				});
			});
			
		});
	}); 
	
//fim menu

function visible_true_contact(){
	document.getElementById('FormAjax').style.display = 'inline';
}

function visible_false_contact(){
	document.getElementById('FormAjax').style.display = 'none';
}

function visible_true_company(){
	document.getElementById('FormCompany').style.display = 'inline';
}

function visible_false_company(){
	document.getElementById('FormCompany').style.display = 'none';
}

function visible_true_jobs(){
	document.getElementById('FormJobs').style.display = 'inline';
}

function visible_false_jobs(){
	document.getElementById('FormJobs').style.display = 'none';
}

function visible_true_BecaCoral(){
	document.getElementById('BecaCoral').style.display = 'inline';
}

function visible_false_BecaCoral(){
	document.getElementById('BecaCoral').style.display = 'none';
}

function visible_true_BecaAmericana(){
	document.getElementById('BecaAmericana').style.display = 'inline';
}

function visible_false_BecaAmericana(){
	document.getElementById('BecaAmericana').style.display = 'none';
}

function tatuape(){
	document.getElementById('loja_tatuape').style.visibility = 'visible';
	document.getElementById('loja_mooca').style.visibility = 'hidden';
	document.getElementById("aba1_maps").className = "aba1_maps";
	document.getElementById("aba2_maps").className = "aba2_maps2";
	document.getElementById("loja_tatuape").className = "loja_tatuape";
	document.getElementById("loja_mooca").className = "loja_mooca1";
}

function mooca(){
	document.getElementById('loja_tatuape').style.visibility = 'hidden';
	document.getElementById('loja_mooca').style.visibility = 'visible';
	document.getElementById("aba1_maps").className = "aba1_maps2";
	document.getElementById("aba2_maps").className = "aba2_maps";
	document.getElementById("loja_mooca").className = "loja_mooca";
}

function tatuape_on(){
	document.getElementById("loja_mooca").className = "loja_mooca1";
}
//function aba1_over(){
//	document.getElementById("aba1_maps").className = "aba1_over";
//}

function validatorCheque(){
	if(document.getElementById('exB_Ciente').checked == false){
		alert('Seleciona o item para confirmar que esta ciente.');
	}
}