function attachEventListener(target,eventType,functionRef,capture){
	if(typeof target.addEventListener!="undefined"){
		target.addEventListener(eventType,functionRef,capture);
	} else if(typeof target.attachEvent!="undefined"){
		target["on"+eventType] = functionRef;
	}else {
		return false;
	} 
	return true;
};
function detachEventListener(target,eventType,functionRef,capture){
	if(typeof target.addEventListener!="undefined"){
		target.removeEventListener(eventType,functionRef,capture);
	} else if(typeof target.attachEvent!="undefined"){
		target["on"+eventType] = null;
	}else {
		return false;
	} 
	return true;
};

/*Copyright (c)2005-2009 Matt Kruse (javascripttoolbox.com)*/
var Position = (function() {
  function resolveObject(s) {
    if (document.getElementById && document.getElementById(s)!=null) {
      return document.getElementById(s);
    }
    else if (document.all && document.all[s]!=null) {
      return document.all[s];
    }
    else if (document.anchors && document.anchors.length && document.anchors.length>0 && document.anchors[0].x) {
      for (var i=0; i<document.anchors.length; i++) {
        if (document.anchors[i].name==s) { 
          return document.anchors[i]
        }
      }
    }
  }
  var pos = {};
  pos.$VERSION = 1.0;

  pos.set = function(o,left,top) {
    if (typeof(o)=="string") {
      o = resolveObject(o);
    }
    if (o==null || !o.style) {
      return false;
    }
    if (typeof(left)=="object") {
      var pos = left;
      left = pos.left;
      top = pos.top;
    }
    
    o.style.left = left + "px";
    o.style.top = top + "px";
    return true;
  };
  pos.get = function(o) {
    var fixBrowserQuirks = true;
    if (typeof(o)=="string") {
      o = resolveObject(o);
    }
    if (o==null) {
      return null;
    }
    var left = 0;
    var top = 0;
    var width = 0;
    var height = 0;
    var parentNode = null;
    var offsetParent = null;
    offsetParent = o.offsetParent;
    var originalObject = o;
    var el = o;
    while (el.parentNode!=null) {
      el = el.parentNode;
      if (el.offsetParent==null) {
      }
      else {
        var considerScroll = true;
        if (fixBrowserQuirks && window.opera) {
          if (el==originalObject.parentNode || el.nodeName=="TR") {
            considerScroll = false;
          }
        }
        if (considerScroll) {
          if (el.scrollTop && el.scrollTop>0) {
            top -= el.scrollTop;
          }
          if (el.scrollLeft && el.scrollLeft>0) {
            left -= el.scrollLeft;
          }
        }
      }
      if (el == offsetParent) {
        left += o.offsetLeft;
        if (el.clientLeft && el.nodeName!="TABLE") { 
          left += el.clientLeft;
        }
        top += o.offsetTop;
        if (el.clientTop && el.nodeName!="TABLE") {
          top += el.clientTop;
        }
        o = el;
        if (o.offsetParent==null) {
          if (o.offsetLeft) {
            left += o.offsetLeft;
          }
          if (o.offsetTop) {
            top += o.offsetTop;
          }
        }
        offsetParent = o.offsetParent;
      }
    } 
    if (originalObject.offsetWidth) {
      width = originalObject.offsetWidth;
    }
    if (originalObject.offsetHeight) {
      height = originalObject.offsetHeight;
    }
    
    return {'left':left, 'top':top, 'width':width, 'height':height
        };
  };
  pos.getCenter = function(o) {
    var c = this.get(o);
    if (c==null) { return null; }
    c.left = c.left + (c.width/2);
    c.top = c.top + (c.height/2);
    return c;
  };
  
  return pos;
})();

var ETNIA = ETNIA || {};
var etGt = function($id){
	return document.getElementById($id);
}
var etGBT = function($tgt,$tag){
	return $tgt.getElementsByTagName($tag);
}
var etPF = function($functions,$params){
	var tempFunction;
	if($functions.constructor == Array){
		tempFunction = function(){
			for(var i = 0; i < $functions.length; i++){
				$functions[i]($params[i]);
			}
			
		}
	} else {
		tempFunction = function(){
			$functions($params);
		}
	}
	return tempFunction;
}
ETNIA.getObjById = function($elemsToSearch,$id){
	for(var i = 0; i<$elemsToSearch.length; i++){
		if($elemsToSearch[i].id == $id){
			return $elemsToSearch[i];
		}
	}
	return null;
}

ETNIA.windowRedirect = function($target,$url){
	target = eval($target);
	target.location = $url;
}
ETNIA.createGlobalVar = function($variable,$value){
	window[$variable] = $value;
}
ETNIA.createVarIn = function($target,$variable,$value){
	var target =eval($target);
	target[$variable] = $value;
}
ETNIA.readVarIn = function($target,$variable){
	var target = eval($target);
	var value = target[$variable];
	if(!value)
		value = null;
	return value;
}
ETNIA.getNumericValue=function($valueToConvert){
	var numericValue = '';
	var index = 0;
	while((!isNaN($valueToConvert.charAt(index)) || $valueToConvert.charAt(index) == '.' || $valueToConvert.charAt(index) == '-') && index < $valueToConvert.length){
		numericValue+=$valueToConvert.charAt(index);
		index++;
	}
	return Number(numericValue);
}
ETNIA.css=function($obj,$prop){
	var cssValue = null;
	if($obj.currentStyle){
		cssValue = $obj.currentStyle[$prop];
	} else if(window.getComputedStyle){
		cssValue = document.defaultView.getComputedStyle($obj,null).getPropertyValue($prop);
	}
	return cssValue;
}
ETNIA.createDOMNode=function($nodeTag,$nodeProps){
	var node = document.createElement($nodeTag);
	for(var prop in $nodeProps){
		node[prop] = $nodeProps[prop];
	}
	return node;
}

ETNIA.customEvent = function($event,$preventDefault,$currentTarget){
	var ie_var = "srcElement";
	var moz_var = "target";
	var eventInfo = {};
	eventInfo.event = $event;
	eventInfo.currentTarget = $currentTarget;
	if($preventDefault){
		if($event.preventDefault)$event.preventDefault();
		$event.returnValue = false;
	}
	return eventInfo;
}
ETNIA.eventHandler = function($dispatch,$args,$prevent){
	var handler;
	handler = function($event){
		if(!$event)$event=event;
		if($dispatch)
			$dispatch(ETNIA.customEvent($event,$prevent,this),$args);
		else
			ETNIA.customEvent($event,$prevent,this);
	}
	return handler;
}

