/*--------------------------------------------------
G R U P P O  DAVI
website by websolute
http://www.websolute.it
--------------------------------------------------*/

/* Leggi Tutto
- - - - - - - - - - - - - - - - - - - - */
function leggi_tutto() {
    var txtApriScheda = "continua a leggere..."
    var txtChiudiScheda = "chiudi paragrafo"
	$("#leggi").text(txtApriScheda);
	//$('#continua').css("display", "none");
    $('#leggi').click(function () {
		var txtApriScheda = $("#leggi").text("continua a leggere...");
    	var txtChiudiScheda = $("#leggi").text("chiudi paragrafo");
        if ($('#continua').is(":hidden")) {
            $('#continua').slideDown("slow");
            $('#leggi').removeClass('apri_scheda');
            $('#leggi').addClass('chiudi_scheda');
            $('#leggi').html(txtApriScheda);
        } else {
            $('#continua').slideUp("slow");
            $('#leggi').removeClass('chiudi_scheda');
            $('#leggi').addClass('apri_scheda');
            $('#leggi').html(txtChiudiScheda)
        }
        return false;
    });
//	 $('#leggi').click(function () {
//        $('#continua').slideUp("slow");
//        if ($('#continua').is(":hidden")) {
//            $('#continua').slideDown("slow");
//            $('#leggi').removeClass('apri_scheda');
//            $('#leggi').addClass('chiudi_scheda');
//            $('#leggi').html(txtChiudiScheda);
//        } else {
//            $('#continua').slideUp("slow");
//            $('#leggi').removeClass('chiudi_scheda');
//            $('#leggi').addClass('apri_scheda');
//            $('#leggi').html(txtApriScheda)
//        }
//        return false;
//    });
}

/*--------------------------------------------------
box info
--------------------------------------------------*/
function infoHome() {
	$("div.info a").click(function () {
		//$("#helphome").css({"display": "block"});
		$("#helphome").show();
		return false
	});
	
	$("div.info a#infoclose").click(function () {
		//$("#helphome").css({"display": "none"});
		$("#helphome").hide();
		return false
	});
	
}

/*--------------------------------------------------
activemenu
--------------------------------------------------*/
function activemenu (){
	

	
	/*var id = querystring("co_id");
	var path = $("#path li a").attr("href");
	
	if ( path ){
	
		var menuOn = $("#path li:eq(2) a").attr("href").split("=")[1];
		
		try {
			if (id != 1){
				$("#menu ul li a[class$=" + menuOn + "]").addClass("on");
				$("#footer_wrap ul li a[class$=" + menuOn + "]").addClass("on");
			} else if (id = 279){  // una volta pubblicato sarà da modificare il valore 279
				var menuOn = $("#path li:eq(3) a").attr("href").split("=")[1];
				$("#menu ul li a[class$=" + menuOn + "]").addClass("on");
				$("#footer_wrap ul li a[class$=" + menuOn + "]").addClass("on");
				//alert ("279");
			} else {
				$("#menu ul li:eq(0) a").addClass("on");
			}
		} catch(err) {
		//	alert ( "Error: " + err );
		}
	}*/
	
	


	try {	

	    if ($("#path").size()) {
		    var id = querystring("co_id");
		    var menuOn = $("#path li:eq(2) a").attr("href").split("=")[1];
			    if (menuOn != 1){
				    $("#menu ul li a[class$=" + menuOn + "]").addClass("on");
				    $("#footer_wrap ul li a[class$=" + menuOn + "]").addClass("on");
			    } 
			    if (menuOn = 279){  // una volta pubblicato sarà da modificare il valore 279
				    var menuOn = $("#path li:eq(3) a").attr("href").split("=")[1];
				    $("#menu ul li a[class$=" + menuOn + "]").addClass("on");
				    $("#footer_wrap ul li a[class$=" + menuOn + "]").addClass("on");
			    } else {
			    }
	    }
    } catch (err) {
      //	alert ( "Error: " + err );
    }



}

