/* artViper® designstudio dropdown menu */
/* ©2009 all rights reserved */
/* removing this copyright notice is prohibited */
/* you are entitled to freely use this piece of code */
/* using this script in commercial products requires */
/* prior acknowledgement of artViper® designstudio */													 
/* please keep this information in place */
/* information and usage request: admin@artviper.net */

function GetWidth()
{
        var x = 0;
        if (self.innerHeight)
        {
                x = self.innerWidth;
        }
        else if (document.documentElement && document.documentElement.clientHeight)
        {
                x = document.documentElement.clientWidth;
        }
        else if (document.body)
        {
                x = document.body.clientWidth;
        }
        return x;
}
	
/* artViper® designstudio dropdown menu */
/* ©2009 all rights reserved */
/* removing this copyright notice is prohibited */
/* you are entitled to freely use this piece of code */
/* using this script in commercial products requires */
/* prior acknowledgement of artViper® designstudio */													 
/* please keep this information in place */
/* information and usage request: admin@artviper.net */

window.addEvent('domready',function(){

$$('.dropdowns').each(function(e){
	e.set('opacity','0');
})

$$('.igniter').addEvent('mouseenter',function(e){
	$$('.dropdowns').setStyle('display','none');
	var r = this.get('rel');
	var pos = this.getPosition();
	var larghezza=GetWidth();
	
	var margine=(larghezza-960)/2;
	if($(r).getStyle('display') == 'none'){
		$(r).setStyles({
						'opacity':'0',
						'position':'absolute',
						'top':'40px',
						'left':pos.x-margine,
						'display':'block',
						'z-index':'1000'
						
		});
	
		var myFx = new Fx.Tween($(r));
		$(r).fade(1);
	}
})

$$('.dropdowns').addEvent('mouseleave',function(e){
var myEffects = new Fx.Morph(this, {duration: 300, transition: Fx.Transitions.Sine.easeOut, 'link':'cancel'});
 
myEffects.start({
    'opacity': [1,0]
}).chain(function(e){
	$$('.dropdowns').setStyle('display','none');
})})})
