// JavaScript Document

//handle page load
var AddLoadEvent = function(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
};

//sets png opacity in ie
var SetIeOpacity = function()
{
	var DivCol = document.getElementsByTagName("div");
	var i;
	for(i in DivCol)
	{
		if(DivCol[i] && typeof DivCol[i] != "number" && typeof DivCol[i] != "function")
		{
			var j;
			for(j = 0; j < pngClassArray.length; j++)
			{
				if(DivCol[i].className == pngClassArray[j])
				{
					DivCol[i].style.background = "none";
					DivCol[i].style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + pngImageArray[j] + "', sizingMethod='crop')"
				}
			}
		}
	}
};

//return an element with a specified class name
var GetElement = function(sType,sClassName)
{
	//get all the Elements of type sType
	var ObjectCol = document.getElementsByTagName(sType);
	var o;
	for(o in ObjectCol)
	{
		if(ObjectCol[o] && typeof ObjectCol[o] != "number" && typeof ObjectCol[o] != "function")
		{
			//for each specific div you are looking for, put the classname in here
			var oTargetElement = (ObjectCol[o].className == sClassName)?ObjectCol[o]:oTargetElement;	
		}
	}
	return oTargetElement;
};