// JavaScript Document
var offsetfromcursorX=12 //Customize x offset of tooltip
var offsetfromcursorY=10 //Customize y offset of tooltip
var offsetdivfrompointerX=10 //Customize x offset of tooltip DIV relative to pointer image
var offsetdivfrompointerY=14 //Customize y offset of tooltip DIV relative to pointer image. Tip: Set it to (height_of_pointer_image-1).
document.write('<div id="dhtmltooltip"></div>') //write out tooltip DIV
document.write('<img id="dhtmlpointer" src="http://www.fargotravel.com/images/hotelsinfo/arrow2.gif">') //write out pointer image
var ie=document.all
var ns6=document.getElementById && !document.all
var enabletip=false
if (ie||ns6)
var tipobj=document.all? document.all["dhtmltooltip"] : document.getElementById? document.getElementById("dhtmltooltip") : ""
var pointerobj=document.all? document.all["dhtmlpointer"] : document.getElementById? document.getElementById("dhtmlpointer") : ""
function ietruebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}
function ddrivetip(thetext, thewidth, thecolor){
if (ns6||ie){
if (typeof thewidth!="undefined") tipobj.style.width=thewidth+"px"
if (typeof thecolor!="undefined" && thecolor!="") tipobj.style.backgroundColor=thecolor
tipobj.innerHTML=thetext
enabletip=true
return false
}
}
function isNull(val){return(val==null);}
function isdefined(a) {
  return typeof a == 'undefined';
}
var thetext;
function ShowExBed(whereidAD, whereidCH, XrateAD, XrateCH){
loadcookie();
var currencyValue;
var popCurrValue;
var currencyVal=cookieval.innerHTML;
if(isdefined(currencyVal)){ currencyVal="us";}
if(currencyVal==""){ currencyVal="us";}
//alert(currencyVal);
if(isNull(currencyVal)){ currencyVal="us";}
	if(currencyVal=="au"){
		popCurrValue="AUD";
		currencyValue=auRate;
	}
	if(currencyVal=="eu"){
		popCurrValue="EUR";
		currencyValue=euRate;
	}
	if(currencyVal=="hk"){
		popCurrValue="HKD";
		currencyValue=hkRate;
	}
	if(currencyVal=="jp"){
		popCurrValue=unescape("%A5");
		currencyValue=jpRate;
	}
	if(currencyVal=="ru"){
		popCurrValue="RUR";
		currencyValue=ruRate;
	}
	if(currencyVal=="sg"){
		popCurrValue="SGD";
		currencyValue=sgRate;
	}
	if(currencyVal=="th"){
		popCurrValue="THB";
		currencyValue=thRate;
	}
	if(currencyVal=="uk"){
		popCurrValue=unescape("%A3");
		currencyValue=ukRate;
	}
	if(currencyVal=="us"){
		popCurrValue="$";
		currencyValue=usRate;
	}
	if(currencyVal=="aed"){
		popCurrValue="AED";
		currencyValue=aedRate;
	}
if(XrateAD==0){
	XrateADVal="N/A";
}else{
	if(currencyVal=="th"){
		XrateADVal=popCurrValue+" "+XrateAD;
	}else{
		XrateADVal=doRound(XrateAD,currencyValue,popCurrValue);
	}
}
if(XrateCH==0){
	XrateCHVal="N/A";
}else{
	if(currencyVal=="th"){
		XrateCHVal=popCurrValue+" "+XrateCH;
	}else{
		XrateCHVal=doRound(XrateCH,currencyValue,popCurrValue);
	}
}
thetext="<table><tr><td><div id=extrarateDiv><b>Extra Bed Rate</b><br>Adult : <span id=Xrate"+whereidAD+">"+XrateADVal+"<br>Child : <span id=Xrate"+whereidCH+">"+XrateCHVal+"</div></td></tr></table>"
if (ns6||ie){
tipobj.innerHTML=thetext
enabletip=true
return false
}
}

