//  Sliding news

var newstickerLiText = new Array();
newstickerLiText.z = 0;
(function($) {
$(function() {
	
	$(".news-item").each(function(){
		newstickerLiText.push( $(this).html() );
	});
	
	for (i=0; i<newstickerLiText.length; i++){
		newstickerLiText[i] = "<p>" + newstickerLiText[i] + "</p>";
 	}
	
});

function Visualizza(){	
	if(newstickerLiText.z==newstickerLiText.length){
		newstickerLiText.z=0;
	}	
		$(".mask").show();
	    $(".mask").empty();
	    $(".mask").append(newstickerLiText[newstickerLiText.z]);
	    newstickerLiText.z++;
	    newstickerLiText.count++;
	    $strip = $(".mask p");
	    $strip.animate({left: 0 },300,function(){
    		$(this).animate({left: 0 },9000,function(){
			    $(this).animate({opacity: 'hide' }, 700, function(){
    				Visualizza();				
			    });										 
		    });										 
	    });
    
    	$strip.hover(function(){
	    	$(this).stop()},
		    function(){
    			$(this).animate({opacity: 'hide' }, 700, function(){
				    Visualizza();				
			    });									
		    });
	
}

$(window).bind("load", function() {
	Visualizza();
});
})
(jQuery);

// Homepage  switching content panels
(function($) {
$.fn.quickview = function() {   
	var menus = this;
	var allContentAreas = $('.quick-view-content');	
	return this.each(function() {
	$(this).mouseover(function() {
		$(menus).not($(this)).removeClass('over');
		var nextElement = this.className.replace(' over','');
		var thisContentArea = '.quick-view-content.' + nextElement;
		
		$(thisContentArea).show();
		$(allContentAreas).not($(thisContentArea)).hide();		
		$(this).addClass('over');		
	   });
	});
};
})
(jQuery);
(function($) {
$(function(){
    $('li.quick1').addClass('over');
    var quickViewContentOuter = $('.quick-view-content-outer');
	var quickViewContent = $('.quick-view-content');
	if (quickViewContent.length < 2)
	{
		quickViewContentOuter[0].innerHTML += qcontent;
	}
	quickViewContent = $('.quick-view-content'); 
	var maxEl = quickViewContent[0].offsetHeight;
	for (var i = 1; i < quickViewContent.length; i++)
	{
		if (quickViewContent[i].offsetHeight > maxEl) maxEl = quickViewContent[i].offsetHeight;
	}
	quickViewContentOuter.css ({height: maxEl });
	$('.quick-view-menu > li').quickview();	
	$('.quick-view-content + .quick-view-content').hide();
});
})
(jQuery);
