var lastKeystroke = 0;

var win = null;

function fPopup(mypage,myname,w,h,pos,infocus,scrollbars){
	if(pos=="top"){
		myleft=20;
		mytop=20;
	}
	if(pos=="random"){
		myleft=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;
		mytop=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;
	}
	if(pos=="center"){
		myleft=(screen.width)?(screen.width-w)/2:100;
		mytop=(screen.height)?(screen.height-h)/2:100;
		}
		else if((pos!="center" && pos!="random" && pos!="top") || pos == null){
		myleft=0;
		mytop=20;
	}
	scrollbars=(scrollbars)?",scrollbars=yes":",scrollbars=no"
	sPosition=''
	if (!aoluser) sPosition=",top=" + mytop + ',left=' + myleft;
	features="width=" + w + ",height=" + h + sPosition + scrollbars + ",location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no";
	win=window.open(mypage,myname,features);
	if (infocus) win.focus();
}

function fCheckField(oFld,sMsg) {

	if (oFld.value=='') {
		alert(sMsg);
		oFld.focus();
		if ((oFld.type=='text') || (oFld.type=='password')) oFld.select();
		return false;
	}

	return true;
}

function fCheckCondition(oFld,isTrue,sMsg) {

	if (!isTrue) {
		alert(sMsg);
		oFld.focus();
		if ((oFld.type=='text') || (oFld.type=='password')) oFld.select();
		return false;
	}

	return true;
}