function positiontip(e){
if (enabletip){
var nondefaultpos=false
var curX=(ns6)?e.pageX : event.x+ietruebody().scrollLeft;
var curY=(ns6)?e.pageY : event.y+ietruebody().scrollTop;
//Find out how close the mouse is to the corner of the window
var winwidth=ie&&!window.opera? ietruebody().clientWidth : window.innerWidth-20
var winheight=ie&&!window.opera? ietruebody().clientHeight : window.innerHeight-20
var rightedge=ie&&!window.opera? winwidth-event.clientX-offsetfromcursorX : winwidth-e.clientX-offsetfromcursorX
var bottomedge=ie&&!window.opera? winheight-event.clientY-offsetfromcursorY : winheight-e.clientY-offsetfromcursorY
var leftedge=(offsetfromcursorX<0)? offsetfromcursorX*(-1) : -1000
//if the horizontal distance isn't enough to accomodate the width of the context menu
if (rightedge<tipobj.offsetWidth){
//move the horizontal position of the menu to the left by it's width
tipobj.style.left=curX-tipobj.offsetWidth+"px"
nondefaultpos=true
}
else if (curX<leftedge)
tipobj.style.left="5px"
else{
//position the horizontal position of the menu where the mouse is positioned
tipobj.style.left=curX+offsetfromcursorX-offsetdivfrompointerX+"px"
pointerobj.style.left=curX+offsetfromcursorX+"px"
}
//same concept with the vertical position
if (bottomedge<tipobj.offsetHeight){
tipobj.style.top=curY-tipobj.offsetHeight-offsetfromcursorY+"px"
nondefaultpos=true
}
else{
tipobj.style.top=curY+offsetfromcursorY+offsetdivfrompointerY+"px"
pointerobj.style.top=curY+offsetfromcursorY+"px"
}
tipobj.style.visibility="visible"
if (!nondefaultpos)
pointerobj.style.visibility="visible"
else
pointerobj.style.visibility="hidden"
}
}
function hideddrivetip(){
if (ns6||ie){
enabletip=false
tipobj.style.visibility="hidden"
pointerobj.style.visibility="hidden"
tipobj.style.left="-1000px"
tipobj.style.backgroundColor=''
tipobj.style.width=''
}
}
document.onmousemove=positiontip

