//È¡µØÖ·À¸²ÎÊý
function getParameter(varName)
{
    var query = location.search;
    if (query != null || query != "")
    {
        query = query.replace(/^\?+/, "");
        var qArray = query.split("&");
        var len = qArray.length;
        if (len > 0)
        {
            for (var i = 0; i < len; i++)
            {
                var sArray = qArray[i].split("=", 2);
                if (sArray[0] && sArray[1] && sArray[0] == varName)
                {
                    return unescape(sArray[1]);
                }
            }
        }
    }
    return null;
}
function OpenTool(Flag,Module,Id,Name,MemberId)
{
   strUrl="../Common/"+Flag+".aspx?Module="+Module+"&Id="+Id+"&Name="+Name+"&MemberId="+MemberId;
   OpenWin("Tools",strUrl,640,670);       
}

function ShowMemberAuth()
{
   strMobile=document.all.MOBILE.value;  
   strEmail=document.all.EMAIL.value;  
   OpenWin("MemberAuth","../Member/MemberAuth.aspx?Mobile="+strMobile+"&Email="+strEmail,350,200);
}

function DoSearch()
{
	if (event.keyCode==13)
	{   
		event.keyCode=9;
		event.returnValue = false;
		document.all.BtnSearch.click(); 
	}	       
}
		            
function ShowAllRoom(HotelId,Rq1,Rq2,CompanyId,From)
{
    OpenWin("RoomStatus","ViewAllRoom.aspx?Id="+HotelId+"&Rq1="+Rq1+"&Rq2="+Rq2+"&CompanyId="+CompanyId+"&From="+From,750,300);
}
		
function ConfirmMsg(Msg){
    return(confirm(Msg));   
}

function btnClick()
{  
    if (event.keyCode==13)
    {   
	event.keyCode=9;
        event.returnValue = false;
	document.all.BtnSearch.click(); 
    }
}

function ShowHide(Id,HideText,ShowText){
     
     RowId="R"+Id; 
     TxtId="T"+Id;
     if (document.all[RowId].style.display=="none")
     {
        document.all[RowId].style.display="";
        document.all[TxtId].innerText=HideText;
     }
     else
     {
          document.all[RowId].style.display="none";
          document.all[TxtId].innerText=ShowText;
     }
  }     

var Win
function OpenWin(Name,strUrl,width,height)
{
var str = "height=" + height + ",innerHeight=" + height;
str += ",width=" + width + ",innerWidth=" + width;
if (window.screen) {
var ah = screen.availHeight - 30;
var aw = screen.availWidth - 10;

var xc = (aw - width) / 2;
var yc = (ah - height) / 2;

str += ",left=" + xc + ",screenX=" + xc;
str += ",top=" + yc + ",screenY=" + yc;
}
  
   if (!Win || Win.closed)
   {
     Win=open(strUrl,Name,"resizable=1,scrollbars=1," + str);
   }else{
     Win.location.href=strUrl;
     Win.focus();
   }  
}
