







//========
<!-- Author Declan Kelly Consult@kelwin.co.uk          -->
//

hestimate=''; //hidden field.. line seperated estimnate
estimate=''; //Used to show user what cost will be
quote='';    //used to build msg to send to friend
request='';  //used to itemize request.
totalcost=0;
currency="&pound;";
var today     = new Date();
var thisMonth = today.getMonth();
var thisYear  = y2k(today.getYear());


err=false;

function showPic (whichpic,where) {
var ph='ph'+where;
if (document.getElementById) {
document.getElementById(ph).src = whichpic.href;

  return false;
 } else {
  return true;
 }
}


var months = new MakeArray(13);
months[1]='Jan'; months[2]='Feb'; months[3]='Mar';
months[4]='Apr'; months[5]='May'; months[6]='Jun';
months[7]='Jul'; months[8]='Aug'; months[9]='Sept';
months[10]='Oct';months[11]='Nov';months[12]='Dec';

//alert(  document.cookie);
function addBookmark(name,ref)
{
  <!--
  bookmarkurl = 'http://www.hotelsabroad.eu/'+ref;
  bookmarktitle = "Bookmark: "+name;
  if (document.all) {
    window.external.AddFavorite(bookmarkurl,bookmarktitle);
    location.href=bookmarkurl;
  }
}


validChars="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ.-_ ";

function strip(what){
var s;
for(var j=0,  s='';j<what.TownName.value.length;j++)
  if( validChars.indexOf(what.TownName.value.charAt(j))!=-1)
    s +=what.TownName.value.charAt(j) ;

page='/spot.php?TownName='+s;
location.href=page;
}




function makeint(string){
var s;
s=0;
if (string.length == 0) return s;
for (var i=0;i < string.length;i++)
   if ((string.substring(i,i+1) >= '0') && (string.substring(i,i+1) <= '9'))
         s+= string.substring(i,i+1);
 return s*1;
 }
 
function isan(string)

 { //****put this FN in to save against bull prices!
if (string.length == 0)
         return false;
     for (var i=0;i < string.length;i++)
         if ((string.substring(i,i+1) < '0') || (string.substring(i,i+1) > '9'))
          // if (string.substring(i,i+1)!='.')
             return false;
    return true;
 }
 



function CurrencyFormatted(amount)
{
var i = parseFloat(amount);
if(isNaN(i)) { i = 0.00; }
var minus = '';
if(i < 0) { minus = '-'; }
i = Math.abs(i);
//i = parseInt((i + .005) * 100);
i = parseInt((i + .006) * 100);
i = i / 100;
s = new String(i);
if(s.indexOf('.') < 0) { s += '.00'; }
if(s.indexOf('.') == (s.length - 2)) { s += '0'; }
s = minus + s;
return s;
}

function padout(number){
return((number<10)?'0'+number:number);
}


function isHistoric (day,month,year) {
 // checks if date passed is valid
 // ie in following format: isDate(dd,mm,ccyy) 
 //    var myDate = new Date(year,month-1,day);
var myDate = new Date;
var nextyear = new Date; 
y=today.getFullYear();
nextyear.setYear(y+1);

//	alert (day+'/'+month-1+'/'+year+'='+test+' > '+today);
myDate.setDate(day);
myDate.setMonth(month); // January = 0
myDate.setFullYear(year); 
//  alert (year+'='+myDate+' > '+today);
     if (myDate < today)
		{
	//	alert (year+'A='+myDate+' > '+today);
	     alert('Booking Historic dates not possible..(yet).');
        return true;
		}


if (myDate >= nextyear)
		{
	  alert('For bookings more than a year in advance, please call 0845 3302500. ');
    return true;
		}		




	myDate.setDate(day-2);
  if (myDate <= today)
		{
	//	alert (year+'A='+myDate+' > '+today);
	     alert('For urgent bookings (within 2days), please call 0845 3302500.');
        return true;
		}		

 return false;
 }
