 function addzero( value )
   {
      while( value.length<2 ) value = String("0") + value;
      return value;
   }
   
function checkDateOrder(frm, ci_day, ci_month_year, co_day, co_month_year) {
    if (document.getElementById) {
        var frm = document.getElementById(frm);
        // create date object from checkin values
        // set date to 12:00 to avoid problems with one
        // date being wintertime and the other summertime
        var my = frm[ci_month_year].value.split("-");
        var ci = new Date (my[0], my[1]-1, frm[ci_day].value, 12, 0, 0, 0);

        // create date object from checkout values
        my = frm[co_month_year].value.split("-");
        var co = new Date (my[0], my[1]-1, frm[co_day].value, 12, 0, 0, 0);

        // if checkin date is at or after checkout date,
        // add a day full of milliseconds, and set the
        // selectbox values for checkout date to new value
        if (ci >= co){
            co.setTime(ci.getTime() + 1000 * 60 * 60 * 24);
            frm[co_day].value =  co.getDate();
            var com = co.getMonth()+1;
            frm[co_month_year].value = co.getFullYear() + "-" + com;
        }
    }
}


//Usp
var uspnum = 0;
var usp= new Array();

usp[0]="Book online";
usp[1]="Pay at the hotel!";
usp[2]="Best price guaranteed!";



function showusp(){
    var el = document.getElementById('usps');
    el.innerHTML="";
    if (uspnum % 2)
      el.className = "even"
    else
      el.className = "odd"
    el.innerHTML=usp[uspnum%3];
    uspnum++;
    setTimeout("showusp()", 2000);
}