/*--------------------------------------------------
sliderDivision
--------------------------------------------------*/
function sliderDivision()
{
	
    if ($("#slider_cont")) {
		var i = $("#label_barra ul li").size();
		var c = parseInt ( ($("#label_barra").width() / i).toString().split ( ".")[0] );
		var d = $("#label_barra ul li").size() - 1;
		var e = parseInt ( ( c / d ).toString().split ( ".")[0] );
		var g = parseInt ( ( e + c ).toString().split ( ".")[0] );
		var h = parseInt ( ( g * d ).toString().split ( ".")[0] );
		var w = $("#label_barra").width();
		if ( (h >= w) ) {
			var h = g - 1;
			$("#label_barra ul li").css("width", h, "px");
			$("#label_barra ul li:last").css("width", "1px").addClass("last");
		} else {
			$("#label_barra ul li").css("width", g, "px");
			$("#label_barra ul li:last").css({'width':'1px'}).addClass("last");
		}
		
		if ( (i == 2) ) {
			$("#label_barra ul li:last").css({"width": "1px" , "margin-left":"0px"}).addClass("last");
		}									
	}
}

/*--------------------------------------------------
Equal Height
--------------------------------------------------*/
function equalHeight(group) {
	
   tallest = 0;
   group.each(function() {
      thisHeight = $(this).height();
      if(thisHeight > tallest) {
         tallest = thisHeight;
      }
   });
   group.height(tallest);
}

/*--------------------------------------------------
Fancy Boxes
--------------------------------------------------*/
function fancy_boxes() {
    $("a.login_btn").fancybox({
        'width': 500,
        'height': 180,
        'type': 'iframe'
    });
    $("a.iFramePrivacy").fancybox({
        'width': 500,
        'height': 600,
        'type': 'iframe'
    });
    $("a.iFrameTellToFriend").fancybox({
        'width': 500,
        'height': 500,
        'type': 'iframe'
    });
    $("a.iFrameWeCallYou").fancybox({
        'width': 500,
        'height': 650,
        'type': 'iframe'
    });
    $("a.iFrameEmailUs").fancybox({
        'width': 500,
        'height': 500,
        'type': 'iframe'
    });

    $("a.iFrameRequestaMeeting").fancybox({
        'width': 500,
        'height': 780,
        'type': 'iframe'
    });

    $("a.iFrameRequestCatalog").fancybox({
        'width': 500,
        'height': 600,
        'type': 'iframe'
    });

    $("a.iFrameRequestSpareParts").fancybox({
        'width': 500,
        'height': 920,
        'type': 'iframe'
    });


}




function chooseMercato(co_id, area_id) {
    var url;
    url = "/choose_mercato.aspx?co_id=" + co_id + "&action=set_area" + "&area_id=" + area_id;
    window.location.href = url;
}



function chooseLang(co_id, lang_id) {
    var url;
    url = "/choose_lang.aspx?co_id=" + co_id + "&action=set_lang" + "&lang_id=" + lang_id;
    window.location.href = url;
}





/*--------------------------------------------------
Paging:  Applicazioni
--------------------------------------------------*/
function ChangePageApplication(cur_co_id, app_grup_id, app_id, curPage, direction, WsMethod){
var wsurl;

     wsurl = "/ws/wsGetContent.asmx/" + WsMethod;

     if ( WsMethod == 'GetListApplication'){

       //$('#corpo_prod').hide('slow');

        $this = $(this);
        $.ajax({
            type: "POST",
            url: wsurl,
            cache: false,
            contentType: "application/json; charset=utf-8",
            data: "{cur_co_id: " + cur_co_id + ",app_grup_id: " + app_grup_id + ",app_id: " + app_id + ",curPage: " + curPage +  ", NavDirection:'" + direction + "'}",
            dataType: "json",
            success: function(data)
            {
               $("#corpo_prod").html(data.d.HTML);

               $('#corpo_prod').show('slow');
            },
            error: function(data)
            {
                if (data.d != null)
                $("#corpo_prod").html(data.d.ErrMessage);
            }
        });

     }

 }