function isnumb(string) {
     if (string.length == 0)
         return false;
     for (var i=0;i < string.length;i++)
         if ((string.substring(i,i+1) < '0') || (string.substring(i,i+1) > '9'))
             return false;

     return true;
 }

function getRequestObj() {
  // Declare variable
  var request;

  // Using exceptions, we can handle errors a bit easier
   try {
      request = new XMLHttpRequest;
   }
   catch (e) {
      try {
         request = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (E) {
         request = false;
      }
   }
   return request;
}

var http = getRequestObj();
if ( !http ) {
   alert("Houston, we have a problem.");
}

// post parameters
//    $session_values['hotelref']=$hotelref;
//    $session_values['hotelname']=$hotelname;
//    $session_values['number']=$number;
//    $session_values['room']=$roomType;
//    $session_values['date']=$booking_date;
//    $session_values['prices']=$session_price;

function bookItem(hotelref, Hotel,NumberOfRooms,roomType,ThisDate,price)
{
//alert(ThisDate);
http.open('get', 'basket/post.php?hotelref='+hotelref+'&hotelname='+Hotel+'&number='+NumberOfRooms+'&roomType='+roomType+'&booking_date='+ThisDate+'&session_price='+price,false);
//  http.open('get', 'basket/post.php?hotelrequest='+hotelrequest+'&roomrequest='+roomrequest,false);
http.onreadystatechange = handleResponse;
http.send(null);
return;
}


function PostItem(hotelrequest, roomrequest)
{
var url = "/content/layout2/basket/ajaxpost.php";
var params = "hotelrequest="+hotelrequest+"&roomrequest="+roomrequest;
http.open("POST", url, true);

//Send the proper header information along with the request
http.setRequestHeader("Content-Encoding", "utf-8");
http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
http.setRequestHeader("Content-length", params.length);
http.setRequestHeader("Connection", "close");

http.onreadystatechange = function() {//Call a function when the state changes.
	if(http.readyState == 4 && http.status == 200) {
	offDiv('Pricing');
	document.getElementById('ShowEstimate').innerHTML= "<table cellspacing='2' cellpadding='0'  align='center' width='100%'   class='infowarning'><tr><td><h3>This Property has been added to your Shortlist.</h3> You can view your shortlist at any time from the option on the main menu OR  the link shown below. <br>Otherwise please continue your search for suitable lodgings.</td></tr><tr><td align='right'><a href='/basket/view/' ><b>View Shortlist Now &raquo;</a></b></td></tr></table>";
	}
}
http.send(params);
return;
}






function handleResponse() 
   {
//   return;
   if(http.readyState == 4 && http.status == 200)
        {
        // Text returned FROM the PHP script
        var response = http.responseText;
        if(response) {
          // UPDATE ajaxTest content
  //        document.getElementById("calendar").innerHTML = response;
          }
	    }
    }

//window.onload = function() {
//getObject("calendar").focus();
//}


function bookIt(hotelref, Hotel,NumberOfRooms,roomType,FromDate,pricestr,Duration,Discount){

var validRates="0123456789";
var pricestr="0.00,"+pricestr; //add a null price at [0]
var penalty=99999999; //use this as  return value, last room night cost
var price=pricestr.split(',');

price[0]=price[10]; //rewrite price at[0] wiyth the one at[10] ... so as to have 10 prices!!!

   //1.decompose FromDate (the date) into 3 numbers
    var da=FromDate.split('/');

    for(var i=0;i<3;i++)
      {
      da[i]=padout(da[i]);
      }
    FromDate=da[0]+'/'+da[1]+'/'+da[2];
    Yy=eval(FromDate.substring(6,10));
    Mm=eval(FromDate.substring(3,5));
    Dd=eval(FromDate.substring(0,2));

    //Ensure the date dividers conform
    ThisDate=Dd+'-'+months[Mm]+'-'+padout(eval(FromDate.substring(6,10)));


        //Valid date, look up cost in tables.
        //Initialise rates from table etc.
        Count=0;
        if ((Dd>31)||(Rates[Mm].substring(Dd-1,Dd)=='X'))
          {

              alert('The property may not be available for all or some of the period you are requesting (refer to Price Calendar). Please call 0845 3302500 to check availability.');
              err=true;
              return;


          }
        Rate=Rates[Mm].substring(Dd-1,Dd);
        LastRate=Rate;
        Arriving='Arriving';

        Dd--;
        //check we have a price for days required
        for(var i = 0; i < Duration; i++)
          {
          Dd++;
          if ((Dd>31)||(Rates[Mm].substring(Dd-1,Dd)=='X'))
            {
            Dd=1;
            Mm++;
            if(Mm>12)
              Mm=1;
            }
          Rate=Rates[Mm].substring(Dd-1,Dd);
          //do we have a rate?
          if( validRates.indexOf(Rate)==-1)
            {
            alert('The property may not be available for all or some of the period you are requesting (refer to Price Calendar). Please call 0845 3302500 to check availability.');

            err=true;
            return;
            }
          //do we have a price?
          if( eval(price[Rate])<=0 || price[Rate]=="" )
            {
            alert('We have no price for '+roomType+' on ' + Dd+'-'+Mm+'-'+Yy);
            err=true;
            return false ;
            }
          }

        //post the cost per day.
        Mm=eval(FromDate.substring(3,5));
        Dd=eval(FromDate.substring(0,2));
        //Repeatedly call bookRoom for each period
estimate+="<tr class='boxlabel'><td nowrap>Number X Room Type</td><td>Date</td><td nowrap align='right'>Unit Cost</td><td align='right'>Total</td></tr>";
style='shade1_0';
roompricetotal=0*1;
        for(var i = 0; i < Duration; i++)
          {
          Rate=Rates[Mm].substring(Dd-1,Dd);
          ThisDate=Dd+'-'+months[Mm]+'-'+padout(eval(FromDate.substring(6,10)));
         //Put item on booking form
        //  bookItem(hotelref, Hotel,NumberOfRooms,roomType,ThisDate,price[Rate]);
	//	$s.= "<tr class=$style><td>$hotelname</td><td>$number X $room</td><td>$datebooked</td><td>$roomprice</td><td>$roompricesubtotal</td></tr> ";
	if(penalty> NumberOfRooms * price[Rate]) //hold this value for return value
	    penalty= NumberOfRooms * price[Rate]; //hold this value for return value

	roompricesubtotal= NumberOfRooms * price[Rate];
	roompricetotal+=roompricesubtotal;

	if(style=='shade1_0')
		style='shade1_1';
	else 
		style='shade1_0';
estimate+="<tr class='"+style+"'><td align='right' nowrap>"+ NumberOfRooms+ " x "+roomType+"</td><td align='right' nowrap>"+ThisDate+"</td><td align='right'>"+price[Rate]+"</td><td align='right'>"+CurrencyFormatted(roompricesubtotal)+"</td></tr>";
hestimate+=NumberOfRooms+ "|"+roomType+"|"+ThisDate+"|"+price[Rate]+",";

//alert(ThisDate);
          Dd++;
          if ((Dd>31)||(Rates[Mm].substring(Dd-1,Dd)=='X'))
            {
            Dd=1;
            Mm++;
            if(Mm>12)
              Mm=1;
            }
          }
totalcost+=roompricetotal;
estimate+="<tr><td colspan='3'   class='boxlabel'>Cost of "+Duration+ " nights in "+ NumberOfRooms+"X"+ roomType +" arriving "+FromDate+" is</td><td align='right'> "+currency+CurrencyFormatted(roompricetotal)+" </td></tr>  ";
quote+="\n Cost of "+Duration+ " nights in "+ NumberOfRooms+"X"+ roomType +" Arriving "+FromDate+" is "+currency+CurrencyFormatted(roompricetotal);

 



    return penalty;
    }


function MakeArray(n)
  {
  this.length = n;
  for(var i=1;i<=n;i++)
    {
    this[i]=0
    }
  return this
  }

function Init()
  {
  Rates=new MakeArray(13);
  }


function ReadyBooking(rates,form,hotel,pricebasedon,minimumstay)

{
//hide map as it is a distraction!

hestimate='';
err=false;

if(typeof(Discount)=='undefined')Discount=0.0;
Init();
n=rates.length;
for(var i=1;i<=n;i++)
  {
  Rates[i]=rates[i]
  }

var Duration=form.nights.value;
if(form.nights.value<minimumstay)Duration=minimumstay;
var supplement=0;
var m=form.M.selectedIndex;
var y=form.Y.selectedIndex;
y= eval (thisYear+y);

//var sr=form.SR.value;



if(isan(Duration)==false)
 {
 alert('The number of nights you wish to Stay has an invalid character.');
 err=true;
 }

else
if(isan(form.D.value)==false)
 {
 alert('The Day you intend to arrive should be in the range 00-31.');
 err=true;
 }
else if (isHistoric(form.D.value,m,y)) 
    {
    err=true;
    } 
else
  {
  m++;




  FromDate=form.D.value+'/'+m+'/'+y;


totalcost=0*1;



estimate="<table width=100% border='0' cellspacing='0' cellpadding='0'  class='TabOrangeBox '><tr><th colspan='4'  class='menu_top'>Price Breakdown for:-<br>"+Duration+"night stay at "+hotel+"</th></tr>";
quote='';
request='';
if(form.nights.value<minimumstay)
  {
  estimate+="<tr><td colspan='4'  class='infowarning'> *** Please note minimum stay at this property is  "+minimumstay+" nights. ***</td></tr>";
  quote="Please note minimum stay at this property is  "+minimumstay+" nights. \n";
  }
  
  
var roomscheck=0; //total all the number of rooms requested
//currency check.. so as to calc.price only in selected currency
min=1;max=9;currency='&pound;';
if(document.getElementById("currency2").checked == true)
  {
  min=9;
  max=17;
  currency='&#36;';
  }
if(document.getElementById("currency3").checked == true)
  {
  min=17;
  max=25;
  currency='&euro;';
  }  
//console.log(min+' to '+max);
for(eid=min;eid<max;eid++)
  {

  numberofrooms=document.getElementById("numberOfRooms"+eid).value;
  numberofrooms=makeint(numberofrooms);
  roomPrice=document.getElementById("roomPrice"+eid).value;
  roomType=document.getElementById("roomType"+eid).value;

  roomscheck+= numberofrooms; //total all the number of rooms requested

  if(numberofrooms>0)
    {
    supplement+=bookIt(form.mapref.value, hotel,numberofrooms, roomType, FromDate, roomPrice, Duration,Discount);
    }
  }

  if(roomscheck<=0) //number of rooms requested is zero! (or less)
	 {
	alert('You forgot to enter Accommodation Requirments. ');
	err=true;
	}// else alert(roomscheck);


    if(!err)
	  {
	  onDiv('ShowEstimate');offDiv('Alternatives');offDiv('BookingForm');
	  //location.href='booking.php';
	  if(Duration<pricebasedon)
		{
	    estimate+="<tr><td colspan='3'  class='boxlabel'>Short Stay' supplement is </td><td align='right'><strong> "+currency+CurrencyFormatted(supplement)+"</strong></td></tr>";
	    quote +="\n Short stay supplement charge. "+currency+supplement;

	    hestimate+="1|1|SHORT STAY SUPLEMENT"+"|"+supplement;

		totalcost+=supplement;

		}
	  
	  estimate+="<tr><td colspan='4' class='boxlabel' align='right'>* Total Amount Due  "+currency+CurrencyFormatted(totalcost)+"</td></tr>";
	  
	  estimate+="<tr><td colspan='4' >(* If there is any variation to the shown prices we will advise you before proceeding.)</td></tr>";
		       // set up room request onto input for form	
    hotelrequest =form.mapref.value+"|"+hotel+"|"+ FromDate+"|"+Duration+"|"+currency;
   	estimate+="<tr><td colspan='4' align='center'><input type='hidden' id='hotelrequest'  name='hotelrequest' value='"+hotelrequest+"'><input type='hidden' id='roomrequest'  name='roomrequest' value='"+hestimate+"'><input type='submit' value='Add to Shortlist &raquo;'></td></tr>";
     
	  
     quote +="\n\n Total cost of your stay would be "+currency+CurrencyFormatted(totalcost);
	  quote +="\n\n link: http://www.hotelsabroad.eu/properties/"+form.mapref.value+"/ \n"; 
	  request=quote;
	  quote+="\n Note: Price is correct at time of estimate.\n ";


	
	  
	  
	  estimate+="</table>";


	  
	//  document.getElementById('ShowEstimate').innerHTML=estimate;

	  // Build mesage for send quote to a friend
	  	   var quotetmp="";
         quotetmp="Hi\n";
         quotetmp+="I just found the following and thought you might be interested.\n\n"
         quotetmp+="Staying in "+hotel+"\n";
         
         quote=quotetmp+quote;
         
         request= "Staying in "+hotel+"  \n "+request;
       // set up input for form
	   estimatemsg="<input type='hidden' name='q_quote' value='"+quote+"'><pre>"+quote+"</pre>" +
					"<input type='hidden' name='r_request' value='"+request+"'>";
       //slot onto form
	   document.getElementById('EstimateMsg').innerHTML=estimatemsg;
	  
 	  document.getElementById('ShowEstimate').innerHTML=estimate;
 	  
	  changeDiv('AcceptEstimate','block');
	  }


  }
if (err==false)
  changeDiv('showmap','none');
}

///////////////////////


function Calendar(rates,Month,Year) {
  var output = '';
  firstDay = new Date(Year,Month,1);
  startDay = firstDay.getDay();

  if (((Year % 4 == 0) && (Year % 100 != 0)) || (Year % 400 == 0))
    days[1] = 29;
  else
    days[1] = 28;

  output +=
    '<table callspacing="0" cellpadding="0" border="0" class="Cal">' +
    '<tr>' +
    '<td class="cal_month" colspan="7">' + names[Month] + ' ' + Year +
    '</td></tr>'+

    '<tr class="cal_weeks" >'+
    '<td>S</td>' +
    '<td>M</td>' +
    '<td>T</td>' +
    '<td>W</td>' +
    '<td>T</td>' +
    '<td>F</td>' +
    '<td>S</td>' +
    '</tr>'+
    '<tr CLASS="Cal" align="right">';


  var column = 0;
  for (i=0; i<startDay; i++) {
    output += '<td class="Cal">&nbsp</td>';
    column++;
  }

var offset=0;//(Year-thisYear)*12
// alert(offset+'='+thisYear+'+'+Year);
  for (i=1; i<=days[Month]; i++) {



       var col=rates[offset+Month+1].substring(i-1,i);


 switch(col)
{   
case '0':
  tdcol= 'class="cal0"';
  break;
  case '1':
  tdcol= 'class="cal1"';
  break;
  case '2':
  tdcol= 'class="cal2"';
  break;
  case '3':
  tdcol= 'class="cal3"';
  break;
  case '4':
  tdcol= 'class="cal4"';
  break;
  case '5':
  tdcol= 'class="cal5"';
  break;
  case '6':
  tdcol= 'class="cal6"';
  break;
 case '7':
  tdcol= 'class="cal7"';
  break;
case '8':
  tdcol= 'class="cal8"';
  break;
case '9':
  tdcol= 'class="cal9"';
  break;
default:
  tdcol= 'class="calx"';
}


    output += '<td ' + tdcol + '>' + i+ '</td>';

    column++;
    if (column == 7) {
      output += '</tr><tr align="right" CLASS="Cal">';
      column = 0;
    }
  }
  output += '</tr></table>';

  return output;
}

function array(
  m0, m1, m2, m3, m4, m5, m6, m7, m8, m9, m10, m11
) {
  this[0]  = m0;  this[1]  = m1;
  this[2]  = m2;  this[3]  = m3;
  this[4]  = m4;  this[5]  = m5;
  this[6]  = m6;  this[7]  = m7;
  this[8]  = m8;  this[9]  = m9;
  this[10] = m10; this[11] = m11;
}

var names =
  new array(
    'Jan','Feb','Mar','Apr','May','Jun',
    'Jul','Aug','Sep','Oct','Nov','Dec'
);
var days =
  new array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);

