/**
 * @author FINSA Consulting
 */

/* 
 * Set Hover behaviour on subMenu items within collections' pages
 */
function setSubMenuHover()
{
	$$('#SubMenu li a').addEvent('mouseover', function(event) {
		
		if(! this.hasClass('itemSelected'))
		{
			Cufon.set('fontFamily', 'TradeGothic-condensed20');
			Cufon.replace(this);
		}
		
		
	 });
	
	 $$('#SubMenu li a').addEvent('mouseout', function(event) {
		
		 if(! this.hasClass('itemSelected'))
		{
			Cufon.set('fontFamily', 'TradeGothic-condensed18');
			Cufon.replace(this);
		}
		 
	 });
}


/*
 * Class for SubMenu
 */

function SubMenu(name, href)
{
	this.name = name;
	this.href = href;
}

/*
 *	Class for Menus 
 */

/*function Menus()
{
	this.menus = new Array();
	//SubMenus
	this.contemporary = new Array();
	this.contemporary[0] = new SubMenu("city casual",  "/persona/collections/collections.html");
	this.contemporary[1] = new SubMenu("the easy look",  "/persona/collections/collections.html");
	this.contemporary[2] = new SubMenu("fresh out",  "/persona/collections/collections.html");
	this.contemporary[3] = new SubMenu("the smart stripes",  "/persona/collections/collections.html");
		
	this.party = new Array();
	this.party[0] = new SubMenu("0",  "/persona/collections/collections.html");
	this.party[1] = new SubMenu("1",  "/persona/collections/collections.html");
	this.party[2] = new SubMenu("2",  "/persona/collections/collections.html");
	this.party[3] = new SubMenu("3",  "/persona/collections/collections.html");
		
	this.sport = new Array();
	this.sport[0] = new SubMenu("0",  "/persona/collections/collections.html");
	this.sport[1] = new SubMenu("1",  "/persona/collections/collections.html");
	this.sport[2] = new SubMenu("2", "/persona/collections/collections.html");
	this.sport[3] = new SubMenu("3",  "/persona/collections/collections.html");
		
	this.accessori = new Array();
	this.accessori[0] = new SubMenu("0",  "/persona/collections/collections.html");
	this.accessori[1] = new SubMenu("2",  "/persona/collections/collections.html");
	this.accessori[2] = new SubMenu("2",  "/persona/collections/collections.html");
	this.accessori[3] = new SubMenu("3",  "/persona/collections/collections.html");
	
	//Append submenus to menu
	this.menus[0] = this.contemporary;
	this.menus[1] = this.party;
	this.menus[2] = this.sport;
	this.menus[3] = this.accessori;
}*/

/*
 * Auxiliary function for Menu Handler.
 * Set submenu postion given the index number of clicked element.  
 * 
 */
function setSubMenuPosition(numIndex)
{
	//set top position of submenu
	var topDist = -105;
	
	switch(numIndex){
	
		case 1:
			topDist = -84;//-82
			break;
			

		case 2:
			topDist = -63;//-59
			break;

		case 3:
			topDist = -42;//-36
			break;
		
		case 4:
			topDist = -21;//-36
			break;
		
	}
	
	$$('#SubMenu').setStyle('margin-top',topDist);
}

/*window.addEvent('domready', function(){
	
	var viewportwidth;
	var viewportheight;

	// the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight

	if (typeof window.innerWidth != 'undefined')
	{
	  viewportwidth = window.innerWidth,
	  viewportheight = window.innerHeight
	}

	// IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)

	else if (typeof document.documentElement != 'undefined'
	 && typeof document.documentElement.clientWidth !=
	 'undefined' && document.documentElement.clientWidth != 0)
	{
	   viewportwidth = document.documentElement.clientWidth,
	   viewportheight = document.documentElement.clientHeight
	}

	// older versions of IE

	else
	{
	   viewportwidth = document.getElementsByTagName('body')[0].clientWidth,
	   viewportheight = document.getElementsByTagName('body')[0].clientHeight
	}
	
	//Se la viewport è minore delle dimensioni del bodywrapper riposiziona correttamente il bodywrapper
	var mgTop =  (viewportheight - $$('.bodyWrapper')[0].getSize().y ) / 2;
	
	//se il rapporto tra altezza viewport e altezza bodyWrapper è negativo, elimina il margin-top
	if(mgTop <= 0)
		mgTop = 0;
	
	$$('.bodyWrapper').setStyles({'margin-top':mgTop});

});*/




