/*** NEVER GO LIVE AH DUHhhh! ****/
var s_account = "OMNI_TEST_SACCOUNT";
var s_ea = "";
	s_ea.pageName = "OMNI_TEST_PAGENAME";

function setOmniValues() {
	
}
/*** NEVER GO LIVE AH DUHhh! ****/



/* footer popup function */
/* Legacy bug fixes */
function openFullChromeWindow(url, name){
	window.open(url, name);
}
function openPositionedWindow(url, name, width, height, x, y, status, scrollbars, moreProperties, openerName) {
	openPopup(url, name, width, height, status, scrollbars, moreProperties);
}
function openPopup(url, name, width, height, status, scrollbars, moreProperties) {
	var agent = navigator.userAgent.toLowerCase();
	var x, y = 0;
	if (screen) {
      x = (screen.availWidth - width) / 2;
      y = (screen.availHeight - height) / 2;
   }
   if (!status) status = '';

	// Adjust width if scrollbars are used (pc places scrollbars inside the content area; mac outside) 
	width += (scrollbars != '' && scrollbars != null && agent.indexOf("mac") == -1) ? 16 : 0;

	var properties = 'width=' + width + ',height=' + height + ',screenX=' + x + ',screenY=' + y + ',left=' + x + ',top=' + y + ((status) ? ',status' : '') + ',scrollbars' + ((scrollbars) ? '' : '=no') + ((moreProperties) ? ',' + moreProperties : '');
   
	window.open(url, name, properties);
	return false;
} 

/**
* Menuslider
*/
var menuSlider = new Class({
	activeSlider: null,
	chainedEffect: null,
	allSliders: new Object(),
	
	initialize: function(theSliders) {
		this.allSliders = theSliders;
				
		$each(theSliders, function(containerId,clickId) {
			if($(containerId) != null && $(clickId) != null){
				this.allSliders[clickId] = new Fx.Slide(containerId, {duration: 500, onComplete: this.fireChainedEffect.bind(this)});
				this.allSliders[clickId].hide();
				this.setSlider(clickId, this.allSliders[clickId]);
			}
		}.bind(this));
	},
	fireChainedEffect: function() {
		if(this.chainedEffect != null) {
			this.activeSlider = this.chainedEffect;
			this.activeSlider.toggle();
			this.chainedEffect = null;
		}	
	},
	setSlider: function(curId, curSlider){
		$(curId).addEvent('click', function(e){
			e = new Event(e);
			$(curSlider.element.id).setStyle("visibility","visible");
			if(this.activeSlider != null && this.activeSlider != curSlider){
				this.chainedEffect = curSlider;
				this.activeSlider.stop();
				this.activeSlider.slideOut();
			} else {
				this.activeSlider = curSlider;
				this.activeSlider.toggle();
			}
			e.stop();
		}.bind(this));	
	}
});

/*** QUICKNAV CODE ***/
var quickNav = new Class({
    initialize: function(containerID,eTrigger){
		this.navBox = $(containerID);
		if(!this.navBox) {
			return;	
		}		
		this.trigger = this.navBox.getElement('.starter');
		this.menu = this.navBox.getElement('.secondary');
		this.outerMenu = this.navBox.getElement('.triggerBox');
		this.menu.style.visibility = "visible";

		this.menuEffect = new Fx.Slide(this.menu, {
			duration: 300,
			transition: Fx.Transitions.Cubic.easeIn
		});

		this.menuEffect.hide();
		
		if (eTrigger == "hover") {
			
			this.trigger.addEvent("mouseenter", function(e) {
				this.menuEffect.stop();															 
				this.menuEffect.slideIn();
			}.bind(this));
			
			this.outerMenu.addEvent("mouseleave", function(e) {
				this.menuEffect.stop();										   
				this.menuEffect.slideOut();
			}.bind(this));


		} else if (eTrigger == "click") {
		
			this.trigger.addEvent("click", function(e) {
			this.menuEffect.toggle();
			}.bind(this));
		
		}
		

	}

});

/**
* Start GUS on domready 
*/
window.addEvent('domready', function() {
	// intialize sliders
	var mySliders = new menuSlider ({ gus_ea: 'gusEA', gus_welcome: 'gusWelcome' });
	var quickNavMenu = new quickNav('quickNav','hover');
});