function showTemplate(id){
	var textinfo='';
	textinfo+='<table border="0" width="265" id="table1" cellspacing="0" cellpadding="0" style="border: 1px solid #6699FF">';
	textinfo+='<tr>';
	textinfo+='<td colspan="2" bgcolor="#6699FF" valign="top">';
	textinfo+='<p style="margin: 2px" align="center"><span lang="en-us">';
	textinfo+='<font style="font-weight: bold; font-size: 9pt; font-family: Arial, Helvetica, sans-serif" color="#FFFFFF">';
	textinfo+='<b>'+hotelname[id]+'</b>';
	textinfo+='</font>';
	textinfo+='<font color="#FFCC00" face="Arial, Helvetica, sans-serif" style="font-size: 9pt; font-weight: 700">'+hotelclass[id]+'</font></span></td>';
	textinfo+='	</tr>';
	textinfo+='	<tr>';
	textinfo+='<td bgcolor="#FFFFFF" width="71" valign="top" height="53">';
	textinfo+='<p align="center">';
	textinfo+='<img border="0" src="'+hotelimg[id]+'" width="'+hotelwidth[id]+'" height="'+hotelheight[id]+'"><br>';
	textinfo+='<font face="Arial" style="font-size: 8pt; font-weight: 700">Rate from<br>'+hotelratefrom[id]+'</font></td>';
	textinfo+='<td bgcolor="#FFFFFF" width="196" valign="top" height="53">';
	textinfo+='<p style="margin: 5px">';
	textinfo+=''+hoteldetail[id]+'';
	textinfo+='</td>';
	textinfo+='	</tr>';
	textinfo+='</table>';
	return textinfo;
}
// mredkj.com
// v1.5.3
function NumberFormat(num, inputDecimal){this.COMMA = ',';this.PERIOD = '.';this.DASH = '-'; this.LEFT_PAREN = '('; this.RIGHT_PAREN = ')'; this.LEFT_OUTSIDE = 0; this.LEFT_INSIDE = 1;  this.RIGHT_INSIDE = 2;  this.RIGHT_OUTSIDE = 3;  this.LEFT_DASH = 0; this.RIGHT_DASH = 1; this.PARENTHESIS = 2; this.NO_ROUNDING = -1; this.num;this.numOriginal;this.hasSeparators = false;  this.separatorValue;  this.inputDecimalValue; this.decimalValue;  this.negativeFormat; this.negativeRed; this.hasCurrency;  this.currencyPosition;  this.currencyValue;  this.places;this.roundToPlaces; this.setNumber = setNumberNF;this.toUnformatted = toUnformattedNF;this.setInputDecimal = setInputDecimalNF; this.setSeparators = setSeparatorsNF; this.setCommas = setCommasNF;this.setNegativeFormat = setNegativeFormatNF; this.setNegativeRed = setNegativeRedNF; this.setCurrency = setCurrencyNF;this.setCurrencyPrefix = setCurrencyPrefixNF;this.setCurrencyValue = setCurrencyValueNF; this.setCurrencyPosition = setCurrencyPositionNF; this.setPlaces = setPlacesNF;this.toFormatted = toFormattedNF;this.toPercentage = toPercentageNF;this.getOriginal = getOriginalNF;this.moveDecimalRight = moveDecimalRightNF;this.moveDecimalLeft = moveDecimalLeftNF;this.getRounded = getRoundedNF;this.preserveZeros = preserveZerosNF;this.justNumber = justNumberNF;this.expandExponential = expandExponentialNF;this.getZeros = getZerosNF;this.moveDecimalAsString = moveDecimalAsStringNF;this.moveDecimal = moveDecimalNF;this.addSeparators = addSeparatorsNF;if (inputDecimal == null) {this.setNumber(num, this.PERIOD);} else {this.setNumber(num, inputDecimal); }this.setCommas(true);this.setNegativeFormat(this.LEFT_DASH); this.setNegativeRed(false); this.setCurrency(false); this.setCurrencyPrefix('$');this.setPlaces(2);}function setInputDecimalNF(val){this.inputDecimalValue = val;}function setNumberNF(num, inputDecimal){if (inputDecimal != null) {this.setInputDecimal(inputDecimal); }this.numOriginal = num;this.num = this.justNumber(num);}function toUnformattedNF(){return (this.num);}function getOriginalNF(){return (this.numOriginal);}function setNegativeFormatNF(format){this.negativeFormat = format;}function setNegativeRedNF(isRed){this.negativeRed = isRed;}function setSeparatorsNF(isC, separator, decimal){this.hasSeparators = isC;if (separator == null) separator = this.COMMA;if (decimal == null) decimal = this.PERIOD;if (separator == decimal) {this.decimalValue = (decimal == this.PERIOD) ? this.COMMA : this.PERIOD;} else {this.decimalValue = decimal;}this.separatorValue = separator;}function setCommasNF(isC){this.setSeparators(isC, this.COMMA, this.PERIOD);}function setCurrencyNF(isC){this.hasCurrency = isC;}function setCurrencyValueNF(val){this.currencyValue = val;}function setCurrencyPrefixNF(cp){this.setCurrencyValue(cp);this.setCurrencyPosition(this.LEFT_OUTSIDE);}function setCurrencyPositionNF(cp){this.currencyPosition = cp}function setPlacesNF(p){this.roundToPlaces = !(p == this.NO_ROUNDING); this.places = (p < 0) ? 0 : p; }function addSeparatorsNF(nStr, inD, outD, sep){nStr += '';var dpos = nStr.indexOf(inD);var nStrEnd = '';if (dpos != -1) {nStrEnd = outD + nStr.substring(dpos + 1, nStr.length);nStr = nStr.substring(0, dpos);}var rgx = /(\d+)(\d{3})/;while (rgx.test(nStr)) {nStr = nStr.replace(rgx, '$1' + sep + '$2');}return nStr + nStrEnd;}function toFormattedNF(){	var pos;var nNum = this.num; var nStr;            var splitString = new Array(2);   if (this.roundToPlaces) {nNum = this.getRounded(nNum);nStr = this.preserveZeros(Math.abs(nNum)); } else {nStr = this.expandExponential(Math.abs(nNum)); }if (this.hasSeparators) {nStr = this.addSeparators(nStr, this.PERIOD, this.decimalValue, this.separatorValue);}var c0 = '';var n0 = '';var c1 = '';var n1 = '';var n2 = '';var c2 = '';var n3 = '';var c3 = '';var negSignL = (this.negativeFormat == this.PARENTHESIS) ? this.LEFT_PAREN : this.DASH;var negSignR = (this.negativeFormat == this.PARENTHESIS) ? this.RIGHT_PAREN : this.DASH;if (this.currencyPosition == this.LEFT_OUTSIDE) {if (nNum < 0) {if (this.negativeFormat == this.LEFT_DASH || this.negativeFormat == this.PARENTHESIS) n1 = negSignL;if (this.negativeFormat == this.RIGHT_DASH || this.negativeFormat == this.PARENTHESIS) n2 = negSignR;}if (this.hasCurrency) c0 = this.currencyValue;} else if (this.currencyPosition == this.LEFT_INSIDE) {if (nNum < 0) {if (this.negativeFormat == this.LEFT_DASH || this.negativeFormat == this.PARENTHESIS) n0 = negSignL;if (this.negativeFormat == this.RIGHT_DASH || this.negativeFormat == this.PARENTHESIS) n3 = negSignR;}if (this.hasCurrency) c1 = this.currencyValue;}else if (this.currencyPosition == this.RIGHT_INSIDE) {if (nNum < 0) {if (this.negativeFormat == this.LEFT_DASH || this.negativeFormat == this.PARENTHESIS) n0 = negSignL;if (this.negativeFormat == this.RIGHT_DASH || this.negativeFormat == this.PARENTHESIS) n3 = negSignR;}if (this.hasCurrency) c2 = this.currencyValue;}else if (this.currencyPosition == this.RIGHT_OUTSIDE) {if (nNum < 0) {if (this.negativeFormat == this.LEFT_DASH || this.negativeFormat == this.PARENTHESIS) n1 = negSignL;if (this.negativeFormat == this.RIGHT_DASH || this.negativeFormat == this.PARENTHESIS) n2 = negSignR;}if (this.hasCurrency) c3 = this.currencyValue;}nStr = c0 + n0 + c1 + n1 + nStr + n2 + c2 + n3 + c3;if (this.negativeRed && nNum < 0) {nStr = '<font color="red">' + nStr + '</font>';}return (nStr);}function toPercentageNF(){nNum = this.num * 100;nNum = this.getRounded(nNum);return nNum + '%';}function getZerosNF(places){var extraZ = '';var i;for (i=0; i<places; i++) {extraZ += '0';}return extraZ;}function expandExponentialNF(origVal){if (isNaN(origVal)) return origVal;var newVal = parseFloat(origVal) + ''; var eLoc = newVal.toLowerCase().indexOf('e');if (eLoc != -1) {var plusLoc = newVal.toLowerCase().indexOf('+');var negLoc = newVal.toLowerCase().indexOf('-', eLoc); var justNumber = newVal.substring(0, eLoc);if (negLoc != -1) {var places = newVal.substring(negLoc + 1, newVal.length);justNumber = this.moveDecimalAsString(justNumber, true, parseInt(places));} else {if (plusLoc == -1) plusLoc = eLoc;var places = newVal.substring(plusLoc + 1, newVal.length);justNumber = this.moveDecimalAsString(justNumber, false, parseInt(places));}newVal = justNumber;}return newVal;} function moveDecimalRightNF(val, places){var newVal = '';if (places == null) {newVal = this.moveDecimal(val, false);} else {newVal = this.moveDecimal(val, false, places);}return newVal;}function moveDecimalLeftNF(val, places){var newVal = '';if (places == null) {newVal = this.moveDecimal(val, true);} else {newVal = this.moveDecimal(val, true, places);}return newVal;}function moveDecimalAsStringNF(val, left, places){var spaces = (arguments.length < 3) ? this.places : places;if (spaces <= 0) return val; var newVal = val + '';var extraZ = this.getZeros(spaces);var re1 = new RegExp('([0-9.]+)');if (left) {newVal = newVal.replace(re1, extraZ + '$1');var re2 = new RegExp('(-?)([0-9]*)([0-9]{' + spaces + '})(\\.?)');		newVal = newVal.replace(re2, '$1$2.$3');} else {var reArray = re1.exec(newVal); if (reArray != null) {newVal = newVal.substring(0,reArray.index) + reArray[1] + extraZ + newVal.substring(reArray.index + reArray[0].length); }var re2 = new RegExp('(-?)([0-9]*)(\\.?)([0-9]{' + spaces + '})');newVal = newVal.replace(re2, '$1$2$4.');}newVal = newVal.replace(/\.$/, ''); return newVal;}function moveDecimalNF(val, left, places){var newVal = '';if (places == null) {newVal = this.moveDecimalAsString(val, left);} else {newVal = this.moveDecimalAsString(val, left, places);}return parseFloat(newVal);}function getRoundedNF(val){val = this.moveDecimalRight(val);val = Math.round(val);val = this.moveDecimalLeft(val);return val;}function preserveZerosNF(val){var i;val = this.expandExponential(val);if (this.places <= 0) return val; var decimalPos = val.indexOf('.');if (decimalPos == -1) {val += '.';for (i=0; i<this.places; i++) {val += '0';}} else {var actualDecimals = (val.length - 1) - decimalPos;var difference = this.places - actualDecimals;for (i=0; i<difference; i++) {val += '0';}}return val;}function justNumberNF(val){newVal = val + '';var isPercentage = false;if (newVal.indexOf('%') != -1) {newVal = newVal.replace(/\%/g, '');isPercentage = true; }var re = new RegExp('[^\\' + this.inputDecimalValue + '\\d\\-\\+\\(\\)eE]', 'g');	newVal = newVal.replace(re, '');var tempRe = new RegExp('[' + this.inputDecimalValue + ']', 'g');var treArray = tempRe.exec(newVal); if (treArray != null) {var tempRight = newVal.substring(treArray.index + treArray[0].length); newVal = newVal.substring(0,treArray.index) + this.PERIOD + tempRight.replace(tempRe, ''); }if (newVal.charAt(newVal.length - 1) == this.DASH ) {newVal = newVal.substring(0, newVal.length - 1);newVal = '-' + newVal;}else if (newVal.charAt(0) == this.LEFT_PAREN&& newVal.charAt(newVal.length - 1) == this.RIGHT_PAREN) {newVal = newVal.substring(1, newVal.length - 1);newVal = '-' + newVal;}newVal = parseFloat(newVal);if (!isFinite(newVal)) {newVal = 0;}if (isPercentage) {newVal = this.moveDecimalLeft(newVal, 2);}return newVal;}// GET CURRENCY RATES
// UDATE DATE May 13, 2008 12:30:07 Update no. 3
var auRate=1.06;
var euRate=0.64;
var hkRate=7.91;
var jpRate=104.73;
var ruRate=0.00;
var sgRate=1.37;
var thRate=31.89;
var ukRate=0.52;
var usRate=1.00;
var aedRate=4.52;
var childAge = '2|3|4|5|6|7|8|9|10|11';
function buildOpt(values,texts) {

	var valuesT = values.split("|");
	var textsT = texts.split("|");
	var j = parseInt(valuesT.length);
	for (var i=0;i<j;i++) {
		document.writeln('<option value="' + valuesT[i] + '">' + textsT[i] + '</option>');
	}
}

