function hideandshow(hide1,hide2,show1,show2,HeadShow,headhide1,headhide2)
{changecss(hide1,'display','none');changecss(hide2,'display','none');changecss(show1,'display','');changecss(show2,'display','');changecss(HeadShow,'display','');changecss(headhide1,'display','none');changecss(headhide2,'display','none');}
function changecss(myclass,element,value)
{var oCSSRules=document.styleSheets[0].cssRules||document.styleSheets[0].rules;for(var i=0;i<oCSSRules.length;i++)
{if(oCSSRules[i].selectorText==myclass)
{oCSSRules[i].style[element]=value;}}}
function tdhideandshow(hide1,hide2,show1,show2,headshow,headhide1,headhide2)
{$(hide1).hide();$(hide2).hide();$(show1).show();$(show2).show();$(headshow).show();$(headhide1).hide();$(headhide2).hide();}
function convertCheckinDate2rmIndex(formobj)
{var checkinobj=formobj.checkin;var indateobj=StrDMY2DateOBJ(checkinobj.value);var ind=indateobj.getDate();var inm=indateobj.getMonth();var today=new Date();var numDaysMth=getNumberDays(today);var today27=plusDate(27,today);if(fixMonth(today.getMonth())==fixMonth(today27.getMonth()))
{var i=ind-today.getDate();}else
{if(fixMonth(inm)==fixMonth(today.getMonth()))
{var i=ind-today.getDate();}else
{var i=(numDaysMth-today.getDate())+ind}}
return i;}
function convertCheckinDate2rmIndex2(formobj)
{var checkinobj=formobj.checkin;var indateobj=StrDMY2DateOBJ(checkinobj.value);var ind=indateobj.getDate();var inm=indateobj.getMonth();var today=indateobj;var numDaysMth=getNumberDays(today);var today27=plusDate(27,today);if(fixMonth(today.getMonth())==fixMonth(today27.getMonth()))
{var i=ind-today.getDate();}else
{if(fixMonth(inm)==fixMonth(today.getMonth()))
{var i=ind-today.getDate();}else
{var i=(numDaysMth-today.getDate())+ind}}
return i;}
var xmlhttp
function GetXmlHttpObject()
{if(window.XMLHttpRequest)
{return new XMLHttpRequest();}
if(window.ActiveXObject)
{return new ActiveXObject("Microsoft.XMLHTTP");}
return null;}
function showDeals(CHECKINDATE,STAYDAYS,MAXPRICE,OFFSET,STAR,KM,sMainId,sCountry,sDeals)
{xmlhttp=GetXmlHttpObject();if(xmlhttp==null)
{alert("Your browser does not support XMLHTTP!");return;}
var url="/SearchRegionHotels3.asp";url=url+"?sMainId="+sMainId;url=url+"&sCountry="+sCountry;url=url+"&checkindate="+CHECKINDATE;url=url+"&staydays="+STAYDAYS;url=url+"&maxprice="+MAXPRICE;url=url+"&star="+STAR;url=url+"&offset="+OFFSET;url=url+"&nearby="+KM;url=url+"&Deals="+sDeals;
if(sDeals=='live_deals_content'){document.getElementById("live_deals_content").innerHTML='<p align="center" style="margin:0px;padding:0px;"><img src="/images/loading.gif"><img src="/images/checkin_loading.jpg"></p>'
xmlhttp.onreadystatechange=stateChangedLD;}
else{document.getElementById("best_deals_content").innerHTML='<p align="center" style="margin:0px;padding:0px;"><img src="/images/loading.gif"><img src="/images/checkin_loading.jpg"></p>'
xmlhttp.onreadystatechange=stateChangedBD;}
xmlhttp.open("GET",url,true);xmlhttp.send(null);}
function showDeals2(CHECKINDATE,STAYDAYS,MAXPRICE,OFFSET,STAR,KM,sMainId,sCountry,sDeals)
{xmlhttp=GetXmlHttpObject();if(xmlhttp==null)
{alert("Your browser does not support XMLHTTP!");return;}
var url="/SearchRegionHotels4.asp";url=url+"?sMainId="+sMainId;url=url+"&sCountry="+sCountry;url=url+"&checkindate="+CHECKINDATE;url=url+"&staydays="+STAYDAYS;url=url+"&maxprice="+MAXPRICE;url=url+"&star="+STAR;url=url+"&offset="+OFFSET;url=url+"&nearby="+KM;url=url+"&Deals="+sDeals;if(sDeals=='live_deals_content')
{document.getElementById("live_deals_content").innerHTML='<p align="center" style="margin:10px;padding:10px;"><img src="/images/loading.gif"><img src="/images/checkin_loading.jpg"></p>'
xmlhttp.onreadystatechange=stateChangedLD;}else
{document.getElementById("best_deals_content").innerHTML='<p align="center" style="margin:0px;padding:0px;"><img src="/images/loading.gif"><img src="/images/checkin_loading.jpg"></p>'
xmlhttp.onreadystatechange=stateChangedBD;}
xmlhttp.open("GET",url,true);xmlhttp.send(null);}
function stateChangedLD(){if (xmlhttp.readyState == 4){document.getElementById("live_deals_content").innerHTML=xmlhttp.responseText;var wkj = OFFSET + 1;if((wkj<=7)&&(wkj>=1)){tdhideandshow('.wk3','.wk4','.wk1','.wk2','.top1','.top2','.top3');}if((wkj<=14)&&(wkj>=7)){tdhideandshow('.wk3','.wk4','.wk1','.wk2','.top1','.top2','.top3');}if((wkj<=21)&&(wkj>=14)){tdhideandshow('.wk1','.wk4','.wk2','.wk3','.top2','.top1','.top3');}if((wkj<=28)&&(wkj>=21)){tdhideandshow('.wk1','.wk2','.wk3','.wk4','.top3','.top1','.top2');}$(function () {$("span").tooltip({ track: true, showURL: false, fixPNG: true, extraClass: "incls", top:8, left:2});$("code").tooltip({ track: true, delay: 0, showURL: false, fixPNG: true, extraClass: "ttbg", top: -10, left: 5 });$("a.next7dt").tooltip({ track: true, delay: 0, showURL: false, showBody: " - ", extraClass: "next7dt" });});}}
function stateChangedBD(){if(xmlhttp.readyState==4){document.getElementById("best_deals_content").innerHTML=xmlhttp.responseText;var wkj = OFFSET + 1;if((wkj<=7)&&(wkj>=1)){tdhideandshow('.wk3','.wk4','.wk1','.wk2','.top1','.top2','.top3');}if((wkj<=14)&&(wkj>=7)){tdhideandshow('.wk3','.wk4','.wk1','.wk2','.top1','.top2','.top3');}if((wkj<=21)&&(wkj>=14)){tdhideandshow('.wk1','.wk4','.wk2','.wk3','.top2','.top1','.top3');}if((wkj<=28)&&(wkj>=21)){tdhideandshow('.wk1','.wk2','.wk3','.wk4','.top3','.top1','.top2');}$(function () {$("span").tooltip({ track: true, showURL: false, fixPNG: true, extraClass: "incls", top:8, left:2});$("code").tooltip({ track: true, delay: 0, showURL: false, fixPNG: true, extraClass: "ttbg", top: -10, left: 5 });$("a.next7dt").tooltip({ track: true, delay: 0, showURL: false, showBody: " - ", extraClass: "next7dt" });});}}
function showlistview(){hidemap();var ListViewContent=document.getElementById('list_view_content');var existingcontent=document.getElementById('overviewhotels');ListViewContent.innerHTML=existingcontent.innerHTML;}
function showoverview()
{hidemap();}
function showmapcnt(CHECKINDATE,STAYDAYS,MAXPRICE,OFFSET,STAR,KM,sMainId,sCountry,sDeals,byn)
{var mapcontents='<iframe src="/multimapsearchnearby.asp?sMainId='+sMainId+'&Deals='+sDeals+'&byn='+byn+'&checkindate='+CHECKINDATE+'&staydays='+STAYDAYS+'&maxprice='+MAXPRICE+'&star='+STAR+'&offset='+OFFSET+'&nearby='+KM+' " scrolling="no" width="100%" height="600" frameborder="0" marginheight="0"></iframe>';var map_view_content=document.getElementById('map_view_content');var temp=mapcontents;map_view_content.innerHTML=temp;map_view_content.style.display='block';}
function hidemap()
{var mapwrap=document.getElementById('map_view_content');if(mapwrap)
{mapwrap.style.display='none';}}
function getHotelDesc(sTitle,ihotelid,sAdd,sSub,iAct,sSum)
{var arrSum=new Array();if(sSum.indexOf('|')>0)
{var arrSum=sSum.split('|');}
else
{arrSum[0]=' '};var count=arrSum.length;var type=' '
switch(iAct)
{case 1:type='Hotel'
break
case 2:type='Motel'
break
case 3:type='Serviced Apartment'
break
case 4:type='Apartment / Holiday Unit'
break
case 5:type='Bed & Breakfast / Guest House'
break
case 6:type='Cottage / Cabin'
break
case 7:type='Backpackers / Hostel'
break
case 8:type='Tourist Park / Camping Area'
break
case 9:type='Houseboat / Cruiser'
break
default:break;}
sbody='<table>'+'<tr><td nowrap>'+sTitle+'</td></tr>'+'<tr><td nowrap>'+sAdd+', '+sSub+'</td></tr>'+'<tr><td>'+'Accommodation Type:&nbsp;'+type+'</td></tr>'+'</table><table>'+'<tr>'+'<td valign="top"><img src="http://www.images.check-in.com.au/images/Homepagehotel/'+ihotelid+'.jpg"></td>'+'<td>'+'<table>'+'<tr>'+'<td><b>Room Style</b></td><td nowrap><b>Full Rate</b></td>'+'</tr>';var j=0;if(count>1)
{for(var i=0;i<count;i++)
{if(j==0)
{sbody=sbody+'<tr>'}
else if(j==2)
{sbody=sbody+'</tr>';j=0;};if(j==1)
{sbody=sbody+'<td align="right">$'+arrSum[i]+'</td>'}
else
{sbody=sbody+'<td nowrap>'+arrSum[i]+'</td>'};j++;}};sbody=sbody+'</table></td></tr></table>'
return sbody}
