var doneloading = 0;

function massage_coupon() {
  newwin = window.open("", "massagecoupon", "titlebar=no,left=1,top=1,status=no,resizable=no,toolbar=no,scrollbars=no,menubar=no,width=350,height=70");
  newwin.document.write("<img src=\"images/massage_coupon.gif\"/><script>window.print()</script>");
  newwin.close();
}

function getInternetExplorerVersion()
// Returns the version of Internet Explorer or a -1
// (indicating the use of another browser).
{
  var rv = -1; // Return value assumes failure
  if (navigator.appName == 'Microsoft Internet Explorer')
  {
    var ua = navigator.userAgent;
    var re  = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
    if (re.exec(ua) != null)
      rv = parseFloat( RegExp.$1 );
  }
  return rv;
}
function loadnav() {
  if (document.images) {

    nav_images = new Array("weddings","bodytreatments","contactus","hairnailservice","home","massagetreatments","privateparties","products","services","skincaresalon","spaetiquette","spavacations","specialoffers","thestaff");
    for(i=0;i<nav_images.length;i++) {
      newimg = new Image();
      newimg.src = "images/n_"+nav_images[i]+".gif";
      newimg = new Image();
      newimg.src = "images/n_"+nav_images[i]+"_over.gif";
    }
    return 1;
  }
  return 0;
}
function setVert() {
  if (document.getElementById) {
    if(document.getElementById('content_right') && document.getElementById('content_text')) {
      if(document.getElementById('content_text').offsetHeight<(document.getElementById('left').offsetHeight-60)) {
        document.getElementById('content_text').style.height = (document.getElementById('left').offsetHeight-60)+"px";
      }
      if(document.documentElement.clientWidth>780) {
        document.getElementById('content_right').style.display = "block";
        document.getElementById('content_text').style.marginRight = "60px";
        if(document.getElementById('content_text').offsetHeight>400) {
          document.getElementById('content_right').style.height = document.getElementById('content_text').offsetHeight+"px";
        } else {
          document.getElementById('content_right').style.height = "400px";
        }
      } else {
        document.getElementById('content_text').style.marginRight = "-30px";
        document.getElementById('content_right').style.height = "1px";
        document.getElementById('content_right').style.display = "none";
      }
    }
  }
}
function rollOn(img, doneloading) {
  var loaddone = typeof(doneloading);
  if (document.images && loaddone!= "undefined") {
    if(doneloading==1)
      eval("document."+img+".src = 'images/n_"+img+"_over.gif'");
  }
}
function rollOff(img, doneloading) {
  var loaddone = typeof(doneloading);
  if (document.images && loaddone!= "undefined") {
    if(doneloading==1)
      eval("document."+img+".src = 'images/n_"+img+".gif'");
  }
}

function win(url, winname, winwidth, winheight) {
  offset=0;
  if (winwidth > screen.width) {
    winwidth = parseInt(screen.width)-200;
  }
  if (winheight > screen.height) {
    winheight = parseInt(screen.height)-200;
  }
  if (navigator.userAgent.toLowerCase().indexOf("msie")!=-1) {
    winwidth+=14;
    winheight+=10;
    eval(winname+"=window.open('"+url+"','"+winname+"','titlebar=yes,left='+(((parseInt(screen.width)/2)-parseInt(winwidth/2))+offset)+',top='+(((parseInt(screen.height)/2)-parseInt(winheight/2))+offset)+',status=yes,resizable=yes,toolbar=no,scrollbars=yes,menubar=no,Width='+winwidth+',Height='+winheight);");
  } else {
    eval(winname+"=window.open('"+url+"','"+winname+"','titlebar=yes,screenX='+(((parseInt(screen.width)/2)-parseInt(winwidth/2))+offset)+',screenY='+(((parseInt(screen.height)/2)-parseInt(winheight/2))+offset)+',status=yes,resizable=yes,toolbar=no,scrollbars=yes,menubar=no,Width='+winwidth+',Height='+winheight);");
  }
  eval(winname+".focus();");
}

window.onload = function() {
  setVert();
  doneloading = loadnav();
}
window.onresize = function() {
  setVert();
}