function popWin(url, width, height, windowName, scrollbar, content){
	var x = (screen.width) ? (screen.width-width) / 2 : 100;
	var y = (screen.height) ? (screen.height-height) / 2 : 100;

	var features = "width=" + width + "px, height=" + height + "px, top=" + y + "px, left=" + x + "px";
		features += (scrollbar) ? ", scrollbars=yes" : "";
		features += ", resizable=yes";
	if (!windowName){
		windowName = "untitled";
	}
	var popWindow = window.open(url, windowName, features);

	if (popWin.arguments.length == 6 && content != ""){
		popWindow.document.write(content);
	}
	if (document.layers){
		window.moveTo(x, y);
	}
	popWindow.focus();
}

var slideShowSpeed = 5000

var crossFadeDuration = 5

var Pic = new Array()

Pic[0] = '../../images/danang.jpg'
Pic[1] = '../../images/danang1.jpg'
Pic[2] = '../../images/danang2.jpg'
Pic[3] = '../../images/danang3.jpg'
Pic[4] = '../../images/danang4.jpg'
//Pic[0] = '../images/christmas_002.jpg'
//Pic[1] = '../images/christmas_003.jpg'
//Pic[2] = '../images/christmas_005.jpg'
//Pic[3] = '../images/christmas_004.jpg'
//Pic[4] = '../images/christmas_001.jpg'

var t
var j = 0
var p = Pic.length
var preLoad = new Array()
for (i = 0; i < p; i++){
   preLoad[i] = new Image()
   preLoad[i].src = Pic[i]
}

function runSlideShow(){
   if (document.all){
      document.images.SlideShow.style.filter="blendTrans(duration=2)"
      document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)"
      document.images.SlideShow.filters.blendTrans.Apply()      
   }
   document.images.SlideShow.src = preLoad[j].src
   if (document.all){
      document.images.SlideShow.filters.blendTrans.Play()
   }
   j = j + 1
   if (j > (p-1)) j=0
   t = setTimeout('runSlideShow()', slideShowSpeed)
}

function checkAvail()
{
	var frm = document.check_avail_form;
	if (frm.room_type.value=="") {
		alert("Please select room type.");
		frm.room_type.focus();
		return false;
	}
	frm.submit();
	frm.checkAvailibility.disabled = true;
	return true;
}