function buildOptenq(values,texts,seroom) {

	var valuesT = values.split("|");
	var textsT = texts.split("|");
	var j = parseInt(valuesT.length);
	for (var i=0;i<j;i++) {
		if(i==seroom-1)
		{
		document.writeln('<option value="' + valuesT[i] + '" selected>' + textsT[i] + '</option>');
		}else{ document.writeln('<option value="' + valuesT[i] + '">' + textsT[i] + '</option>');}
	}
}

var childArray = new Array(0,0,0,0,0,0,0,0,0,0);
function showChildTitle() {
	var c = 0;
	var r = document.selectrooms.rooms[document.selectrooms.rooms.selectedIndex].value;
	for (var i=0;i<r;i++) {
		c = c + childArray[i];
	}
	return true;
}
function showChild(me,Span,nb) {
	var occ = me[me.selectedIndex].value;
	var vals = occ.split("|");
	var gocc=vals[0]+"|"+vals[1];
	if (gocc == '2|1') {
		childArray[nb-1] = 1;
		document.getElementById(Span).style.display = '';
	} else {
		childArray[nb-1] = 0;
		document.getElementById(Span).style.display = 'none';
	}
	return showChildTitle();
}

function showRoom() {
	var nbR = document.selectrooms.rooms[document.selectrooms.rooms.selectedIndex].value;
	var j;
	for (var i=1; i<=10; i++) {
		document.getElementById('r'+i).style.display = 'none';
	}
	for (i=1; i<=nbR; i++) {
		document.getElementById('r'+i).style.display = 'inline';
	}

	return showChildTitle();
}

