//test browser
if(document.getElementById&&!document.all){
	//alert("w3c");
	w3c = true;
	ie = false;
	ns4 = false;
	fShow="visible";
	fHide="hidden";
}
else if(document.all){
	//alert("ie");
	ie = true;
	w3c = false;
	ns4 = false;
	fShow="visible";
	fHide="hidden";
}
else if(document.layers){
	ns4 = true;
	w3c = false;
	ie = false;
	fShow="show";
	fHide="hide";
}

  
// create vars 

init1x = init1y = init2x = init2y = 0;
currentx1 = currentx2 = currentx3 = 0;
xmouse = ymouse = count = 0;
speed = 1;
iamready = false;


function mouseMove(e) {
	// Set x and y to current pos of mouse
	//xmouse = (ns4)? e.pageX : event.x;
	//ymouse = (ns4)? e.pageY : event.y+document.body.scrollTop;
	xmouse = (window.event)? event.x : e.pageX;
	ymouse = (window.event)? event.y+document.body.scrollTop : e.pageY;
	return true;
}

function showall(){
    if (w3c) {
               block1 = document.getElementById("block1Div");
               block2 = document.getElementById("block2Div");
               block3 = document.getElementById("block3Div");
               block4 = document.getElementById("block4Div");
               block5 = document.getElementById("block5Div");
           }
    if (ie) {
               block1 = block1Div;        
               block2 = block2Div; 
               block3 = block3Div;
               block4 = block4Div;
               block5 = block5Div;
               }  
    if (ns4) {
               block1 = document.layers["block1Div"];
               block2 = document.layers["block2Div"];
               block3 = document.layers["block3Div"];
               block4 = document.layers["block4Div"];
               block5 = document.layers["block5Div"];
           }

  document.onmousemove = mouseMove;
  if (ns4) document.captureEvents(Event.MOUSEMOVE);
  if (w3c) document.captureEvents(Event.MOUSEMOVE);
  ready = true;
  stopit = 10;
  xmin = 10;
  xmax = 210;
  ymax = 210;
  iamready = true;
}

function hideblocks() {
	hide(block1);
        hide(block2);  
        hide(block3);     
        hide(block4);
        hide(block5);
}


function showblock(num) {
  if (iamready == true){
   hideblocks();
   if (num == 1){         
        show(block1);
        //changeObjectVisibility("block1Div", "visible");
        stopit = 0;
        xmin = 10;
        xmax = 294;  //modify these numbers to adjust when listings pop-up goes away
        ymax = 300;        
        track_mouse();
   }
   if (num == 2){      
        show(block2);
        //changeObjectVisibility("block2Div", "visible");
        stopit = 0;
        xmin = 10;
        xmax = 416;  //modify these numbers to adjust when listings pop-up goes away
        ymax = 300;        
        track_mouse();
   }
   if (num == 3){    
        show(block3);
        //changeObjectVisibility("block3Div", "visible");
        stopit = 0;
        xmin = 10;
        xmax = 538;  //modify these numbers to adjust when listings pop-up goes away
        ymax =450;        
        track_mouse();
   }
   if (num == 4){ 
        show(block4);
        //changeObjectVisibility("block4Div", "visible");
        stopit = 0;
        xmin = 10;
        xmax = 660;  //modify these numbers to adjust when listings pop-up goes away
        ymax = 300;        
        track_mouse();
   }
   if (num == 5){      
        show(block5);
       // changeObjectVisibility("block5Div", "visible");
        stopit = 0;
        xmin = 0;
        //xmax = 122;  //modify these numbers to adjust when listings pop-up goes away
        xmax = 160;
        ymax = 300;       
        track_mouse();
   }
  }
}

function track_mouse(){
       stopit++;        
       if ( ((xmouse < xmin) || (xmouse > xmax)) || ((ymouse < 50) || (ymouse > ymax) ) ){
          hideblocks();
          stopit = 200;
       }
       if (stopit < 200) { 
          setTimeout('track_mouse()', 100); 
       }
}

function getStyleObject(objectId) {
    // cross-browser function to get an object's style object given its id
    if(document.getElementById && document.getElementById(objectId)) {
	// W3C DOM
	return document.getElementById(objectId).style;
    } else if (document.all && document.all(objectId)) {
	// MSIE 4 DOM
	return document.all(objectId).style;
    } else if (document.layers && document.layers[objectId]) {
	// NN 4 DOM.. note: this won't find nested layers
	return document.layers[objectId];
    } else {
	return false;
    }
} // getStyleObject

function changeObjectVisibility(objectId, newVisibility) {
    // get a reference to the cross-browser style object and make sure the object exists
    var styleObject = getStyleObject(objectId);
    if(styleObject) {
	styleObject.visibility = newVisibility;
	return true;
    } else {
	// we couldn't find the object, so we can't change its visibility
	return false;
    }
} // changeObjectVisibility

function show(obj) {
        if (w3c){ 
        	obj.style.visibility = fShow;
        	 }
        if (ns4){ 
        	obj.visibility = fShow;
        	 }
        else if (ie){	 
          obj.style.filter="blendTrans(duration=.3)";
	  if ((obj.visibility != fShow)) {
            obj.filters.blendTrans.Apply();
            obj.style.visibility=fShow;
	    obj.filters.blendTrans.Play();
	  }
        }
}

function hide(obj) {
	if (w3c) { 
        	obj.style.visibility = fHide;
        	 }
	else if (ns4) { 
        	obj.visibility = fHide;
        	 }
        else if (ie){	 
          obj.style.filter="blendTrans(duration=.3)";
	  if ((obj.visibility != fHide)) {
            obj.filters.blendTrans.Apply();
            obj.style.visibility=fHide;;
	    obj.filters.blendTrans.Play();
	  }
        }
}