var hide = true;
var bName=navigator.appName;
//var bVer=parseInt(navigator.appVersion);


function hideOk(elem)
{
  //alert(elem);
  newelem = elem;
  hide = true;
  setTimeout("menuchangeHid(newelem);",200);

}



function menuchangeVis(obj, roomdiv)
{
objId = obj;
//alert(objId);
obj = document.getElementById(obj);
//var x = document.getElementById('za');
//alert(obj);
xx=top_pos(obj);
//alert(xx);
yy=left_pos(obj)
//alert(yy);

if(objId == 'place')
{
  xx = xx + 14;
  yy = yy + 9;
}
if(objId == 'sideplace')
{
  //xPos = elem.offsetWidth;
  var offset = document.getElementById(objId).offsetWidth;
  //alert(offset);
  xx = xx - 3;
  yy = yy + offset;
}
document.getElementById(roomdiv).style.top=xx;
document.getElementById(roomdiv).style.left=yy;
document.getElementById(roomdiv).style.display='block';
}
function menuchangeHid(roomdiv)
{
  if(hide)
  {
    document.getElementById(roomdiv).style.display='none';
  }
}

function top_pos(objName)
{
  //var obj = eval("document.formm." + objName);
  var objTop=0,tempObj=objName;
  while(tempObj.offsetParent){
    objTop+=tempObj.offsetTop;
    tempObj=tempObj.offsetParent
  }
  //alert(objTop); // This returns 2 - when I expect it to return a larger number
  //alert(objName.value);
  return objTop;
}
function left_pos(objName)
{
  //var obj = eval("document.formm." + objName);
  var objLeft=0,tempObj=objName;
  while(tempObj.offsetParent){
    objLeft+=tempObj.offsetLeft;
    tempObj=tempObj.offsetParent
  }
  //alert(objTop); // This returns 2 - when I expect it to return a larger number
  //alert(objName.value);
  return objLeft;
}


function drive_open()
       {
         var newWindow = window.open('http://www.whereis.com/whereis/directions.do', 'drive', 'width=620,height=500,toolbar=1,location=1,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,left=150,top=0');
         newWindow.focus();
       }
var suitcaseWindow;
function suitcase_open(url)
{
suitcaseWindow = window.open(url,'suitcase','title=no, toolbar=no, location=no, directories=no, status=yes, menubar=no, scrollbars=no, resizable=no, copyhistory=yes, width=280, height=200, left=100, top=100');
suitcaseWindow.focus();
setTimeout("suitcaseWindow.close();", 2800);
}
function viewsuit_open()
       {
         if(bName == 'Netscape')
         {
           newWindow = window.open('/viewsuit.php','viewsuit');
         }
         else
         {
           newWindow = window.open('/viewsuit.php','viewsuit', 'title=yes, toolbar=yes, location=yes, directories=no, status=yes, menubar=yes, scrollbars=yes, resizable=yes, copyhistory=yes, width=0, height=0, left=5, top=5');
         }
         newWindow.focus();
       }
function prop_open(url)
{
 var winName = 'prop';
 var currentName = self.name;
 if(currentName == 'prop')
 {
   winName = 'prop1';
 }
 if(currentName == 'prop1')
 {
   winName = 'prop';
 }

if(bName == 'Netscape')
   {
     newWindow = window.open(url,winName);
   }
   else
   {
     newWindow = window.open(url,winName, 'title=yes, toolbar=yes, location=yes, directories=no, status=yes, menubar=yes, scrollbars=yes, resizable=yes, copyhistory=yes');
   }
newWindow.focus();
}




function currency_open()
       {
         var newWindow = window.open('http://www.fieba.net/fieba/popup.jsp?FI_from=AUD&FI_to=USD', 'currency', 'width=410,height=185,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,left=200,top=200');
         newWindow.focus();
       }

function openwindow()
{
var newWindow = window.open('image.html','image', "width=350, height=360, toolbar=0, location=0, directories=0, status=1, menubar=0, scrollbars=0, resizable=0, left=100, top=100");
newWindow.focus();
}
//alert(bName + bVer);

function terms_open(url)
       {
         var newWindow = window.open(url, 'terms', 'width=450,height=400,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,left=200,top=50');
         newWindow.focus();
       }
function example_open(url)
       {
         var newWindow = window.open(url, 'example', 'width=650,height=400,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,left=50,top=50');
         newWindow.focus();
       }
function avail_open(url)
       {
         var newWindow = window.open(url, 'avail', 'width=650,height=400,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,left=50,top=25');
         newWindow.focus();
       }
function redirect(propid, website)
{
  website_counter = new Image(2,2);
  var web_counter_address = '/websitecounter.php?propid='+propid;
  //alert(web_counter_address);
  website_counter.src=web_counter_address;

  location = website;
}
