window.addEvent('domready', function() {

//FUNCTIONS /////////////////////////////////

///// Login Panel
  var labelOpen='Open Login';
  var labelClose='Close Login';
  
  // Set slide and styles effects
 /*
 var mySlide = new Fx.Slide('logincontent').hide();    
  var fx = new Fx.Styles($('linkPanelText'), {duration:500, wait:false});
  $('linkPanel').addEvent('click', function(e){
    mySlide.toggle();
    $('linkPanel').toggleClass('openPanel');
    fx.start({
      'opacity': 0  
    }).chain(function(){
      if($('linkPanel').hasClass('openPanel')) $('linkPanelText').setHTML(labelOpen);
      else $('linkPanelText').setHTML(labelClose);
      fx.start({'opacity': 1})
    });
  });
  */
///// END Login Panel


///// Menu Rollover hack ie6
/* ================================================================ 
This copyright notice must be kept untouched in the stylesheet at 
all times.

The original version of this script and the associated (x)html
is available at http://www.stunicholls.com/menu/skeleton.html
Copyright (c) 2005-2007 Stu Nicholls. All rights reserved.
This script and the associated (x)html may be modified in any 
way to fit your requirements.
=================================================================== */

stuHover = function() {
	var cssRule;
	var newSelector;
	for (var i = 0; i < document.styleSheets.length; i++)
		for (var x = 0; x < document.styleSheets[i].rules.length ; x++)
			{
			cssRule = document.styleSheets[i].rules[x];
			if (cssRule.selectorText.indexOf("LI:hover") != -1)
			{
				 newSelector = cssRule.selectorText.replace(/LI:hover/gi, "LI.sfhover");
				document.styleSheets[i].addRule(newSelector , cssRule.style.cssText);
			}
		}
	var getElm = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<getElm.length; i++) {
		getElm[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		getElm[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if(window.ie6) stuHover();
///// END Menu Rollover hack ie6


///// SmoothScroll
//new SmoothScroll({duration:1000});
///// END SmoothScroll


	if ($('homepage')){
		///// Slide show Homepage
				var slideshowHP = {
					wait: 4500, 
					effect: 'fade',
					transition: Fx.Transitions.Cubic.easeInOut,
					duration: 1000, 
					loop: true, 
					thumbnails: true,
					backgroundSlider: true,
					onClick: function(i){}
				}
				show = new SlideShow('slideshowContainer','slideshowThumbnail',slideshowHP);
				show.play();
		///// END Slide show Homepage
		
		///// SmoothTabs
				smooth = new smoothtabs();
		///// END SmoothTabs
		
		///// Product Rollover
				$$('div.product img').each(function(e){
				  var fade = new Fx.Style(e, 'opacity', {wait:false});
				  fade.set(1);
				  e.addEvent('mouseover', function(){
				    fade.start(.6);
				  });
				  e.addEvent('mouseout', function(){
				    fade.start(1);
				  });
				});
		///// END Product Rollover
	}else{
		///// Scalable Inman Flash Replacement
		  	if ($('internalpage')){
			  	new MoosIFR("body .content h1", {flashsrc: "/scripts/museo.swf", textcolor: "#BBBBBB", wmode: "transparent"});
				new MoosIFR("body .content h2", {flashsrc: "/scripts/museo.swf", textcolor: "#00544c", wmode: "transparent"});
		  	}else{
	  		  	new MoosIFR("body .content h1", {flashsrc: "/scripts/museo.swf", textcolor: "#00544c", wmode: "transparent"});
		  	}
			///// END Scalable Inman Flash Replacement

		///// Menu Left Start
		 	mooMenu = new mooMenu();
		///// END Menu Left Start
		
		///// MultiColumn	
		
			
		
		///// ENDMultiColumn	
	};
});

//chiusura DOM READY