/*--------------------------------------------------
Paging:  News-Eventi-Ricerca
--------------------------------------------------*/
function ChangePage(cur_co_id, curPage, direction, WsMethod){
var wsurl;

    wsurl = "/ws/wsGetContent.asmx/" + WsMethod;

    if ( WsMethod == 'GetListNewsEventi'){

       //$('#corpo_prod').hide('slow');

        $this = $(this);
        $.ajax({
            type: "POST",
            url: wsurl,
            cache: false,
            contentType: "application/json; charset=utf-8",
            data: "{cur_co_id: " + cur_co_id +  ",curPage: " + curPage +  ", NavDirection:'" + direction + "'}",
            dataType: "json",
            success: function(data)
            {
               $("#corpo_prod").html(data.d.HTML);
               $('#corpo_prod').show('slow');
            },
            error: function(data)
            {
                if (data.d != null)
                $("#corpo_prod").html(data.d.ErrMessage);
            }
        });
     }
 
    if ( WsMethod == 'GetSearchResult' ){
       
        //$('#corpo_prod').hide('slow');

        $this = $(this);
        $.ajax({
            type: "POST",
            url: wsurl,
            cache: false,
            contentType: "application/json; charset=utf-8",
            data: "{curPage: " + curPage +  ", NavDirection:'" + direction + "'}",
            dataType: "json",
        
            success: function(data)
            { 
               
               $("#corpo_prod").html(data.d.HTML);
               $('#corpo_prod').show('slow');
            },
            error: function(data)
            {
                if (data.d != null)
                    $("#corpo_prod").html(data.d.ErrMessage);
            }
        });
    }             
}


/*--------------------------------------------------
	SEARCH
--------------------------------------------------*/
function do_search(){
	var text_to_search;
	
	$("input[id$='button_search']").click(function() {

			text_to_search=$("#text_to_search").val()
			
			if(text_to_search.length >0){
			       //$("body").removeAttr("onunload");
				   //$("#fake_text_to_search").val(text_to_search);
					$("#frm_Search").submit();
			}
			
	});
	
	$("#text_to_search").keyup(function(event){
		if(event.keyCode == 13){
			text_to_search=$("#text_to_search").val()
			if(text_to_search.length >0){
					$("#button_search").click();
			}
		}
	});
  
}


/*--------------------------------------------------
querystring
--------------------------------------------------*/
function querystring(name){
  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var results = regex.exec(window.location.href);
  if(results == null){
    return "";
	} else {
    return results[1];
	}
}


