function chgPage(page)
{
	$('page').value = page;
	$('filter').submit();
}
String.prototype.trim=function()  
{
    return this.replace(/(^\s*)|(\s*$)/g, "");  
}
function addOption(selectId, txt, val)
{
    $(selectId).options.add(new Option(txt, val));
}
function removeOptions(selectId)
{
	for (i=$(selectId).options.length-1; i>=0; i--) {
		$(selectId).options.remove(i);
	}
}
function addOptions(selectId, opts)
{
	for(var v in opts){
		$(selectId).options.add(new Option(opts[v], v));
	}
}
function addBookmark(){
	var _title=document.title;
	var _url=document.location.href;
	if (window.sidebar) {
		window.sidebar.addPanel(_title, _url,"");
	} else if( document.all ) {
		window.external.AddFavorite( _url, _title);
	} else if( window.opera && window.print ) {
		return true;
	}
}
function run()
{
	var requestModule = arguments[0];
	var requestFunction = arguments[1];
	var requestParams = Array(arguments.length-2);
	for(i=0; i<arguments.length-2; i++) {
		requestParams[i]=arguments[i+2];
	}
    xajax.config.requestURI ="/xajaxrequest/" +  requestModule;
    xajax.request({ xjxcls: requestModule + 'Ajax', xjxmthd: requestFunction }, {mode:'asynchronous', method: 'post', parameters:requestParams});
}
function getOs()
{
   if(navigator.userAgent.indexOf("MSIE")>0)return 1;
   if(isFirefox=navigator.userAgent.indexOf("Firefox")>0)return 2;
   if(isSafari=navigator.userAgent.indexOf("Safari")>0)return 3;  
   if(isCamino=navigator.userAgent.indexOf("Camino")>0)return 4;
   if(isMozilla=navigator.userAgent.indexOf("Gecko/")>0)return 5;
   return 0;
}