var util = function(){};

util.prototype = {
    winOpen:function(url,windowname,width,height){
	    window.open(url,windowname,"toolbar=no,location=no,scrollbars=yes,resizable=yes,menubar=no,status=no,width="+width+",height="+height);
    },
    dump:function(Obj){
        var dumper = new JKL.Dumper();
        alert( dumper.dump( Obj ) );
    },
    selectToObj:function(Obj){
        var data = new Array();
        Obj.each(function(){
            data.push({"ID":$(this).val(),"NAME":Utility.htmlspecialchars($(this).text())});
        });
        return data;
    },
    htmlspecialchars:function (ch) {
//        ch = ch.replace(/&/g,"&amp;");
//        ch = ch.replace(/&amp;amp;/g,"&amp;");
        ch = ch.replace(/"/g,"&quot;");
        ch = ch.replace(/'/g,"&#039;");
        ch = ch.replace(/</g,"&lt;");
        ch = ch.replace(/>/g,"&gt;");
        return ch;
    }
};

Utility = new util;

function UtWinOpen(url,windowname,width,height){
    subWindow = window.open(url,windowname,"toolbar=no,location=no,scrollbars=yes,resizable=yes,menubar=no,status=no,width="+width+",height="+height);
}

