	HiveAlert = function(msg) {
		showMsgBox('alert', msg );
	}

	HiveConfirm = function(msg, tfn, ffn ) {
		showMsgBox('confirm', msg, null, '', false, tfn, ffn);
	}

	function MemoViewer(si, ci, pi){
		if( si && si!=siteID() ) pi = contentID();
		var url = memoHandler.params(true).set("include","view").view(pi,si,ci,null);
		document.location = url;
	}
	
	/*
	function removeMemo(si,ci,inc) {
		var obj;
		var val = "";
		try {
			obj = elm('search');
		}
		catch(e) {}
		
		alert(obj);
		
		try { 
			
			val = elm('search').value;
			if (val == resourceManager.getString("alert-search-no-terms") )
				val = '';
		} catch(e) { }
		
		var st = 0, ed = 9;
		try {
			st = ifEmpty(elm('cntListStart').value,0);
			ed = ifEmpty(elm('cntListEnd').value,9);
		} catch(e) { }

		var index = memoHandler.getIndex().params(true);
		var query = index.set("include", inc).bounds("cntList", st, ed).search( siteID(), val );
		memoHandler.dest(query).remove( null,ci,contentID() );
	}
	*/

	/*	documentPage List(Announcements,News)	*/
	function goDocPage(docType) {
		
		var parentID;
		
		if (docType == 'announce')
			parentID = '00010';
		else if (docType == 'news')
			parentID = '00011';
			
		documentHandler
			.context('/','memothis')
			.set('include','doc')
			.bounds("cntList",0, 9)
			.searchActives('memothis', null, null, parentID, null, null, null);
	}
		
	
	function goFaq() {
		documentHandler
			.context('','memothis')
			.set('include','faq')
			.bounds("cntList",0, 50)
			.searchActives('memothis', null, null, '00012', null, null, 'CNT_ID ASC');
	}
	
	/*	html in div innerHTML */
	function viewContent(ax, divID) {
		var rightDiv = document.getElementById('' + divID + '');
		rightDiv.innerHTML = ax.responseText;
	}
	
	/*	ajaxCall Page */
	function ajaxCall(url, divID) {
		var ax = new MultiAsyncs( getXmlHttpRequest(),"viewContent(this.ax, '" + divID + "');" ).attach();
		ax.open( "GET", url , true );
		ax.send(null);
	}
	
	/*	delete comment */
	function confirmDelete(thisSite,thisID,cmtID, st, ed) {
		var data = memoHandler.params(false)
			.dest("/jsp/ajax/ajaxComment.jsp")
			.bounds("cmts",st,ed)
			.removeComments( thisSite,thisID,cmtID );
		if( data==null ) return;

		var ax = ajaxPost( memoHandler.toURL(),false );
		ax.send( data ); eval( ax.responseText );
		this.refresh();
	}
	
	/* flash intro */
	function goFlashIntro() {
		var content = '<object type="application/x-shockwave-flash" width="472px" height="300px" align="middle" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"><param name="movie" value="/movie.swf"/><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="true" /><param name="bgcolor" value="#ffffff" /><param name="wmode" value="transparent" /><embed src="/movie.swf" width="472px" height="300px" allowScriptAccess="always" type="application/x-shockwave-flash" allowFullScreen="true" bgcolor="#ffffff" wmode="transparent" ></embed></object>';
		
		var msgBox = document.getElementById('commonPopupBox');
			
		if (msgBox == null ) {
			this.box = new CommonPopup()
							.add()
							.attachEvents()
							.setEnableOuterClose(true)
							.setBtnClose(true)
							.setContent(content,'center');
			this.box.owner = this;
			this.box.render();
		}
	}
	
	function goQuickIntro() {
		var obj = document.getElementById('introMovie');

		if (obj.style.display == 'none')
			obj.style.display = 'block';

	}
	
	//<![CDATA[
	// This is a fix about the "__flash__removeCallback" bug.
	if ( ( navigator.userAgent.toLowerCase().indexOf('msie') != -1 ) && ( navigator.userAgent.toLowerCase().indexOf( 'opera' ) == -1 ) )
	{
		window.attachEvent( 'onunload', function()
			{
				window['__flash__removeCallback'] = function ( instance, name )
				{ 
					try
					{ 
						if ( instance )
						{ 
							instance[name] = null ; 
						} 
					}
					catch ( flashEx )
					{
	
					} 
				} ;
			}
		) ;
	}
	//]]>

	/*	TopMedia */
	function playMedia(obj, val) {
		var xx = obj;
		var objW = 330;
		var objH = 248;
		var reHeight;

		if( xx.substr(0,7)=="http://" ) xx = "<IMG src='" + xx + "'>";
		var el = document.getElementById("viewTopMedia");
		
		try {
			var w = xx.replace( /^<object[^>]+width=['"]?([0-9]+).*["']?.+$/i,"$1" );
			var h = xx.replace( /^<object[^>]+height=['"]?([0-9]+).*["']?.+$/i,"$1" );
	
			if (w > 330)  {
	
				reHeight = (h * objW) / w;
				
				if (reHeight) reHeight = Math.ceil(reHeight);
				
				if (reHeight < objH)
					objH = reHeight;
				
				xx = xx.replace( /width=["']?[0-9]+p?x?['"]?/gi,'width="' + objW + '"');
				xx = xx.replace( /height=["']?[0-9]+p?x?['"]?/gi,'height="' + objH + '"');
			}
			
			el.style.display = 'block';
			el.innerHTML = xx;
		} catch(e) { }
		
		if( el.innerHTML=="" ) { var rr = xx.match(new RegExp("(<embed[^>]+>.*</embed>)","gi")); if( rr ) el.innerHTML = rr[0]; }
		
		try {
			el.firstChild.width = el.firstChild.style.width = objW; 
			el.firstChild.height = el.firstChild.style.height = objH; 
		} catch(e) { }
		
		if (el.innerHTML == "" ) { el.innerHTML = '<img src="/staticApp/graphics/layout/cartoon/picScreenshot'+val+'.png" border="0" />'; }
		
	}
	/*
	function logout() {
		url = accessHandler.params().dest("/jsp/memo/sync.login.jsp").logout();
		var ax= ajaxPost( accessHandler.context("/tool").toURL(),false );
		ax.send( url ); eval( ax.responseText );
	}
	*/

	function showCommonPopUp(content) {
		new CommonPopup().add().attachEvents()
			.setOpacity(false)
			.setBtnClose(true)
			.setEnableOuterClose(true)
			.setContent(content,'left; padding:5px; word-wrap:break-word')
			.render();
	}

    function goFocusOut(obj, val) {
		if (obj.value != '') return;
		
		obj.className = val;
	}
	
	function _noKeyEvent() {
		var msgBox = document.getElementById('commonMsgBox');
		
		if (msgBox != null ) {
			document.getElementById('commonMsgBox').focus();
			return false;
		}
	}

	function _checkLayer() {
	
		document.body.onkeyup = _noKeyEvent;
		document.body.onkeydown = _noKeyEvent;
		document.body.onkeypress = _noKeyEvent;
	}
	
	addLoadEvent( _checkLayer );