// JavaScript Document
function OpenWindow(windowUri, windowName,  windowWidth, windowHeight, property )
{
    var centerWidth = (window.screen.width - windowWidth) / 2;
    var centerHeight = (window.screen.height - windowHeight - 60) / 2;

    newWindow = window.open(windowUri, windowName, 'width=' + windowWidth + 
        ',height=' + windowHeight + ',left=' + centerWidth + ',top=' + centerHeight+ ',' + property);

    newWindow.focus();
    //return newWindow.name;
}

function limitLen(t,l){
	var mlength=t.getAttribute? parseInt(t.getAttribute("maxlength")):"";
	tmp=trim(t.value);
	if(tmp.length > mlength) {
		//alert('vuot qua');
		t.value=tmp.substr(0,mlength)
		t.focus();
	}
	//l.value=mlength-t.value.length;
	l.innerHTML=mlength-t.value.length;
	//alert(mlength-t.value.length);
}

function contain_invalid(str,invalidstr){
		for(i=0;i<str.length;i++){
			if(invalidstr.indexOf(str.charAt(i))>=0) return false;			
		}
		return true;
}
function checkTextAZ09(name) {
	var re=/^[a-zA-Z0-9]+$/;
	if(name.match(re) == null)
	{
		return false;
	}
	return true;
}