function showRoomenq(seroom) {
	var nbR = document.selectrooms.rooms[document.selectrooms.rooms.selectedIndex].value;
	var j;
	if(seroom>0)
	{
		nbR=seroom;
	}
	for (var i=1; i<=10; i++) {
		document.getElementById('r'+i).style.display = 'none';
	}
	for (i=1; i<=nbR; i++) {
		document.getElementById('r'+i).style.display = '';
	}

	return showChildTitle();
}
function buildRoomList(txt,langid) {
	if(langid==2){
		var exad="Extrabed for adult";
		var exch="Extrabed for child (0-11 years old)";
	}else{
		var exad="Extrabed for adult";
		var exch="Extrabed for child (0-11 years old)";
	}
	for (var i=2;i<=10;i++) {
		document.writeln('<div id="r'+i+'" style="display:none;"><table border=0 cellpadding=0 cellspacing=0><tr>');
		document.writeln('<tr><td><img src="http://www.fargotravel.com/images/spacer.gif" width=120 height=1></td><td></td></tr>');
		document.writeln('<TD align=left valign=top style="width:120px;padding-top:6px;"><b>'+txt+' #'+i+'</b></td>');
		document.writeln('<td align="left" style="padding-left:6px;padding-top:6px;"><select name="roomO[]" onChange="return showChild(this,\'kid_'+i+'\','+i+');" style="width:250px;" id="room['+i+']">');
		document.writeln('<script>');
		document.writeln('buildOcc();');
		document.writeln('<\/script>');
		document.writeln('</select><input type="hidden" name="selectroomtype_id[]">');
		document.writeln('<div id="kid_'+i+'" style="display:none;"><INPUT TYPE="radio" NAME="extrabed_room_'+i+'_1" value=1>'+exad+'<INPUT TYPE="radio" NAME="extrabed_room_'+i+'_1" value=2> '+exch+'');
		document.writeln('</div></td></tr></table></div>');
	}
	return true;
}

