var Doc = {
    "g" :  function(objid){
    	if (typeof(objid) != "string" || objid == "") return null;
    	if (document.getElementById) return document.getElementById(objid);
    	if (document.all) return document.all(objid);
    	try {return eval(objid);} catch(e){ return null;}
    },
    "s" : function(objid,html){
        var obj = document.getElementById(objid);
        obj.innerHTML = html;
    }
}
var Win = {
    "open" : function(url,width,height,menubar,toolbar,location,status,scrollbars,resizable,backFun){
        if(menubar == null) menubar = "yes";
        if(scrollbars == null) scrollbars = "yes";
        if(toolbar == null) toolbar = "yes";
        if(resizable == null) resizable = "yes";
        x = parseInt((window.screen.width - width) / 2.0);
		y = parseInt((window.screen.height - height) / 2.0) - 30;
        var win = window.open(url, "", "top=" + y + ",left=" + x + ",menubar=" + menubar + ",location=" + location + ",status=" + status + ",scrollbars=" + scrollbars + ",toolbar=" + toolbar + ",dialog=yes,minimizable=yes" + ",modal=yes,width=" + width + ",height=" + height + ",resizable=" + resizable);
        if(backFun != null)
            window.BackValue = backFun;
    },
    "customDialog" : function(content,w,h,callBack){
        var winobj = Dialog.custom(content,{windowParameters: {width:w, height:h},ok:callBack});
    },
    "dialog" : function (url,width,height,obj){
		var pos = "center:1;help:no;dialogWidth:" + width + "px;dialogHeight:" + height + "px;";
		window.showModalDialog(url,obj,pos);
    }
}
String.prototype.trim = function(){	return this.replace(/(^\s*)|(\s*$)/g, "");}