ETNIA.extend =function(Child, Parent){
	var F = function(){};
	F.prototype = Parent.prototype;
	Child.prototype = new F();
	Child.prototype.constructor = Child;
	Child.uber = Parent.prototype;
}
ETNIA.SimpleMenu = function($elements,$selectedOption,$dispatchActions){
	var _classScope = this;
	var _elements = $elements;
	var _dispatchActions = $dispatchActions;
	var _selectedOption = $selectedOption;
	var _overStatus;
	var _onOptionClicked = function(){};
	var _onOptionOver = function(){};
	var _onOptionOut = function(){};
	var _onResetElements = function(){};
	var _lastElementSelected = $selectedOption || 0;
	var _currentElementSelected = $selectedOption || 0;
	var _onFocus = ETNIA.eventHandler(function($event){$event.currentTarget.blur();});
	
	this.onOptionClicked = function($handler){
		_onOptionClicked = $handler;
	}
	this.onOptionOver = function($handler){
		_onOptionOver = $handler;	
	}
	this.onOptionOut = function($handler){
		_onOptionOut = $handler;	
	}
	this.onResetElements = function($handler){
		_onResetElements = $handler;	
	}
	this.onFocus = function($hanlder){
		_onFocus = $hanlder;	
	}
	this.resetElems = resetElements;
	this.lastElementSelected = function($index){
		if($index!=undefined){
			_lastElementSelected = $index;	
		} else {
			return _lastElementSelected;
		}
	}
	this.currentElementSelected = function($index){
		if($index!=undefined){
			_currentElementSelected = $index;	
		} else {
			return _currentElementSelected;
		}
	}
	function SimpleMenu(){
		if(!_selectedOption)_selectedOption=0;
		for(var i= 0; i<_elements.length; i++){
			_elements[i].setAttribute("posInMenu",i);
			attachEventListener(_elements[i],"focus",_onFocus,false);
		}
	}
	this.setEvents = function($set,$exception){
		for(var i= 0; i<_elements.length; i++){
			if($set){
				if(i != $exception){
					_classScope.addEventsTo(_elements[i]);
				}
			}else{
				if(i != $exception){
					_classScope.removeEventsFrom(_elements[i]);
				}	
			}
		}	
	}
	this.removeEventsFrom = function($tgt){
		detachEventListener($tgt,"mouseover",_onOptionOver,false);
		detachEventListener($tgt,"mouseout",_onOptionOut,false);
		detachEventListener($tgt,"click",_onOptionClicked,false);
	}
	this.addEventsTo = function($tgt){
		attachEventListener($tgt,"mouseover",_onOptionOver,false);
		attachEventListener($tgt,"mouseout",_onOptionOut,false);
		attachEventListener($tgt,"click",_onOptionClicked,false);	
	}
	this.addEventsToIndex = function($index){
		_classScope.addEventsTo(_elements[$index]);	
	}
	this.removeEventsToIndex = function($index){
		_classScope.removeEventsFrom(_elements[$index]);	
	}
	this.getElementByIndex = function($index){
		return _elements[$index];
	}
	function resetElements(){
		for(var i= 0; i<_elements.length; i++){
			_onResetElements(_elements[i]);	
		}	
	}
	SimpleMenu();
}
ETNIA.EtniaEasing = function($easingTargets,$properties,$finalDestinies,$speeds,$dispatch,$timerSpeed,$startEasing){
	var _classScope = this;
	var _easingTargets = $easingTargets;
	var _timer;
	var _speeds = $speeds;
	var _finalDestinies = $finalDestinies;
	var _properties = $properties;
	var _timerSpeed = $timerSpeed;
	var _dispatch = $dispatch;
	var _easingComplete = false;
	var _dispatchFunctionExe = false;
	var _endTimeout;
	
	function EtniaEasing(){
		for(var s = 0; s < _easingTargets.length; s++){
			_easingTargets[s].originalWidth = ETNIA.getNumericValue(ETNIA.css(_easingTargets[s],"width"));
			_easingTargets[s].originalHeight = ETNIA.getNumericValue(ETNIA.css(_easingTargets[s],"height"));
			_easingTargets[s].easingComplete = false;
			setPropInitialValues(false,s);
		}
		if($startEasing)_classScope.initEasing();
	}
	function setPropInitialValues($readyValue,$targetIndex){
		for(var i = 0; i<_properties[$targetIndex].length; i++){
			_properties[$targetIndex][i].ready = $readyValue;
			var prop = _properties[$targetIndex][i].prop;
			if(prop != "scale")
				_properties[$targetIndex][i].originalValue = ETNIA.getNumericValue(ETNIA.css(_easingTargets[$targetIndex],_properties[$targetIndex][i].prop));
		}
	}
	function motion(){
		for (var i=0; i<_easingTargets.length; i++){
			for (var index = 0; index < _properties[i].length; index++) {
				singleElementMotion(_properties[i][index]["prop"],_finalDestinies[i][index],index,i);
			}
		}
	}
	function singleElementMotion($prop,$finalDestiny,$propIndex,$targetIndex){
		var currentValue;
		if($prop == "scaleX" || $prop == "scaleY" || $prop == 'scale'){
			if($prop == 'scale'){
				currentValue = getScale(_easingTargets[$targetIndex],'x');
				currentValue += ($finalDestiny - currentValue)/_speeds[$targetIndex][$propIndex];
				setProportionalScale(_easingTargets[$targetIndex],currentValue);
			}
		} else {
			currentValue = _properties[$targetIndex][$propIndex].originalValue += ($finalDestiny - _properties[$targetIndex][$propIndex].originalValue)/_speeds[$targetIndex][$propIndex];
			_easingTargets[$targetIndex].style[$prop] = String(currentValue+getSuffix($prop));
			if($prop == "opacity"){
				_easingTargets[$targetIndex].style.filter = 'alpha(opacity='+(currentValue*100)+')';	
			}
		}
		if (($prop == "filter" || $prop == "opacity" || $prop == "scaleX" || $prop == "scaleY" || $prop == 'scale')) {
			if($prop == "scaleX" || $prop == "scaleY" || $prop == 'scale'){
				if($prop == 'scale'){
					tempValue = (Math.abs($finalDestiny-getScale(_easingTargets[$targetIndex],'x'))*100);
				}
			} else {
				var dif = $finalDestiny-ETNIA.getNumericValue(ETNIA.css(_easingTargets[$targetIndex],$prop))
				tempValue = (Math.abs($finalDestiny-ETNIA.getNumericValue(ETNIA.css(_easingTargets[$targetIndex],$prop)))*100);
			}
			if (Math.floor(tempValue)<=2) {
				_properties[$targetIndex][$propIndex]["ready"] = true;
				if(!_easingTargets[$targetIndex].easingComplete){
					easingComplete($targetIndex);
				}
			}
		} else {
			tempValue = Math.floor(Math.abs($finalDestiny - ETNIA.getNumericValue(ETNIA.css(_easingTargets[$targetIndex],$prop))));
			if (tempValue<=2) {
				_properties[$targetIndex][$propIndex]["ready"] = true;
				if(!_easingTargets[$targetIndex].easingComplete){
					easingComplete($targetIndex);
				}
			}
		}
	}
	function checkEasingComplete($targetIndex) {
		var completeElements = 0;
		for (var j = 0; j < _properties[$targetIndex].length; j++) {	
			if (_properties[$targetIndex][j]["ready"] == true) {
				completeElements ++;
			} 
		}
		if(completeElements == _properties[$targetIndex].length){
			_easingTargets[$targetIndex].easingComplete = true;
			return true;
		}
		return false;
	}
	function checkAllAnimationsComplete(){
		var completeAnimations= 0;
		for(j = 0; j<_easingTargets.length; j++){
			if(_easingTargets[j].easingComplete)completeAnimations++;
			if(completeAnimations == _easingTargets.length)return true;
		}
		return false;
	}
	function easingComplete($targetIndex) {
		checkEasingComplete($targetIndex);
		if(checkAllAnimationsComplete()){
			stopMotion();
			function finishAllAnimations(){
				stopMotion();
				for(var index = 0; index < _properties[$targetIndex].length; index++){
					var prop = _properties[$targetIndex][index]["prop"];
					if(prop == "scaleX" || prop == "scaleY" || prop == 'scale'){
						if(prop == 'scale'){
							setProportionalScale(_easingTargets[$targetIndex],_finalDestinies[$targetIndex][index]);
						}
					} else {
						_easingTargets[$targetIndex].style[prop]=_finalDestinies[$targetIndex][index]+getSuffix(prop);
						if(prop=="opacity"){
							_easingTargets[$targetIndex].style.filter = 'alpha(opacity='+(_finalDestinies[$targetIndex][index]*100)+')';	
						}
					}
				}
				
				if(_dispatch != null && !_dispatchFunctionExe){
					_dispatchFunctionExe = true;
					_dispatch();
				}
			}
			_endTimeout = setTimeout(finishAllAnimations,100);
		}
	}
	function stopMotion() {
		clearInterval(_timer);
	}
	function getSuffix($prop){
		var suffix;
		if($prop == 'opacity' || $prop == 'filter'){
			suffix = '';
		}else{
			suffix = 'px';	
		}
		return suffix;
	}
	function getScale($element,$scaleType){
		var scale;
		switch($scaleType){
			case 'x':
				scale = ETNIA.getNumericValue($element.style.width)/$element.originalWidth;
				break;
			case 'y':
				scale = ETNIA.getNumericValue($element.style.height)/$element.originalHeight;
				break;
		}
		return scale;
	}
	function setProportionalScale($element,$scaleValue){
		$element.style.width = ($element.originalWidth * $scaleValue)+'px';
		$element.style.height = ($element.originalHeight * $scaleValue)+'px';
	}
	this.initEasing = function() {
		if (_timer != undefined) {
			stopMotion();
		}
		if(_endTimeout != undefined){
			clearTimeout(_endTimeout);	
		}
		_timer = setInterval(motion,_timerSpeed);
	}
	this.updateMotion = function($targets,$properties,$finalDestinies,$speeds,$dispatch,$timerSpeed) {
		if($dispatch!=undefined){
			_dispatch = $dispatch;
		}
		_easingTargets = $targets;
		_timerSpeed = $timerSpeed;
		_properties = $properties;
		_finalDestinies = $finalDestinies;
		_speeds = $speeds;
		_dispatchFunctionExe = false;
		for(var s = 0; s < _easingTargets.length; s++){
			_easingTargets[s].easingComplete = false;
			setPropInitialValues(false,s);
		}
		this.initEasing();
	}
	this.setSingleProperty=function($prop,$finalDestiny,$speed){
		var currentValue;
		if($prop == "scaleX" || $prop == "scaleY" || $prop == 'scale'){
			if($prop == 'scale'){
				currentValue = getScale(_easingTargets[0],'x');
				currentValue = $finalDestiny;
				for(var s = 0; s < _easingTargets.length; s++){
					setProportionalScale(_easingTargets[s],currentValue);
				}
			}
		} else {
			currentValue = ETNIA.getNumericValue(ETNIA.css(_easingTargets[0],$prop));
			currentValue = $finalDestiny;
			for(var d = 0; d<_easingTargets.length; d++){
				_easingTargets[d].style[$prop] = String(currentValue+getSuffix($prop));
				if($prop == "opacity"){
					_easingTargets[d].style.filter = 'alpha(opacity='+(currentValue*100)+')';	
				}
			}
		}	
	}
	this.stopEasing = stopMotion;
	EtniaEasing();
}
ETNIA.EtniaCarousel=function($parentContainer,$elementsURL,$numbOfElemsToMove,$speed,$styles,$elemsInfo,$carouselType, $elementTag){
	this._classScope = this;
	var _parentContainer = $parentContainer;
	var _elementsURL = $elementsURL;
	var _numbOfElementsToMove = $numbOfElemsToMove;
	var _speed = $speed;
	var _styles = $styles;
	var _mainContainer;
	var _elementsContainerBackground;
	var _elementsContainer;
	var _elementsWrapper;
	var _leftArrow;
	var _rightArrow;
	var _rightBlocker;
	var _leftBlocker;
	var _carouselElements = new Array();
	var _xSeparation = $elemsInfo.xSeparation;
	var _xPos = 0;
	var _yPos = 0;
	var _carouselInterval;
	var _singleElementWidth;
	var _borderSize = $elemsInfo.borderSize || 1;
	var _currentCountClicks = 1;
	var _direction;
	var _carouselType = $carouselType;
	this.carrouselElements = function(){
		return _carouselElements;
	}
	this.currentCountClicks = function($currentCount){
		_currentCountClicks = $currentCount;
		if(_currentCountClicks<=1){
			_leftArrow.style.visibility = "hidden";
			_rightArrow.style.visibility = "visible";
		} else if(_currentCountClicks>=_carouselElements.length/_numbOfElementsToMove){
			_leftArrow.style.visibility = "visible";
			_rightArrow.style.visibility = "hidden";
		} else {
			_leftArrow.style.visibility = "visible";
			_rightArrow.style.visibility = "visible";
		}
	}
	function EtniaCarousel(){
		_mainContainer = ETNIA.createDOMNode("div",{className:_styles.mainContainerStyle});
		_parentContainer.appendChild(_mainContainer);
		if(_styles.elementsContainerBackground){
			_elementsContainerBackground = 	ETNIA.createDOMNode("div",{className:_styles.elementsContainerBackground});
			_mainContainer.appendChild(_elementsContainerBackground);
		}
		_elementsContainer =  ETNIA.createDOMNode("div",{className:_styles.elementsContainer});
		_leftArrow =  ETNIA.createDOMNode("a",{className:_styles.leftArrowStyle});
		_leftArrow.href = "";
		_rightArrow =  ETNIA.createDOMNode("a",{className:_styles.rightArrowStyle});
		_rightArrow.href = "";
		_rightBlocker = ETNIA.createDOMNode("a",{className:_styles.rightBlocker});
		_rightBlocker.href = "";
		if(_styles.leftBlocker){
			_leftBlocker = ETNIA.createDOMNode("a",{className:_styles.leftBlocker});
			_leftBlocker.href = "";
			_mainContainer.appendChild(_leftBlocker);
		}
		_elementsWrapper= ETNIA.createDOMNode("div",{className:_styles.carouselElementWrapper});
		_mainContainer.appendChild(_leftArrow);
		_mainContainer.appendChild(_elementsContainer);
		_elementsContainer.appendChild(_elementsWrapper);
		_mainContainer.appendChild(_rightBlocker);
		_mainContainer.appendChild(_rightArrow);
		_elementsWrapper.left = "0px";
		_leftArrow.style.visibility = "hidden";
		createCarouselElements();
		setArrowsEvents();
	}
	function setArrowsEvents(){
		attachEventListener(_leftArrow,'click',ETNIA.eventHandler(arrowButtonsManager,"left",true));
		attachEventListener(_rightBlocker,'click',ETNIA.eventHandler(null,null,true));
		attachEventListener(_rightArrow,'click',ETNIA.eventHandler(arrowButtonsManager,"right",true));
		attachEventListener(_rightBlocker,'focus',ETNIA.eventHandler(clearFocus,null,true));
		if(_leftBlocker){
			attachEventListener(_leftBlocker,'click',ETNIA.eventHandler(null,null,true));
			attachEventListener(_leftBlocker,'focus',ETNIA.eventHandler(clearFocus,null,true));
		}
		attachEventListener(_rightArrow,'focus',ETNIA.eventHandler(clearFocus,null,true));
		attachEventListener(_leftArrow,'focus',ETNIA.eventHandler(clearFocus,null,true));
	}
	function clearFocus($event){
		$event.currentTarget.blur();	
	}
	function createCarouselElements(){
		for(var i = 0; i<_elementsURL.length; i++){
			var element; 
			if(!$elementTag){	
				element = document.createElement('img');
				element.src = _elementsURL[i]
			} else{
				element = document.createElement($elementTag);
			}
			element.className = $styles.carouselElement;
			_carouselElements.push(element);
			_elementsWrapper.appendChild(element);
			if(_carouselType == "horizontal"){
				element.style.left = _xPos+'px';
				_xPos+=$elemsInfo.imageWidth+_xSeparation;
			} else if(_carouselType == "vertical"){
				element.style.top = _yPos+'px';
				_yPos+=$elemsInfo.imageHeight+_ySeparation;
			} else {
				element.style.left = _xPos+'px';
				element.style.top = _yPos+'px';
			}
		}
		_singleElementWidth=($elemsInfo.imageWidth+_xSeparation)
	}
	function arrowButtonsManager($event,$direction){
		_direction = $direction;
		if(_direction=='left'){
			_rightArrow.style.visibility = "visible";
			arrowsClickActions(_direction)
			_currentCountClicks--;
			if(_currentCountClicks<=1){
				_leftArrow.style.visibility = "hidden";	
			}
		} else if(_direction=='right'){
			if(_currentCountClicks<(_carouselElements.length/_numbOfElementsToMove)){
				_leftArrow.style.visibility = "visible";
				arrowsClickActions(_direction)
				_currentCountClicks++;
				if(_currentCountClicks>=_carouselElements.length/_numbOfElementsToMove){
					_rightArrow.style.visibility = "hidden";
				}
			}
		}
	}
	function animateElementContainer($destiny){
		var currentPos = ETNIA.getNumericValue(_elementsWrapper.style.left);
		if(_carouselInterval!=undefined){
			clearInterval(_carouselInterval);	
		}
		_carouselInterval = setInterval(animate,33.33)
		function animate(){
			if(_direction=='left'){
				currentPos+=$speed;
				if(currentPos>$destiny){
					currentPos = $destiny;
					clearInterval(_carouselInterval)
				} 
			} else if(_direction=='right'){
				currentPos-=$speed;
				if(currentPos<$destiny){
					currentPos = $destiny;
					clearInterval(_carouselInterval)
				} 
			}
			_elementsWrapper.style.left = currentPos + "px";
		}
	}
	function arrowsClickActions($direction){
		if($direction == "left"){
			var currentPos = -((_singleElementWidth*_numbOfElementsToMove)*(_currentCountClicks-1));
			animateElementContainer(currentPos+(_singleElementWidth*_numbOfElementsToMove));
		} else if($direction == "right"){
			animateElementContainer(-((_singleElementWidth*_numbOfElementsToMove)*_currentCountClicks));	
		}
	}
	this.arrowsClickActions = function($clickAction){
		arrowsClickActions = $clickAction;	
	}
	this.setArrowsOverEvents = function($mouseOverEventHandler,$mouseOutEventHandler){
		attachEventListener(_leftArrow,'mouseover',$mouseOverEventHandler);
		attachEventListener(_leftArrow,'mouseout',$mouseOutEventHandler);	
	}
	EtniaCarousel();
}


