
function imgSwap(oImg)
{
   var strOver  = "_on"    // image to be used with mouse over
   var strOff = "_off"     // normal image
   var strImg = oImg.src
   if (strImg.indexOf(strOver) != -1) 
      oImg.src = strImg.replace(strOver,strOff)
   else
      oImg.src = strImg.replace(strOff,strOver)
}

function MM_openBrWindowGet(theURL,winName,features) { //v2.0

id=parent.document.URL;
theURL=theURL+'?hiddenField='+id;
  
  window.open(theURL,winName,features);
}

/* open browser image */
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

/* jump menu */
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

/* Control Flash */
function MM_controlShockwave(objStr,x,cmdName,frameNum) { //v3.0
  var obj=MM_findObj(objStr);
  if (obj) eval('obj.'+cmdName+'('+((cmdName=='GotoFrame')?frameNum:'')+')');
}

/* change lang */
function swapth() {

var url=document.URL;

url =(url).replace('#','');

countstr=url.length;
data=url.substr(countstr-1);

if(data=='/'){
url=url+'index.php';
}

sp_url=url.split("."); 
pointtype=(sp_url.length)-1;

type=sp_url[pointtype];

newurl =url.replace('.'+type,'-th.'+type);
window.location=newurl;
//alert(newurl);

}
function swapen() {
		var url=document.URL;
			newurl =(url).replace('#','');
			newurl =(newurl).replace('-th','');
			window.location=newurl;
}


/* swap image */
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

/* menu */
function  clearMenu(){
document.getElementById('mCompany').style.display = "none";
document.getElementById('mProject').style.display = "none";
//document.getElementById('mServices').style.display = "none";
document.getElementById('mInvestor').style.display = "none";
//document.getElementById('mCustomer').style.display = "none";
//document.getElementById('menuMain0').style.display = "block";
document.getElementById('menuRoot').style.display = "block";
document.getElementById('menuRootA').style.display = "none";
document.getElementById('menuRootB').style.display = "none";
//document.getElementById('menuRootC').style.display = "none";
document.getElementById('menuRootD').style.display = "none";
document.getElementById('menuRootE').style.display = "none";
document.getElementById('menuRootF').style.display = "none";
document.getElementById('menuRootG').style.display = "none";
}
function hiderootmenu(){
document.getElementById('menuRoot').style.display = "none";
document.getElementById('menuRootA').style.display = "none";
document.getElementById('menuRootB').style.display = "none";
//document.getElementById('menuRootC').style.display = "none";
document.getElementById('menuRootD').style.display = "none";
document.getElementById('menuRootE').style.display = "none";
document.getElementById('menuRootF').style.display = "none";
document.getElementById('menuRootG').style.display = "none";
}

/* print */
function print_content()
{ 
 var disp_setting="toolbar=yes,location=no,directories=yes,menubar=yes,"; 
      disp_setting+="scrollbars=yes,width=650, height=600, left=100, top=25"; 
 
var content_URL = document.URL; 
var content_L = document.getElementById("printcontent").innerHTML; 
var content='';
var contentArray='';
var strRe=Array('h1-address.gif',
'h1-background.gif',
'h1-board-of-directors.gif',
'h1-crowne.gif',
'h1-feedback.gif',
'h1-financial.gif',
'h1-hilight-projects.gif',
'h1-hotels.gif',
'h1-hotnews.gif',
'h1-hun-hin.gif',
'h1-ir-contact.gif',
'h1-management-team.gif',
'h1-map.gif',
'h1-meriden.gif',
'h1-newsletter.gif',
'h1-organization-chart.gif',
'h1-properties.gif',
'h1-regent.gif',
'h1-regent-hotel.gif',
'h1-sales-contact.gif',
'h1-shareholder.gif',
'h1-thesails.gif',
'h1-tready.gif',
'h1-westin.gif',
'l-crowne.gif',
'l-huahin.gif',
'l-meridien.gif',
'l-regent.gif',
'l-residences.gif',
'l-sails.gif',
'l-sheraton.gif',
'l-tremdy.gif',
'l-westin.gif',
't-crowne.gif',
't-huahin.gif',
't-meridien.gif',
't-regent.gif',
't-regent_bangkok.gif',
't-residences.gif',
't-sails.gif',
't-sheraton.gif',
't-trendy.gif',
't-westin.gif');

for(i=0;i<strRe.length;i++)
{
   
   if (content_L.indexOf(strRe[i]) != -1){
      contentArray += strRe[i]+"@";
	  //
   }

}
contentArray=contentArray.substr(0, (contentArray.length-1))



//alert(contentArray)


var docprint=window.open("","",disp_setting); 

   docprint.document.open(); 
   docprint.document.write('<html><head><title>Grande Asset Hotels And Property Public Company Limited</title>'); 
   docprint.document.write('<link href="http://www.grandeasset.com/css/print.css" rel="stylesheet" type="text/css">');
   docprint.document.write('</head>');
   docprint.document.write('<body onLoad="self.print()">');
   docprint.document.write('<table width="100%" border="0" cellspacing="5" cellpadding="5" valign="top">');
   docprint.document.write('<tr><td width="21%"><img src="http://www.grandeasset.com/engine/global/logo-ga_p.gif"></td>');
   docprint.document.write('<td width="79%" align="right">'+content_URL+'</td></tr>');  
   docprint.document.write('<tr><td colspan="2">&nbsp;</td> </tr>');
   docprint.document.write('<tr><td colspan="2">'+content_L+'</td></tr>');
   docprint.document.write('<tr><td colspan="2">&nbsp;</td></tr>');
   docprint.document.write('<tr><td colspan="2" align="left"><table  border="0" cellpadding="0" cellspacing="0">');
   docprint.document.write('<tr><td valign="bottom">&copy; Copyright 2008 All rights reserved by Grande Asset Hotels And Property Public Company Limited</td></tr>');
   docprint.document.write('</table></td></tr></table>');
   docprint.document.write('</body></html>');
   docprint.document.close(); 
   docprint.focus(); 

}

function MM_CheckFlashVersion(reqVerStr,msg){
  with(navigator){
    var isIE  = (appVersion.indexOf("MSIE") != -1 && userAgent.indexOf("Opera") == -1);
    var isWin = (appVersion.toLowerCase().indexOf("win") != -1);
    if (!isIE || !isWin){  
      var flashVer = -1;
      if (plugins && plugins.length > 0){
        var desc = plugins["Shockwave Flash"] ? plugins["Shockwave Flash"].description : "";
        desc = plugins["Shockwave Flash 2.0"] ? plugins["Shockwave Flash 2.0"].description : desc;
        if (desc == "") flashVer = -1;
        else{
          var descArr = desc.split(" ");
          var tempArrMajor = descArr[2].split(".");
          var verMajor = tempArrMajor[0];
          var tempArrMinor = (descArr[3] != "") ? descArr[3].split("r") : descArr[4].split("r");
          var verMinor = (tempArrMinor[1] > 0) ? tempArrMinor[1] : 0;
          flashVer =  parseFloat(verMajor + "." + verMinor);
        }
      }
      // WebTV has Flash Player 4 or lower -- too low for video
      else if (userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 4.0;

      var verArr = reqVerStr.split(",");
      var reqVer = parseFloat(verArr[0] + "." + verArr[2]);
  
      if (flashVer < reqVer){
        if (confirm(msg))
          window.location = "http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash";
      }
    }
  } 
}