function buildRoomListEnquire(txt,langid) {
	if(langid==2){
		var exad="Extrabed for adult";
		var exch="Extrabed for child (0-11 years old)";
	}else{
		var exad="Extrabed for adult";
		var exch="Extrabed for child (0-11 years old)";
	}
	for (var i=2;i<=10;i++) {
		//alert("Cextrabed_room_"+i+"_1");
		document.writeln('<tr id="r'+i+'" style="display:none;">');
		document.writeln('<td align="left" class="c8" style="padding-left:3px;padding-top:6px;"><select name="roomO[]" onChange="chkRoomEnquery();showChild(this,\'kid_'+i+'\','+i+');" style="width:460px;" id="room['+i+']" class="plain c8">');
		document.writeln('<script>');
		document.writeln('buildOcc('+i+');');
		document.writeln('<\/script>');
		document.writeln('</select><input type="hidden" name="selectroomtype_id[]">');
		document.writeln('<div id="kid_'+i+'" style="display:none;"><INPUT TYPE="radio" onClick="chkRoomEnquery();" NAME="extrabed_room_'+i+'_1" id="Aextrabed_room_'+i+'_1" value=1>'+exad+'<INPUT TYPE="radio" onClick="chkRoomEnquery();" NAME="extrabed_room_'+i+'_1" id="Cextrabed_room_'+i+'_1" value=2> '+exch+'');
		document.writeln('</div></td></tr>');
	}
	return true;
}

function buildRoomListEnquireRate(txt,langid) {
	if(langid==2){
		var exad="Extrabed for adult";
		var exch="Extrabed for child (0-11 years old)";
	}else{
		var exad="Extrabed for adult";
		var exch="Extrabed for child (0-11 years old)";
	}
	for (var i=2;i<=10;i++) {
		document.writeln('<tr id="r'+i+'" style="display:none;">');
		document.writeln('<td align="left" style="padding-left:3px;padding-top:6px;"><select name="roomO[]" onChange="chkRoomEnquery();" style="width:460px;" id="room['+i+']">');
		document.writeln('<script>');
		document.writeln('buildOcc('+i+');');
		document.writeln('<\/script>');
		document.writeln('</select><input type="hidden" name="selectroomtype_id[]">');
		document.writeln('</td></tr>');
	}
	return true;
}// JavaScript Document
var bustcachevar=1 //bust potential caching of external pages after initial request? (1=yes, 0=no)
var loadedobjects=""
var rootdomain="http://"+window.location.hostname
var bustcacheparameter=""