var BUICKMX = BUICKMX || {};
BUICKMX.GalleryCarousel=function($parentContainer,$elementsURL,$numbOfElemsToMove,$speed,$styles,$elemsInfo,$carouselType){
	_classScope = this;
	var _carrouselElements;
	var _currentElementIndex = 0; 
	var _lastElementIndex = 0; 
	var _currentElement;
	var _lastElement;
	var _currentEasing;
	var _lastEasing;
	var _onCarouselChange = function(){};
	
	this.currentElementIndex = function(){
		return _currentElementIndex;	
	}
	this.onCarouselChange = function($handler){
		_onCarouselChange = $handler;	
	}
	
	function GalleryCarousel(){
		_classScope.constructor.uber.constructor($parentContainer,$elementsURL,$numbOfElemsToMove,$speed,$styles,$elemsInfo,$carouselType);
		_classScope.arrowsClickActions(arrowsClickActions);
		_carrouselElements = _classScope.carrouselElements();
		_currentElement = _carrouselElements[_currentElementIndex];
		_currentElement.style.opacity = "1";
		removeAlphaFilter();	
	}
	function arrowsClickActions ($direction){
		if($direction == "left"){
			_currentElementIndex--;
		} else if($direction == "right"){
			_currentElementIndex++;
		}
		_classScope.changeMediaInDisplay(_currentElementIndex);
	}
	
	this.changeMediaInDisplay = function($index){
		_currentElementIndex = $index;
		_lastElement = _currentElement;
		_currentElement = _carrouselElements[_currentElementIndex];
		fadeElements();
		_onCarouselChange();	
	}
	
	function removeAlphaFilter(){
		_currentElement.style.filter = "";
	}
	
	function fadeElements(){
		for(var i= 0; i<_carrouselElements.length; i++){
			if(_carrouselElements[i] != _lastElement && _carrouselElements[i] != _currentElement){
				_carrouselElements[i].style.opacity = "0"; 
				_carrouselElements[i].style.filter = "alpha(opacity=0)";
			}
		}
		
		if(!_lastEasing){
			_lastEasing = new ETNIA.EtniaEasing([_lastElement],[[{prop:"opacity"}]],[[0]],[[3]],null,33.33,true);
		} else {
			_lastEasing.updateMotion([_lastElement],[[{prop:"opacity"}]],[[0]],[[3]],null,33.33)
		}
		if(!_currentEasing){
			_currentEasing = new ETNIA.EtniaEasing([_currentElement],[[{prop:"opacity"}]],[[1]],[[3]],removeAlphaFilter,33.33,true);
		} else {
			_currentEasing.stopEasing();
			_currentEasing.updateMotion([_currentElement],[[{prop:"opacity"}]],[[1]],[[3]],removeAlphaFilter,33.33)
		}	
	}
	
	GalleryCarousel();
}
ETNIA.extend(BUICKMX.GalleryCarousel,ETNIA.EtniaCarousel);

