function OpenNewWin(url, win) {
	popupWin = window.open(url, win, 'menubar=1,toolbar=0,location=0,directories=0,status=0,scrollbars=1,resizable=1,dependent=1,width=720,height=420')
} 
function OpenChildWin(url, win) {
	popupWin = window.open(url, win, 'menubar=1,toolbar=0,location=0,directories=0,status=0,scrollbars=1,resizable=1,dependent=1,width=740,height=450')
}
function OpenLittleWin(url, win) {
	popupWin = window.open(url, win, 'menubar=1,toolbar=0,location=0,directories=0,status=0,scrollbars=1,resizable=1,dependent=1,width=320,height=240')
}
function OpenTinyWin(url, win) {
	popupWin = window.open(url, win, 'menubar=1,toolbar=0,location=0,directories=0,status=0,scrollbars=1,resizable=1,dependent=1,width=320,height=240')
}

function OpenNewsWindow(NewsID){
	window.open("/popupNews.asp?NewsID=" + NewsID,"NewsWindow","Width=550,Height=500,Scrollbars=1,Resizable=yes")
}

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		preloadFlag = true;
	}
}

function DisplayPopUp()
{
window.open("popup.asp?keywords=pop", "PopUPWindow", "resizable=yes,scrollbars=yes,width=500,height=400");
}

function toggleLayer(whichLayer, newUsed)
{			
if (document.getElementById)
{
// this is the way the standards work
var style2 = document.getElementById(whichLayer).style;
style2.display = style2.display? "":"block";
}
else if (document.all)
{
// this is the way old msie versions work
var style2 = document.all[whichLayer].style;
style2.display = style2.display? "":"block";
}
else if (document.layers)
{
// this is the way nn4 works
var style2 = document.layers[whichLayer].style;
style2.display = style2.display? "":"block";
}


if (newUsed == 0){
	if (document.forms.frmAutoID.chNew){
	
		document.forms.frmAutoID.chNew.checked = true;
		if (document.forms.frmAutoID.chUsed){
			document.forms.frmAutoID.chUsed.checked = false;
		}
		if (document.forms.frmAutoID.chCrtf){
			document.forms.frmAutoID.chCrtf.checked = false;
		}				
	}else{
		document.forms.frmAutoID.newused.value = "0";
	}	
}
if (newUsed == 1){
	if (document.forms.frmAutoID.chUsed){
		document.forms.frmAutoID.chUsed.checked = true;
		if (document.forms.frmAutoID.chNew){
			document.forms.frmAutoID.chNew.checked = false;
		}
		if (document.forms.frmAutoID.chCrtf){
			document.forms.frmAutoID.chCrtf.checked = false;
		}				
	}else{
		document.forms.frmAutoID.newused.value = "1";
	}	
}
if (newUsed == 2){
	if (document.forms.frmAutoID.chCrtf){
		document.forms.frmAutoID.chCrtf.checked = true;
		if (document.forms.frmAutoID.chNew){
			document.forms.frmAutoID.chNew.checked = false;
		}
		if (document.forms.frmAutoID.chUsed){
			document.forms.frmAutoID.chUsed.checked = false;
		}				
	}else{
		document.forms.frmAutoID.newused.value = "2";
	}	
}	
}

//Image rollovers
function findimg()
{
	var i,imgs;
// loop through all images of the document
	imgs=document.getElementsByTagName('img');
	for(i=0;i<imgs.length;i++)
	{
// test if the class 'roll' exists
		if(/roll/.test(imgs[i].className))
		{
// add the function roll to the image onmouseover and onmouseout and send
// the image itself as an object
			imgs[i].onmouseover=function(){roll(this);};
			imgs[i].onmouseout=function(){roll(this);};
		}
	}
}
function roll(o)
{
// get the src of the image, and find out the file extension
	var src = o.src;
	var ftype = src.substring(src.lastIndexOf('.'), src.length);
// check if the src already has an _over and delete it, if that is the case 
	if(/_over/.test(src))
	{
		var newsrc = src.replace('_over','');
	}else{
// else, add the _over to the src 
		var newsrc = src.replace(ftype, '_over'+ftype);
	}
	o.src=newsrc;
}