
var NS = (navigator.appName == "Netscape");


function blockIt(f) {
	return false;
}	


function openWindow(internalURL,internalName,internalArgs) {
	if (internalURL == null || internalURL == '') {
		exit;
	}
	if (internalName == null || internalName == '') {
		internalName = 'popupWin';
	}
	if (internalArgs == null || internalArgs == '') {
		internalArgs = 'scrollbars,resizable,toolbar,status,width=640,height=480,left=50,top=50';
	}
	popupWin = window.open(internalURL,internalName,internalArgs);
 	popupWin.focus();
}


function openWindow640(thisURL) {
	openWindow(thisURL,'popupWin640','');
}

function openWindowWH(thisURL,thisW,thisH) {
	internalArgs = 'scrollbars,resizable,toolbar,status,left=50,top=50,width=' + thisW + ',height=' + thisH;
	openWindow(thisURL,'popupWinWH',internalArgs);
}


function openWindowDemo(thisURL) {
	internalName = 'popupWinDemo';
	internalArgs = 'scrollbars,resizable,toolbar,status,left=50,top=50,width=475,height=570';
  openWindow(thisURL,internalName,internalArgs);
}


function openWindowDemoSmall(thisURL) {
	internalName = 'popupWinDemo';
	internalArgs = 'scrollbars,resizable,toolbar,status,left=50,top=50,width=250,height=250';
  openWindow(thisURL,internalName,internalArgs);
}

function openWindowATC(thisURL,thisType,thisWidth,thisHeight,thisArgs,thisName) {
	if (thisType != '') {
		switch (thisType) {
			case 'demo':
				openWindowDemo(thisURL);
				break;
			case 'demosmall':
				openWindowDemo(thisURL);
				break;
			case '640':
				openWindow640(thisURL);
				break;
		}
	} else {
		if ((thisWidth != '') && (thisHeight != '')) {
			openWindowWH(thisURL,thisWidth,thisHeight);
		} else {
			openWindow(thisURL,thisName,thisArgs);
		}
	}
}


var singlePop;
function openSinglePop(thisURL,thisWidth,thisHeight) {
	var internalArgs = 'scrollbars,left=100,top=100,width=' + thisWidth + ',height=' + thisHeight;
	if (singlePop != null) {
		newPop = window.open(thisURL,'singlePop',internalArgs);
		singlePop.close();
		singlePop = newPop;
	} else {
		singlePop = window.open(thisURL,'singlePop',internalArgs);
	}	
}

function windowNamer(thisURL) {
	var tmp = thisURL;
	var tmpArray = tmp.split('/');
	var idx = ((tmpArray.length) - 1);
  var name = 'popupWin_';
  if (tmpArray[idx] != null) {
  		name += tmpArray[idx].replace(/[-]/g,"_");	
  }
  return(name);
}

function writeWindow(inURL,inType,inWidth,inHeight,inArgs) {
	var tmpName = windowNamer(inURL);
	var linkStr = "<a href=\"#\" onclick=\"javascript:openWindowATC('" + inURL + "','" + inType + "','" + inWidth + "','" + inHeight + "','" + inArgs + "','" + tmpName + "');return false;\">";
	document.write(linkStr);
}


function ToggleBoxes(dowhat) {
	for (i=0; i<document.forms[0].elements.length; i++) {
		if (document.forms[0].elements[i].type == 'checkbox') {
			if (dowhat == 'on') {
				document.forms[0].elements[i].checked = true;
			} else {
				document.forms[0].elements[i].checked = false;
			}
		}
	}
}

function printit(){
	window.print();
}