t1on = new Image;   t1on.src = "img/menu/butic_on.gif";
t2on = new Image;   t2on.src = "img/menu/fitness_on.gif";
t3on = new Image;   t3on.src = "img/menu/fitness_on.gif";
t4on = new Image;   t4on.src = "img/menu/news_on.gif";
t5on = new Image;   t5on.src = "img/menu/events_on.gif";
t6on = new Image;   t6on.src = "img/menu/about_on.gif";
t7on = new Image;   t7on.src = "img/menu/tenant_on.gif";
  
t1off = new Image;  t1off.src = "img/menu/butic_off.gif";
t2off = new Image;  t2off.src = "img/menu/fitness_off.gif";
t3off = new Image;  t3off.src = "img/menu/fitness_off.gif";
t4off = new Image;  t4off.src = "img/menu/news_off.gif";
t5off = new Image;  t5off.src = "img/menu/events_off.gif";
t6off = new Image;  t6off.src = "img/menu/about_off.gif";
t7off = new Image;  t7off.src = "img/menu/tenant_off.gif";



 function active(imgName) {
  if (document.images) {
  imgOn = eval(imgName + "on.src");
  document [imgName].src = imgOn; 
    }
  }

 function passive(imgName) {
  if (document.images) {
  imgOff = eval(imgName + "off.src");
  document [imgName].src = imgOff; }
   }
function showFlash(o){
var bg,q,s,v;
if(o.bgcolor){bg=o.bgcolor;}else{bg="#000000";}
if(o.quality){q=o.quality;}else{q="high";}
if(o.scale){s=o.scale;}else{s="noscale";}
if(o.ver){v=o.ver;}else{v=6;}
var str='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+v+',0,0,0" ';
str+='id="'+o.id+'" ';
if(o.base){str+='base="'+o.base+'" ';}
if(o.align){str+='align="'+o.align+'" ';}
str+='width="'+o.width+'" height="'+o.height+'"><param name="movie" value="'+o.name+'"/><param name="bgcolor" value="'+bg+'"/><param name="quality" value="'+q+'"/>';
if(o.flashvars){str+='<param name="flashvars" value="'+o.flashvars+'"/>';}
if(o.allowScriptAccess){str+='<param name="allowScriptAccess" value="'+o.allowScriptAccess+'"/>';}
if(o.salign){str+='<param name="salign" value="'+o.salign+'"/>';}
str+='<param name="wmode" value="opaque"/>';
str+='<param name="scale" value="'+s+'"/><embed type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" id="'+o.id+'-embed" src="'+o.name+'" bgcolor="'+bg+'" ';
if(o.flashvars){str+='flashvars="'+o.flashvars+'" ';}
if(o.swLiveConnect){str+='swLiveConnect="'+o.swLiveConnect+'" ';}
if(o.allowScriptAccess){str+='allowScriptAccess="'+o.allowScriptAccess+'" ';}
str+='quality="'+q+'" ';
if(o.base){str+='base="'+o.base+'" ';}
str+='wmode="opaque" ';
if(o.salign){str+='salign="'+o.salign+'" ';}
str+='scale="'+s+'" width="'+o.width+'" height="'+o.height+'"></embed></object>';
document.writeln(str);
}

function explain(i,Width,Height) {
    var fileName =  i;
    var features = "width=" + Width + ",height=" + Height + ",menubar=no";
    window.open(fileName,"explWin",features);
                  }

//------------ popup
    var IE = document.all?true:false
    var tempX = 0
    var tempY = 0
    var tipVis = 0;
    var tip;
    var tip2Vis = 0;
    var tip2;


function initPopup(){
    if (!IE) document.captureEvents(Event.MOUSEMOVE)
    document.onmousemove = getMouseXY;
    tip = document.getElementById('tip');
    tip2 = document.getElementById('tipoff');
}

function showTip(text){
    if(tipVis>0) return;
    if(tip){
        tip.style.display = 'block';
        tip.innerHTML = text;
//    alert(tip.style.left);
        tipVis = 1;
    }
}

function showTip2(text){
    if(tip2Vis>0) return;
    if(tip2){
        tipoff.style.display = 'block';
        tipoff.innerHTML = text;
//    alert(tip.style.left);
        tip2Vis = 1;
    }
}

function hideTip2(){
    if(tip2){
        tipoff.style.display = 'none';
        tip2Vis = 0;
    }
}

function hideTip(){
    if(tip){
        tip.style.display = 'none';
        tipVis = 0;
    }
}

function getMouseXY(e) {
  if (IE) { // grab the x-y pos.s if browser is IE
    tempX = event.clientX + document.body.scrollLeft
    tempY = event.clientY + document.body.scrollTop
  } else {  // grab the x-y pos.s if browser is NS
    tempX = e.pageX
    tempY = e.pageY
  }
  if(tempX+155>document.body.clientWidth) tempX = document.body.clientWidth-155;
  // catch possible negative values in NS4
  if (tempX < 0){tempX = 0}
  if (tempY < 0){tempY = 0}
  // show the position values in the form named Show
  // in the text fields named MouseX and MouseY
  //document.Show.MouseX.value = tempX
  //document.Show.MouseY.value = tempY

  if(tip){
    tip.style.left = ''+(tempX-5)+'px';
    tip.style.top = ''+(tempY+15)+'px';
  }

  if(tip2){
    tipoff.style.left = ''+(tempX-5)+'px';
    tipoff.style.top = ''+(tempY+15)+'px';
  }


  return true
}

//------------ glossary

function insertTerm(n,t){
    r = opener.document.selection.createRange();
    if(r.htmlText.length>0) n = r.htmlText;
    r.pasteHTML('<span class="term" onmouseover="showTip(\''+t+'\');" onmouseout="hideTip();">'+n+'</span>');
    self.close();
    return false;
}



