function setBodyClass(custClassName)
{
	document.getElementsByTagName('body')[0].className = custClassName;
	SetCookie('millskin',custClassName);
}

function changePic(thePic, root)
{
	div = document.getElementById('photo_container');
	div.innerHTML = '<img src="' + root + 'i/' + thePic + '.jpg" />';
}

function openPic(thePic, root)
{
	objDisplay('photo_pg_bg','block');
	var containerSize = getObjSize('photo_pg_bg');
	var containerWidth = containerSize[0];
	var containerHeight = containerSize[1];
	objDisplay('vert_center','block');
	objDisplay('theCloser','block');
	var pContainerWidth = Math.round(containerWidth * .80);
	var pContainerHeight = Math.round(containerHeight * .80);
	tObj = document.getElementById('photo_container');
	tObj.style.width = pContainerWidth + 'px';
	tObj.style.height = pContainerHeight + 'px';
	tObj.style.marginLeft = '-' + Math.round(pContainerWidth / 2) + 'px';
	tObj.style.top = '-' + Math.round(pContainerHeight / 2) + 'px';
	objDisplay('photo_container','block');
	changePic(thePic, root);
	//alert('Cwidth = ' + containerWidth + ' CHeight = ' + containerHeight + ' photoWidth = ' + photoWidth + ' photoHeight = ' + photoHeight);
}

function closePic()
{
	objDisplay('photo_pg_bg','none');
	objDisplay('vert_center','block');
	objDisplay('photo_container','none');
	objDisplay('theCloser','none');
}

function showOverlay()
{
	objDisplay('photo_pg_bg','block');
	objDisplay('vert_center','block');
	objDisplay('photo_container','block');
	objDisplay('theCloser','block');
}

function objDisplay(obj,disp)
{
	tObj = document.getElementById(obj);
	tObj.style.display = disp;
}

function getObjSize(obj)
{
	tObj = document.getElementById(obj);
	var sizeArray = new Array();
	sizeArray[0] = tObj.clientWidth;
	sizeArray[1] = tObj.clientHeight;
	return sizeArray;
}

function sfHover() 
{
	var browserName=navigator.appName;
	if (browserName=="Microsoft Internet Explorer" && document.getElementById("top_nav"))
	{
		var sfEls = document.getElementById("top_nav").getElementsByTagName("LI");
		for (var i=0; i<sfEls.length; i++) {
			sfEls[i].onmouseover=function() {
				this.className+=" sfhover";
			}
			sfEls[i].onmouseout=function() {
				this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
			}
		}
	}
}

AttachEvent(window, "load", sfHover);

//*******PRELOAD AND ROLLOVER FUNCTIONS END********//
//*****************************************************************************************//

function AttachEvent(elementObj, eventName, eventHandlerFunctionName)
{
  if (elementObj.addEventListener) 
  { // Non-IE browsers
    elementObj.addEventListener(eventName, eventHandlerFunctionName, false);		
  } 
  else if (elementObj.attachEvent) 
  { // IE 6+
    elementObj.attachEvent('on' + eventName, eventHandlerFunctionName);
  } 
  else 
  { // Older browsers 
    var currentEventHandler = elementObj['on' + eventName];
    if (currentEventHandler == null) 
    {
      elementObj['on' + eventName] = eventHandlerFunctionName;
    } 
    else 
    {
      elementObj['on' + eventName] = function(e) { currentEventHandler(e); eventHandlerFunctionName(e); }
    }
  }
}