
var sPop = null;
var postSubmited = false;

document.write("<style type='text/css'id='defaultPopStyle'>");
document.write(".cPopText { font-family: Verdana; background-color: #FFFFCC; border: 1px #000000 solid; font-size: 11px; padding-right: 4px; padding-left: 4px; height: 16px; padding-top: 2px; padding-bottom: 2px; visibility: hidden; filter: Alpha(Opacity=90)}");

document.write("</style>");
document.write("<div id='popLayer' style='position:absolute;z-index:1000' class='cPopText'></div>");


function showPopupText() {
	var o=event.srcElement;
	MouseX=event.x;
	MouseY=event.y;
	if(o.alt!=null && o.alt!="") { o.pop=o.alt;o.alt="" }
        if(o.title!=null && o.title!=""){ o.pop=o.title;o.title="" }
	if(o.pop!=sPop) {
		sPop=o.pop;
		if(sPop==null || sPop=="") {
			popLayer.style.visibility="hidden";	
		} else {
			if(o.dyclass!=null) popStyle=o.dyclass 
			else popStyle="cPopText";
			popLayer.style.visibility="visible";
			showIt();
		}
	}
}

function showIt() {
	popLayer.className=popStyle;
	popLayer.innerHTML=sPop.replace(/<(.*)>/g,"&lt;$1&gt;").replace(/\n/g,"<br>");;
	popWidth=popLayer.clientWidth;
	popHeight=popLayer.clientHeight;
	if(MouseX+12+popWidth>document.body.clientWidth) popLeftAdjust=-popWidth-24
		else popLeftAdjust=0;
	if(MouseY+12+popHeight>document.body.clientHeight) popTopAdjust=-popHeight-24
		else popTopAdjust=0;
	popLayer.style.left=MouseX+12+document.body.scrollLeft+popLeftAdjust;
	popLayer.style.top=MouseY+12+document.body.scrollTop+popTopAdjust;
}

document.onmouseover=showPopupText;


// loading
function pagefinal(){
	this.ns4 = (document.layers) ? true : false;
	this.ie4 = (document.all) ? true : false;
	if(this.ns4){
		document.layers["loading"].visibility="hide";
	}else if(this.ie4){
		document.all("loading").style.visibility="hidden";
	}
}

function PopUpWin(pop_up_url,pop_up_name,pop_up_features){
	window.open(pop_up_url,pop_up_name,pop_up_features);
}

function SelectJump(targ,sel_Obj,restore){
	eval(targ+".location='"+sel_Obj.options[sel_Obj.selectedIndex].value+"'");
	if (restore) sel_Obj.selectedIndex=0;
}

function PopUpBooking(hotel_district,hotel_region,hotel_name,form_name,language){
	if(hotel_name!=""){
		booking_url ="https://www.hotelsbookingcenter.com/ssl/reservation.php?region="+hotel_district+"&hotelname="+hotel_name+"&ct=Singapore&title=Hotel-Reservation-Form&dn=singapore-hotel.com&language="+language+"&color=006699";
	}
	else{
		booking_url ="https://www.hotelsbookingcenter.com/ssl/reservation.php?dn=singapore-hotel.com";
	}
	window.open(booking_url,'BookingForm','width=780,height=500,scrollbars=yes,status=yes,resizable=yes');
}

function PopUpEnquiry(hotel_district,hotel_region,hotel_name,form_name,language){
	if(hotel_name!=""){
		booking_url ="http://www.hotelsbookingcenter.com/enquiry.php?region="+hotel_district+"&hotelname="+hotel_name+"&ct=Singapore&title=Hotel-PreBook-Enquiry-Form&dn=singapore-hotel.com&language="+language+"&color=006699";
	}
	else{
		booking_url ="http://www.hotelsbookingcenter.com/enquiry.php?dn=singapore-hotel.com";
	}
	window.open(booking_url,'PreBookEnquiryForm','width=780,height=580,scrollbars=yes,status=yes,resizable=yes');
}