// ==== EXECUTION ENVIRONMENT ==================================================
// jscript version:
var JS_VER_MS=4.0;
/*@cc_on @*/
/*@if (@_jscript_version)
	JS_VER_MS=@_jscript_version;
@else @*/
	void(0);
/*@end @*/
// ms ie version:
var IE_VER_MS=0;
var sAppVer=window.navigator.appVersion;
var arrAppVer=sAppVer.split("MSIE");
if (arrAppVer.length>0) sAppVer=arrAppVer[arrAppVer.length-1];
IE_VER_MS=parseFloat(sAppVer);
// ==== PROTOTYPES =============================================================
function wd_ArrCount(arrArray) {
	var sKey=""; var iI=0;
	for (sKey in arrArray) iI++;
	return iI;
}
function wd_ObjCount(oObj) {return wd_ArrCount(oObj);}
//
//String.prototype.trim = function() {
//	return this.replace(/(^\s*)|(\s*$)/g, "");
//}
function wd_TrimStr(sStr) {return sStr.replace(/(^\s*)|(\s*$)/g, "");}
//==============================================================================
function wd_ErrCodes(iError) {
	/* Script56.CHM::/html/js56jspronumber.htm:
	An error number is a 32-bit value.
	The upper 16-bit word is the facility code,
	while the lower word is the actual error code.*/
	var arrCodes=new Array();
	arrCodes[0]=(iError & 0xFFFF) // the actual error code
	arrCodes[1]=((iError>>16) & 0x1FFF) // the facility code.
	return arrCodes;
}
function wd_navigate(sURL) {document.location.href=sURL; return false;}
function wd_RefreshDoc() {document.location.href=document.location.href;}
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_URLFileName(sURL) {var sSrc=sURL; var arrSrc=sSrc.split("/"); return(arrSrc[arrSrc.length-1]);}
function amg_SelectCanc() {
	//alert('amg_SelectCanc');
	var bAnswer=false;
	var theSrcEl=event.srcElement;
	if (theSrcEl) {
		var sTag=theSrcEl.tagName.toUpperCase();
		var sId=theSrcEl.id;
		//alert(theSrcEl+"\n"+sTag+"\n"+sId);
		if ((sTag==="INPUT" || sTag==="TEXTAREA" || sId==="wdallowselect") && (!theSrcEl.disabled)) bAnswer=true;
	}
	return bAnswer;
}
function wd_Concat(arr1, arr2) {
	var s="";
	for (s in arr2) arr1[s]=arr2[s];
	return arr1;
}