BUICKMX.GalleryMenu = function($elements,$selectedOption,$dispatchActions){
	var _classScope = this;
	function GalleryMenu(){
		_classScope.constructor.uber.constructor($elements,$selectedOption,$dispatchActions);
		_classScope.onOptionOver(ETNIA.eventHandler(overStatus,"over",true));
		_classScope.onOptionOut(ETNIA.eventHandler(overStatus,"out",true));
		_classScope.setEvents(true,$selectedOption);
	}
	function overStatus($event,$status){
		var tgt = $event.currentTarget;
		var bullet = etGBT(tgt,"img")[0];
		if($status == "over"){
			bullet.src = "../../images/menuOverGray.gif";
		} else if($status == "out"){
			bullet.src = "../../images/menuArrowOverBlue.gif";	
		}
	}
	GalleryMenu();
}
ETNIA.extend(BUICKMX.GalleryMenu,ETNIA.SimpleMenu);
BUICKMX.ThumbsMenu = function($elements,$selectedOption,$dispatchActions){
	var _classScope = this;
	var _onElementChanged = function(){};
	
	this.onElementChanged = function($handler){
		_onElementChanged = $handler;	
	}
	
	function ThumbsMenu(){
		_classScope.constructor.uber.constructor($elements,$selectedOption,$dispatchActions);
		_classScope.onOptionClicked(ETNIA.eventHandler(thumbClicked,null,true));
		_classScope.onResetElements(resetAction);
		_classScope.setEvents(true,0);
	}
	function thumbClicked($event){
		var tgt = $event.currentTarget;
		_classScope.selectElement(tgt);
		_onElementChanged();
	}
	this.selectElement = function($target){
		_classScope.resetElems();
		_classScope.currentElementSelected($target.getAttribute("posInMenu"));
		_classScope.removeEventsFrom($target);
		$target.id = "selected";	
	}
	function resetAction($target){
		_classScope.addEventsToIndex(_classScope.currentElementSelected());
		$target.id = "";
	}
	ThumbsMenu();
}
ETNIA.extend(BUICKMX.ThumbsMenu,ETNIA.SimpleMenu);


