function popUp(url, width, height) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(url, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=' + width + ',height=' + height +',left = 312,top = 184');");
}

function validateInt(sourceElem) {
	var strlength = sourceElem.value.length;
	var lastchar = sourceElem.value.substring((strlength - 1),strlength);
	
	if(isNaN(lastchar) == true) {
		sourceElem.value = sourceElem.value.substring(0, (strlength-1));
	}
}

function confirmURL(url, message) {
	if(confirm(message)) {
		document.location.href = url;
	}
}

function resize(which, max) {		
  var elem = document.getElementById(which);
  if (elem == undefined || elem == null) return false;
  if (max == undefined) max = 100;	  
  if (elem.width > elem.height) {
    if (elem.width > max) elem.width = max;
  } else {
    if (elem.height > max) elem.height = max;
  }
}

