/*
2010/10/22
VERSION 1.0.0
author milkmidi	 
*/
var anteaterUtil = { };
(function(){	
	/*
	@params pDivId
	*/
	anteaterUtil.init = function( pDivId/*String*/ ){
		anteaterUtil.divId = pDivId;
	}

    /*
    @params pMsg 訊息
    */
	anteaterUtil.alert = function( pMsg/*String*/ ){			
		setTimeout( function(){
			alert( pMsg );
		} , 50);		
		return false;
	}
	
	/*
    @params pMsg 訊息
    */
	anteaterUtil.confirm = function ( pMsg/*String*/ ) {
		var _result;
		setTimeout( function(){
			_result = confirm(pMsg);    			
			swfobject.getObjectById( anteaterUtil.divId )["anteaterUtilConfirm_callback"](_result);
		} , 50);       		
		return _result;
    }
	
	
	anteaterUtil.windowOpen = function(pURL/*String*/, pWidth/*Number*/ , pHeight/*Number*/, pWindowName/*String*/, pOption/*String*/) {										
		if (pWidth != 0 && pHeight != 0) {
			var _x = (screen.width - pWidth) * 0.5;
			var _y = (screen.height - pHeight) * 0.5;
			pOption += ", left=" + _x + ", top=" + _y;
		}
		var _win = window.open(pURL, pWindowName, pOption);						
		if(_win){
			_win.focus();
			return true;
		}else{
			//alert(blockMessage);
			return false;
		}
		return true;
	}
	
})();

