var logo = document.getElementById('logo');
var topbarlogo = document.getElementById('topbarlogo');
function showLogo(){
if(window.pageYOffset)
var display = window.pageYOffset - 70;
else
var display = document.documentElement.scrollTop - 70;
if(0 < display){
topbarlogo.style.visibility = 'visible';
}
else {
topbarlogo.style.visibility = 'hidden';
}
}
setInterval('showLogo()', 200);
function toggle(divID, clicked){
var div1 = document.getElementById(divID);
var class1 = div1.className;
switch (class1){ // show
case 'hide':
div1.className = 'show';
clicked.innerHTML = 'close';
break;
case 'show':
div1.className = 'hide';
clicked.innerHTML = 'more';
break;
default :
div1.className = 'show';
clicked.innerHTML = 'more';
}
}
/* ultimate rotating banners script*/
/* script goes at the bottom of html page, adds child div to #banners */
/*
to start
*/
var squareBanner=new Array() //2nd array set example. Remove or add more sets as needed.
//SET IMAGE PATHS. Extend or contract array as needed
squareBanner[0]=["http://www.bangkok.com/images/banner-promo.jpg", "http://www.bangkok.com/freenights/", "_new", ""] //plain image syntax
squareBanner[1]=["http://www.malaysia-hotels.net/images/banner/banner-promo.jpg", "http://www.malaysia-hotels.net/promotion", "_new" , ""] //image with link syntax
squareBanner[2]=["http://www.phuket.com/images/banner-pkt.gif", "http://www.phuket.com/hotels/super-saver.htm", "_new", ""] //image with link and target syntax
var stripBanner=new Array()
stripBanner[0]=["http://www.bangkok.com/images/stripbanner-promo.jpg", "http://www.bangkok.com/freenights/", "_new", ""] //plain image syntax
stripBanner[1]=["http://www.malaysia-hotels.net/images/banner/banner-promo-strip.jpg", "http://www.malaysia-hotels.net/promotion", "_new" , ""] //image with link syntax
stripBanner[2]=["http://www.phuket.com/images/supersaver.gif", "http://www.phuket.com/hotels/super-saver.htm", "_new", ""] //image with link and target syntax
var fadebgcolor="white"
////NO need to edit beyond here/////////////
var fadearray=new Array() //array to cache fadeshow instances
var fadeclear=new Array() //array to cache corresponding clearinterval pointers
var dom=(document.getElementById) //modern dom browsers
var iebrowser=document.all
function fadeshow(theimages, fadewidth, fadeheight, borderwidth, delay, pause, displayorder, appendDivId){
this.pausecheck=pause
this.mouseovercheck=0
this.delay=delay
this.degree=10 //initial opacity degree (10%)
this.curimageindex=0
this.nextimageindex=1
fadearray[fadearray.length]=this
this.slideshowid=fadearray.length-1
this.canvasbase="canvas"+this.slideshowid
this.curcanvas=this.canvasbase+"_0"
if (typeof displayorder!="undefined")
theimages.sort(function() {return 0.5 - Math.random();}) //thanks to Mike (aka Mwinter) :)
this.theimages=theimages
this.imageborder=parseInt(borderwidth)
this.postimages=new Array() //preload images
for (p=0;p
')
}
if (iebrowser&&dom||dom) //if IE5+ or modern browsers such as Firefox
this.startit()
else{
this.curimageindex++
setInterval("fadearray["+this.slideshowid+"].rotateimage()", this.delay)
}
}
function fadepic(obj){
if (obj.degree<100){
obj.degree+=10
if (obj.tempobj.filters&&obj.tempobj.filters[0]){
if (typeof obj.tempobj.filters[0].opacity=="number") //if IE6+
obj.tempobj.filters[0].opacity=obj.degree
else //else if IE5.5-
obj.tempobj.style.filter="alpha(opacity="+obj.degree+")"
}
else if (obj.tempobj.style.MozOpacity)
obj.tempobj.style.MozOpacity=obj.degree/101
else if (obj.tempobj.style.KhtmlOpacity)
obj.tempobj.style.KhtmlOpacity=obj.degree/100
else if (obj.tempobj.style.opacity&&!obj.tempobj.filters)
obj.tempobj.style.opacity=obj.degree/101
}
else{
clearInterval(fadeclear[obj.slideshowid])
obj.nextcanvas=(obj.curcanvas==obj.canvasbase+"_0")? obj.canvasbase+"_0" : obj.canvasbase+"_1"
obj.tempobj=iebrowser? iebrowser[obj.nextcanvas] : document.getElementById(obj.nextcanvas)
obj.populateslide(obj.tempobj, obj.nextimageindex)
obj.nextimageindex=(obj.nextimageindex'
slideHTML+='
'
if (this.theimages[picindex][1]!="") //if associated link exists for image
slideHTML+=''
picobj.innerHTML=slideHTML
}
}
fadeshow.prototype.rotateimage=function(){
if (this.pausecheck==1) //if pause onMouseover enabled, cache object
var cacheobj=this
if (this.mouseovercheck==1)
setTimeout(function(){cacheobj.rotateimage()}, 50)
else if (iebrowser&&dom||dom){
this.resetit()
var crossobj=this.tempobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)
crossobj.style.zIndex++
fadeclear[this.slideshowid]=setInterval("fadepic(fadearray["+this.slideshowid+"])",25)
this.curcanvas=(this.curcanvas==this.canvasbase+"_0")? this.canvasbase+"_1" : this.canvasbase+"_0"
}
else{
var ns4imgobj=document.images['defaultslide'+this.slideshowid]
ns4imgobj.src=this.postimages[this.curimageindex].src
}
this.curimageindex=(this.curimageindex
var httphrefShort = location.href;
httphrefShort = httphrefShort.replace("http://", "");
var arrhttphrefShort = httphrefShort.split("/");
httphrefShort = "http://" + arrhttphrefShort[0];
var pathwebcheckavailabilityShort = httphrefShort + '/reserve/indexShort.php';
var ckAvailStartTdyShort = new Date();
var ckAvailStartTdyDateShift = 1;
//remove time from Date
ckAvailStartTdyShort = new Date(ckAvailStartTdyShort.getFullYear(), ckAvailStartTdyShort.getMonth(), ckAvailStartTdyShort.getDate());
var ckAvailStartDateShort = new Date(ckAvailStartTdyShort.getFullYear(), ckAvailStartTdyShort.getMonth(), ckAvailStartTdyShort.getDate() + ckAvailStartTdyDateShift);
function getElcheckavailabilityShort(tmpname) {
return document.forms['checkAvailShort'].elements[tmpname];
}
function shortAddDate(cDate, addDay)
{
return new Date(cDate.getFullYear(), cDate.getMonth(), cDate.getDate() + addDay);
}
function showChangeDateShort(values) {
if(values=='in') {
setAllDate(getElcheckavailabilityShort('txtCheck_InShort').value,'in');
}
else
if (values=='out')
{
setAllDate(getElcheckavailabilityShort('txtCheck_OutShort').value,'out');
}
}
function showshortDestination(fCountry) {
var a = getElcheckavailabilityShort("pDestinationID").value;
var b = getElcheckavailabilityShort("DestinationID").value;
en_disListShort(true);
var lang = getElcheckavailabilityShort('checkHotel[LanguageCode]').value;
var x = pathwebcheckavailabilityShort + '?action=dest&dest='+a+'&deF='+b+"&lang="+lang;
if(fCountry!="") x = x + "&TypeSet=" + fCountry;
var IE = (document.all) ? 1: 0;
if(IE)
{
makeRequest(x, donereturnShort);
}
else
{
var jScript;
var jScript = document.createElement('SCRIPT');
jScript.setAttribute('type','text/javascript');
jScript.setAttribute('id','jsShOChaVDestination');
jScript.setAttribute('src',x);
document.getElementsByTagName('BODY')[0].appendChild(jScript);
}
}
function donereturnShort(p) {
try {eval(p.responseText);} catch(e) {}
}
function changelistShort(aarr, barr, obj, indexSelected) {
var i;
obj = getElcheckavailabilityShort(obj);
obj.length = 0;
for(i=0;i=endDate) endDate = shortAddDate(startDate, ckAvailStartTdyDateShift);
}
else
if (InOut=='out')
{
var startDate = ChStrtoDate(getElcheckavailabilityShort('txtCheck_InShort').value);
var endDate = ChStrtoDate(cDate);
if(startDate=endDate) endDate = shortAddDate(startDate, ckAvailStartTdyDateShift);
}
else
{
var startDate = ckAvailStartTdyShort;
var endDate = ckAvailStartDateShort;
}
var Nights = Math.floor((endDate.getTime() - startDate.getTime()) / (1000 * 60 * 60 * 24));
getElcheckavailabilityShort('checkHotel[Nights]').value = Nights;
getElcheckavailabilityShort('txtCheck_InShort').value = ChDatetoStr(startDate);
getElcheckavailabilityShort('txtCheck_OutShort').value = ChDatetoStr(endDate);
var arrtmpDate = ChDatetoStr(startDate).split("/");
var b = getElcheckavailabilityShort('checkHotel[sMonth2]');
setElementShort(b, arrtmpDate[1]+'/'+arrtmpDate[2]);
var b = getElcheckavailabilityShort('checkHotel[sYear]');
b.value = arrtmpDate[2];
var b = getElcheckavailabilityShort('checkHotel[sMonth]');
b.value = arrtmpDate[1];
var b = getElcheckavailabilityShort('checkHotel[sDay]');
setElementShort(b, arrtmpDate[0]);
var arrtmpDate = ChDatetoStr(endDate).split("/");
var b = getElcheckavailabilityShort('checkHotel[eMonth2]');
setElementShort(b, arrtmpDate[1]+'/'+arrtmpDate[2]);
var b = getElcheckavailabilityShort('checkHotel[eYear]');
b.value = arrtmpDate[2];
var b = getElcheckavailabilityShort('checkHotel[eMonth]');
b.value = arrtmpDate[1];
var b = getElcheckavailabilityShort('checkHotel[eDay]');
setElementShort(b, arrtmpDate[0]);
}
function setSubmitButtonShort(flag) {
var cForm = document.forms['checkAvailShort'];
var x;
if(flag) x = "";
else x = "none";
var cElement = cForm.getElementsByTagName('input')
var i;
var j = cElement.length;
var k = null;
for(i=0;i=13) {
sMonth = 1;
sYear = sYear + 1;
}
}
}
var ddd = 0;
function setDefDateShort() {
ddd = ddd + 1;
getElcheckavailabilityShort('txtCheck_InShort').value = ChDatetoStr(ckAvailStartTdyShort);
getElcheckavailabilityShort('txtCheck_OutShort').value = ChDatetoStr(ckAvailStartDateShort);
setAllDate(ChDatetoStr(ckAvailStartTdyShort), 'in');
setAllDate(ChDatetoStr(ckAvailStartDateShort), 'out');
}
function ChDatetoStr(cDate) {
return padZero(cDate.getDate()) + '/' + padZero(cDate.getMonth() + 1) + '/' + cDate.getFullYear();
}
function ChStrtoDate(cDate) {
var arrcDate = cDate.split("/");
return new Date(arrcDate[2], Number(arrcDate[1])-1, Number(arrcDate[0]));
}
function setElementShort(cElement,cValue)
{
for(var i=0;i and