kickoff = function() {
//Start Popup Scripts
  var els = document.getElementsByTagName("a");
  for(var i = 0; i < els.length; i++) {
    if (els[i].className.indexOf("popup") !=- 1) {
      els[i].onclick=popup;
    }
	if (els[i].className.indexOf("minipopup") !=- 1) {
      els[i].onclick=minipopup;
    }
  }

	//Focus on first form field
	if (document.forms.length > 0) {
		document.forms[0].elements[0].focus();
		}

	//Image Rollover Kickoff
	findimg();
}

//Popup Functions
popup = function() {
    var win=window.open(this.href, "popup", "width=800, height=550, toolbar=yes,location=yes, menubar=yes, scrollbars=yes, resizable=yes");
    win.focus()
  return false; 
}
minipopup = function() {
    var win=window.open(this.href, "minipopup", "width=520, height=320, toolbar=no, location=no, menubar=no, scrollbars=yes, resizable=yes");
    win.focus()
  return false; 
}

window.onload = kickoff;

//Rollover Functions
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 _on and delete it, if that is the case 
	if(/_on/.test(src))
	{
		var newsrc = src.replace('_on','');
	}else{
// else, add the _on to the src 
		var newsrc = src.replace(ftype, '_on'+ftype);
	}
	o.src=newsrc;
}