/*--------------------------------------------------
global
--------------------------------------------------*/
global = {
    menuAlign: function () {
        var menuSize = parseInt($("#menu li a").size());
        var menuWidth = 940;
        var liWidth = 0;
        var extra = 0;
        var totActualLiWidth = 0;
        var totMarginToDivide = 0;
        var liMarginToAdd = 0;

        $('#menu ul li').each(function (i) {
            totActualLiWidth += $(this).width();
        });

        totMarginToDivide = menuWidth - totActualLiWidth;
        liMarginToAdd = Math.floor(totMarginToDivide / (menuSize - 1)) - 1;
        // console.info( liMarginToAdd );			

        $('#menu ul li').each(function (i) {
            var halfMargin = liMarginToAdd / 2;
            var posY = 14;
            var thisW = $(this).width();
            $(this).css({ 'padding-right': liMarginToAdd-1 + 'px', 'background-position': thisW + halfMargin + 'px ' + posY + 'px' });

        });
        $("#menu li:last").css({ "padding-right": 0 });
    },
    focusInput: function () {
        $("input.focus").focus(function () {
            if ($(this).val() == $(this).attr("title")) {
                $(this).val("");
            }
        }).blur(function () {
            if ($(this).val() == "") {
                $(this).val($(this).attr("title"));
            }
        });
    },
    menuInt: function () {
        //var id = querystring("co_id");
        var id = $("body").attr("class");
        var pos;
        var co_id;

        pos = id.indexOf('id_', 0);

        co_id = id.substring(pos, id.lenght);

        //var $el = $("#menu_int ul li a[href$=co_id=" + co_id + "]");

        //alert(co_id);

        var $el = $("#menu_int ul li a[class$=" + co_id + "]");

        

        $el.addClass("on");
        $el.parents("ul").show();
        if ($el.next().is("ul")) {
            $el.next().show();
        }
        $("#menu_int ul li a[href=#]").click(function () {
            $(this).next().show();
            return false;
        });
    },
    galMarg: function () {
        //$("#gallery li:odd").css({"margin-right":0});
    },
    suggMarg: function () {
        $(".suggerimenti li:last").css({ "margin-right": 0 });
    },
    openTopBar: function () {
        $(".topbar a.paese").not($(".topbar #paese a")).click(function () {
            $("#paese").toggle();
            $("#lingua").hide();
            return false;
        });
        $(".topbar a.lingua").not($(".topbar #lingua a")).click(function () {
            $("#lingua").toggle();
            $("#paese").hide();
            return false;
        });
        $("#header").click(function () {
            $("#lingua").hide();
            $("#paese").hide();
        });
    },
    boxContatti: function () {
        if ($("#right .col .box_contatti").size()) {
            var tit = $("#right .col .box_contatti h2").text();
            $("#right .col .box_contatti").parent().removeClass("col").addClass("box").find(".box_contatti").removeClass("box_contatti").addClass("box_wrap").find("ul").addClass("ico").prev().replaceWith("<h3>" + tit + "</h3>");
        }
    }
}


/*--------------------------------------------------
showreel homepage
--------------------------------------------------*/
function showreelHome() {
	if ($(".showreel").size()){
		$("#submenu ul ul").remove();
		$("#submenu a:last").addClass("on");

		$("#submenu ul li").each(function (i) {
    	$(this).addClass("submenu_" + i);
		});
		
		// var
		var looppa;
		var speed = 3000;
		var timeout = 4000;
		var i = 0;
		var size = $(".showreel_img").size();
		var ind;
		var hover = false;
		
		// sistemo le immagini
		$(".showreel_img").each(function(i){
			$(this).css({"background":"url(" + $(this).find("img").attr("src") + ") no-repeat top center", "z-index":(i+1)}).attr("rel",(i+1)).find("img").hide();
		});
		
		// rollover
		function loop(){
			$("#submenu a.on").removeClass("on");
			$("#submenu a:eq(" + (i%3) + ")").addClass("on");
			
						
			size = size + 1;
			if (hover) {
				$(".showreel_img:eq(" + i + ")").hide().css({"z-index":(size)}).fadeIn(speed/3);
			} else {
				$(".showreel_img:eq(" + i + ")").hide().css({"z-index":(size)}).fadeIn(speed);
			}
			if (i >= $(".showreel_img").size() - 1) {
				i = 0;
			} else {
				i = i+1;
			}
		}
		
		// rollover
		$("#submenu a").mouseover(function(){
			hover = true;
			clearInterval (myloop);
			i = $("#submenu a").index($(this));
			loop(i);
		}).mouseout(function(){
			hover = false;
			myloop = setInterval(function(){
				loop();
			},timeout);
		});
		
		myloop = setInterval(function(){
			loop();
		},timeout);
		
	}
}


