function OpenDialogForDisplay(TargetURL, TargetQueryString, DialogStyle, Width)
{
	// §PÂ_Browser
	var myBrowser = navigator.userAgent; 
	//IE¡GMozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; KKMAN3.2; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET4.0C)
	//Chrome¡GMozilla/5.0 (Windows NT 5.1) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.77 Safari/534.30
	//FireFox¡GMozilla/5.0 (Windows; U; Windows NT 5.1; zh-TW; rv:1.9.2.17) Gecko/20110420 Firefox/3.6.17 
	//Safari¡GMozilla/5.0 (Windows; U; Windows NT 5.1; zh-TW) AppleWebKit/533.20.25 (KHTML, like Gecko) Version/5.0.3 Safari/533.19.4

	if ( myBrowser.indexOf("iPhone") != -1 )
	{
		myBrowser = "iPhone";
	}
	else if ( myBrowser.indexOf("iPad") != -1 )
	{
		myBrowser = "iPad";
	}
	else if ( myBrowser.indexOf("MSIE") != -1 )
	{
		myBrowser = "IE";
	}
	else if ( myBrowser.indexOf("Chrome") != -1 )
	{
		myBrowser = "Chrome";
	}
	else if ( myBrowser.indexOf("Firefox") != -1 )
	{
		myBrowser = "Firefox";
	}
	else if ( myBrowser.indexOf("Safari") != -1 )
	{
		myBrowser = "Safari";
	}
	
	var ScreenWidth=screen.width;
	var ScreenHeight=screen.availHeight;
	var FrameURL = "/F10A_TourSell/F10A_Frame.aspx";
	var QueryString = "?TargetURL=" + TargetURL + "&" + TargetQueryString;
	
	if ( myBrowser == "Chrome" || myBrowser == "Safari" )
	{
		ScreenHeight = ScreenHeight-55;
	}

	if ( myBrowser == "iPhone" || myBrowser == "iPad" )
	{
		window.open(FrameURL + QueryString,"");
	}
	else
	{
		switch ( DialogStyle )
		{
			case 1 :
				window.showModalDialog(FrameURL + QueryString, document, 'dialogWidth:' + Width + 'px; dialogHeight:' + (ScreenHeight-0) + 'px; help:0; dialogTop:1px; dialogLeft:0px; status:1; resizable:0; center:1');			
				break;
			case 2 :
				window.showModalDialog(FrameURL + QueryString, document, 'dialogWidth:' + Width + 'px; dialogHeight:' + (ScreenHeight-0) + 'px; help:0; dialogTop:1px; dialogLeft:' + (ScreenWidth - Width) + 'px; status:1; resizable:0; center:1');			
				break;
		}
	}
}

function OpenDialogForAcceptValue(TargetURL, TargetQueryString, DialogStyle, Width)
{
	var myAcceptValue;
	var ScreenWidth=screen.width;
	var ScreenHeight=screen.availHeight;
	var FrameURL = "/F10A_TourSell/F10A_Frame.aspx";
	var QueryString = "?TargetURL=" + TargetURL + "&" + TargetQueryString;

	switch ( DialogStyle )
	{
		case 1 :
			myAcceptValue = window.showModalDialog(FrameURL + QueryString, document, 'dialogWidth:' + Width + 'px; dialogHeight:' + (ScreenHeight-0) + 'px; help:0; dialogTop:0px; dialogLeft:0px; status:1; resizable:0; center:1');			
			break;
		case 2 :
			myAcceptValue = window.showModalDialog(FrameURL + QueryString, document, 'dialogWidth:' + Width + 'px; dialogHeight:' + (ScreenHeight-0) + 'px; help:0; dialogTop:0px; dialogLeft:' + (ScreenWidth - Width) + 'px; status:1; resizable:0; center:1');			
			break;
	}
	
	return myAcceptValue;
}

// ¶}±Ò®ÈÀ]®y¼Ð¦ì¸m
function OpenDisplayGoogleMap(obj)
{
	var HotelNo				= obj.HotelNo;
	var ScreenWidth			= screen.width;
	var ScreenHeight		= screen.availHeight;			
	var WinWidth			= 650;
	var FrameURL			= "/F10A_TourSell/F10A_Frame.aspx";
	var TargetURL			= "/F10A_TourSell/F10A_Q02_DisplayGoogleMap.aspx&TitleName=F10A_Q02 ®ÈÀ]®y¼Ð¦ì¸m";
	var TargetQueryString	= "HotelNo=" + HotelNo;
	var QueryString			= "?TargetURL=" + TargetURL + "&" + TargetQueryString;
	window.showModalDialog(FrameURL + QueryString, document, 'dialogWidth:' + WinWidth + 'px; dialogHeight:' + (ScreenHeight-0) + 'px; help:0; dialogTop:0px; dialogLeft:' + (ScreenWidth - WinWidth) + 'px;  status:1; resizable:0; center:1');
}
