<!--

//if (top.location != self.location) { top.location.replace(self.location); }
window.onload=function(){ initpage(); }
window.status = "Loading page ...";
function initpage()
{
	p = getID("R24menu").rows;
	if (p) for (var i = 0; i < p.length; i++) {
		p[i].onmouseover = function(){ this.bgColor="#80FF80"; };
		p[i].onmouseout  = function(){ this.bgColor="#FFFFFF"; };
	}
 
	if (thispage == "DETAIL") {
		disableClick();  
		p = getID("mainpic");
		if (p) p.ondblclick=function(){ enableClick(); };   
	}
  
	if (thispage == "BOOK") { initbook(); }
	
	p = getID("booklayer");
	if (p) p.onmouseover=function(){ bm_hideshow(1); };   
	if (p) p.onmouseout=function(){ bm_hideshow(0); };   	
	bm_getcookie();

	p = getID("strHref");
	if (p) p.innerHTML = window.location.href;
	
	if (!partner) {  loadticker();  newsticker(); }
	window.status = thishotel;
}  



// news ticker function
var newslist=new Array();
var tcnt=0;			// current news item
var curr = "";
var iii=-1;			// current letter being typed
function newsticker()
{
  // next character of current item
  if (iii < newslist[tcnt][0].length - 1)
  {
    iii++;
    temp1 = newslist[tcnt][0];
    temp1 = temp1.split('');
    curr = curr+temp1[iii];
    temp2 = newslist[tcnt][1];
    document.getElementById("mtxt").innerHTML = "<a href='http://www.sawadee.com/opener.php?go="+temp2+"' target='_blank'>"+curr+" </a>";
    setTimeout('newsticker()',10)
    return;
  }
  // new item
  iii = -1; curr = "";
  if (tcnt<newslist.length-1)
    tcnt++;
  else
    tcnt=0;
  setTimeout('newsticker()',3000)
}


// ========================== 
function getID(divID) {
    if( document.getElementById ) { //DOM; IE5, NS6, Mozilla, Opera
        return document.getElementById(divID); }
    if( document.all ) { //Proprietary DOM; IE4
        return document.all[divID]; }
    if( document.layers ) { //Netscape layers
        return document.layers[divID]; }
    if( document[divID] ) { //Netscape alternative
        return document[divID]; }
    return false;
}


function rounding(rnum,dec) {
	var rlength = dec;  // The number of decimal places to round to
	if (rnum > 8191 && rnum < 10485) {
		rnum = rnum-5000;
		var newnumber = Math.round(rnum*Math.pow(10,rlength))/Math.pow(10,rlength);
		newnumber = newnumber+5000;
	} else {
		var newnumber = Math.round(rnum*Math.pow(10,rlength))/Math.pow(10,rlength);
	}
	return newnumber;
}

// ========================== functions disable right-click and mark
function disableClick() {
   document.oncontextmenu=new Function ("return false") 
   document.onselectstart=new Function ("return false") 
   function disableselect(e){ return false } 
   function reEnable(){ return true } 
   if (window.sidebar){
      document.onmousedown=disableselect
      document.onclick=reEnable
      }
}

function enableClick() {
  document.onselectstart=new Function ("return true")
  document.oncontextmenu=new Function ("return true") 
}

// ========================== counters for enable right-click and mark
var CountClick=0;
var timerClick="";
function Set_CountClick() {
  clearTimeout(timerClick)
  CountClick++
  timerClick=setTimeout("Check_CountClick()",300)
}

function Check_CountClick() {
  if(CountClick==3) {
  document.onselectstart=new Function ("return true")
  document.oncontextmenu=new Function ("return true") 
  alert("ok")
  }
  CountClick=0
}


//-->