BUICKMX.GalleryManager = function($carouselContainer,$carouselElementsURL,$carouselNumbOfElemsToMove,$carouselSpeed,$carouselStyles,$carouselElemsInfo,$carouselType,$menuElements,$menuDispatchActions,$menuSelectOption,$mediaDescriptionContainer,$mediaThumbsContainer){
	var _classScope = this;
	var _mediaCarousel;
	var _galleryMenu;
	var _mediaDescriptionContainer = $mediaDescriptionContainer;
	var _mediaThumbsContainer = $mediaThumbsContainer;
	var _thumbsMenu;
	
	function GalleryManager(){
		initGalleryCarousel();
		initMenu();
		initThumbnails();
		updateDescription(0);
	}
	function initGalleryCarousel(){
		_mediaCarousel = new BUICKMX.GalleryCarousel($carouselContainer,$carouselElementsURL,$carouselNumbOfElemsToMove,$carouselSpeed,$carouselStyles,$carouselElemsInfo,$carouselType);
		_mediaCarousel.onCarouselChange(updateThumbAndDescription);
	}
	function initMenu(){
		_galleryMenu = new BUICKMX.GalleryMenu($menuElements,$menuSelectOption,$menuDispatchActions);
	}
	function initThumbnails(){
		var thumbsButtons = etGBT(_mediaThumbsContainer,"a");
		_thumbsMenu = new BUICKMX.ThumbsMenu(thumbsButtons);
		_thumbsMenu.onElementChanged(updateMediaCarousel);
	}
	function updateThumbAndDescription(){
		_thumbsMenu.selectElement(_thumbsMenu.getElementByIndex(_mediaCarousel.currentElementIndex()));
		updateDescription(_mediaCarousel.currentElementIndex());
	}
	function updateMediaCarousel(){
		_mediaCarousel.currentCountClicks(Number(_thumbsMenu.currentElementSelected())+1);
		_mediaCarousel.changeMediaInDisplay(_thumbsMenu.currentElementSelected());	
	}
	function updateDescription($descIndex){
		var descriptions = etGBT(_mediaDescriptionContainer,"li");
		for(var i=0; i < descriptions.length; i++){
			descriptions[i].style.display = "none";	
		}
		descriptions[$descIndex].style.display = "block";	
	}
	
	GalleryManager();
}

BUICKMX.ColorSectionManager = function($menuElements,$menuDispatchActions,$menuSelectOption,$flashGalleryContainer){
	var _classScope = this;
	var _galleryMenu;
	var _flashGalleryContainer = $flashGalleryContainer;
	
	function ColorSectionManager(){
		initMenu();
	}
	function initMenu(){
		_galleryMenu = new BUICKMX.GalleryMenu($menuElements,$menuSelectOption,$menuDispatchActions);
		attachEventListener(_flashGalleryContainer,"focus",ETNIA.eventHandler(clearFocus,null,true));
	}
	function clearFocus($event){
		$event.currentTarget.blur();	
	} 
	ColorSectionManager();
}


