﻿<!--
var DecData = new QSData()
var new_window

function QSData()
{
    var vMapFields;
}

function IniDecData()
{
    DecData.vMapFields = "";
    return 1;
}
function openwin(url,winName,features) {
	url = encodeURI(url); 
	if (typeof (features) == "undefined") 
		var hintW=window.open(url,winName);
	else	
		var hintW = window.open(url,winName,features);
		
	if (!hintW.opener) hintW.opener = self;
    if (hintW.focus != null) hintW.focus();	
}
 
//---------------------------------------------------------------------------------
// 執行開窗HELP程式
// 傳入: vMapFields, 於呼叫程式內設定回傳物件名稱
//       urlname, 執行的(HELP)ASP程式名稱, 不含附加檔名 (.asp)
//		 wHeight, 0:標準高, 否則自訂
//		 wWidth , 0:標準寬, -1:小於標準寬 1:大於標準寬, 否則自訂
//		 wTop	, 0:置中, 否則自訂垂直起始位置
//		 wLeft	, 0:置中, 否則自訂水平左起位置
//				  一般傳入0,0,0,0 , 未定則全螢幕
//				  螢幕: 768 * 1024	

function HISearch(vMapFields, urlname,wHeight,wWidth,wTop,wLeft) 
{
	var ret = IniDecData();
	
	DecData.vMapFields = vMapFields;
	url = "/webhelp/" + urlname ;
	
	//-- 計算開窗的大小及位置
	if (wHeight <= 0)											// 標準高
		{wHeight = 350;}
	else 
		if (wHeight > screen.heigh)
			{wHeight = screen.heigh;}
		
	if (wWidth == 0)											// 標準寬
		{wWidth = 650}
	else		
		if (wWidth <= -1)										// 標準寬-1
			{wWidth = 450}
		else		
			if (wWidth == 1)									// 標準寬+1
				{wWidth = 850}
			else		
				if (wWidth > screen.width)
					{wWidth = screen.width}
		
	if (wTop<=0 || wTop =='')									// 置中
		{ wTop = (screen.height - wHeight) / 2;}		  
	else 
		if (screen.height - wHeight < wTop)						// 偏下方, 否則自訂值
		{ wTop = screen.height - wHeight}		
	
	if (wLeft<=0 || wLeft=='')									// 置中
		{ wLeft= (screen.width  - wWidth ) / 2; }
	else 
		if (screen.width - wWidth < wLeft)						// 偏右方, 否則自訂值
		{ wWidth = screen.width - wWidth}		

	// 開窗呼叫help程式    
	new_window = openwin(url,"qs","height="+wHeight+",width="+wWidth+",left="+wLeft+",top="+wTop+",status=no,toolbar=no,menubar=no,resizable=yes,scrollbars=yes");	
}



