

$(document).ready(function() {
  
$(function () {
	$("#mission").tabs("div.pane", { tabs: 'h2', effect: 'slide', initialIndex: 0});
	$("#soluzioni").tabs("div.pane", { tabs: 'h2', effect: 'slide', initialIndex: 0});
	$("#portfolio").tabs("div.pane", { tabs: 'h2', effect: 'slide', initialIndex: 0});
	$("#chi_siamo").tabs("div.pane", { tabs: 'h2', effect: 'slide', initialIndex: 0});
	$("#contatti").tabs("div.pane", { tabs: 'h2', effect: 'slide', initialIndex: 0});
	$("#assistenza").tabs("div.pane", { tabs: 'h2', effect: 'slide', initialIndex: 0});
	
	$("ul.css-tabs").tabs("div.css-panes > div", {
		effect: 'fade', onBeforeClick: function(event, i) {
			// get the pane to be opened
			var pane = this.getPanes().eq(i);
			// only load once. remove the if ( ... ){ } clause if you want the page to be loaded every time
			if (pane.is(":empty")) {
				// load it with a page specified in the tab's href attribute
				pane.load(this.getTabs().eq(i).attr("href"));
			}
		}
	});
 });
 });       
 
function gototab(index) {
       $("#mission").tabs("div.pane").click(index).getIndex();
       $("#soluzioni").tabs("div.pane").click(index).getIndex();
       $("#portfolio").tabs("div.pane").click(index).getIndex();
       $("#chi_siamo").tabs("div.pane").click(index).getIndex();
       $("#contatti").tabs("div.pane").click(index).getIndex();
       $("#assistenza").tabs("div.pane").click(index).getIndex();
    }



$(function () {
 
	// if the function argument is given to overlay,
	// it is assumed to be the onBeforeLoad event listener
	$("a[rel]").overlay({
 
		expose: '#789',
		effect: 'apple',
 
		onBeforeLoad: function () {
 
			// grab wrapper element inside content
			var wrap = this.getContent().find(".contentWrap");
 
			// load the page specified in the trigger
			wrap.load(this.getTrigger().attr("href"));
		}
 
	});
});