BUICKMX.VehiclesMenu = function($infoContainer,$menuInfo,$imagesPath){
	var _classScope = this;
	var _hideTimeOut;
	var _showTimeOut;
	var _panelHideTimeOut;
	var _panelShowTimeOut;
	var _topPart;
	var _optionsContainer;
	var _infoContainer = $infoContainer;
	var _menuOptions;
	var _panelHotSpot;
	var _currenOptionIndex;
	var _panelTitle = etGt("VMInfoPanelCarTitle");
	var _panelImage = etGt("vMInfoPanelCar");
	var _panelPrice = etGt("VMInfoPanelCarPrice");
	var _panelOverviewButton = etGt("VMModelOverviewBtn");
	var _panelOverviewButton2 = etGt("VMModelOverviewBtn2");
	var _panelRequestButton = etGt("VMRequestQuoteBtn");
	var _imagesPath = $imagesPath
	this.hideDelay = 300;
	this.showDelay = 200;
	
	function VehiclesMenu(){
		var vehiclesMenu = etGt("vehicleHandler");
		_panelHotSpot = ETNIA.createDOMNode("div",{id:"VMHotspotPanel"});
		_topPart = etGt("subMenuTopPart");
		_infoContainer.style.visibility = "hidden";
		_optionsContainer = etGt("subMenuWrapper");
		_optionsContainer.style.visibility = "hidden";
		_menuOptions = etGBT(_optionsContainer,"li");
		attachEventListener(vehiclesMenu,"mouseover",ETNIA.eventHandler(showMenu,null,true));
		attachEventListener(vehiclesMenu,"mouseout",ETNIA.eventHandler(hideMenu,null,true));
		attachEventListener(_infoContainer,"mouseover",ETNIA.eventHandler(showPanel,null,true));
		for(var i = 0; i<_menuOptions.length; i++){
			_menuOptions[i].setAttribute("posInMenu",i);
			_menuOptions[i].setAttribute("model",$menuInfo[i].modelName);
			_menuOptions[i].setAttribute("modelImage",$menuInfo[i].img);
			_menuOptions[i].setAttribute("price",$menuInfo[i].price);
			_menuOptions[i].setAttribute("overviewLabel",$menuInfo[i].overviewLabel);
			attachEventListener(_menuOptions[i],"mouseover",ETNIA.eventHandler(showPanel,null,true));
			attachEventListener(_menuOptions[i],"mouseout",ETNIA.eventHandler(hidePanel,null,true));	
		} 
	}
	
	function showPanel($event){
		if(_panelHideTimeOut)
			clearTimeout(_panelHideTimeOut);
		var tgt = $event.currentTarget;
		_panelShowTimeOut = setTimeout(function(){optionOver(tgt);},250);
		if(tgt == _infoContainer){
			etGBT(_menuOptions[_currenOptionIndex],"a")[0].className = "selected";	
		}
	}
	function optionOver(tgt){
		_infoContainer.style.visibility = "visible";
		if(tgt != _infoContainer){
			resetLastOption();
			_currenOptionIndex = tgt.getAttribute("posInMenu");
			_panelTitle.innerHTML = tgt.getAttribute("model");
			_panelPrice.innerHTML = tgt.getAttribute("price");
			_panelImage.src = _imagesPath+tgt.getAttribute("modelImage");
			//_panelOverviewButton.innerHTML = tgt.getAttribute("overviewLabel");
			if(tgt.getAttribute("posInMenu") == 1){
				_panelRequestButton.style.display = "none"
				_panelOverviewButton.style.display = "none";
				_panelOverviewButton2.style.visibility = "visible";
			} else {
				_panelOverviewButton.style.display = "block";
				_panelRequestButton.style.display = "block";
				_panelOverviewButton2.style.visibility = "hidden";
			}
			Cufon.refresh("h2");
		} 
		
	}
	
	function hidePanel($event){
		if(_panelShowTimeOut)
			clearTimeout(_panelShowTimeOut);
		_panelHideTimeOut = setTimeout(function(){_infoContainer.style.visibility = "hidden";},200);
	}
	
	function showMenu($event){
		var eTarget = $event.currentTarget;
		clearTimeout(_hideTimeOut);
		_showTimeOut = setTimeout(showDisplay,_classScope.showDelay);
		function showDisplay(){
			_topPart.style.visibility = "visible";
			_optionsContainer.style.visibility = "visible";			
		}
	}
	function hideMenu($event){
		var eTarget = $event.currentTarget;
		clearTimeout(_showTimeOut);
		_hideTimeOut = setTimeout(hideDisplay,_classScope.hideDelay);
		function hideDisplay(){
			_topPart.style.visibility = "hidden";
			_optionsContainer.style.visibility = "hidden";
			_infoContainer.style.visibility = "hidden";
			_panelOverviewButton2.style.visibility = "hidden";
			resetLastOption();
		}
	}
	
	function resetLastOption(){
		for(var i = 0; i<_menuOptions.length; i++){
			etGBT(_menuOptions[i],"a")[0].className = "";
			Cufon.replace(etGBT(_menuOptions[i],"a")[0], {
				hover: true
			});	
		}
		/*if(_currenOptionIndex){
			etGBT(_menuOptions[_currenOptionIndex],"a")[0].className = "";
			Cufon.replace(_menuOptions[_currenOptionIndex], {
				hover: true
			});
		}*/
	}
	VehiclesMenu();
}


