$(document).ready(function() {
    var windowHeight = $(window).height();
	var contentHeight=windowHeight-196;
	$('#content_single').css('min-height',contentHeight);
	$('#wrapper').css('min-height',contentHeight);
	$(window).bind('resize', function() {
	    var windowHeight = $(window).height();
		var contentHeight=windowHeight-196;
		$('#content_single').css('min-height',contentHeight);
		$('#wrapper').css('min-height',contentHeight);
	});
	$.preLoadImages = function() {
	    var args_len = arguments.length;
	    for (var i = args_len; i--;) {
	      var cacheImage = document.createElement('img');
	      cacheImage.src = arguments[i];
	      cache.push(cacheImage);
	    }
	};
    $("#nav").lavaLamp({
        fx: "backout",
        speed: 700
    });
    $('#slider').easySlider({
		speed:800
    });
    $('.back').css('padding',0);
    $('.back').css('padding-top',1);
    $('.sotto_menu').hover(function(){
    	var child=$(this).children().attr('id');
    	var a=$('#'+child).offset();
    	$('li a').attr('style','');
    	$('#'+child).css('color','#fff');
    	//if(child=='lavora')
    	//	var num=parseInt(a.left)-270;
    	//else
    		var num=parseInt(a.left)-50;
    	$('.baloon').hide();
    	$('.baloon').attr('style','');
    	$('#'+child+'_ball').css('left',num+'px');
    	$('#'+child+'_ball').css('top','185px');
    	$('#'+child+'_ball').show();
    	
    });
    $('#header,#content,body,.no_menu,#wrapper,#content_single').hover(function(){
    		$('li a').attr('style','');
    		$('.baloon').hide();
    		move(curr);
    });
    
    $('#link_integration').click(function(){
    	document.location.href = baseURL+"/?page_id=24";
    });
    $('#link_technology').click(function(){
    	document.location.href = baseURL+"/?page_id=22";
    });
    $('#link_solution').click(function(){
    	document.location.href = baseURL+"/?page_id=26";
    });

});