/*--------------------------------------------------
showreel homepage OIL&SEPARATION SOLUTIONS
--------------------------------------------------*/
function showreelInt() {
	if($(".showreel_int").size()){
		
		// var
		var looppa;
		var speed = 4000;
		var timeout = 4000;
		var i = 0;
		var size = $(".showreel_img").size();
		var ind;
		var hover = false;
		
		// sistemo le immagini
		$(".showreel_img").each(function(i){
			$(this).css({"background":"url(" + $(this).find("img").attr("src") + ") no-repeat top center", "z-index":(i+1)}).attr("rel",(i+1)).find("img").hide();
		});
		
		// rollover
		function loop(){
			
			size = size + 1;
			if (!hover) {
				$(".showreel_img:eq(" + i + ")").hide().css({"z-index":(size)}).fadeIn(speed/3);
			} else {
				$(".showreel_img:eq(" + i + ")").hide().css({"z-index":(size)}).fadeIn(speed);
			}
			if (i >= $(".showreel_img").size() - 1) {
				i = 0;
			} else {
				i = i+1;
			}
		}
		
		myloop = setInterval(function(){
			loop();
		},timeout);
		
	}}

/*--------------------------------------------------
Showreel Success Stories
--------------------------------------------------*/
function showreelSuccess() {
	
	if ($(".showreel_img").size()){
		
	} else {
		$(".showreel_wrap").css({"display":"none"});
	}
	
	
	if ($(".showreel_success").size()){
		
		// var
		var looppa;
		var speed = 3000;
		var timeout = 4000;
		var i = 0;
		var size = $(".showreel_img").size();
		var ind;
		var hover = false;
		var numImgs = $('.showreel_wrap').children().length;
		
		for(i = 0; i < numImgs; i++){
			$("#submenu ul").append('<li><a href="#"></a></li>');
		}
				
		$("#submenu a:last").addClass("on");
		$("#submenu ul li").each(function (i) {
			$(this).addClass("submenu_" + i);
			$(this).css({'left' : i*30 + 'px'});
		});		
		
		// sistemo le immagini
		$(".showreel_img").each(function(i){
			$(this).css({"background":"url(" + $(this).find("img").attr("src") + ") no-repeat top center", "z-index":(i+1)}).attr("rel",(i+1)).find("img").hide();
		});
		
		// rollover
		function loop(){
			
			console.info( numImgs );
			$("#submenu a").click(function(event) {
  			event.preventDefault();
			});
			$("#submenu a.on").removeClass("on");
			$("#submenu a:eq(" + (i % numImgs) + ")").addClass("on");
			
						
			size = size + 1;
			if (hover) {
				$(".showreel_img:eq(" + i + ")").hide().css({"z-index":(size)}).fadeIn(speed/3);
			} else {
				$(".showreel_img:eq(" + i + ")").hide().css({"z-index":(size)}).fadeIn(speed);
			}
			if (i >= $(".showreel_img").size() - 1) {
				i = 0;
			} else {
				i = i+1;
			}
		}
		
		// rollover
		$("#submenu a").mouseover(function(){
			hover = true;
			clearInterval (myloop);
			i = $("#submenu a").index($(this));
			loop(i);
		}).mouseout(function(){
			hover = false;
			myloop = setInterval(function(){
				loop();
			},timeout);
		});
		
		myloop = setInterval(function(){
			loop();
		},timeout);		
	}
}


/*--------------------------------------------------
tab link
--------------------------------------------------*/
function tab_links(){
	if ($(".tab_links").size()){
		$(".tab_links .tab_bot").hide();
		$(".tab_links .tab").click(function(){
			$(".tab_links .on").removeClass("on");
			$(this).addClass("on");
			$(".tab_links .tab_bot").hide();
			$(".tab_links .tab_bot[id=" + $(this).attr("href").split("#")[1] + "]").show();
			return false;
		});
		$(".tab_links .tab:eq(0)").click();
	}
}


