
	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;
						}
					}
}




function slideSwitch() {
    var $active = $('#slideshow IMG.active');

    if ($active.length == 0) $active = $('#slideshow IMG:last');

    // use this to pull the images in the order they appear in the markup
    var $next = $active.next().length ? $active.next()
        : $('#slideshow IMG:first');

    // uncomment the 3 lines below to pull the images in random order

    // var $sibs  = $active.siblings();
    // var rndNum = Math.floor(Math.random() * $sibs.length );
    // var $next  = $( $sibs[ rndNum ] );


    $active.addClass('last-active');

    $next.css({ opacity: 0.0 })
        .addClass('active')
        .animate({ opacity: 1.0 }, 3000, function () {
            $active.removeClass('active last-active');
        });
}

$(function () {
    setInterval("slideSwitch()", 5000);
});
