﻿xmlhttp=false;function createXML(str,target){document.getElementById(target).innerHTML="<img src='element/style/loading.gif'>Fetching...";if (window.XMLHttpRequest) xmlhttp=new XMLHttpRequest();else xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");xmlhttp.open("GET",str,true);xmlhttp.send();xmlhttp.onreadystatechange=function(){  if (xmlhttp.readyState==4 && xmlhttp.status==200) document.getElementById(target).innerHTML=xmlhttp.responseText;  else document.getElementById(target).innerHTML="<h2>Website under maintenance</h2> - unable to fetch resource<br><span class='content'>The website is temporally down due to undergoing maintenance work.<br>We apologize for the inconvenience this may cause you<br>and encourage you to check back with us again shortly.<br>Thank you.</span>";  }}function postXML(url,parameters){if (window.XMLHttpRequest) xmlhttp=new XMLHttpRequest();else xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");http_request.onreadystatechange = sendForm;http_request.open('POST', url, true);http_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");http_request.setRequestHeader("Content-length", parameters.length);http_request.setRequestHeader("Connection", "close");http_request.send(parameters);}function createXML1(str,target){xmlhttp1=false;document.getElementById(target).innerHTML="<img src='element/style/loading.gif'>Fetching...";if (window.XMLHttpRequest) xmlhttp1=new XMLHttpRequest();else xmlhttp1=new ActiveXObject("Microsoft.XMLHTTP");xmlhttp1.open("GET",str,true);xmlhttp1.send();xmlhttp1.onreadystatechange=function(){  if (xmlhttp1.readyState==4 && xmlhttp1.status==200) document.getElementById(target).innerHTML=xmlhttp1.responseText;  else document.getElementById(target).innerHTML="<h2>Website under maintenance</h2> - unable to fetch resource<br><span class='content'>The website is temporally down due to undergoing maintenance work.<br>We apologize for the inconvenience this may cause you<br>and encourage you to check back with us again shortly.<br>Thank you.</span>";  }}function postXML(url,parameters){if (window.XMLHttpRequest) xmlhttp=new XMLHttpRequest();else xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");http_request.onreadystatechange = sendForm;http_request.open('POST', url, true);http_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");http_request.setRequestHeader("Content-length", parameters.length);http_request.setRequestHeader("Connection", "close");http_request.send(parameters);}function alertContents() {      if (http_request.readyState == 4) {         if (http_request.status == 200) {            document.getElementById('content').innerHTML = http_request.responseText;			} else {            alert('There was a problem with the request.');         }      }  }function get(obj) {      var poststr = "name=" + encodeURI( document.getElementById("name").value ) +                    "&phone=" + encodeURI( document.getElementById("phone").value );      postXML('proceed.php', poststr);}function validate_email(field,alerttxt){with (field)  {  apos=value.indexOf("@");  dotpos=value.lastIndexOf(".");  if (apos<1||dotpos-apos<2)    {alert(alerttxt);return false;}  else {return true;}  }}function validate_required(field,alerttxt){with (field)  {  if (value==null||value=="")    {    alert(alerttxt);return false;    }  else    {     return true;    }  }}function validate_form(thisform){with (thisform)  {  if (validate_email(email,"請輸入正確電郵地址")==false)    {email.focus();return false;}  else if (validate_required(name,"請輸入姓名")==false)  {name.focus();return false;}  else if (validate_required(phone,"請輸入聯絡電話")==false)  {phone.focus();return false;}  else if (validate_required(content,"請輸入查詢內容")==false)  {content.focus();return false;}  }}function Show1(){	document.getElementById("LargeImageContainerDiv").innerHTML = '<img src=element/land/spot1.png>';}function Show2(){	document.getElementById("LargeImageContainerDiv").innerHTML = '<img src=element/land/spot2.png>';}function Show3(){	document.getElementById("LargeImageContainerDiv").innerHTML = '<img src=element/land/spot3.png>';}function Show4(){	document.getElementById("LargeImageContainerDiv").innerHTML = '<img src=element/land/spot4.png>';}function ShowS1(){	document.getElementById("LargeImageContainerDiv").innerHTML = '<img src=element/sea/spot1.png>';}function ShowS2(){	document.getElementById("LargeImageContainerDiv").innerHTML = '<img src=element/sea/spot2.png>';}function ShowS3(){	document.getElementById("LargeImageContainerDiv").innerHTML = '<img src=element/sea/spot3.png>';}function ShowS4(){	document.getElementById("LargeImageContainerDiv").innerHTML = '<img src=element/sea/spot4.png>';}function ShowS5(){	document.getElementById("LargeImageContainerDiv").innerHTML = '<img src=element/sea/spot5.png>';}function ShowS6(){	document.getElementById("LargeImageContainerDiv").innerHTML = '<img src=element/sea/spot6.png>';}//e--function Show1e(){	document.getElementById("LargeImageContainerDiv").innerHTML = '<img src=element/land/spot1e.png>';}function Show2e(){	document.getElementById("LargeImageContainerDiv").innerHTML = '<img src=element/land/spot2e.png>';}function Show3e(){	document.getElementById("LargeImageContainerDiv").innerHTML = '<img src=element/land/spot3e.png>';}function Show4e(){	document.getElementById("LargeImageContainerDiv").innerHTML = '<img src=element/land/spot4e.png>';}function ShowS1e(){	document.getElementById("LargeImageContainerDiv").innerHTML = '<img src=element/sea/spot1e.png>';}function ShowS2e(){	document.getElementById("LargeImageContainerDiv").innerHTML = '<img src=element/sea/spot2e.png>';}function ShowS3e(){	document.getElementById("LargeImageContainerDiv").innerHTML = '<img src=element/sea/spot3e.png>';}function ShowS4e(){	document.getElementById("LargeImageContainerDiv").innerHTML = '<img src=element/sea/spot4e.png>';}function ShowS5e(){	document.getElementById("LargeImageContainerDiv").innerHTML = '<img src=element/sea/spot5e.png>';}function ShowS6e(){	document.getElementById("LargeImageContainerDiv").innerHTML = '<img src=element/sea/spot6e.png>';}function ShowDefaultImage(){	document.getElementById("LargeImageContainerDiv").innerHTML = "";}
