﻿String.prototype.trim = function(){return this.replace(/(^[ |　]*)|([ |　]*$)/g, "");}
function $(s){return document.getElementById(s);}
function $$(s){return document.frames?document.frames[s]:$(s).contentWindow;}
function $c(s){return document.createElement(s);}
function hide(s){$(s).style.display=$(s).style.display=="none"?"":"none";}
function isNull(_sVal){return (_sVal == "" || _sVal == null || _sVal == "undefined");}
function openWindow(_sUrl, _sWidth, _sHeight, _sTitle, _sScroll){var oEdit = new dialog();oEdit.init();oEdit.set('title', _sTitle ? _sTitle : "系统提示信息" );oEdit.set('width', _sWidth);oEdit.set('height', _sHeight);oEdit.open(_sUrl, _sScroll ? 'no' : 'yes');}

function tableAddNullRow(tableName,count)
{
	var o = $(tableName);
	if(o==null)return;
	var l = o.rows.length;
	var n = l%count
	var m = l-n;
	
	var myNewRow = o.insertRow(l-n)
	var myNewCell = myNewRow.insertCell();
	myNewCell.style.height=20;	
	
	for(var i=m-count;i>0;i=i-count)
	{
		var myNewRow = o.insertRow(i)
		var myNewCell = myNewRow.insertCell();
		myNewCell.style.height=20;		
	}	
}

function OpenReader(url,width,height) {
	var availLeft = (window.screen.availWidth-width) / 2;
	var availTop = (window.screen.availHeight-height) / 2;	window.open(url,'','top='+availTop+'px,left='+availLeft+'px,status=no,width='+width+',height='+height+',');
}
