function amg_ModalWin(sSrc, iWidth, iHeight, sWinName, iXOffset) {
	if (!iXOffset) iXOffset=0; iXOffset=parseInt(iXOffset);
	if (!sWinName) var sWinName=null;
	iWidth=parseInt(iWidth);
	iHeight=parseInt(iHeight);
	var sw=screen.availWidth; var sh=screen.availHeight;
	if ((iWidth+20)>sw) iWidth=sw-20;
	if ((iHeight+24)>sh) iHeight=sh-24;
	var ww=iWidth+20; var wh=iHeight+24;
	// ====
	var sResize="no";
	if (ww>800) {
		ww=800; sResize="yes";
	}
	if (wh>600) {
		wh=600; sResize="yes";
	}
	// ====
	var wx=(sw-ww)/2; if (wx<0) wx=0;
	var wy=(sh-wh)/2; if (wy<0) wy=0;
	wx+=iXOffset;
	// ================================
	var sFlusher=""; while (sFlusher.length<12) sFlusher+="&nbsp;";
	// ================================
	var bu=window.open("about:blank", sWinName, "left="+wx+",top="+wy+",width="+ww+",height="+wh+",location=no,menubar=no,resizable="+sResize+",status=no,titlebar=yes,toolbar=no");
	bu.focus();
	var sExtntn=sSrc.substr(sSrc.lastIndexOf(".")).toUpperCase();
	if (sExtntn==".GIF"||sExtntn==".PNG"||sExtntn==".JPG"||sExtntn==".GPEG"||sExtntn==".BMP") {
		bu.document.open();
		bu.document.write("<HTML><HEAD><TITLE>&nbsp;"+"site image viewer"+sFlusher+"</TITLE></HEAD><BODY SCROLL='"+sResize+"' ONSELECTSTART='return false;' ONSELECT='return false;' ONCONTEXTMENU='return false;' ONCLICK='self.close();' ONBLUR='self.close();'><IMG SRC='"+sSrc+"' BORDER='0'></BODY></HTML>");
		bu.document.close();
	} else {
		bu.document.location.href=sSrc;
	}
	return false;
}

function wd_ChPgSearch(sSrchStr) {
	var sPath=document.location.pathname;
	if (sPath.substr(0, 1)=="/") sPath=sPath.substr(1);
	var sNewHref="http://";
	sNewHref+=document.location.hostname+"/";
	sNewHref+=sPath+"?";
	sNewHref+=sSrchStr;
	document.location.href=sNewHref;
	return false;
}

function wd_TimeUTC() {
	var theDate=new Date();
	var iDate=Date.UTC(theDate.getYear(), theDate.getMonth(), theDate.getDate(), theDate.getHours(), theDate.getMinutes(), theDate.getSeconds());
	return iDate;
}
function wd_TimeLc() {
	var theDate=new Date();
	var iDate=theDate.getTime();
	return iDate;
}

function wd_ClientInfoStr() {
	var sAnswer="";
	//
	var theDate=new Date();
	var theClient=window.navigator;
	var theScreen=window.screen;
		sAnswer+="clnt[js_ver_ms]=-";//+JS_VER_MS;
		//sAnswer+="&clnt[appCodeName]="+theClient.appCodeName;
		//sAnswer+="&clnt[appMinorVersion]="+theClient.appMinorVersion;
		//sAnswer+="&clnt[appName]="+theClient.appName;
		//sAnswer+="&clnt[appVersion]="+theClient.appVersion;
		sAnswer+="&clnt[brwsLang]="+(typeof(theClient.browserLanguage)==="undefined"?"-":theClient.browserLanguage); // current browser language
		sAnswer+="&clnt[ckEnbl]="+(typeof(theClient.cookieEnabled)==="undefined"?"-":theClient.cookieEnabled);
		sAnswer+="&clnt[cpuClass]="+(typeof(theClient.cpuClass)==="undefined"?"-":theClient.cpuClass);
		//sAnswer+="&clnt[onLine]="+theClient.onLine;
		sAnswer+="&clnt[pltfrm]="+(typeof(theClient.platform)==="undefined"?"-":theClient.platform);
		sAnswer+="&clnt[sysLang]="+(typeof(theClient.systemLanguage)==="undefined"?"-":theClient.systemLanguage); // default language used by the operating system
		//sAnswer+="&clnt[uAgent]="+theClient.userAgent;
		sAnswer+="&clnt[uLang]="+(typeof(theClient.userLanguage)==="undefined"?"-":theClient.userLanguage); // operating system's natural language setting
		sAnswer+="&clnt[scrAvW]="+(typeof(theScreen.availWidth)==="undefined"?"-":theScreen.availWidth);
		sAnswer+="&clnt[scrAvH]="+(typeof(theScreen.availHeight)==="undefined"?"-":theScreen.availHeight);
		sAnswer+="&clnt[scrClrs]="+(typeof(theScreen.colorDepth)==="undefined"?"-":theScreen.colorDepth);
		//sAnswer+="&clnt[screenUpdateInterval]="+theScreen.updateInterval;
		sAnswer+="&clnt[scrW]="+(typeof(theScreen.width)==="undefined"?"-":theScreen.width);
		sAnswer+="&clnt[scrH]="+(typeof(theScreen.height)==="undefined"?"-":theScreen.height);
		sAnswer+="&clnt[lctime]="+theDate.getTime();
		sAnswer+="&clnt[lctzn]="+theDate.getTimezoneOffset();
	//
	return sAnswer
}
function wd_FormValid(sFormName) {
	var bAnswer=true;
	//
	var theForm=document.forms[sFormName];
	var theReqsArr=eval("arrReqs"+sFormName);
	if (theForm && theReqsArr) {
		var iRequired=0;
		for (iRequired=0; iRequired<theReqsArr.length; iRequired++) {
			var theEl=theForm.elements[theReqsArr[iRequired]];
			if (theEl && !theEl.value) {
				bAnswer=false;
				alert(WDLBL_REQFORMFIELDS);
				break;
			}
		}
	}
	//
	return bAnswer;
}
