addLoadEvent(addObjects);
addLoadEvent(setWindowHeight);
function addObjects()
{
	iFeature 	= new iFeature('lessoninteractions', 'ifeature.asp');
	Tooltip		= new Tooltip('Tooltip', -11, -11);
	Glossary 	= new Glossary('glossary_content','visualglossary.asp','termslist', 'visualglossarylist.asp');
	
	SB = new Switchboard(Tooltip, Glossary);
	
	
}
function setTransparency(){
	var TransparencyObj = $('transparency');

	if(TransparencyObj)
	{
		assignEvent(window, 'resize', setTransparency);

		windowHeight = getWindowHeight() ;

		TransparencyObj.style.width = 	document.body.offsetWidth+'px';
		TransparencyObj.style.height = 	document.getElementById('background').offsetHeight+'px';

		//Element.show(TransparencyObj);
		TransparencyObj.style.display='block';
	}
}
function hideTransparency(layer)
{
	var popuplayer = $(layer)
	if (popuplayer){
		Element.hide(popuplayer);
	}
	$('transparency').visibility=false;
	Element.hide($('top_layers'));
}

function getWindowHeight() {
	var windowHeight=0;
	if (typeof(window.innerHeight)=='number') {
		windowHeight=window.innerHeight;
	} 
	else {
		if (document.documentElement && document.documentElement.clientHeight) {
				windowHeight = document.documentElement.clientHeight;
		} 
		else 
		{
			if (document.body&&document.body.clientHeight) {
				windowHeight=document.body.clientHeight;
			}
		}
	}
		return windowHeight;
}
function setWindowHeight() {
	windowHeight = getWindowHeight() ;
	
	if(document.getElementById('background').offsetHeight <= windowHeight){
		//document.getElementById('background').style.height = windowHeight+'px';
	}
	else if(document.getElementById('wrapper').offsetHeight <= windowHeight){
		document.getElementById('wrapper').style.height = windowHeight+'px';
	}
	if(document.getElementById('page').offsetHeight <= windowHeight){
		document.getElementById('page').style.height = windowHeight+'px';
	}
}


/*
 * Function to add onload events while preserving existing onload events
 * @param func - sting
 * 	function name
 */
 function addLoadEvent(func) {
    var oldonload = window.onload;
    if (typeof window.onload != 'function') {
        window.onload = func;
    } else {
        window.onload = function() {
            oldonload();
            func();
        }
    }
}

/**
 * Function to assign an event to an element
 * @description assigns an event to an element; auto detects browser.
 *
 * @param obj element - the element to attach an event to
 * @param string eventType - the event to attach
 * @param function functionName - The function which should be executed when the event is triggered
*/
function assignEvent(element, eventType, functionName)
{
    // Not IE
    if(!element.attachEvent)
    {
        element.addEventListener(eventType, functionName, false);
    }
    // IE Only
    else
    {
        eventType = 'on'+eventType;
        element.attachEvent(eventType, functionName);
    }
}

/**
 * Function to fix event and event target property for ie
 *
 * @param obj e - the captured event
*/
function fixEvents(e) {
	if (!e) var e = window.event;

	if (e.target) var tg = e.target;
	else if (e.srcElement) var tg = e.srcElement;
	while (tg.nodeType!=1)
		{ 
		tg = e.target.parentNode;
		}

	//if (!e.relatedTarget) e.relatedTarget = e.toElement;
	return {evnt:e , trgt:tg};
}

var Switchboard = Class.create();
	Switchboard.prototype = {
		initialize:
			function (listener, actor) {
				this.listener = listener;
				this.actor = actor;
			},
		trigger: 
			function (eventname) {
				switch (eventname) {
					case 'register':
						this.listener.removeTriggers();
						this.listener.attachTriggers();
						break;
				}
			}
	};
<!-- Email Function //-->
function DisplayMail(Server, Login, Display){
	if ((Display.length == 0) || (Display.indexOf('@')+1)) {
	document.write("<a href=" + "'mai" + "lto:" + Login + "@" + Server + "'>" + Login + "@" + Server + "</a>"); }
	else  {
	document.write("<a href=" + "'mai" + "lto:" + Login + "@" + Server + "'>" + Display + "</a>"); }
}

function debug(show)
{
		$('test').innerHTML += show+'<br>';
//debug('show: '+e.target+'<br>');
}

