var exitURL, scriptID, wSize, hSize, showPopup;

window.name="iaw_main";

scriptID='functionScript';

function AutoTab(field,size,nextField){
	if(field.value.length >= size){
		var cmd = "field.form." + nextField + ".select();";
		eval(cmd);
	}
}

function ShowPopup(val)
{
  //IF VALUE = 0 THEN NOSHOW
  //IF VALUE = 1 THEN SHOW (default)

  showPopup=val;
}

function AddExit(sURL,w,h)
{
  exitURL=sURL;
  wSize=w;
  hSize=h;

}

function errorIgnore(e) { return true; }

function openExitWin() {
  if(exitURL != ''){
	if(showPopup != 0){
		if(wSize == 1){
			var args = "scrollbars=yes,toolbar=no,directories=no,menubar=no,resizeable=yes,status=yes,width=" + wSize + ",height=" + hSize + ",left=5000,top=5000";
		}else{
			var args = "scrollbars=yes,toolbar=no,directories=no,menubar=no,resizeable=yes,status=yes,width=" + wSize + ",height=" + hSize + ",left=0,top=0";
		}

		window.open(exitURL,'NewExitWin',args);
		//self.focus();
	}
  
  }

  return true;
}

closetime = 600; // Close window after 600 number of seconds?

function Start(URL, WIDTH, HEIGHT) {
  windowprops = "scrollbars=yes,toolbar=yes,resizeable=yes,location=no,status=yes,left=1,top=1,width=" + WIDTH + ",height=" + HEIGHT;
  preview = window.open(URL, "preview", windowprops);
  if (closetime) setTimeout("preview.close();", closetime*1000);
}

function doPopup(u,w,h,d) {
	url = u;
	width = w;
	height = h;
	delay = d;    // time in seconds before popup opens

	if(showPopup != 0){
		timer = setTimeout("Start(url, width, height)", delay*1000);
	}
}

<!--
function openWindow(theURL,winName,features,menubar)
{
	window.open(theURL,winName,features,menubar);
}

function OpenWin(URL,WIDTH,HEIGHT){
  neu = open(URL, "NewWin", "toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,width=" + WIDTH + ",height=" + HEIGHT + ",left=0,top=0");
  neu.window.focus();
}

