/* Browser check */
IS_DOM = (document.getElementById) ? true : false;
IS_IE = (document.all) ? true : false;
IS_IE55 = (navigator.userAgent.indexOf("IE 5.5") != -1);
IS_Mac = (navigator.appVersion.indexOf("Mac") != -1);

var menuVisible = false;
var menuDelayTime = 100;
var menuDelay;
var mouseoutDelay;

YAHOO.namespace('menuon.anim');
YAHOO.menuon.anim.init = function()
{
 var attributes = {
  width: {to: 365},
  height: {to: 308},
  opacity: { from: 0, to: 1.0 }
 };
 
 if (IS_IE55) {
  var attributes = {
   width: {to: 365},
   height: {to: 340},
   opacity: { from: 0, to: 1.0 }
  };
 }
 
 anim = new YAHOO.util.Anim('theMenuEnvelope', attributes, .5, YAHOO.util.Easing.easeBoth);
 
 var animate = function(e) {
  YAHOO.util.Event.stopEvent(e);
  clearTimeout(mouseoutDelay);
  if (!menuVisible && this.id == 'seeAllLink') {
   menuDelay = setTimeout(function() {
    anim.animate();
   }, menuDelayTime);
  }
 };
 
 var animIsComplete = function(e) {
  YAHOO.util.Event.stopEvent(e);
  menuVisible = true;
 };
 
 var animStart = function(e) {
  this.getEl().style.display = "block";
 };
 
 YAHOO.util.Event.addListener('seeAllLink', 'mouseover', animate); YAHOO.util.Event.addListener('seeAllLink', 'mouseover', formSelectOff); YAHOO.util.Event.addListener('theMenuEnvelope', 'mouseover', animate); YAHOO.util.Event.addListener('theMenuEnvelope', 'mouseover', formSelectOff);  anim.onComplete.subscribe(animIsComplete);
 anim.onStart.subscribe(animStart);
};

function formSelectOff()
{
	if (document.getElementById("sortOrder")) {
		setTimeout("turnFormOff()",menuDelayTime);
	}
}

function turnFormOff()
{
	document.getElementById("sortOrder").style.visibility = "hidden";
}

function formSelectOn()
{
	if (document.getElementById("sortOrder")) {
		document.getElementById("sortOrder").style.visibility = "visible";
	}
}

YAHOO.util.Event.addListener(window, 'load', YAHOO.menuon.anim.init);

YAHOO.namespace('menuoff.anim');
YAHOO.menuoff.anim.init = function()
{
 var attributes = {
  width: {to: 0},
  height: {to: 0},
  opacity: { to: 0 }
 };
 
 var anim = new YAHOO.util.Anim('theMenuEnvelope', attributes, .5, YAHOO.util.Easing.easeOut);  var animate = function(e) {
  YAHOO.util.Event.stopEvent(e);
  clearTimeout(menuDelay);
 
  mouseoutDelay = setTimeout(function() {
   anim.animate();
  }, 50);
 };
 
 var animIsComplete = function(e) {
  formSelectOn();
  this.getEl().style.display = "none";
  menuVisible = false;
 };
 
 YAHOO.util.Event.addListener('seeAll', 'mouseout', animate); anim.onComplete.subscribe(animIsComplete);
 
};

YAHOO.util.Event.addListener(window, 'load', YAHOO.menuoff.anim.init);
