
function fadeIn(id, millisec){
	dojo.fadeIn({
		node: id,
		duration: millisec,
		beforeBegin: function() {
			var node = dojo.byId(id);
			dojo.style(node, "opacity", 0);
			dojo.style(node, "display", "");
		}
	}).play();
}

function fadeOut(id, millisec){
	dojo.fadeOut({
		node: id,
		duration: millisec,
		afterEnd: function() {
			var node = dojo.byId(id);
			dojo.style(node, "display", "none");
		}
	}).play();
}

function limitText(limitField, limitCount, limitNum) {
	if (limitField.value.length > limitNum) {
		limitField.value = limitField.value.substring(0, limitNum);
	} else {
		limitCount.value = limitNum - limitField.value.length;
	}
}

function limitText(field, limit, counter) {
	if (document.getElementById(field).value.length > limit) {
		document.getElementById(field).value = document.getElementById(field).value.substring(0, limit);
	}
	if(counter) document.getElementById(counter).innerHTML = limit - document.getElementById(field).value.length;
	return true;
}
var popUpWin=0;
function popUpWindow(URLStr, left, top, width, height)
{
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}