function fwModalDialog(page, width, height) {
	window.showModalDialog(page,window,"dialogWidth:" + width + "px;dialogHeight:" + height + "px;status:no;help:no;");
}

function openWindow(url, width, height) {                     
  	var iTop = (window.screen.availHeight-30-height)/2;      
  	var iLeft = (window.screen.availWidth-10-width)/2;          
  	window.open(url,"_blank",'height='+height+',,innerHeight='+width+',width='+width+',innerWidth='+width+',top='+iTop+',left='+iLeft+',toolbar=no,menubar=no,scrollbars=auto,resizeable=no,location=no,status=no');

}


function checkNum(thetxtNum) {
	 	var _value = thetxtNum.value;
	 	var kc=window.event.keyCode;
	 	if(kc==110 || kc==190){
	  		if(_value.length==0){
	   			
	   			window.event.returnValue = false;
	   			return false;
	  		}
		  	
		  	if(_value.indexOf(".")>0){
		   		//window.event.keyCode=8;
		   		
		   		window.event.returnValue = false;
		   		return false;
		  	}
	 	}
	 
	 	//alert(kc);
	 	
	 	if( (kc>=48 && kc<=57) || (kc>=96 && kc<=105) || kc==110 || kc==190){
	  		window.event.returnValue = true;
	  		return true;
	 	}else if(kc==8) {
	 		
	  		//var text = thetxtNum.value;
	  		//thetxtNum.value = text.substring(0, text.length-1);
	  		//thetxtNum.value="";
	  		//thetxtNum.focus();
	  		//window.event.returnValue = true;
	  		//return true;
	 	}else if(kc==13){
	    	window.event.keyCode=9;
	        window.event.returnValue = true;
	        return true;
	   	}else if(kc==9 || kc==45 || kc==46 || kc==16 || kc==17 || kc==18 || kc==20 || (kc>=112 && kc<=123)){
	        window.event.returnValue = true;
	        return true;
	    }else {
	  		//window.event.keyCode=8;
	  		
	  		window.event.returnValue = false;
	  		return false;
	 	}
	 	return true;
	}
	
	//
	function TableRowHilighter(tbl, selectedRowIndex, hilightColor) {
	    this.currentRow = null;
	    this.hilightColor = hilightColor ? hilightColor : 'green';    
	
	    if (selectedRowIndex != null 
	        && selectedRowIndex >= 0 
	        && selectedRowIndex < tbl.rows.length) 
	    {
	        this.currentRow = tbl.rows[selectedRowIndex];        
	        //tbl.rows[selectedRowIndex].runtimeStyle.backgroundColor = this.hilightColor;
	    }
	
	    var _this = this;
	    var _thisTable = tbl;
	    tbl.attachEvent("onmousemove",table_onMouseMove);
	    tbl.attachEvent("onmouseout",table_onMouseOut);
	    tbl.attachEvent("onclick", table_onClick);	//
	    
	    function table_onMouseMove() {
	    	
	        var e = event.srcElement;  
	        if (e.tagName == 'TD')
	            e = e.parentElement;            
	        if (e.tagName != 'TR') 
	        	return;
	        e.runtimeStyle.backgroundColor = _this.hilightColor;
	        _this.currentRow = e;
	    }
	    
	    function table_onMouseOut() {
	        var e = event.srcElement; 
	        if (e.tagName == 'TD')
	            e = e.parentElement;            
	        if (e.tagName != 'TR') return;
	        var count=0;
	        for(;count<_thisTable.rows.length;count++)
	        {
	            if(e==_thisTable.rows[count]){
	                break;
	            }
	        }
	        if(count%2 ==0)
	            e.runtimeStyle.backgroundColor = '';
	        else
	            e.runtimeStyle.backgroundColor = 'EBF3FB';
	    }
	    
	    function table_onClick() {
	    	
	    	var e = event.srcElement; 
	        if (e.tagName == 'TD')
	            e = e.parentElement;            
	        if (e.tagName != 'TR') return;
	        var count=0;
	        for(;count<_thisTable.rows.length;count++)
	        {
	            if(e==_thisTable.rows[count]){
	                break;
	            }
	        }
	        var arrs = [];
			for(var i=0; i<5; i++) {
				arrs[i] = _thisTable.rows[count].cells[i].innerText;
			}
			
			window.opener.createText(arrs);
			window.close();
	    }
	    
	    
	} 