function ajaxpage(url, containerid){
var page_request = false
if (window.XMLHttpRequest) // if Mozilla, Safari etc
page_request = new XMLHttpRequest()
else if (window.ActiveXObject){ // if IE
try {
page_request = new ActiveXObject("Msxml2.XMLHTTP")
} 
catch (e){
try{
page_request = new ActiveXObject("Microsoft.XMLHTTP")
}
catch (e){}
}
}
else
return false
page_request.onreadystatechange=function(){
loadpage(page_request, containerid)
}
if (bustcachevar) //if bust caching of external page
bustcacheparameter=(url.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime()
page_request.open('GET', url+bustcacheparameter, true)
page_request.send(null)
}
function isDefined(a) {
  return typeof a == 'undefined';
}

function loadpage(page_request, containerid){
if (isDefined(loadingtext)) { var loadingtext="Loading Information";}
if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1)){
document.getElementById(containerid).innerHTML=page_request.responseText;
}else{
document.getElementById(containerid).innerHTML="<im" + "g src=\"/images/loading.gif\" alt=\""+loadingtext+"\"><br><blink><b>"+loadingtext+"</b></blink>";
}
}

function loadobjs(){
if (!document.getElementById)
return
for (i=0; i<arguments.length; i++){
var file=arguments[i]
var fileref=""
if (loadedobjects.indexOf(file)==-1){ //Check to see if this object has not already been added to page before proceeding
if (file.indexOf(".js")!=-1){ //If object is a js file
fileref=document.createElement('script')
fileref.setAttribute("type","text/javascript");
fileref.setAttribute("src", file);
}
else if (file.indexOf(".css")!=-1){ //If object is a css file
fileref=document.createElement("link")
fileref.setAttribute("rel", "stylesheet");
fileref.setAttribute("type", "text/css");
fileref.setAttribute("href", file);
}
}
if (fileref!=""){
document.getElementsByTagName("head").item(0).appendChild(fileref)
loadedobjects+=file+" " //Remember this object as being already added to page
}
}
}




<!-- // ADD REVIEW ON HOTEL DETAIL
        function Chkfrom(frm){
			clearInterval(intervalID);
                var frm=document.review;
                if(frm.name.value.length==0){
                        alert('Please fill your name');
                        frm.name.focus();
                return false;}
                if(frm.country.selectedIndex==0){
                        alert('Please select your country');
                        frm.country.focus();
                return false;}
                if(!Is_Email_Valid(frm.email.value)){
                         frm.email.focus();
                return false;}
                if(frm.rating.value==0){
                        alert('Please rate this hotel');
                        frm.rating.focus();
                return false;}
                if(frm.review_title.value.length==0){
                        alert('Please fill your title of review.');
                        frm.review_title.focus();
                return false;}
                if(frm.review_msg.value.length==0){
                        alert('Please fill your review.');
                      //  frm.review_msg.focus();
                return false;}
			changetime();
        return true;
        }

function Is_Email_Valid(email){

        if (email.indexOf('@')==-1)
                {alert("You missed @ in your eMail Address");
                 return false;}
        if (email.indexOf('.')==-1)
                {alert("You missed . in your eMail Address");
                return false;}
        if (email.indexOf('@.')!=-1)
                {alert("Email Address contains an Unrecognised '@.' character ");
                 return false;}
        return true;}

function loadFooter(langid){
	createXMLHttpRequest();
	var url;
	if(langid=='russian'){
		url = "/languages/russian/footer.php";
	}else{
		url = "/languages/english/footer.html";
	}
	xmlHttp.open("GET", url, true);
	xmlHttp.onreadystatechange = function(){
		if(xmlHttp.readyState == 4) {
			if(xmlHttp.status == 200) {
				document.getElementById("showfooter").innerHTML = xmlHttp.responseText;
			}
		}
	};
	xmlHttp.send(null);

}

 function displayStatus() {
        var mg = document.getElementById("mg_status_container");
        mg.style.visibility="visible";
 }

 function clearStatus() {
        var mg = document.getElementById("mg_status_container");
        mg.style.visibility="hidden";
 }
//-->

