/*
The ultimate DHTML drop-down code
Nick Nettleton | www.fluid7.co.uk
--
You can adapt, use and distribute this code under GNU public licence, as long as:
(1) You leave all the comment and credit lines in, including these ones
(2) You don't sell it for profit
--
Enjoy!!!
*/

//browser vars
iexplore=(ie5||ie6)?1:0
nscape=(ns4)?1:0

//code for drops

function LG_showdrop(thelayer,theimage,newsrc){
 LG_keep=thelayer; LG_hideall(); checkpos=0; LG_showitnow=1
 LG_showit(thelayer,theimage,newsrc)
 }

function LG_showit(thelayer){
 if(iexplore){ eval(LG_droplayer[thelayer][0]+'.style.visibility="visible"') }
 if(nscape){ eval('document.'+LG_droplayer[thelayer][0]+'.visibility="show"');}
 //document.images[LG_droplayer[thelayer][1]].src=LG_droplayer[thelayer][3]
 }


function LG_hidedrop(){
 LG_keep=-1; checkpos=1; setTimeout('LG_hideall()',500)
 }

LG_keep=-1

function LG_hideall(){
 for(i=0;i<LG_droplayer.length;i++){ 
  if(iexplore && LG_keep!=i){ 
   eval(LG_droplayer[i][0]+'.style.visibility="hidden"')
   //document.images[LG_droplayer[i][1]].src=LG_droplayer[i][2]
  }
  if(nscape){
   LG_hideit=0; LG_checkmousepos(i)
   if(LG_hideit){ 
    eval('document.'+LG_droplayer[i][0]+'.visibility="hide"')
    //document.images[LG_droplayer[i][1]].src=LG_droplayer[i][2]
   }
  }
  if(!nscape && !iexplore && LG_keep!=i){ 
   document.images[LG_droplayer[i][1]].src=LG_droplayer[i][2]
   }
  }
 }

//deal with cursor over layer for ns

if(nscape){
 document.onmousemove = LG_getmousepos
 document.captureEvents(Event.MOUSEMOVE)
 }

function LG_getmousepos(e){
 if(nscape){LG_mousex=e.pageX; LG_mousey=e.pageY}
 }

checkpos=0

function LG_checkmousepos(i){          
 if(nscape && checkpos){     
  LG_x_min=eval('document.'+LG_droplayer[i][0]+'.left')
  LG_x_max=LG_x_min+eval('document.'+LG_droplayer[i][0]+'.clip.width')
  LG_y_min=eval('document.'+LG_droplayer[i][0]+'.top')
  LG_y_max=LG_y_min+eval('document.'+LG_droplayer[i][0]+'.clip.height')
  if (LG_mousex>=LG_x_min && LG_mousex<=LG_x_max && LG_mousey>=LG_y_min && LG_mousey<=LG_y_max){
   LG_hideit=0; setTimeout('LG_hideall()',500)
   }
  else { LG_hideit=1 }
  return LG_hideit
 }    
}

function readParams() {
    if (navigator.userAgent.toLowerCase().indexOf("mac") == -1) {
        var szSrc = "http://www.eyeblaster-ds.com/BurstingScript/ReadParametersPipe.asp";
    
        if (parent && parent.parent && parent.parent.location) {
            szSrc += "?pageLocation=" + escape(parent.parent.location);
        }
        else {
            szSrc += "?pageLocation=invalid";
        }
    
        if (document.createElement && document.body && document.body.appendChild) {
            var newTag = document.createElement("script");
            newTag.id = "readParametersPipe";
            newTag.src = szSrc;
            document.body.appendChild(newTag);
        }
    }
}