
var popupW = "560";
var popupH = "700";
var scrolling = "yes";
var counter;

var agt=navigator.userAgent.toLowerCase();
var is_major = parseInt(navigator.appVersion);
var is_minor = parseFloat(navigator.appVersion);
var is_nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1) && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1) && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1));
var is_gecko = (agt.indexOf('gecko') != -1);
var is_mac    = (agt.indexOf("mac")!=-1);
var is_nav4up = (is_nav && (is_major >= 4));


var iTop,iLeft;
function getLocation(oCurrentNode){
         iTop=0, iLeft=0;
      if (oCurrentNode!=null){
          while(oCurrentNode.tagName!="BODY"){ //Get the absolute position
          //alert(iTop+" "+oCurrentNode.tagName);
          iTop+=oCurrentNode.offsetTop;
          iLeft+=oCurrentNode.offsetLeft;
          oCurrentNode=oCurrentNode.offsetParent;
          //alert(iTop+" "+oCurrentNode.tagName);
          }
      }
  }
function showDescription3(popid,button, text) {

//**** this is to allow for IE4 but is untested so far ****
    if (document.layers && document.layers[popid]) {
        document.layers[button].left = href.x;
        document.layers[button].top = href.y;  
        document.layers[popid].visibility = 'visible';
        }
        
//**** this code is for IE *****
    else if (document.all) {
          getLocation(document.all[button]);
        document.all[popid].style.posLeft = iLeft +8;//left location -4 -the variable for the button offset
        document.all[popid].style.posTop = iTop +36;
        document.all.areas.innerHTML=text;
        document.all[popid].style.visibility = 'visible';
    }
            
//**** this next code is for mozilla ****            
    else if (document.getElementById) {
                linkDiv = document.getElementById(button);//set working variable for the following
                //alert("ok to here ; linkdiv :"+linkDiv);
                getLocation(linkDiv);
                x = iLeft;//re-set x to be the offsetLeft from the parseInt
                y = iTop;//re-set y to be the value of offsetTop from the parseInt above
                document.getElementById(popid).style.left = x +0 +"px";//position the Stopper, & add the px so the style is set to pixels
                document.getElementById(popid).style.top = y+20 +"px";//as above
				         
            document.getElementById(popid).innerHTML=text;
            document.getElementById(popid).style.visibility = "visible";
			}
}

function hideTip(id){

      if (is_gecko) {
               elm = document.getElementById(id);
               elm.style.visibility="hidden";
      } else if (is_nav4up) {
              document.layers[id].visibility="hidden";
      } else {
               document.all[id].style.visibility="hidden";
      }
}



function previous(){
     counter = counter - 1;
     if(counter < 1){
       counter = counterMax;
     }
     changepicture();

}

function next(){
     counter = counter + 1;
     if(counter > counterMax){
       counter = 1
     }
     changepicture();
}


function changepicture(){        

	if (document.all) {

    eval('document.picture.src = "images/properties/' + eval('imagepath' + counter)+ '"');
    eval('document.all[\'reference\'].innerHTML = "' + eval('reference' + counter) + '"');
	eval('document.all[\'address\'].innerHTML = "' + eval('address' + counter) + '"');
	eval('document.all[\'description\'].innerHTML = "' + eval('description' + counter) + '"');
	}
	else if (document.getElementById) {
    eval('document.picture.src = "images/properties/' + eval('imagepath' + counter)+ '"');
    eval('document.getElementById(\'reference\').innerHTML = "' + eval('reference' + counter) + '"');
	eval('document.getElementById(\'address\').innerHTML = "' + eval('address' + counter) + '"');
	eval('document.getElementById(\'description\').innerHTML = "' + eval('description' + counter) + '"');
		
	}


   }
   
   
   

   
   
   
   
   
   
   