function _maxLength(t , mx_id){
	if(!t && !t.getAttribute && !t.value){
		return;
	}
    var mx = doi.dom.parseInt(t.getAttribute('maxlength'));
    var items = doi.dom.getElementsByTagName('input' , t.parentNode);
    if(items && items[0]){
        var mxo = items[0];
    }
    if(!mxo && !mxo.value){
    	return;
    }
  
    var len = t.value.length;
    if(len > mx){
        t.value = t.value.substring(0 , mx);
        mxo.value = 0;
    }else{
        mxo.value = mx - len;
    }
}
function _go2URL(address,target)
{
    window.open(address,target);
}
function _newMaxPopWindow(address,window_name){
    _newPopWindow(address,window_name,screen.width,screen.height);
}
function _newMaxWindow(address,window_name){
    var w = screen.width;
    var h = screen.height;

    var win = window.open(address,window_name,"toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,copyhistory=yes,width="+w+",height="+h);
    if(win){
        win.moveTo(0,0);
        win.focus();
    }
}
function _newWindow(address,window_name)
{
    var maxW = screen.width;
    var maxH = screen.height;
    var w = 800;
    var h = 600;
    var _top = Math.floor((maxH - h) / 2);
    var _left = Math.floor((maxW - w) / 2);

    var win = window.open(address,window_name,"toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,copyhistory=yes,width="+w+",height="+h);
    if(win){
        win.moveTo(_left,_top);
        win.focus();
    }
}
function _newCustomPopWindow(address,window_name,window_conf,w,h){
    var maxW = screen.width;
    var maxH = screen.height;
    var _top = Math.floor((maxH - h) / 2);
    var _left = Math.floor((maxW - w) / 2);

    var win = window.open(address,window_name,window_conf+",width="+w+",height="+h);
    if(win){
        win.moveTo(_left,_top);
        win.focus();
    }
}
function _newPopWindow(address,window_name,w,h){
    var maxW = screen.width;
    var maxH = screen.height;
    var _top = Math.floor((maxH - h) / 2);
    var _left = Math.floor((maxW - w) / 2);
    var win = window.open(address,window_name,"toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width="+w+",height="+h);
    if(win){
        win.moveTo(_left,_top);
        win.focus();
    }
}