 /* Image w/ description tooltip v2.0
* Created: April 23rd, 2010. This notice must stay intact for usage 
* Author: Dynamic Drive at http://www.dynamicdrive.com/
* Visit http://www.dynamicdrive.com/ for full source code
*/


var ddimgtooltip={

	tiparray:function(){
		var tooltips=[]
		//define each tooltip below: tooltip[inc]=['path_to_image', 'optional desc', optional_CSS_object]
		//For desc parameter, backslash any special characters inside your text such as apotrophes ('). Example: "I\'m the king of the world"
		//For CSS object, follow the syntax: {property1:"cssvalue1", property2:"cssvalue2", etc}

		tooltips[0]=["http://www.gaterlist.com/portal/wp-content/themes/wisebusiness_wp/images/pop_gerenciador.gif"]
		tooltips[1]=["http://www.gaterlist.com/portal/wp-content/themes/wisebusiness_wp/images/pop_album_fotos.gif"]
		tooltips[2]=["http://www.gaterlist.com/portal/wp-content/themes/wisebusiness_wp/images/pop_disparador_emails.gif"]
		

		return tooltips //do not remove/change this line
	}(),

	tooltipoffsets: [-150, -235], //additional x and y offset from mouse cursor for tooltips

	//***** NO NEED TO EDIT BEYOND HERE

	tipprefix: 'imgtip', //tooltip ID prefixes

	createtip:function($, tipid, tipinfo){
		if ($('#'+tipid).length==0){ //if this tooltip doesn't exist yet
			return $('<div id="' + tipid + '" class="ddimgtooltip" />').html(
				'<div style="text-align:center"><img src="' + tipinfo[0] + '" /></div>'
				+ ((tipinfo[1])? '<div style="text-align:left; margin-top:5px">'+tipinfo[1]+'</div>' : '')
				)
			.css(tipinfo[2] || {})
			.appendTo(document.body)
		}
		return null
	},

	positiontooltip:function($, $tooltip, e){
		var x=e.pageX+this.tooltipoffsets[0], y=e.pageY+this.tooltipoffsets[1]
		var tipw=$tooltip.outerWidth(), tiph=$tooltip.outerHeight(), 
		x=(x+tipw>$(document).scrollLeft()+$(window).width())? x-tipw-(ddimgtooltip.tooltipoffsets[0]*2) : x
		y=(y+tiph>$(document).scrollTop()+$(window).height())? $(document).scrollTop()+$(window).height()-tiph-10 : y
		$tooltip.css({left:x, top:y})
	},
	
	showbox:function($, $tooltip, e){
		$tooltip.show()
		this.positiontooltip($, $tooltip, e)
	},

	hidebox:function($, $tooltip){
		$tooltip.hide()
	},


	init:function(targetselector){
		jQuery(document).ready(function($){
			var tiparray=ddimgtooltip.tiparray
			var $targets=$(targetselector)
			if ($targets.length==0)
				return
			var tipids=[]
			$targets.each(function(){
				var $target=$(this)
				$target.attr('rel').match(/\[(\d+)\]/) //match d of attribute rel="imgtip[d]"
				var tipsuffix=parseInt(RegExp.$1) //get d as integer
				var tipid=this._tipid=ddimgtooltip.tipprefix+tipsuffix //construct this tip's ID value and remember it
				var $tooltip=ddimgtooltip.createtip($, tipid, tiparray[tipsuffix])
				$target.mouseenter(function(e){
					var $tooltip=$("#"+this._tipid)
					ddimgtooltip.showbox($, $tooltip, e)
				})
				$target.mouseleave(function(e){
					var $tooltip=$("#"+this._tipid)
					ddimgtooltip.hidebox($, $tooltip)
				})
				$target.mousemove(function(e){
					var $tooltip=$("#"+this._tipid)
					ddimgtooltip.positiontooltip($, $tooltip, e)
				})
				if ($tooltip){ //add mouseenter to this tooltip (only if event hasn't already been added)
					$tooltip.mouseenter(function(){
						ddimgtooltip.hidebox($, $(this))
					})
				}
			})

		}) //end dom ready
	}
}

//ddimgtooltip.init("targetElementSelector")
ddimgtooltip.init("*[rel^=imgtip]")

// lightbox initialize script -->
$(function() {
   $('a.lightbox').lightBox();
});

// ajax contact form -->
$(document).ready(function(){
  $('#contact').ajaxForm(function(data) {
	 if (data==1){
		 $('#success').fadeIn("slow");
		 $('#bademail').fadeOut("slow");
		 $('#badserver').fadeOut("slow");
		 $('#contact').resetForm();
		 }
	 else if (data==2){
			 $('#badserver').fadeIn("slow");
		  }
	 else if (data==3)
		{
		 $('#bademail').fadeIn("slow");
		}
		});
	 });
// dropdown setup 
$(document).ready(function(){ 
	$("ul.sf-menu").superfish({
		delay:       200,                             // one second delay on mouseout 
		animation:   {opacity:'show',height:'show'},  // fade-in and slide-down animation 
		speed:       'fast',                          // faster animation speed 
		autoArrows:  true,                           // disable generation of arrow mark-up 
		dropShadows: true                            // disable drop shadows 			
		}); 
});