function y2k(number) {
  return (number < 1000) ? number + 1900 : number;
}

function relCalendar(rates,m,y){

if(m>11){m=m-12; y++;}
return Calendar(rates,m,y);
}
  function seeCalendar(m1,m2,m3,m4,m5,m6,m7,m8,m9,m10,m11,m12 ){

  rates=new MakeArray(13);
  rates[0]='1234567890123456789012345678901X';
  rates[1]=m1;
  rates[2]=m2;
  rates[3]=m3;  
  rates[4]=m4;
  rates[5]=m5;
  rates[6]=m6;  
  rates[7]=m7;
  rates[8]=m8;
  rates[9]=m9;  
  rates[10]=m10;
  rates[11]=m11;
  rates[12]=m12;
  showCalendar(rates);
  }

function showCalendar(rates){

var output =

    '<table border="0" cellspacing="0" cellpadding="0">' +
  '<tr valign="top"><td>'+
  relCalendar(rates,thisMonth,thisYear) +
  '</td><td>' +
  relCalendar(rates,thisMonth+1,thisYear) +
  '</td><td>' +
  relCalendar(rates,thisMonth+2,thisYear) +
  '</td><td>' +
  relCalendar(rates,thisMonth+3,thisYear) +
  '</td><td>' +
  relCalendar(rates,thisMonth+4,thisYear) +
  '</td><td>' +
  relCalendar(rates,thisMonth+5,thisYear) +
  '</td></tr><tr valign="top"> <td>' +
  relCalendar(rates,thisMonth+6,thisYear) +
  '</td><td>' +
  relCalendar(rates,thisMonth+7,thisYear) +
  '</td><td>' +
  relCalendar(rates,thisMonth+8,thisYear) +
  '</td><td>' +
  relCalendar(rates,thisMonth+9,thisYear) +
  '</td><td>' +
  relCalendar(rates,thisMonth+10,thisYear) +
  '</td><td>' +
  relCalendar(rates,thisMonth+11,thisYear) +
  '</td></tr></table>';
document.getElementById('calendar').innerHTML=output;
//document.write(output);
return 0;
}

