function blockError(){return true;}
window.onerror = blockError;
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
function P7_Snap() { //v2.63 by PVII
 var x,y,ox,bx,oy,p,tx,a,b,k,d,da,e,el,tw,q0,xx,yy,w1,pa='px',args=P7_Snap.arguments;a=parseInt(a);
 if(document.layers||window.opera){pa='';}for(k=0;k<(args.length);k+=4){
 if((g=MM_findObj(args[k]))!=null){if((el=MM_findObj(args[k+1]))!=null){
 a=parseInt(args[k+2]);b=parseInt(args[k+3]);x=0;y=0;ox=0;oy=0;p="";tx=1;
 da="document.all['"+args[k]+"']";if(document.getElementById){
 d="document.getElementsByName('"+args[k]+"')[0]";if(!eval(d)){
 d="document.getElementById('"+args[k]+"')";if(!eval(d)){d=da;}}
 }else if(document.all){d=da;}if(document.all||document.getElementById){while(tx==1){
 p+=".offsetParent";if(eval(d+p)){x+=parseInt(eval(d+p+".offsetLeft"));y+=parseInt(eval(d+p+".offsetTop"));
 }else{tx=0;}}ox=parseInt(g.offsetLeft);oy=parseInt(g.offsetTop);tw=x+ox+y+oy;
 if(tw==0||(navigator.appVersion.indexOf("MSIE 4")>-1&&navigator.appVersion.indexOf("Mac")>-1)){
  ox=0;oy=0;if(g.style.left){x=parseInt(g.style.left);y=parseInt(g.style.top);}else{
  w1=parseInt(el.style.width);bx=(a<0)?-5-w1:-10;a=(Math.abs(a)<1000)?0:a;b=(Math.abs(b)<1000)?0:b;
  x=document.body.scrollLeft+event.clientX+bx;y=document.body.scrollTop+event.clientY;}}
 }else if(document.layers){x=g.x;y=g.y;q0=document.layers,dd="";for(var s=0;s<q0.length;s++){
  dd='document.'+q0[s].name;if(eval(dd+'.document.'+args[k])){x+=eval(dd+'.left');y+=eval(dd+'.top');
  break;}}}e=(document.layers)?el:el.style;xx=parseInt(x+ox+a),yy=parseInt(y+oy+b);
 if(navigator.appVersion.indexOf("MSIE 5")>-1 && navigator.appVersion.indexOf("Mac")>-1){
  xx+=parseInt(document.body.leftMargin);yy+=parseInt(document.body.topMargin);}
 e.left=xx+pa;e.top=yy+pa;}}}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
var requiredVersion = 8;   // Version the user needs to view site (max 9, min 2)
var useRedirect = false;    // Flag indicating whether or not to load a separate
                          
var flashPage   = "flash.php"    // The location of the flash movie page
var noFlashPage = "noflash.php"  // Page displayed if the user doesn't have the
                                  // plugin or we can't detect it.
var upgradePage = "upgrade.php"  // Page displayed if we detect an old plugin
var flash2Installed = false;    // boolean. true if flash 2 is installed
var flash3Installed = false;    // boolean. true if flash 3 is installed
var flash4Installed = false;    // boolean. true if flash 4 is installed
var flash5Installed = false;    // boolean. true if flash 5 is installed
var flash6Installed = false;    // boolean. true if flash 6 is installed
var flash7Installed = false;    // boolean. true if flash 7 is installed
var flash8Installed = false;    // boolean. true if flash 8 is installed
var flash9Installed = false;    // boolean. true if flash 9 is installed
var maxVersion = 9;             // highest version we can actually detect
var actualVersion = 0;          // version the user really has
var hasRightVersion = false;    // boolean. true if it's safe to embed the flash movie in the page
var jsVersion = 1.0;            // the version of javascript supported
// Check the browser...we're looking for ie/win
var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;    // true if we're on ie
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false; // true if we're on windows

jsVersion = 1.1;
if(isIE && isWin){
  document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
  document.write('on error resume next \n');
  document.write('flash2Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.2"))) \n');
  document.write('flash3Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.3"))) \n');
  document.write('flash4Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4"))) \n');
  document.write('flash5Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5"))) \n');  
  document.write('flash6Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6"))) \n');  
  document.write('flash7Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.7"))) \n');
  document.write('flash8Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.8"))) \n');
  document.write('flash9Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.9"))) \n');
  document.write('<\/SCR' + 'IPT\> \n'); 
}
function detectFlash() {  
  if (navigator.plugins) {
    if (navigator.plugins["Shockwave Flash 2.0"]
        || navigator.plugins["Shockwave Flash"]) {

      var isVersion2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
      var flashDescription = navigator.plugins["Shockwave Flash" + isVersion2].description;

      var flashVersion = parseInt(flashDescription.substring(16));

      flash2Installed = flashVersion == 2;    
      flash3Installed = flashVersion == 3;
      flash4Installed = flashVersion == 4;
      flash5Installed = flashVersion == 5;
      flash6Installed = flashVersion == 6;
      flash7Installed = flashVersion == 7;
      flash8Installed = flashVersion == 8;
      flash9Installed = flashVersion >= 9;
    }
  }

  for (var i = 2; i <= maxVersion; i++) {  
    if (eval("flash" + i + "Installed") == true) actualVersion = i;
  }

  if(navigator.userAgent.indexOf("WebTV") != -1) actualVersion = 4;  

  if (actualVersion >= requiredVersion) {

    if (useRedirect) {
      if(jsVersion > 1.0) {
        window.location.replace(flashPage);  
      } else {
        window.location = flashPage;
      }
    }
    hasRightVersion = true;                
  } else {  
    if (useRedirect) {
      if(jsVersion > 1.0) {
        window.location.replace((actualVersion >= 2) ? upgradePage : noFlashPage);
      } else {
        window.location = (actualVersion >= 2) ? upgradePage : noFlashPage;
      }
    }
  }
}

detectFlash();

function AC_AddExtension(src, ext)
{
  if (src.indexOf('?') != -1)
    return src.replace(/\?/, ext+'?'); 
  else
    return src + ext;
}

function AC_Generateobj(objAttrs, params, embedAttrs) 
{ 
  var str = '<object ';
  for (var i in objAttrs)
    str += i + '="' + objAttrs[i] + '" ';
  str += '>';
  for (var i in params)
    str += '<param name="' + i + '" value="' + params[i] + '" /> ';
  str += '<embed ';
  for (var i in embedAttrs)
    str += i + '="' + embedAttrs[i] + '" ';
  str += ' ></embed></object>';

  document.write(str);
}

function AC_FL_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
     , "application/x-shockwave-flash"
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_SW_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".dcr", "src", "clsid:166B1BCA-3F9C-11CF-8075-444553540000"
     , null
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
  var ret = new Object();
  ret.embedAttrs = new Object();
  ret.params = new Object();
  ret.objAttrs = new Object();
  for (var i=0; i < args.length; i=i+2){
    var currArg = args[i].toLowerCase();    

    switch (currArg){	
      case "classid":
        break;
      case "pluginspage":
        ret.embedAttrs[args[i]] = args[i+1];
        break;
      case "src":
      case "movie":	
        args[i+1] = AC_AddExtension(args[i+1], ext);
        ret.embedAttrs["src"] = args[i+1];
        ret.params[srcParamName] = args[i+1];
        break;
      case "onafterupdate":
      case "onbeforeupdate":
      case "onblur":
      case "oncellchange":
      case "onclick":
      case "ondblClick":
      case "ondrag":
      case "ondragend":
      case "ondragenter":
      case "ondragleave":
      case "ondragover":
      case "ondrop":
      case "onfinish":
      case "onfocus":
      case "onhelp":
      case "onmousedown":
      case "onmouseup":
      case "onmouseover":
      case "onmousemove":
      case "onmouseout":
      case "onkeypress":
      case "onkeydown":
      case "onkeyup":
      case "onload":
      case "onlosecapture":
      case "onpropertychange":
      case "onreadystatechange":
      case "onrowsdelete":
      case "onrowenter":
      case "onrowexit":
      case "onrowsinserted":
      case "onstart":
      case "onscroll":
      case "onbeforeeditfocus":
      case "onactivate":
      case "onbeforedeactivate":
      case "ondeactivate":
      case "type":
      case "codebase":
        ret.objAttrs[args[i]] = args[i+1];
        break;
      case "width":
      case "height":
      case "align":
      case "vspace": 
      case "hspace":
      case "class":
      case "title":
      case "accesskey":
      case "name":
      case "id":
      case "tabindex":
        ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
        break;
      default:
        ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
    }
  }
  ret.objAttrs["classid"] = classid;
  if (mimeType) ret.embedAttrs["type"] = mimeType;
  return ret;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function openWindow(img)
{
	var w = 850;
	var h = 800;
	var left = screen.width/2 - w/2;
	var top = screen.height/2 - h/2;
	window.open('popup2.php?img='+img,'','width='+w+',height='+h+',left='+left+',top='+top)
}
function openPic(img)
{
	var w = 800;
	var h = 780;
	var left = screen.width/2 - w/2;
	var top = screen.height/2 - h/2;
	if(img==1)
	window.open('images/floorplan/ground.html','','width='+w+',height='+h+',left='+left+',top='+top)
	else if(img==2)
	window.open('images/floorplan/17floor.html','','width='+w+',height='+h+',left='+left+',top='+top)
	else if(img==3)
	window.open('images/floorplan/811floor.html','','width='+w+',height='+h+',left='+left+',top='+top)
	else if(img==4)
	window.open('images/floorplan/mezzanine.html','','width='+w+',height='+h+',left='+left+',top='+top)
	else if(img==5)
	window.open('images/floorplan/mechanical.html','','width='+w+',height='+h+',left='+left+',top='+top)
}
/* - dropdowns - */
var d=document;
var ddSwitch = 0; // initializes menus set to off

function ddInit(){
    if (d.layers) { // Netscape
        d.captureEvents(Event.ONMOUSEMOVE);
        d.onmousemove=captureMousePosition;
    } else if (d.getElementById || d.all){ // IE or Mozilla
        d.onmousemove=captureMousePosition;
    }
}

function ddDisplaySelect(){
    /* grab ID names of all side-parcels with "nojs" and switch out with "js" */
    ddCount = d.getElementsByTagName('div');
    for(i=0;i<ddCount.length;i++){
        if(ddCount[i].className == 'nojs'){ ddHide(ddCount[i].id); }
        if(ddCount[i].className == 'js'){ ddShow(ddCount[i].id); }
    }
}
var yMousePos=0;
var yMousePosMin=0;
var yMousePosMax=0;
function captureMousePosition(e) {
   if (d.all) {
            yMousePos = window.event.y+document.body.scrollTop;
            yMousePosMin = d.body.scrollTop;
            yMousePosMax = d.body.clientHeight+d.body.scrollTop;
        } else if (d.getElementById || d.layers){
            // Mozilla, FF, & Netscape work the same in this regard
            yMousePos = e.pageY;
            yMousePosMin = window.pageYOffset;
            yMousePosMax = window.innerHeight+window.pageYOffset;
    }
}
function ddShow(menu){
    d.getElementById(menu).style.display="block";
}
function ddHide(menu){
    d.getElementById(menu).style.display="none";
}
function ddHideAll(){
    var ddFound = ddFind();
    for (i=0;i<ddFound.length;i++){
        if(d.getElementById(ddFound[i]).style.display=="block") { ddHide(ddFound[i]);}
    }
}
function ddDir(menu){
        // Fixes slow computer redraw problem
            d.getElementById(menu).style.left="-10000px";
            ddShow(menu);
        /* if IE */
        if (d.all){
            ddMenuSpaceAvail=d.documentElement.clientHeight-yMousePos;
        } else {
            ddMenuSpaceAvail=yMousePosMax-yMousePos;
        }

        if ((d.getElementById(menu).offsetHeight<ddMenuSpaceAvail) || (ddMenuSpaceAvail>(yMousePos-yMousePosMin))){ /* checks if room to open down */
            d.getElementById(menu).style.top="-1px";
        } else { /* opens up */
            d.getElementById(menu).style.top = (2-(d.getElementById(menu+'Box').offsetHeight + d.getElementById(menu).offsetHeight))+'px';
        }
        ddHide(menu);
        d.getElementById(menu).style.left="0px";
}

function ddFind(){
    /* grab ID names of all side-parcels with selectBoxes */
    ddCount = d.getElementsByTagName("div");
    j=0;
    var ddFound = new Array();
    for(i=0;i<ddCount.length;i++){
        if(ddCount[i].className == 'selectBox'){
            // assuming parent div class is same as child minus 3 letter ext
            ddFound[j] = ddCount[i].id.substring(0, (ddCount[i].id.length-3));
            j++;
        }
    }
    return ddFound;
}

function ddToggle(menu, e){
    /* kill further events */
    e.cancelBubble=true;

    // assuming parent div is same as child minus 3 letter ext, set primary menu
    menu = menu.substring(0, (menu.length-3));

    if (ddSwitch==0){
        /* if menus were initially off */
        ddDir(menu);
        ddShow(menu);
        ddSwitch=1;
    } else {
        /* if the menu was open, turn that menu off */
        if (d.getElementById(menu).style.display=="block"){
            ddHide(menu);
            ddSwitch=0;
        /* otherwise confirm/turn other menus off before displaying primary menu */
        } else {
            ddHideAll();
            ddDir(menu);
            ddShow(menu);
            ddSwitch=1;
        }
    }
}
/* - parameters set for glide menus - */
GlideParams = {
	START_SPEED : 400, // px per second
	HIDE_DELAY_MS : 250,
	SHOW_DELAY_MS : 2000, // pause before showing submenu
	ACCELERATION_OUT :  .009, // px/second/millisecond
	ACCELERATION_BACK : .0009, // px/second/millisecond
	FRAME_PAUSE : 1,
	CLICK_HIDE : false,
	CLICK_SHOW : false,
	IMG_OVER_EXT : "MO"
};

if (!(/Safari/.test(navigator.userAgent)) && !(/Linux/.test(navigator.userAgent))){
	document.write("<style type='text/css'>.menuFrame{display:block;}</style>");
}
/*****************************************************
 * GlideMenus by Garrett Smith
 * 02-22-2004 v2.1
 *****************************************************/

GM_DOMAIN = "*";
GM_CREATOR = "DHTMLKITCHEN";
GM_LICENSEE = "Cisco";

ua = new function() {
	var u = navigator.userAgent, d = document;
	this.ie = typeof d.all != "undefined";
	this.ns4 = typeof d.layers != "undefined";
	this.dom = typeof d.getElementById != "undefined";
	this.safari = /Safari/.test(u);
	this.moz = /Gecko/.test(u) && !this.safari;
	this.mie = this.ie && /Mac/.test(u);
	this.win9x = /Win9/.test(u) || /Windows 9/.test(u);
	this.o7 = /Opera 7/.test(u);
	this.supported = (typeof d.write != "undefined") && (this.ie || this.ns4 || this.dom);
	this.px = this.dom && d.compatMode != "BackCompat" || this.mie ? "px" : 0;
	this.dblThread = this.ie && this.win9x || this.safari;
};
//------------------------------------------------------------------------

if(GlideParams.CLICK_HIDE)
	document.onmousedown = function(e) {
		var am = GlideMenus.activeMenu;
		if(!am || contains(am.actuator, getTarget(e)) || contains(am.el, getTarget(e))) return;
		am.hideTree();
		GlideMenus.activeMenu = null;
	};

function showMenu(e, id, dir, adjX, adjY) {
	var menu = GlideMenu.getInstance(e, id, dir);

	if(!menu.actuator)
		menu.actuator = menu.getActuator(e);
	menu.over = true;

	if(menu.parentMenu == null) {
		var am = GlideMenus.activeMenu;
		if(am && am != menu && !am.closing()) {
			clearTimeout(am.animTimer);
			clearTimeout(am.animTimer2);
			am.hideTree();
 		}
	}

	// if this menu is scheduled to close, cancel it.
	window.clearTimeout(menu.hideTimer);

	if (menu.closing())
		menu.glideBackEnd();
	else
		clearTimeout(menu.showTimer);

	if(GlideMenus.activeMenu && GlideMenus.activeMenu == menu) return;


	GlideMenus.activeMenu = menu;
	clearTimeout(menu.showTimer);

	GlideMenu.positionFrame(menu, e, adjX, adjY);
	menu.glideOutStart(true);
};

function showSubMenu(e, parentMenuId, id, dir, adjX, adjY) {

	var menu = GlideMenu.getInstance(e, id, dir);
	if(!menu.actuator)
		menu.actuator = menu.getActuator(e);
	clearTimeout(menu.hideTimer);
	menu.over = true;
	menu.parentMenu = GlideMenus[parentMenuId];

	if(ua.ns4) adjX -= e.layerX;

	GlideMenu.positionFrame(menu, e, adjX + menu.parentMenu.w(), adjY);

	var activeMenu = menu.parentMenu.activeMenu;
	if(activeMenu != null && activeMenu != menu) {
		if(!activeMenu.opening || !activeMenu.fullyOpen()) {
			menu.showTimer = setTimeout(menu.GlideOutStartStr, GlideParams.SHOW_DELAY_MS);
		}
		else
			menu.parentMenu.activeMenu.menuInCue = menu;
		return;
	}


	clearTimeout(menu.parentMenu.hideTimer);
	if (menu.closing())
		menu.glideBackEnd();
	else if(menu.fullyClosed())
		menu.showTimer = setTimeout(menu.GlideOutStartStr, GlideParams.SHOW_DELAY_MS);
}

/** Called from onmouseout of submenu's actuator.
 * The only other function that hides a sub is
 * GlideMenu.onmouseover
 */
function hideSubMenu(id) {

	var menu = GlideMenus[id];

	clearTimeout(menu.showTimer);

	if(menu.parentMenu != null
		&& menu.parentMenu.activeMenu != null
		&& menu.parentMenu.activeMenu.menuInCue != null
		&& menu.parentMenu.activeMenu.menuInCue != menu) {
		menu.parentMenu.activeMenu.menuInCue.hide();
	}

	window.clearTimeout(menu.hideTimer);

	menu.over = false;


	// if over parentMenu,
	// this menu will be hidden by GlideMenus.onmouseout
 	if(menu.parentMenu && (!menu.parentMenu.over || GlideParams.CLICK_HIDE))
 		return;

	menu.hideTimer = window.setTimeout(menu.hideStr, GlideParams.HIDE_DELAY_MS);
}

function headerMouseover(imgName_or_element) {
	if(GlideMenus.activeMenu)
		GlideMenus.activeMenu.hideTree();

	if(typeof imgName_or_element == "string") {
		var img = document.images[imgName_or_element];
		img.lowSrc = img.src;
		img.src = img.src.replace(Exps.EXT, GlideParams.IMG_OVER_EXT+"$1");
	}
	else {
		var el = imgName_or_element;
		el.className += " hover";
	}
}

function headerMouseout(imgName_or_element) {
	if(typeof imgName_or_element == "string") {
		var img = document.images[imgName_or_element];
		img.src = img.lowSrc;
	}
	else {
		var el = imgName_or_element;
		removeClass(el, "hover");
	}
}


function actuatorMouseover(event, menuId, dir, adjX, adjY) {
	if(adjX == null) adjX = 0;
	if(adjY == null) adjY = 0;

	var tgt = event.srcElement;
	if (tgt == null){
		tgt=event.target;
	}

	if(tgt.className.search(/.*nav.*/)>-1 || GlideMenus[menuId]!=null){
		if(GlideParams.CLICK_SHOW) {
			var menu = GlideMenu.getInstance(event, menuId, dir);
			menu.getActuator(event);
			menu.hiliteHdr();
			if(GlideMenus.activeMenu )
				if(GlideMenus.activeMenu.id != menuId) {
					hideMenu(GlideMenus.activeMenu.id);
					showMenu(event, menuId, dir, adjX, adjY);
				}
				else
					GlideMenus.activeMenu.glideOutStart();
		}
		else
			showMenu(event, menuId, dir, adjX, adjY);
	}


}

function actuatorMouseout(event, menuId) {

	if(GlideParams.CLICK_SHOW) {
		var menu = GlideMenu.getInstance(event, menuId, "");
		menu.getActuator(event);
		menu.over = false;
		if(menu.fullyClosed())
			menu.unhiliteHdr();
	}
	else
		hideMenu(menuId);
}


/** Schedule menu to close after <Params.HIDE_DELAY_MS> ms, which
 *  gives the user time to cancel the action if they accidentally moused out.
 */
function hideMenu(id) {

	var menu = GlideMenus[id];

	if(menu == null || menu.frame == null) return;
	if(!menu.opening && !menu.fullyOpen()) return;
	window.clearTimeout(menu.hideTimer);
	window.clearTimeout(menu.showTimer);

	if(!menu.opening) {
		window.clearInterval(menu.animTimer);
		window.clearInterval(menu.animTimer2);
	}


	// XXX :confused:
	if(menu.activeMenu)
		 menu.activeMenu.hideTimer = window.setTimeout(menu.activeMenu.hideStr, 1100);

	menu.over = false;
	if(menu.activeMenu) return;

	if(GlideParams.CLICK_HIDE) return;

	menu.hideTimer = window.setTimeout(menu.hideStr, GlideParams.HIDE_DELAY_MS);

	clearTimeout(menu.showTimer);
}



GlideMenu = function(e, id, dir) {

	if(!ua.supported) return;

	var d = window.document;

	this.actuator = (e == null) ? null : this.getActuator(e);

	this.id = id;
	this.dir = dir;
	var fID = id + "Frame";

	this.frame = ua.dom ? d.getElementById(fID) : ua.ie ? d.all[fID] : d.layers[fID];
	if(ua.ns4 && !this.frame && d.parentLayer)
		this.frame = d.parentLayer.d.layers[fID];

	if(ua.ns4)
		this.frame.style = this.frame;

	this.el = ua.dom ? d.getElementById(id) : ua.ns4 ? this.frame.layers[id] : d.all[id];
	this.css = ua.ns4 ? this.el : this.el.style;

	if(!ua.ns4 && !ua.mie) {
		if(!ua.o7) //XXX why doesn't o7 like width: auto?
			this.css.height = this.css.width = "auto";
		this.frame.style.width = this.el.offsetWidth + "px";
	}

	// Position of menu when not shown.
	if(this.dir.indexOf("e") >= 0)
		this.startX = -this.w();
	else if(this.dir.indexOf("w") >= 0)
		this.startX = this.w();

	if(this.dir.indexOf("n") >= 0)
		this.startY = this.h();
	else if(this.dir.indexOf("s") >= 0)
		this.startY = -this.h();
	// Position of menu when fully open is always {0,0}.
	var cId = id;
	/**
	 * for some reason this is not getting called for ns4
	 */
	if(ua.ns4) {
		this.frame.captureEvents(Event.MOUSEMOVE);
		this.frame.onmousemove = function(e) {
			GlideMenu.onmouseover(cId);
			var sub;
			if((sub = GlideMenus[cId].activeMenu) == null) return;

			if(e.y > sub.actuator.y + 14 || e.y < sub.actuator.y-1
			  || e.pageX < this.x || e.pageX > this.x + this.clip.width) {

				sub.over = false;
				sub.hideTimer = setTimeout(sub.hideStr, GlideParams.HIDE_DELAY_MS);
			}
		};
	}
	else {
		this.el.onmouseover = function() { GlideMenu.onmouseover(e, cId); };
		this.el.onmouseout = function(e) { GlideMenu.onmouseout(e, cId); };
	}

	var ref = "GlideMenus."+this.id;
	this.GlideOutStartStr = ref+".glideOutStart(true)";
	this.GlideOutStr = ref+".glideOut()";
	this.GlideBackStr = ref+".glideBack()";
	this.hideStr = ref+".hide()";


	//set initial state
	this.moveTo(this.startX, this.startY);
	this.initAnimProps();

	GlideMenus[id] = this;
};

GlideMenus = { activeMenu : null };

GlideMenu.getInstance = function(e, id, dir) {
	if(GlideMenus[id] == null)
		GlideMenus[id] = new GlideMenu(e, id, dir);

	return GlideMenus[id];
};

GlideMenu.onmouseover = function(e, cId) {

		var menu = GlideMenus[cId];

		var toEl = e ? (window.event) ? window.event.toElement : e.relatedTarget : null;
 			menu.over = true;

		if(GlideParams.CLICK_HIDE) {
			if(menu.activeMenu && !menu.activeMenu.over) {

				if(contains(menu.el, toEl)) // over an item, hide the sub!
					menu.activeMenu.hide();
				else // outside the menu, set a timer on the sub.
					if(!menu.activeMenu.hideTimer)
						hideSubMenu(menu.activeMenu.id);
			}
			return;
		}

		// menu may be closing.
		// clear timers and Glide it out.
		clearTimeout(menu.hideTimer);

		if(!menu.opening && !menu.fullyOpen()) {
			clearInterval(menu.animTimer);
			clearInterval(menu.animTimer2);
			menu.glideOutStart(false);
		}

		if(menu.parentMenu){
			menu.parentMenu.over = false;
			clearTimeout(menu.parentMenu.hideTimer);
		}
	};

GlideMenu.onmouseout = function(e, cId) {
		var toEl = (window.event) ? window.event.toElement : e.relatedTarget;
		if(contains(GlideMenus[cId].el, toEl)) return;
		hideMenu(cId);
	};

GlideMenu.positionFrame = function(menu, e, adjX, adjY) {
	if(ua.ns4) return;
	if(typeof adjX == "number") {
		// mac IE does not calculate offsetWidth properly.
		if(ua.mie && menu.actuator) {
			var actuatorPaddingL = parseInt(menu.actuator.currentStyle.paddingLeft);
			if(!isNaN(actuatorPaddingL))
				adjX -= actuatorPaddingL;
		}

		var left = getPageOffset(menu.actuator, "offsetLeft");
		menu.frame.style.left = Math.round(left + adjX) + ua.px;
	}
	if(typeof adjY == "number"){
		var top = (ua.ns4 ? e.y - menu.actuator.y : getPageOffset(menu.actuator, "offsetTop"));
		var elHeight = menu.actuator.offsetHeight;
		menu.frame.style.top = Math.round(top  + adjY + elHeight) + ua.px;
	}
};


GlideMenu.prototype = {

	el : null,
	css : null,
	frame : null,

	actuator : null,
	imgSrc : null,
	hiSrc : null,

	parentMenu : null,
	activeMenu : null,
	showTimer : 0,
	hideTimer : 0,
	animTimer : 0,
	animTimer2 : 0,

	startX : 0,
	endX : 0,
	startY : 0,
	endY : 0,

	dir : "s",

	GlideOutStartStr : "",
	GlideOutStr : "",
	GlideBackStr : "",
	hideStr : "",

	opening : false,

	// is the cursor over something that keeps the menu open?
	over : false,
	GlideDist : 0,
	rx : 0,
	ry : 0,
	del: 0,


	glideOutStart : function(bActivate) {
		if(bActivate)
			this.onactivate();
		if(this.fullyOpen()) return;
		this.hiliteHdr();

		if(this.opening)
 			clearTimeout(this.hideTimer);

		this.opening = true;

		if(this.parentMenu)
			this.parentMenu.activeMenu = this;

 		this.GlideStartOffset = this.GlideDist - Math.sqrt(this.x*this.x + this.y*this.y);

		this.frame.style.visibility = "visible";

		if(this.parentMenu == null)
			GlideMenus.activeMenu = this;

		// menu may be closing at this point.
		// to avoid concurrent competing threads, clear all close timers.
		window.clearInterval(this.animTimer);
		window.clearInterval(this.animTimer2);

		this.startTime = new Date().getTime();

		this.animTimer = window.setInterval(this.GlideOutStr, this.del);
		if(ua.dblThread)
			this.animTimer2 = window.setInterval(this.GlideOutStr, this.del);
	},

	glideBackStart : function() {

		this.ondeactivate();
		this.unhiliteHdr();
		if(this.fullyClosed())
			return;


		this.opening = false;

		if(this.parentMenu && this.parentMenu.activeMenu == this)
			this.parentMenu.activeMenu = null;
 		this.GlideBackOffset = -(this.rx*this.x + this.ry*this.y);

		// menu may be opening at this point.
		window.clearInterval(this.animTimer);
		window.clearInterval(this.animTimer2);

		this.startTime = new Date().getTime();


		this.animTimer = window.setInterval(this.GlideBackStr, this.del );
		if(ua.dblThread)
			this.animTimer2 = window.setInterval(this.GlideBackStr, this.del);
	},

	glideOut : function() {
		var t = new Date().getTime() - this.startTime;
		var d = Math.ceil(GlideParams.START_SPEED/1000 * t + .5 * GlideParams.ACCELERATION_OUT * t*t)
			    + this.GlideStartOffset;
		if(d >= this.GlideDist) {
			this.moveTo(0, 0);
 			this.glideOutEnd( );
		}
		else {
 			this.moveTo(this.startX + d * this.rx, this.startY + d * this.ry);
		}
	},

	glideBack : function() {

		var t = new Date().getTime() - this.startTime;
		var d = Math.ceil(GlideParams.START_SPEED/1000 * t + .5 * GlideParams.ACCELERATION_BACK * t*t)
			   + this.GlideBackOffset;
		if(d >= this.GlideDist) {
			this.moveTo(this.startX, this.startY);
 			this.glideBackEnd( );
		}
		else {
			this.moveTo(-d * this.rx, -d * this.ry);
		}
	},

	glideOutEnd : function() {

		this.animTimer = window.clearTimeout(this.animTimer);
		this.animTimer2 = window.clearTimeout(this.animTimer2);

		if(!this.parentMenu)
			GlideMenus.activeMenu = this;

		else if(ua.ns4) // over (for ns4, but not sure how we got here).
			;//this.glideOutStart(false);
	},

	glideBackEnd : function() {
		this.animTimer = window.clearTimeout(this.animTimer);
		this.animTimer2 = window.clearTimeout(this.animTimer2);

		if(this.menuInCue && this.menuInCue.over) {
			if(this.parentMenu)
				(this.parentMenu.activeMenu = this.menuInCue).glideOutStart();

			this.menuInCue = null;
		}
		else if(!this.parentMenu && !this.menuInCue && GlideMenus.activeMenu == this && !GlideParams.CLICK_HIDE)
			GlideMenus.activeMenu = null;

	//	this.frame.style.visibility = "hidden";

		if(this.parentMenu) {
			if(!this.parentMenu.over && this.fullyClosed() && !GlideParams.CLICK_HIDE)
				this.parentMenu.glideBackStart();
			else if(this.over) // over actuator
				this.glideOutStart(false);
			if(!GlideParams.CLICK_HIDE)
				this.parentMenu = null;
		}
		if(!this.over)
			this.frame.style.visibility = "hidden";

	},

	hiliteHdr : function() {
		if(!this.actuator) return;
		var src;
		if((src = this.actuator.src) != null) {
			if(!this.imgSrc) {
				this.imgSrc = src;
				this.hiSrc = new Image().src = src.replace(Exps.EXT, GlideParams.IMG_OVER_EXT+"$1");
			}
			this.actuator.src = this.hiSrc;
		}
 		if(!ua.ns4){
			this.actuator.className = (this.actuator.className + " hover").trim();
			this.frame.style.zIndex = (this.parentMenu) ? parseInt(this.parentMenu.frame.style.zIndex) + 1 : 100;
		}
	},

	unhiliteHdr : function() {
		if(!this.actuator) return;

		if(this.actuator.src) {
			this.actuator.src = this.imgSrc;
		}
		if(!ua.ns4){
			removeClass(this.actuator, "hover");
			if(!this.parentMenu)
				this.frame.style.zIndex = "";
		}
	},

	hide : function() {

		// cursor is not over something that should keep menu open.
		if(this.over) return;

		this.activeMenu = null;
		window.clearTimeout(this.hideTimer);

		// if this menu is open, close it.;
		if (this.opening || this.fullyOpen()) {
			this.unhiliteHdr();
			this.glideBackStart();
		}
		else if(!this.closing())
			this.parentMenu = null;
	},

	hideTree : function() {
		var am = this;
		for(; am.activeMenu != null; am = am.activeMenu);
		for(var p = am; (p = p.parentMenu) != null; p.hide());
		am.hide();
	},

	moveTo : (ua.ie ?
		function(x,y) {this.x=this.css.posLeft=x;this.y=this.css.posTop=y;}	:
		function(x, y) {
			this.css.left = (this.x = x) + ua.px;
			this.css.top = (this.y = y) + ua.px;
		}),

	closing : function() {
		return this.animTimer && !this.opening;
	},

	fullyOpen : function() {
		return this.x == 0 && this.y == 0;
	},
	fullyClosed : function() {
		return this.x == this.startX && this.y == this.startY;
	},

	overSubmenu : function() {
		for(var menu = this; menu != null;menu = menu.activeMenu)
			if(menu.over) return true;
		return false;
	},

	initAnimProps : function() {

		// calculate the hypoteneuse.
		this.GlideDist = Math.ceil(Math.sqrt(Math.pow(this.startX, 2) + Math.pow(this.startY, 2)));
		// ratio of x and y to hypoteneuse
		this.rx = -this.startX/this.GlideDist;
		this.ry = -this.startY/this.GlideDist;

		this.del = GlideParams.FRAME_PAUSE;

		// time delay is further reduced.
		// a delay of less than 50ms takes longer than whatever it is in IE windows 9x.
		// other browsers show little difference with very low delays.
		if(ua.win9x && ua.ie && this.del < 54)
			this.del = Math.floor(Math.pow(this.del, 1 - (.54 - this.del/100)));
	},

	/** methods for w and h allow menus to reposition based on updated
	 * layout values (perhaps due to font-size change).
	 */
	w : function() { return ua.ns4 ? this.frame.clip.width : this.el.offsetWidth; },
	h : function() { return ua.ns4 ? this.frame.clip.height : this.el.offsetHeight; },
	getActuator : function(e) {
		var el = getTarget(e);
		return el ? (el.nodeType == 3) ? el.parentNode : el : null;
	},

	toString : function() { return this.id; },

	onactivate : function(){},
	ondeactivate : function(){}
};

if(ua.supported)
	document.writeln("<style type='text/css'>.menuFrame{visibility:hidden;}<"+"/style>");

function contains(a, b) {
	if(b == null) return false;
	while(a != b && ((b = b.parentNode) != null || ua.ns4 && (b = b.parentLayer) != null));
	return a == b;
}
function getPageOffset(el, off){
	var total = 0;
	if(typeof el[off] == "number")
		for(var parent = el; parent.offsetParent != null; parent = parent.offsetParent)
			total += parent[off];
	return total;
}
function getTarget(e){return e&&e.target?e.target:(window.event)?event.srcElement:null;}
function removeClass(el,klass){el.className=el.className.replace(getTokenizedExp(klass,"g")," ").normalize();}
String.prototype.normalize=function(){return this.trim().replace(Exps.NORMALIZE," ");};
String.prototype.trim=function(){return this.replace(Exps.TRIM,"");};
Exps={NORMALIZE:/\s\s+/g,TRIM:/^\s+|\s+$/g,EXT:/(\.(.[^\.]+)$)/};
function getTokenizedExp(t,f){var x=Exps[t];if(!x)x=Exps[t]=new RegExp("(^|\\s)"+t+"($|\\s)",f);return x;}
function getCookie(name) {
	var match = (new RegExp(name+'\s?=\s?([^;]*);?', 'g')).exec(document.cookie)||[];
	return match.length>1?unescape(match[1]):null;
}

function SubmitLoginTop5()
		 {
        // process only the Enter key
        if (event.keyCode == 13)
        {
            // cancel the default submit
            event.returnValue=false;
            event.cancel = true;
            // submit the form by programmatically clicking the specified button
            document.getElementById("Search1_btnGO").click();
        }
    }

function openWindow(img)
{
	var w = 850;
	var h = 800;
	var left = screen.width/2 - w/2;
	var top = screen.height/2 - h/2;
	window.open('popup2.php?img='+img,'','width='+w+',height='+h+',left='+left+',top='+top)
}