//sliding boxes

$(document).ready(function(){
		//To switch directions up/down and left/right just place a "-" in front of the top/left attribute
		//Vertical Sliding
		$('.boxgrid.slidedown').hover(function(){
			$(".cover", this).stop().animate({top:'-260px'},{queue:false,duration:300});
		}, function() {
			$(".cover", this).stop().animate({top:'0px'},{queue:false,duration:300});
		});
		//Horizontal Sliding
		$('.boxgrid.slideright').hover(function(){
			$(".cover", this).stop().animate({left:'325px'},{queue:false,duration:300});
		}, function() {
			$(".cover", this).stop().animate({left:'0px'},{queue:false,duration:300});
		});
		//Diagnal Sliding
		$('.boxgrid.thecombo').hover(function(){
			$(".cover", this).stop().animate({top:'260px', left:'325px'},{queue:false,duration:300});
		}, function() {
			$(".cover", this).stop().animate({top:'0px', left:'0px'},{queue:false,duration:300});
		});
		//Partial Sliding (Only show some of background)
		$('.boxgrid.peek').hover(function(){
			$(".cover", this).stop().animate({top:'90px'},{queue:false,duration:160});
		}, function() {
			$(".cover", this).stop().animate({top:'0px'},{queue:false,duration:160});
		});
		//Full Caption Sliding (Hidden to Visible)
		$('.boxgrid.captionfull').hover(function(){
			$(".cover", this).stop().animate({top:'180px'},{queue:false,duration:160});
		}, function() {
			$(".cover", this).stop().animate({top:'250px'},{queue:false,duration:160});
		});
		//Caption Sliding (Partially Hidden to Visible)
		$('.boxgrid.caption').hover(function(){
			$(".cover", this).stop().animate({top:'180px'},{queue:false,duration:160});
		}, function() {
			$(".cover", this).stop().animate({top:'250px'},{queue:false,duration:160});
		});
	});


<!--

window.onload = function(){

     MM_preloadImages('http://www.gaterlist.com/portal/wp-content/themes/wisebusiness_wp/images/bg_pauta.gif','http://www.gaterlist.com/portal/wp-content/themes/wisebusiness_wp/images/mn_sobre_over.gif','http://www.gaterlist.com/portal/wp-content/themes/wisebusiness_wp/images/mn_pauta_over.gif','images/mn_agencia_over.gif','http://www.gaterlist.com/portal/wp-content/themes/wisebusiness_wp/images/mn_parceria_over.gif','http://www.gaterlist.com/portal/wp-content/themes/wisebusiness_wp/images/mn_contato_over.gif');
  
}



function MM_findObj(n, d) { //v4.01

  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {

    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}

  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];

  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);

  if(!x && d.getElementById) x=d.getElementById(n); return x;

}



function MM_swapImgRestore() { //v3.0

  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;

}



function MM_preloadImages() { //v3.0

  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();

    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)

    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}

}



function MM_swapImage() { //v3.0

  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)

   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}

}


function jchange(o) {
var fold_image = new Array();
fold_image[0] = "http://www.gaterlist.com/portal/wp-content/themes/wisebusiness_wp/images/seta_fecha.gif";
fold_image[1] = "http://www.gaterlist.com/portal/wp-content/themes/wisebusiness_wp/images/seta_abre.gif";

if(document.getElementById(o).style.display=='none') {
document.getElementById(o).style.display='block';
 if(document.getElementById('nfolding')) {
document.getElementById('nfolding').src=fold_image[0];
  }
 } else {
document.getElementById(o).style.display='none';
   if(document.getElementById('nfolding')) {
document.getElementById('nfolding').src=fold_image[1];
   }
   }
 
 }
 
 function jchanga(o) {
var fold_image = new Array();
fold_image[0] = "http://www.gaterlist.com/portal/wp-content/themes/wisebusiness_wp/images/seta_fecha.gif";
fold_image[1] = "http://www.gaterlist.com/portal/wp-content/themes/wisebusiness_wp/images/seta_abre.gif";

if(document.getElementById(o).style.display=='none') {
document.getElementById(o).style.display='block';
 if(document.getElementById('nfoldin')) {
document.getElementById('nfoldin').src=fold_image[0];
  }
 } else {
document.getElementById(o).style.display='none';
   if(document.getElementById('nfoldin')) {
document.getElementById('nfoldin').src=fold_image[1];
   }
   }
 
 }
 
 function jchangb(o) {
var fold_image = new Array();
fold_image[0] = "http://www.gaterlist.com/portal/wp-content/themes/wisebusiness_wp/images/seta_fecha.gif";
fold_image[1] = "http://www.gaterlist.com/portal/wp-content/themes/wisebusiness_wp/images/seta_abre.gif";

if(document.getElementById(o).style.display=='none') {
document.getElementById(o).style.display='block';
 if(document.getElementById('nfoldi')) {
document.getElementById('nfoldi').src=fold_image[0];
  }
 } else {
document.getElementById(o).style.display='none';
   if(document.getElementById('nfoldi')) {
document.getElementById('nfoldi').src=fold_image[1];
   }
   }
 
 }
 
 
 