function showPrice(exists,roomDescription,eid,rates,q1,q2,q3,q4,q5,q6,q7,q8,q9,q10)
{

 var col;
 var p1="";
 var p2="";
 var p3="";
 var p4="";
 var p5="";
 var p6="";
 var p7="";
 var p8="";
 var p9="";
 var p10="";

if(exists!="yes")
  {

  output ="<INPUT id='roomType"+eid+"' TYPE=HIDDEN  VALUE='"+roomDescription+"'>"+
          "<INPUT id='numberOfRooms"+eid+"' TYPE=HIDDEN  VALUE='0''>"+
          "<INPUT id='roomPrice"+eid+"' TYPE=hidden  VALUE='0'>";
  document.write(output);
  return 0; //quick exit!
  }
//expose the prices that are applicable
var   ratestr="";
for(var i=1; i<=12; i++)
  ratestr+=rates[i];


  //if( ratestr.indexOf('1')!=-1)
  //   p1=CurrencyFormatted((q1 * 85)/100);
  //if( ratestr.indexOf('2')!=-1)
  //   p2=CurrencyFormatted((q2 * 85)/100);
  //if( ratestr.indexOf('3')!=-1)
  //   p3=CurrencyFormatted((q3 * 85)/100);
  //if( ratestr.indexOf('4')!=-1)
  //   p4=CurrencyFormatted((q4 * 85)/100);
 // if( ratestr.indexOf('5')!=-1)
 //    p5=CurrencyFormatted((q5 * 85)/100);
 // if( ratestr.indexOf('6')!=-1)
 //    p6=CurrencyFormatted((q6 * 85)/100);
 // if( ratestr.indexOf('7')!=-1)
 //    p7=CurrencyFormatted((q7 * 85)/100);
 // if( ratestr.indexOf('8')!=-1)
 //    p8=CurrencyFormatted((q8 * 85)/100);
 // if( ratestr.indexOf('9')!=-1)
 //    p9=CurrencyFormatted((q9 * 85)/100);


  if( ratestr.indexOf('1')!=-1)
     p1=CurrencyFormatted(q1);
  if( ratestr.indexOf('2')!=-1)
     p2=CurrencyFormatted(q2);
  if( ratestr.indexOf('3')!=-1)
     p3=CurrencyFormatted(q3);
  if( ratestr.indexOf('4')!=-1)
     p4=CurrencyFormatted(q4);
  if( ratestr.indexOf('5')!=-1)
     p5=CurrencyFormatted(q5);
  if( ratestr.indexOf('6')!=-1)
     p6=CurrencyFormatted(q6);
  if( ratestr.indexOf('7')!=-1)
     p7=CurrencyFormatted(q7);
  if( ratestr.indexOf('8')!=-1)
     p8=CurrencyFormatted(q8);
  if( ratestr.indexOf('9')!=-1)
     p9=CurrencyFormatted(q9);
  if( ratestr.indexOf('0')!=-1)
     p10=CurrencyFormatted(q10);






  output =
    '<tr  class="boxlabel">' +
    '<td align="right" nowrap >' + roomDescription +
    "<INPUT TYPE=HIDDEN id='roomType"+eid+"' VALUE='"+roomDescription+"'></td>"+
    "<td><INPUT  id='numberOfRooms"+eid+"' TYPE=TEXT  VALUE='0' SIZE='2'>"+
    "<INPUT TYPE=hidden  id='roomPrice"+eid+"' VALUE='"+p1+"," +p2+","+p3+"," +p4+"," +p5+"," +p6+"," +p7+"," +p8+"," +p9+"," +p10+"'></td>";

  if(p1.length>0)
    output +='<td class="cal1" align="right" width="40"> ' + p1+ '</td>';
  if(p2.length>0)
    output +='<td class="cal2" align="right" width="40"> ' + p2+ '</td>';
  if(p3.length>0)
    output +='<td class="cal3" align="right" width="40"> ' + p3+ '</td>';
  if(p4.length>0)
    output +='<td class="cal4" align="right" width="40"> ' + p4+ '</td>';
  if(p5.length>0)
    output +='<td class="cal5" align="right" width="40"> ' + p5+ '</td>';
  if(p6.length>0)
    output +='<td class="cal6" align="right" width="40"> ' + p6+ '</td>';
  if(p7.length>0)
    output +='<td class="cal7" align="right" width="40"> ' + p7+ '</td>';
  if(p8.length>0)
    output +='<td class="cal8" align="right" width="40"> ' + p8+ '</td>';
  if(p9.length>0)
    output +='<td class="cal9" align="right" width="40"> ' + p9+ '</td>';
  if(p10.length>0)
    output +='<td class="cal0" align="right" width="40"> ' + p10+ '</td>';
     


	
document.write(output);

}

