	var dom 	= document.getElementById ? 1 : 0;
	var ie		= document.all ? 1 : 0;
	var mac		= (navigator.userAgent.indexOf("Mac") > -1) ? 1 : 0;
	var ieReal	= (ie && (!mac) && ( typeof(window.offscreenBuffering) != 'undefined') ) ? 1 : 0;
	var opera	= (navigator.userAgent.indexOf("Opera") > -1) ? 1 : 0;
	var opera7	= (navigator.userAgent.indexOf("Opera/7") > -1) ? 1 : 0;
	var isActiveX = ieReal;

	var isSp2		= ieReal && (window.navigator.userAgent.indexOf("SV1") != -1); 



	function getById(eleId) {
		if(dom) {
			return document.getElementById(eleId);
		}
		else if(ie) {
			return document.all[eleId];
		}
		else {
			return null;
		}
	}


	function alterClass(oElement, szClasses) {
		do {
			if( !(dom || ie) || (opera && !opera7) ) break;
			if(oElement) oElement.className = szClasses;
		} while(0);
	}

	function setValue(obj, val) {
		if(obj.value == '') obj.value = val;
	}

	function goTo(url) {
		location.href=url;
	}

	function doExpandDetail(oBut, eleId) {
		var obj = getById(eleId);
		do {
			if(obj == null) break;

			if(obj.style.display == 'none') {
				disp	= '';
				butVal	= '-';
			}
			else {
				disp = 'none';
				butVal	= '+';
			}
			obj.style.display	= disp;
			oBut.value			= butVal;
		} while(0);
	}

	function doExpandDetailExt(oBut, eleId, show) {
		var obj = getById(eleId);
		do {
			if(obj == null) break;

			if(show) {
				disp	= '';
				butVal	= '-';
			}
			else {
				disp = 'none';
				butVal	= '+';
			}
			obj.style.display	= disp;
			oBut.value			= butVal;
		} while(0);
	}


	function areaClick(oArea, idxLink) {
		oChilds	= null;
		oLink	= null;
		iLink	= 0;
		do {
			if(!ie) break;
			event.cancelBubble=true;
			oChilds = oArea.children;
			for(i=0; i<oChilds.length; i++) {
				if(oChilds.item(i).tagName == 'A') {
					iLink++;
					if(iLink == idxLink) {
						oLink = oChilds.item(i);
						break;
					}
				}
			}

			if(oLink != null) oLink.click();

		} while(0);
	}

	function showModeless(url, alias, height, width, resizable, edge, center, status) {
		if(window.showModelessDialog) {
			return window.showModelessDialog(url, alias, "dialogHeight:" + height + "px; dialogWidth:" + width + "px; edge:" + edge + "; center:" + center + "; help:No; resizable:" + resizable + "; status:" + status);		
		}
		else {
			return window.open(url, alias, "width=" + width + ",height=" + height + ",resizable=" + resizable + ",toolbar=0,location=0,directories=0,status=" + status + ",menuBar=0,scrollbars=1");
		}
	}
	
	function doTextPopUp() { /* dummy */}
	
	
	function listBoxSelect(obj, selected) {
		if(obj == null) return;

		for(i=0; i < obj.length; i++)
			obj.options[i].selected = selected;
	}
	
	
	function disableElement(eleId, state) {
		var oElement = getById(eleId);
		if(oElement != null) oElement.disabled = state;
	}
	
	function checkElement(eleId, state) {
		var oElement = getById(eleId);
		if(oElement != null) oElement.checked = state;
	}