if (!(window.m)) {
    m=new Array();
     
    m[0] = new Array();    m[0].push( [ 'home', '&nbsp;&nbsp;&nbsp;Home&nbsp;&nbsp;&nbsp;', 'index.php','Home Page'] );
	
	m[1] = new Array();    m[1].push( [ 'reservation', '&nbsp;&nbsp;&nbsp;Reservation&nbsp;&nbsp;&nbsp;', 'reservation/menu.php', 'Reservation'] );
			
	m[2] = new Array();    m[2].push( [ 'accommodation', '&nbsp;&nbsp;&nbsp;Accommodations & Rates&nbsp;&nbsp;&nbsp;', 'accommodation.html', 'Accommodations & Rates'] );
	
	m[3] = new Array();    m[3].push( [ 'meetings & events', '&nbsp;&nbsp;&nbsp;Meetings & Events&nbsp;&nbsp;&nbsp;', 'events.html', 'Meetings & Events'] );
	
	m[4] = new Array();    m[4].push( [ 'facilities', '&nbsp;&nbsp;&nbsp;Facilities&nbsp;&nbsp;&nbsp;', 'facilities.html', 'Facilities'] );
	
//	m[5] = new Array();    m[5].push( [ 'packages', '&nbsp;&nbsp;&nbsp;Packages&nbsp;&nbsp;&nbsp;', 'packages.html', 'Packages'] );
	                       
    m[5] = new Array();    m[5].push( [ 'location', '&nbsp;&nbsp;&nbsp;Location&nbsp;&nbsp;&nbsp;', 'location.html', 'Location'] );
	
	m[6] = new Array();    m[6].push( [ 'enquiry', '&nbsp;&nbsp;&nbsp;Enquiry&nbsp;&nbsp;&nbsp;', 'enquiry.php', 'Enquiry'] );
	
	m[7] = new Array();    m[7].push( [ 'e-complaint', '&nbsp;&nbsp;&nbsp;E-Complaint&nbsp;&nbsp;&nbsp;', 'Ecomplaint/index.php', 'E-Complaint'] ); 
    
	m[8] = new Array();    m[8].push( [ 'login', '&nbsp;&nbsp;&nbsp;Login&nbsp;&nbsp;&nbsp;', 'redirectLogin.html','Login'] );  
    
}

if (!(window.aI)) {
    aI=new Array();
    aI[0] = new Array();    aI[0].push( [ 'pavement', 'Pavement', 'pavement.jpg','pavement2.jpg','01_Pavement'] ); 
    aI[1] = new Array();    aI[1].push( [ 'shoulder', 'Shoulder', 'shoulder.jpg','shoulder2.jpg','02_Shoulder'] ); 
    aI[2] = new Array();    aI[2].push( [ 'furniture', 'Furniture', 'furniture.jpg', 'furniture2.jpg', '04_Furniture'] ); 
    aI[3] = new Array();    aI[3].push( [ 'bridge', 'Bridge', 'bridge.jpg', 'bridge.jpg','05_Bridge'] ); 
    aI[4] = new Array();    aI[4].push( [ 'culvert', 'Culvert', 'culvert.jpg', 'culvert2.jpg','05c_Culvert'] ); 
    aI[5] = new Array();    aI[5].push( [ 'drain', 'Drain', 'drain.jpg', 'drain2.jpg','06_Drain'] ); 
}
if (!(window.aD)) {
    aD=new Array();
    aD.push([ '01', '01_Kota Kinabalu', 'Kota Kinabalu' ]);  aD.push([ '02', '02_Papar', 'Papar' ]);       
    aD.push([ '03', '03_Kota Belud', 'Kota Belud' ]);        aD.push([ '04', '04_Tuaran', 'Tuaran' ]);
    aD.push([ '05', '05_Kudat', 'Kudat' ]);                  aD.push([ '06', '06_Ranau', 'Ranau' ]);
    aD.push([ '07', '07_Sandakan', 'Sandakan' ]);            aD.push([ '08', '08_Labuk Sugut', 'Labuk Sugut' ]);
    aD.push([ '09', '09_Kinabatangan', 'Kinabatangan' ]);    aD.push([ '10', '10_Tawau', 'Tawau' ]);         
    aD.push([ '11', '11_Lahad Datu', 'Lahad Datu' ]);        aD.push([ '12', '12_Semporna', 'Semporna' ]);
    aD.push([ '13', '13_Keningau', 'Keningau' ]);            aD.push([ '14', '14_Tambunan', 'Tambunan' ]);   
    aD.push([ '15', '15_Pensiangan', 'Pensiangan' ]);        aD.push([ '16', '16_Tenom', 'Tenom' ]);         
    aD.push([ '17', '17_Beaufort', 'Beaufort' ]);            aD.push([ '18', '18_Kuala Penyu', 'Kuala Penyu' ]);
    aD.push([ '19', '19_Sipitang', 'Sipitang' ]);            aD.push([ '21', '21_Penampang', 'Penampang' ]);  
    aD.push([ '22', '22_Kota Marudu', 'Kota Marudu' ]);      aD.push([ '23', '23_Pitas', 'Pitas' ]);       
    aD.push([ '24', '24_Kunak', 'Kunak' ]);
}
        