var req;
var thediv;
function loadXMLDoc(url,div) {
thediv=div;

// Internet Explorer
try { req = new ActiveXObject("Msxml2.XMLHTTP"); }
catch(e) {
try { req = new ActiveXObject("Microsoft.XMLHTTP"); }
catch(oc) { req = null; }
}

// Mozailla/Safari
if (!req && typeof XMLHttpRequest != "undefined") { req = new XMLHttpRequest(); }

// Call the processChange() function when the page has loaded
if (req != null) {
req.onreadystatechange = processChange;
req.open("GET", url, true);
req.send(null);
}
}

function processChange() {
// The page has loaded and the HTTP status code is 200 OK
if (req.readyState == 4 && req.status == 200) {

// Write the contents of this URL to the searchResult layer
getObject(thediv).innerHTML = req.responseText;
}
}


function getObject(name) {
var ns4 = (document.layers) ? true : false;
var w3c = (document.getElementById) ? true : false;
var ie4 = (document.all) ? true : false;

if (ns4) return eval('document.' + name);
if (w3c) return document.getElementById(name);
if (ie4) return eval('document.all.' + name);
return false;
}





function onDiv(the_div)
{
var the_style = getStyleObject(the_div);
  the_style.display='block';
//changeDiv('facilities','none');
}
function offDiv(the_div)
{
var the_style = getStyleObject(the_div);
  the_style.display='none';
//changeDiv('facilities','block');
}

