// open additional window
function MM_openBrWindow(theURL,winName,features) {
  window.open(theURL,winName,features);
}

// call JS
function MM_callJS(jsStr) { //v2.0
  return eval(jsStr)
}

// check to see if something is a number
function checknum(field) {
var valid = "0123456789.";
for (var i=0; i < field.length; i++) {
  temp = "" + field.substring(i, i+1);
  if (valid.indexOf(temp) == "-1") {
    return false;
  }
}
return true;
}

//convert to cents
function cent(amount) {
   amount -= 0;
   amount = (Math.round(amount*100))/100;
   return (amount == Math.floor(amount)) ? amount + '.00' : ( (amount*10 == Math.floor(amount*10)) ? amount + '0' : amount);
}


//-----
//checks for valid email
//-----
function isEmail(str) {
  // are regular expressions supported?
  var supported = 0;
  if (window.RegExp) {
    var tempStr = "a";
    var tempReg = new RegExp(tempStr);
    if (tempReg.test(tempStr)) supported = 1;
  }
  if (!supported)
    return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);
  var r1 = new RegExp("(@.*@)|(\\.\\.)|(@\\.)|(^\\.)");
  var r2 = new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$");
  return (!r1.test(str) && r2.test(str));
}


var message="Copyright 2005-2006  costarica-vacation-rentals.com ";

function click(e) {
  if (document.all) {
    if (event.button == 2) {
      alert(message);
      return false;
    }
  }
  if (document.layers) {
    if (e.which == 3) {
      alert(message);
      return false;
    }
    else {    // Not the right mouse button, route the event.
      return routeEvent(e);
    }
  }
}
if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);
}
document.onmousedown=click;