/*--------------------------------------------------
help
--------------------------------------------------*/
function help(){
	var o = false;
	if ($("#left .help_wrap").size()){
		$("#left a#infoclose").hide();
		$("#left .help_wrap").hover(function(){
			$(this).find("em").css({"color":"#018B73"});
		},function(){
			$(this).find("em").css({"color":"#454545"});
		});
		if (!o){
			$("#left .help_wrap").click(function(){
				o = true;
				$(this).find("em").css({"color":"#018B73"});
				$(this).css({"cursor":"default"});
				$(this).find(".help_1").slideDown(500);
				$(this).find(".help_2").slideDown(500);
				$(this).find(".links").slideDown(500);
				$("#left a#infoclose").show();
			});
		}
	}
}




/*--------------------------------------------------
gallery
--------------------------------------------------*/



function show_zoom() {
	$('.gall_zoom').css('cursor', 'pointer');
	
	
    var value;
    $("#prod_img img#test").live('click', function () {
        value = $("input.zoom_src").val();
        if (value !== '') {
            $.fancybox({ href: value });
        }
        return false;
    });
	
	$(".gall_zoom").live('click', function () {
        value = $("input.zoom_src").val();
        if (value !== '') {
            $.fancybox({ href: value });
        }
        return false;
    });
};




function prodGal() {
    var img_zoom;
	
	$("a.prev").addClass("disabled");
	
	if ($("a.prev").size()){
		$("#gallery").addClass("padd");
	} else {
		$("#gallery").addClass("nopadd");
	}
	
	
    $("#gallery .items a").click(function () {

        img_zoom = $(this).find("input").val();

        if (img_zoom != '') {
            $("input.zoom_src").val(img_zoom);
            $('#prod_img').css('cursor', 'pointer');
        } else {
            $("input.zoom_src").val('');
            $('#prod_img').css('cursor', '');
        }

        img = $(this).attr("href");
        $("#prod_img").css({ "background": "url(" + $("#prod_img img").attr("src") + ") no-repeat 0 0", width: $("#prod_img img").width(), height: $("#prod_img img").height() }).find("img").hide();
        $("#prod_img").append("<div class='loading' />");
        $.ajax({
            cache: false,
            url: img,
            success: loadOut,
            error: loadOut
        });
        return false;
    });


	function loadOut(){
		$("#prod_img img").attr("src","http://" + location.hostname + img).fadeIn(500,function(){
			$("#prod_img").animate({"height":$("#prod_img img").height()},200);
		});
		ciccio = setTimeout(function(){
			$("#prod_img .loading").fadeOut(300,function(){
				$(this).remove();
			});
		},300);		
	}
}


/*--------------------------------------------------
HELP
--------------------------------------------------*/
function showHelp(){
	$('#help').hide();
	$('#submenu ul li.submenu_3 a').click(function(event) {
		$('#help').fadeIn();
		return false;
  });
	$( document ).click( function(){
		$('#help').fadeOut();
	});
	$( '#help' ).click( function(e){
		e.stopPropagation();
	});
}



/*--------------------------------------------------
GEOMAP LIST
--------------------------------------------------*/
function AlignItems(){
	$('.rivenditori ul li:nth-child(3n+1)').addClass('clear');
	$('.lista-prodotti ul li:nth-child(3n+1)').addClass('clear');
}


/*--------------------------------------------------
SCROLLABLE
--------------------------------------------------*/
function ScrollableInit() {
	$(".scrollable").not($("#slider_cont")).scrollable();
}

/*--------------------------------------------------
SLIDER - Pagina Interna
--------------------------------------------------*/

/*--------------------------------------------------
Scheda prodotto
--------------------------------------------------*/
function SchedaTecnica (){
	$(".scheda_tecnica table tr th:eq(0)").addClass("left");
	$(".scheda_tecnica table tr").each(function(){
        $(this).find("td:eq(0)").addClass("left");
    });
}