htmlStyle = { 'bgColor':'#0000ff', 'fontColor':'#000000', 'menuBgColor':'#FFFF00', 'menuFontColor':'orange', 'logo':'globinaco5.jpg'  };        
window.onresize= doResize;
var myMouseX = 0;
var myMouseY = 0;
var IE = document.all?true:false;
if (!IE) document.captureEvents(Event.MOUSEMOVE)
document.onmousemove = getMouseXY;
function getMouseXY(e) {
   var IE = document.all?true:false;
   if (IE) { myMouseX = event.clientX + document.body.scrollLeft;
             myMouseY = event.clientY + document.body.scrollTop;  }
   else {    myMouseX = e.pageX;   myMouseY = e.pageY;   }  
   if (myMouseX < 0){myMouseX = 0;}   
   if (myMouseY < 0){myMouseY = 0;}  
   return true;
}
var _emptyTags = {"IMG":true, "BR":true, "INPUT":true, "META":true, "LINK":true, "PARAM":true, "HR":true };
if (!IE) {
   HTMLElement.prototype.__defineGetter__("outerHTML", function () {
      var attrs = this.attributes;    var str = "<" + this.tagName;
      for (var i = 0; i < attrs.length; i++)   str+=" "+attrs[i].name+"=\""+ attrs[i].value+"\"";
      if (_emptyTags[this.tagName])    return str + ">";
      return str + ">" + this.innerHTML + "</" + this.tagName + ">";
   });
}
function getLocSearchValue(theKey) {
   var q = location.search;
   if(q.length > 1) { q = q.substring(1, q.length); } else { q = null;  }
   if(q) {
      keyValuePairs = q.split('&');
      for (var i=0; i < keyValuePairs.length; i++) {
         if(this.keyValuePairs[i].split("=")[0] == thekey) {
            return keyValuePairs[i].split("=")[1];
         }
      }
   } 
   return false;
}
function getRef(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 objExist(objToTest) {
   if (objToTest == null || objToTest == undefined) {  return false; }
   return true;
}
function getWebPath() {
   var string  = self.location.href.split( "/" );
   var cP =''; for ( var i =3; i < ( string.length-1 ); i++ )  cP=cP+'../'; 
   return cP;
}
function getHtmlName() {
   var program = self.location.pathname;
   var nPos=program.indexOf('/');
   while (nPos!=-1) {  
      program=program.substring(1, program.length);   
      nPos=program.indexOf('/'); 
   }    
}
 function doResize() {
   if (typeof BodyJsExist == "string") {  setBodyImg();   }
   if (typeof LogoJsExist == "string") {  resizeLogo();   }
   if (typeof MenuJsExist == "string") resizeMenu();
   if (typeof intranet == "string"){     if (intranet=="login")   intranetResize(); }
   //if (typeof iamhere == "string"){     if (iamhere=="login")     loginResize();   }
   if (typeof intranet == "string"){    if (intranet=="login")    intranetResize();   }
   //if (typeof inventory == "string"){   InvResize();   }
   if (typeof cThisNewPosition == "string"){   setNewPosition();   }
   if (typeof loginPHPexist == "string"){      loginPHPheight();   }
}
function fixPNG(myImage) {
   var arVersion = navigator.appVersion.split("MSIE")
   var version = parseFloat(arVersion[1])
    if ((version >= 5.5) && (version < 7) && (document.body.filters)) 
    {
       var imgID = (myImage.id) ? "id='" + myImage.id + "' " : ""
	   var imgClass = (myImage.className) ? "class='" + myImage.className + "' " : ""
	   var imgTitle = (myImage.title) ? 
		             "title='" + myImage.title  + "' " : "title='" + myImage.alt + "' "
	   var imgStyle = "display:inline-block;" + myImage.style.cssText
	   var strNewHTML = "<span " + imgID + imgClass + imgTitle
                  + " style=\"" + "width:" + myImage.width 
                  + "px; height:" + myImage.height 
                  + "px;" + imgStyle + ";"
                  + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
                  + "(src=\'" + myImage.src + "\', sizingMethod='scale');\"></span>"
	   myImage.outerHTML = strNewHTML	  
    }
}
function SignOff() {
      document.cookie = "validuser=;expires=Thu, 01-Jan-1970 00:00:01 GMT";
      document.cookie = "userid=;expires=Thu, 01-Jan-1970 00:00:01 GMT";
      document.cookie = "password=;expires=Thu, 01-Jan-1970 00:00:01 GMT";
      document.cookie = "area=;expires=Thu, 01-Jan-1970 00:00:01 GMT";
      document.cookie = "district_zone=;expires=Thu, 01-Jan-1970 00:00:01 GMT";
      document.cookie = "su=;expires=Thu, 01-Jan-1970 00:00:01 GMT";
}

//var ImageDoExists = false;
//function ImageExists(URL) {
//    var tester=new Image();
//    tester.onLoad=isGood;
//    tester.onError=isBad;
//    var nL = ImageExists.arguments.length;
//    if (nL>0) { tester.src=ImageExists.arguments[1]; } else { tester.src='images/px1.gif'; };
//}
//function isGood() {    ImageDoExists = true;  }
//function isBad()  {    ImageDoExists = false; }

function dec2hex( s ) { return ( s<15.5 ? '0' : '' ) + Math.round( s ).toString( 16 ); }
function hex2dec( s ) { return parseInt( s, 16 ); }
function val2hex( s ) { return s.value.toLowerCase().replace( /[^\da-f]/g, '' ).replace( /^(\w)(\w)(\w)$/, '$1$1$2$2$3$3' ); }
function incColor( colorStr, colorMode, incByDecimal ) {
   var hasSign='';   var cS='';    var nS;
   if (colorStr.substring(0,1)=='#') { hasSign='#';  colorStr = colorStr.substring(1,colorStr.length); }
   var cR = cS=colorStr.substring(0,2);
   var cG = cS=colorStr.substring(2,4);
   var cB = cS=colorStr.substring(4,6);
   if (colorMode.substring(0,1).toLowerCase()=='r') {  cR = increseColor(cR);   }
   else if (colorMode.substring(0,1).toLowerCase()=='g') {   cG = increseColor(cG); }
   else if (colorMode.substring(0,1).toLowerCase()=='b') {   cB = increseColor(cB); }
   return hasSign+cR+cG+cB;
}
function increseColor(s,incByDecimal) {
   if (incByDecimal==undefined)  incByDecimal=1; 
   nS = hex2dec( s );
   nS = nS +incByDecimal;
   if (nS>255) nS=255;
   if (nS<0) nS=0;
   return dec2Hex(nS);
}
function num(nStr,deci) {
    if (num.arguments.length<2) deci=0;
    nStr.toFixed(deci); 
	nStr += '';
	x = nStr.split('.');
	x1 = x[0];
	x2 = x.length > 1 ? '.' + x[1] : '';
	var rgx = /(\d+)(\d{3})/;
	while (rgx.test(x1)) {  x1 = x1.replace(rgx, '$1' + ',' + '$2'); }
	return x1 + x2;
}
function money(nStr,deci) {
    if (num.arguments.length<2) deci=0;
    nStr.toFixed(deci); 
	nStr += '';
	x = nStr.split('.');
	x1 = x[0];
	x2 = x.length > 1 ? '.' + x[1] : '';
	var rgx = /(\d+)(\d{3})/;
	while (rgx.test(x1)) {  x1 = x1.replace(rgx, '$1' + ',' + '$2'); }
    var zX=x1;
    var xB='';   sB='';  if ((zX/1000000000)>1)   { xB=Math.int(zX/1000000000);   zX = zX-xB; sB=","; }
    var xM='';   sM='';  if ((zX/1000000)>1)   { xM=Math.int(zX/1000000);   zX = zX-xM; sM=","; }
    var xT='';   sT='';  if ((zX/1000)>1)   { xT=Math.int(zX/1000);   x1 = zX-xT; sT=",";   }
	return xB+sB +xM+sM +xT+sT +x1 + x2;
}
function isAlien(a) {
   //Internet Explorer holds references to objects which are not JavaScript objects, and which produce errors if they are treated as JavaScript objects. This is a problem because typeof identifies them as JavaScript objects. The isAlien() function will return true if a is one of those alien objects.
   return isObject(a) && typeof a.constructor != 'function';
}
function isArray(a) {
    //it was produced by the Array constructor or by using the [ ] array literal notation.
    return isObject(a) && a.constructor == Array;
}
function isBoolean(a) {
   //isBoolean(a) returns true if a is one of the boolean values, true or false.
    return typeof a == 'boolean';
}
function isEmpty(o) {
   //isEmpty(a) returns true if a is an object or array or function containing no enumerable members.
    var i, v;
    if (isObject(o)) {
        for (i in o) {
            v = o[i];
            if (isUndefined(v) && isFunction(v)) {
                return false;
            }
        }
    }
    return true;
}
function isFunction(a) {
   //isFunction(a) returns true if a is a function. Beware that some native functions in IE were made to look like objects instead of functions. This function does not detect that
    return typeof a == 'function';
}
function isNull(a) {
   //isNull(a) returns true if a is the null value.
    return a === null;
}
function isNumber(a) {
   //isNumber(a) returns true if a is a finite number. It returns false if a is NaN or Infinite. It also returns false if a is a string that could be converted to a number
    return typeof a == 'number' && isFinite(a);
}
function isObject(a) {
   //isObject(a) returns true if a is an object, and array, or a function. It returns false if a is a string, a number, a boolean, or null, or undefined
    return (a && typeof a == 'object') || isFunction(a);
}
function isString(a) {
    return typeof a == 'string';
}
function isUndefined(a) {
   //isUndefined(a) returns true if a is the undefined value. You can get the undefined value from an uninitialized variable or from a missing member of an object
    return typeof a == 'undefined';
} 
function toAddEvent( obj, type, fn ) { 
   //addEvent( document.getElementById('foo'), 'click', doSomething );
   //addEvent( obj, 'mouseover', function(){ alert('hello!'); } );
  if ( obj.attachEvent ) { 
    obj['e'+type+fn] = fn; 
    obj[type+fn] = function(evt){ obj['e'+type+fn](evt); }
    obj.attachEvent( 'on'+type, obj[type+fn] ); 
  } else 
    obj.addEventListener( type, fn, false ); 
} 
function toRemoveEvent( obj, type, fn ) { 
  //removeEvent( object, eventType, function );
  if ( obj.detachEvent ) { 
    obj.detachEvent( 'on'+type, obj[type+fn] ); 
    obj[type+fn] = null; 
  } else 
    obj.removeEventListener( type, fn, false ); 
} 
//function reloadRecovery() {
//   if ( (typeof autoInit=='function') && (document.body.clientWidth<9000)) { 
//      //fixing the IE6 refresh problem on select-options cases
//      //alert('window was Refreshed'); 
//   } 
//}
//window.onunload=reloadRecovery();
//document.oncontextmenu=doContectMenu;
//function doContectMenu() { alert('active context menu'); }
 
