var constPath = "http://www.dutagardenhotel.com/"
if(navigator.appName.indexOf("Microsoft")!=-1) {
  document.writeln("  <style type=\"text/css\" title=\"currentStyle\" media=\"screen\">");
  document.writeln("    #kawista-main { _height: 600px; }");
  document.writeln("  </style>");
}

function statistics() {
  document.open();
  document.write("<img src=\"" + constPath + "kawista-statistics.asp?r=" + escape(document.referrer) + "\" width=\"10\" height=\"10\" />");
  document.close();
}
function go(shortcut) {
  if (shortcut.value!="") window.location = shortcut.value;
}
function showImage(id) {
  imageWnd = window.open(constPath+"kawista-image.asp?id="+id,"imageWnd","toolbar=no,width=520,height=400,resizable=no,scrollbars=no");
  imageWnd.moveTo((screen.width/2)-(520/2),(screen.height/2)-(400/2));
  imageWnd.focus();
}
function showProduct(id) {
  productWnd = window.open(id,"imageWnd","toolbar=no,width=560,height=470,resizable=no,scrollbars=yes");
  productWnd.moveTo((screen.width/2)-(560/2),(screen.height/2)-(470/2));
  productWnd.focus();
}
function random() { 
  random.seed = (random.seed*random.a + random.c) % random.m; 
  return random.seed / random.m; 
}
random.m=714025; random.a=4096; random.c=150889;
random.seed = (new Date()).getTime()%random.m;
function validate(objForm) {
  if (objForm.elements["requiredField"]==null || objForm.elements["requiredField"].value=="") {
    var arrRequired=new Array()
  }else{
    var arrRequired=objForm.elements["requiredField"].value.split(",")
  }
  if (objForm.elements["numericField"]==null || objForm.elements["numericField"].value=="") {
    var arrNumeric=new Array()
  }else{
    var arrNumeric=objForm.elements["numericField"].value.split(",")
  }
  if (objForm.elements["dateField"]==null || objForm.elements["dateField"].value=="") {
    var arrDate=new Array()
  }else{
    var arrDate=objForm.elements["dateField"].value.split(",")
  }
  if (objForm.elements["eMailField"]==null || objForm.elements["eMailField"].value=="") {
    var arrEmail=new Array()
  }else{
    var arrEmail=objForm.elements["eMailField"].value.split(",")
  }
  valid=true;
  if (valid) {
    for (i=0;i<arrRequired.length;i++) {
      if (objForm.elements[arrRequired[i]].value=="") {
        alert(arrMessage[0] + objForm.elements[arrRequired[i]].name + "\".");
        valid=false;
        objForm.elements[arrRequired[i]].focus();
        break;
      }
    }
  }
  if (valid) {
    for (i=0;i<arrEmail.length;i++) {
      if (objForm.elements[arrEmail[i]].value.indexOf("@")==-1 || objForm.elements[arrEmail[i]].value.indexOf(".")==-1) { 
        alert(objForm.elements[arrEmail[i]].name + arrMessage[1]);
        valid=false;
        objForm.elements[arrEmail[i]].select();
        break;
      }
    }
  }
  if (valid) {
    for (i=0;i<arrDate.length;i++) {      
      strReservationDate=objForm.elements[arrDate[i]].value
      arrReservationDate=strReservationDate.split("/");
      reservationDate=new Date(arrReservationDate[2], arrReservationDate[0]-1, arrReservationDate[1]);
      if (isNaN(reservationDate)) {
        valid=false;
      }else{
        if (reservationDate.getMonth()!=arrReservationDate[0]-1) {
          valid=false;
        }
      }
      if (objForm.elements[arrDate[i]].value=="") valid=true;
        if (!valid){
          alert(objForm.elements[arrDate[i]].name + arrMessage[3]);
          objForm.elements[arrDate[i]].select();
          break;
      }
    }
  }
  if (valid) {
    for (i=0;i<arrNumeric.length;i++) {
      if (isNaN(objForm.elements[arrNumeric[i]].value)) {
        alert(objForm.elements[arrNumeric[i]].name + arrMessage[2]);
        objForm.elements[arrNumeric[i]].select();
        valid=false;
        break;
      }
    }
  }
  return valid;
}
function showMap(ID){
  wndMap=window.open("","wndMap","toolbar=no,width=610,height=540,resizable=no,scrollbars=no");
  wndMap.moveTo((screen.width/2)-(610/2),(screen.height/2)-(540/2));
  wndMap.focus();
  wndMap.document.open();
  wndMap.document.writeln("<html>" +
    "<head>" +
    "  <title>Tourism Map of Yogyakarta</title>" +
    "</head>" +
    "<frameset rows=100%>" +
    "  <frame name=top src=\""+constPath+"plug-in/map/\" noResize>" +
    "  <noframes>" +
    "    <body>" +
    "      <p>This page uses frames, but your browser doesn't support them.</p>" +
    "    </body>" +
    "  </noframes>" +
    "</frameset>" +
    "</html>");
  wndMap.document.close();
}
function calendar(id,defaultDate) {
  wndCalendar=window.open("","wndCalendar","toolbar=no,width=370,height=220,resizable=no,scrollbars=no");
  wndCalendar.document.write("<html><head><title>YogYES.COM: Calendar</title></head><body bgColor=#C0C0C0><p align=center style=font-size:10pt;font-family:verdana;><b>Loading calendar, please wait</body><html>");
  wndCalendar.moveTo((screen.width/2)-(220/2),(screen.height/2)-(220/2));
  wndCalendar=window.open(constPath+"calendar.asp?id="+id+"&defaultDate="+defaultDate,"wndCalendar","toolbar=no,width=370,height=260,resizable=no,scrollbars=no");
  wndCalendar.focus();
}