/*--------------------------------------------------
SchedaTecnicaShowMore
--------------------------------------------------*/
function SchedaTecnicaShowMore (){
	$(".more").click(function (event) {
		$(".wrap_txt_sx").css({"height":"auto"});
		$(".wrap_txt_sx a.more").css({"display":"none"});
		$(".wrap_txt_sx a.less").css({"display":"block"});
		$(".desc2").show('slow');
		return false;
	});
	$(".less").click(function (event) {
		$(".wrap_txt_sx a.more").css({"display":"block"});
		$(".wrap_txt_sx a.less").css({"display":"none"});
		$(".desc2").hide('slow');
		$(".wrap_txt_sx").animate({"height":"220px"},500);
		
		//.css({"height":"220px"});
		return false;	
	});
}




/*--------------------------------------------------
RichiediPreventivo
--------------------------------------------------*/
function RichiediPreventivo() {
    var rel_value;
    var new_url;

    $("a.request_quote").fancybox({
        'width': 500,
        'height': 900,
        'type': 'iframe'
    });

    $(".richiedi_preventivo").click(function (event) {
        rel_value = $(this).attr('rel');

       
        // Accodo all'url il paramatro selezionato nella riga	
        new_url = "viewdoc?co_id=123&prodotto=" + rel_value

        //sostituisco l'url con quello modificato
        $("a.request_quote").attr('href', new_url);

        // Apro il fancybox	
        $("a.request_quote").click();

        return false;
    });



    $(".richiedi_preventivo_bottom").click(function (event) {
        rel_value = $(this).attr('rel');

        // Accodo all'url il paramatro selezionato nella riga	
        new_url = "viewdoc?co_id=123&prodotto=" + rel_value

        //sostituisco l'url con quello modificato
        $("a.request_quote").attr('href', new_url);

        // Apro il fancybox	
        $("a.request_quote").click();

        return false;
    });




}



/*--------------------------------------------------
Icone Contatti
--------------------------------------------------*/
function IcoContact() {
		if ($("#container.home").size()) {
			
		} else {
			$(".box_contatti ul li a").attr("style","");
			$(".box_contatti ul li a").addClass("interno");
		}
}


/*--------------------------------------------------
HP North America
--------------------------------------------------*/
function north_america() {
	$("#container.north_america #menu ul li:eq(4)").hide();
	
	if($("#container.home").size()){
		$("body.lang_2 .box_contatti ul li:eq(0) a").attr("style","").attr("style","background: url('/img/richiedi_preventivo_eng.png') no-repeat scroll 1px 7px transparent;");
	} else {
		$("body.lang_2 .box_contatti ul li:eq(0) a").attr("style","").attr("style","background: url('/img/richiedi_preventivo_eng_interno.png') no-repeat scroll 1px 7px transparent;");
	}
	//$("body.lang_2 .box_contatti ul li span a").unwrap();
}

/*--------------------------------------------------
INIT
--------------------------------------------------*/
$(function () {
	
	//alert ( "function" );
	
    global.menuAlign();
    global.focusInput();
    global.menuInt();
    global.galMarg();
    global.suggMarg();
    global.openTopBar();
    global.boxContatti();
	
	
    showreelHome();
	infoHome();
    showreelInt();
    showreelSuccess();
    fancy_boxes();
    do_search();
	IcoContact();
    tab_links();
    help();
    showHelp()
    prodGal();
    show_zoom();
    AlignItems();
    ScrollableInit();
	north_america();
	
    //InitSlider();
	
    leggi_tutto();
    sliderDivision();
    SchedaTecnica();
	
	
    SchedaTecnicaShowMore();
    RichiediPreventivo();
	
	setTimeout ( showreelText, 5000 );
	
	addJfe ();

	//activemenu();
	
	
	
});

function showreelText (){
//	console.log ( "add showreel animation" );
	$(".txt_showreel").show();
}

function addJfe () {
	//alert ( "addJfe" );
    
    $(".player").jfe({ ver: "10,2,0", display: "alternate", manual: true, noflash: false });
}



/*--------------------------------------------------
WIN LOAD
--------------------------------------------------*/
$(window).load(function(){
	//$(".txt_showreel").show();
	global.menuAlign();
	equalHeight($(".box"));
	activemenu();
});




