/*
This script was created by Ian Lloyd (http://lloydi.com/). 
The addEvent function comes courtesy of Scott Andrew: http://tinyurl.com/qcmrd
*/
function addEvent(elm, evType, fn, useCapture)
{
		if(elm.addEventListener)
		{
			elm.addEventListener(evType, fn, useCapture);
			return true;
		}
		else if (elm.attachEvent)
		{
			var r = elm.attachEvent('on' + evType, fn);
			return r;
		}
		else
		{
			elm['on' + evType] = fn;
		}
}



function togglePrintDisplay(e)
{
var el = document.getElementsByTagName("div");
var previousClass

alert("You are about to switch to print view. To return to normal view press the refresh button.");

for (i=0;i<el.length;i++)
	{
		//previousClass[i] =  el[i].className;
		el[i].removeAttribute("className");
		if (el[i].id=="superFrame" || el[i].id=="mainFrame" || el[i].id=="content" || el[i].id=="printableArea" || el[i].id=="signature" || el[i].id=="footer" || el[i].id=="header" || el[i].id=="logo" || el[i].id=="vacanciesPriority" || el[i].id=="eblastContent" || el[i].id=="eblastHeader")
			
			{
			//show only this section for print
			el[i].setAttribute("className",el[i].className + " print");
			el[i].setAttribute("class",el[i].className + " print");
			}
		else
			{
			//hide the sections from print-out
			el[i].setAttribute("className",el[i].className + " noprint");
			el[i].setAttribute("class",el[i].className + " noprint");
			}
	}

document.getElementById("refreshButton").className="print";

if (window.event) 
	{
	window.event.returnValue = false;
	window.event.cancelBubble = true;
	} 
else if (e) 
	{
	e.stopPropagation();
	e.preventDefault();
	}

window.print();

for (i=0;i<el.length;i++)
	{

//		el[i].className=el[i].className.replace("noprint","")
	}
}