$(document).ready(function(){
	 
	 setTimeout(function(){
    
        $("#uno").animate({"left":"0px"},1000,"easeOutQuart");

    },500);
    setTimeout(function(){
    
        $("#due").animate({"left":"240px"},1500,"easeOutQuart");

    },1500);
    
 
    
    setTimeout(function(){
    
        $(".scroll-pane").fadeIn({duration:1200});
    
    },2000);
    
     setTimeout(function(){
        
        $("#zero").fadeIn({duration:1200});
        
    },3000);
    
    setTimeout(function(){
    
    $("#bkgs").hide();
    
    },4000);
	
	
	setTimeout(function(){
    	
		$(".selector a:eq(0)").trigger("click");
    
    },3000);
    
    $(".selector a").each(function(){
		
		
		
		$(this).click(function(){
			
			
			var ckdue = $("#due").hasClass(".closed");
			
			if(ckdue){
         
         	$("#due").animate({"left":"240px"},1500,"easeOutQuart").removeClass("closed");
			
			}
			
			
			
			$(this).parent().parent().find(".active").removeClass("active");
			$(this).addClass("active");
			var idx = $(".selector a").index(this);
			
			var ccontent = $(".seltext:eq("+idx+")").html();
			var ctitle = $(".seltext:eq("+idx+")").attr("title");
			
			$(".duetitle").empty().html(ctitle);
			$("#listpager").empty().hide();
        	$(".scroll-pane").empty().hide().html(ccontent).jScrollPane({scrollbarWidth: 8}).fadeIn({duration:1200});
			
			
			
			
			$(".mini,#listpager").fadeIn({duration:1200});
			
			
			
		});
	
	});
	
	$(".pics").width($("#zero").width());
	$(".pics").height($("#zero").height());
	/*
	$(".pics").googleMap(45.757756, 9.044007, 13, {
		controls: ["GSmallMapControl"],
		markers: $(".geo")
	});
	*/
	
	
	
  	
	setTimeout(function(){
	$("body").append('<div id="map"></div>');
	
	$("#map").width($("#zero").width());
	$("#map").height($("#zero").height());
	
	},4000);
	
	
	setTimeout(function(){
	
	$("#map").jMapping({
    map_config: function(map){
     
      //map.setMapType(G_NORMAL_MAP);
      
      map.addControl(new GSmallMapControl());
      map.enableScrollWheelZoom();
         
    }
  	});
  	
  	
  	$("#map,#close").click(function(){
          	var ckdue = $("#due").hasClass(".closed");
			if(ckdue){}else{
         	$("#due").animate({left:"-178px"},1500,"easeOutQuart").addClass("closed");
			}
		 });
		
		
    },4500);
	
	    
		 setTimeout(function(){
		
		//	self.resizeTo((screen.availWidth-1),(screen.availHeight-1));
			$("#mapcenter").trigger("click");
		
		
		 },4550);



    var theid = $("#menu a.active");
    var theidx = $("a.be").index(theid);
    var theh = (theidx*32)+94;
       
    $(theid).animate({"height":"359px"},1200,"easeOutQuart");
    
    $("#menu").css({"width":"260px"});
   
    $("#uno,#due,#tre").css({"top":theh+"px"}); 
    $(".scroll-pane").jScrollPane({scrollbarWidth: 8});
    $(".scroll-pane").hide();
    
    $(theid).data("ck","ok");
    $(theid).trigger("mouseover");
    
    
         
      
        
         
    
     
});