BUICKMX.FeaturesPanel = function($optionsList, $panelMainContainer, $imagesPath, $imagesURL){
	var _classScope=this;
	var _panelImage;
	var _panelTitle;
	var _panelTextElements;
	var _panelClose;
	var _panelCollapse;
	var _panelFeaturesBtns = $optionsList.getElementsByTagName('a');
	var _panelMainContainer = $panelMainContainer;
	var _currentDisplayIndex = 0;
	var _imagesURL=$imagesURL;
	var _imagesPath  = $imagesPath;
	var _descriptionEasing;
	var _descriptionVisible;
	var _descriptionsContainer = etGBT(_panelMainContainer,"ul")[0];
	var _videoPlayerMovie = swfobject.getObjectById("videoPlayerFlash");
	var _videoPlayerInterval;
	
	function FeaturesPanel(){
		_descriptionVisible = true;
		_panelTextElements =_panelMainContainer.getElementsByTagName('li');
		_panelTitle = _panelMainContainer.getElementsByTagName('h4');
		_panelImage = etGt('featureImage');
		_panelClose = etGt('featureClose');
		_panelCollapse = etGt('featureCollapse');
		_panelTextElements[_currentDisplayIndex].style.display="block";
		_panelTitle[_currentDisplayIndex].style.display="block"
		setEvents();
		_panelMainContainer.style.display = "none";
	}
	function setEvents(){
		for(var i=0; i<_panelFeaturesBtns.length; i++){
			_panelFeaturesBtns[i].btnPosition=i;
			attachEventListener(_panelFeaturesBtns[i], "click", ETNIA.eventHandler(onFeatureClicked,null,true), false);
		}
		attachEventListener(_panelClose, "click",function($event){panelVisibilityControl("none")}, false);
		attachEventListener(_panelCollapse, "click",ETNIA.eventHandler(hideDescription,null,true));
	}
	function onFeatureClicked($event){
		var targetIndex = $event.currentTarget.btnPosition;
		updatePanelInfo(targetIndex);	
	}
	function panelVisibilityControl($display){
		if($display == "none"){resetElements()}
		_panelMainContainer.style.display = $display;
		
	}
	function hideDescription($event){
		var animDestiny;
		if(_descriptionVisible){
			animDestiny = 270;
			_descriptionVisible = false;
			_panelCollapse.style.backgroundPosition = "0px -14px";
		} else {
			animDestiny = 0;
			_descriptionVisible = true;
			_panelCollapse.style.backgroundPosition = "0px 0px";
		}
		if(!_descriptionEasing)
			_descriptionEasing = new ETNIA.EtniaEasing([_descriptionsContainer],[[{prop:"top"}]],[[animDestiny]],[[2]],null,33.33,true);
		else 
			_descriptionEasing.updateMotion([_descriptionsContainer],[[{prop:"top"}]],[[animDestiny]],[[2]],null,33.33)
	}
	function updatePanelInfo($elementIndex){
		if(!$elementIndex){
			$elementIndex = 0;
		}
		panelVisibilityControl("block")
		resetElements();
		_panelTextElements[$elementIndex].style.display = "block";
		_panelTitle[$elementIndex].style.display = "block";
		_panelFeaturesBtns[$elementIndex].className = "formatList";
		Cufon.replace(document.getElementById("featuresButtonsContainer"), {
			hover: true
		});
		_panelFeaturesBtns[$elementIndex].style.display = "block";
		
		if(_imagesURL[$elementIndex].indexOf(".flv")!=-1){
			etGt("videoPlayer").style.display="block"
			hideDescription();
			//swfobject.registerObject("videoPlayerFlash");
			setTimeout(function(){loadVideo(_imagesURL[$elementIndex])}, 100);
			
			
		}else{
			if (_videoPlayerMovie){
				if(_videoPlayerMovie.externalClean){
			_videoPlayerMovie.externalClean();
				}
			}
			
			setTimeout(function(){etGt("videoPlayer").style.display="none"}, 100);
			
		_panelImage.style.backgroundImage = "url("+_imagesPath+_imagesURL[$elementIndex]+")";	
		}
		
	}
	function videoPlayerReady(){
		_videoPlayerInterval = setInterval;
	}
	
	function loadVideo($url){
		_videoPlayerMovie = swfobject.getObjectById("videoPlayerFlash")
		if(_videoPlayerMovie.externalLoad){
		_videoPlayerMovie.externalLoad($url);
		} else{
			_videoPlayerInterval = setInterval(function(){if(_videoPlayerMovie.externalLoad){clearInterval(_videoPlayerInterval);loadVideo($url)}},500)
		}
	}
	
	
	
	function resetElements(){
		_descriptionsContainer.style.top = "0px";
		_panelCollapse.style.backgroundPosition = "0px 0px";
		_descriptionVisible = true;
		for(var j=0; j<_panelTextElements.length;j++){
			_panelFeaturesBtns[j].className = "defaultFeature";
			_panelTextElements[j].style.display = "none";
			_panelTitle[j].style.display = "none";
		}
	}
	FeaturesPanel();
}

BUICKMX.ScrollListCarousel = function($mainContainer){
	var _classScope = this;	
	var _mainContainer = $mainContainer;
	var _topArrow = etGt("featuresTopArrow");
	var _bottomArrow = etGt("featuresBottomArrow");
	var _topHotSpot = etGt("featuresTopHS");
	var _bottomHotSpot = etGt("featuresBottomHS");
	var _listContainer = etGt("featuresButtonsContainer");
	var _listDestiny = 0;
	var _speed = 5;
	var _maskHeight = 186-20;
	var _listInfo;
	var _continuousMotionInterval;
	var _continuousTimeout;
	var _direction;
	var _scrollDelay = 400;
	
	function ScrollListCarousel(){
		attachEventListener(_topArrow,"mousedown",ETNIA.eventHandler(startMotion,null,true));
		attachEventListener(_bottomArrow,"mousedown",ETNIA.eventHandler(startMotion,null,true));
		attachEventListener(_topArrow,"mouseup",ETNIA.eventHandler(stopMotion,null,true));
		attachEventListener(_bottomArrow,"mouseup",ETNIA.eventHandler(stopMotion,null,true));
		attachEventListener(_topArrow,"mouseout",ETNIA.eventHandler(stopMotion,null,true));
		attachEventListener(_bottomArrow,"mouseout",ETNIA.eventHandler(stopMotion,null,true));
		attachEventListener(_topHotSpot,"mouseover",ETNIA.eventHandler(startMotion,null,true));
		attachEventListener(_topHotSpot,"mouseout",ETNIA.eventHandler(stopMotion,null,true));
		attachEventListener(_bottomHotSpot,"mouseover",ETNIA.eventHandler(startMotion,null,true));
		attachEventListener(_bottomHotSpot,"mouseout",ETNIA.eventHandler(stopMotion,null,true));
		_listInfo = Position.get(_listContainer);
	}
	function startMotion($event){
		var tgt = $event.currentTarget;
		if(tgt == _topArrow || tgt == _topHotSpot){
			_direction = "bottom";
		} else {
			_direction = "top";
		}
		moveElements(_direction);
		if(tgt == _topHotSpot || tgt == _bottomHotSpot){
			_continuousTimeout = setTimeout(startContinousMotion,10);
		} else {
			_continuousTimeout = setTimeout(startContinousMotion,_scrollDelay);	
		}
		
	}
	function stopMotion($direction){
		if(_continuousTimeout)
			clearTimeout(_continuousTimeout);
		if(_continuousMotionInterval)
			clearInterval(_continuousMotionInterval);
	}
	function startContinousMotion(){
		_continuousMotionInterval = setInterval(moveElements,33.33);
	}
	function moveElements(){
		if(_direction == "top"){
			arrowEnabled(_topArrow,true);
			_listDestiny-=_speed;
			if(_listDestiny<-_listInfo.height+_maskHeight){
				_listDestiny = -_listInfo.height+_maskHeight;
				arrowEnabled(_bottomArrow,false);
			}
		} else {
			arrowEnabled(_bottomArrow,true);
			_listDestiny+=_speed;
			if(_listDestiny>0){
				_listDestiny = 0;
				arrowEnabled(_topArrow,false);
			}
		}
		_listContainer.style.top = _listDestiny+"px";
	}
	function arrowEnabled($arrow,$enabled){
		if(!$enabled){
			$arrow.style.opacity = ".4";
		} else {
			$arrow.style.opacity = "1";
		}
	}
	ScrollListCarousel();
}