function changeDiv(the_div,the_change)
{
  var the_style = getStyleObject(the_div);
  if (the_style != false)
  {
    the_style.display = the_change;
  }
}
function toggleDiv(the_div)
{
  var the_style = getStyleObject(the_div);
  if (the_style.display == 'block')
  {
    the_style.display = 'none';
  }
  else
      the_style.display = 'block';

}
function showDiv(the_div)
{
  var the_style = getStyleObject(the_div);
  the_style.display = 'block';

}
function hideDiv(the_div)
{
  var the_style = getStyleObject(the_div);
  the_style.display = 'none';

}
function getStyleObject(objectId) {
  if (document.getElementById && document.getElementById(objectId)) {
    return document.getElementById(objectId).style;
  } else if (document.all && document.all(objectId)) {
    return document.all(objectId).style;
  } else {
    return false;
  }
}






function xxgetStay()
{
var today = new Date(); 
d=today.getDate();
today.setDate(d+3);
var d=today.getDate();
var m=today.getMonth();
m++;
      
output="<strong>Arrive</strong><br><pre><span><input type='TEXT' value='"+
        d +
        "' name='D'  id='D' SIZE=2>" +
        "<select id='M' name='M'><OPTION ";
       if(m==1) output+=" selected ";        
output+=">Jan<OPTION ";
       if(m==2) output+="Selected "; 
output+=">Feb<OPTION "
       if(m==3) output+="Selected "; 
output+=">Mar<OPTION ";
       if(m==4) output+="Selected "; 
output+=">Apr<OPTION ";
       if(m==5) output+="Selected ";
output+=">May<OPTION ";
       if(m==6) output+="Selected ";
output+=">Jun<OPTION ";
        if(m==7) output+="Selected ";
output+=">Jul<OPTION ";
       if(m==8) output+="Selected ";
output+=">Aug<OPTION ";
       if(m==9) output+=" selected ";
output+=">Sep<OPTION ";
       if(m==10) output+=" selected ";
output+=">Oct<OPTION ";
       if(m==11) output+=" selected ";
output+=">Nov<OPTION ";
       if(m==12) output+=" selected ";
output+=">Dec</select>" +
        "<select name='Y' id='Y'><OPTION value='0'>this Year<OPTION value='1'>Next Year</select></span></pre>" +
        "<br><strong>Length of Stay</strong><br><input type='TEXT' id='nights' name='nights' value='1' SIZE='2'>(Nights).";
document.write(output);
//document.getElementById('Mon').selectedindex = today.getMonth();
//document.getElementById('M').selectedindex = 4 ;// today.getMonth();
return 0;
}

Rxxxx=new MakeArray(13);
function init(m1,m2,m3,m4,m5,m6,m7,m8,m9,m10,m11,m12 ){

  Rxxxx[0]='1234567890123456789012345678901X';
  Rxxxx[1]=m1;
  Rxxxx[2]=m2;
  Rxxxx[3]=m3;
  Rxxxx[4]=m4;
  Rxxxx[5]=m5;
  Rxxxx[6]=m6;
  Rxxxx[7]=m7;
  Rxxxx[8]=m8;
  Rxxxx[9]=m9;
  Rxxxx[10]=m10;
  Rxxxx[11]=m11;
  Rxxxx[12]=m12;
  }