BUICKMX.FlashFormsManager = function($flashContainer,$flashObj,$dispatchersInfo,$swfPath){
	var _classScope = this;
	var _dipatchersInfo = $dispatchersInfo;
	var _buttons;
	var _flashContainer = $flashContainer;
	var _flashObj;
	var _flashObjHMargin =20;
	var _swfPath = $swfPath;
	var _deepLinkInterval;
	
	function FlashFormsManager(){
		_buttons = new Array();
		initButtons();
		openDeepLink();
	}
	function initButtons() {
		for(var i = 0; i<_dipatchersInfo.length; i++){
			var button = etGt(_dipatchersInfo[i].btnId);
			button.setAttribute("formURL",$dispatchersInfo[i].formURL);
			button.setAttribute("formWidth",$dispatchersInfo[i].width);
			button.setAttribute("formHeight",$dispatchersInfo[i].height);
			button.setAttribute("hPos",$dispatchersInfo[i].hPos);
			button.setAttribute("vPos",$dispatchersInfo[i].vPos);
			attachEventListener(button,"click",ETNIA.eventHandler(showForm,null,true),false);
			_buttons.push(button);
		}	
	}
	function showForm($event){
		
		var tgt = $event.currentTarget;
		var formH = tgt.getAttribute("formHeight");
		var formW = tgt.getAttribute("formWidth");
		var transformInfo = Position.get(tgt);
		_flashContainer.style.display = "block";
		_flashObj = swfobject.getObjectById( $flashObj);
		_flashObj.width = formW;
		_flashObj.height = formH;
		_flashContainer.style.width =formW + "px";
		_flashContainer.style.height =formH + "px";
		
		if(tgt.getAttribute("vPos") == "top"){
			var topDestiny = transformInfo.top - (Number(formH)+15);
			_flashContainer.style.top = topDestiny + "px";
		} else {
			var topDestiny = transformInfo.top + Number(transformInfo.height) +8;
			_flashContainer.style.top = topDestiny + "px";	
		}
		if(tgt.getAttribute("hPos") == "left"){
			_flashContainer.style.left = (transformInfo.left-_flashObjHMargin) + "px";
		} else if(tgt.getAttribute("hPos") == "right"){
			var lDestiny = ((transformInfo.left+transformInfo.width)-Number(formW))+15;
			_flashContainer.style.left = lDestiny + "px";
		} else {
			var leftDestiny = (transformInfo.left + (transformInfo.width/2))-(Number(formW)/2);
			_flashContainer.style.left = leftDestiny + "px";
		}
		setTimeout(function(){_flashObj.initLoad(_swfPath+tgt.getAttribute("formURL"));},300);
	}
	
	function openDeepLink(){
		_deepLinkInterval = setInterval(validateDeepLink,500);
	}
	
	function validateDeepLink(){
		if(swfobject.getObjectById( $flashObj)){
			var id = Number(swfobject.getQueryParamValue("formID"));
			if(id != "" && id!=null && id != undefined){
				if(id>=0 && id<=_dipatchersInfo.length-1){
					showForm({currentTarget:etGt(_dipatchersInfo[id].btnId)})
				}
			}
			clearInterval(_deepLinkInterval);
		}
	}
	
	
	this.hideFormPanel = function(){
		_flashContainer.style.left = "-100%"	
	}
	FlashFormsManager();
}

BUICKMX.RollOverMenu = function($menuParent,$menuInfo,$styles){
	var _classScope = this;
	var _menuParent = $menuParent;
	var _menuInfo = $menuInfo;
	var _colorBackground;
	var _menuContainer;
	var _listContainer;
	var _hideTimeOut;
	var _showTimeOut;
	var _styles = $styles;
	this.hideDelay = 500;
	this.showDelay = 200;
	
	function RollOverMenu(){
		_menuContainer = ETNIA.createDOMNode("div",{id:_styles.menuContainer});
		_listContainer = ETNIA.createDOMNode("ul",{id:_styles.mainList});
		_colorBackground = ETNIA.createDOMNode("div",{className:_styles.background});
		for(var i=0; i<_menuInfo.length; i++){
			_listContainer.appendChild(menuOption(_menuInfo[i].id,_menuInfo[i].url,_menuInfo[i].label));	
		}
		_menuContainer.appendChild(_listContainer);
		_menuParent.appendChild(_colorBackground);
		_menuParent.appendChild(_menuContainer);
		Cufon.replace(document.getElementById(_menuParent.id), {
			hover: true
		});
		
		attachEventListener(etGBT(_menuParent,"a")[0],"click",ETNIA.eventHandler(function(){},null,true));
		attachEventListener(_menuParent,"mouseover",ETNIA.eventHandler(showMenu,null,false));
		attachEventListener(_menuParent,"mouseout",ETNIA.eventHandler(hideMenu,null,false));
	}
	function showMenu(){
		if(_hideTimeOut)
			clearInterval(_hideTimeOut);	
		_showTimeOut = setTimeout(function(){_menuContainer.style.display = "block";_colorBackground.style.display = "block"},_classScope.showDelay);
	}
	function hideMenu(){
		if(_showTimeOut)
			clearInterval(_showTimeOut);
		_hideTimeOut = setTimeout(function(){_menuContainer.style.display = "none";_colorBackground.style.display = "none"},_classScope.hideDelay);	
	}
	
	function menuOption($id,$url,$label){
		var menuLi = ETNIA.createDOMNode("li",{});
		var liAnchor = ETNIA.createDOMNode("a",{id:$id});
		var textLabel = document.createTextNode($label);
		liAnchor.appendChild(textLabel);
		liAnchor.href = $url;
		liAnchor.target = "_blank";
		menuLi.appendChild(liAnchor)
		return menuLi;
	}
	RollOverMenu();
}