window.onscroll = wsgLightMoveForScroll;
function wsgLightMoveForScroll(){
	var containerTop = 0;
	var myHeight = 0, myWidth = 0;
	if( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE
		myWidth = window.innerWidth;
		myHeight = window.innerHeight;
	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth;
		myHeight = document.documentElement.clientHeight;
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		//IE 4 compatible
		myWidth = document.body.clientWidth;
		myHeight = document.body.clientHeight;
	}
	blockHeight = parseInt($('wsgLightContentContainer').style.height);
	blockWidth = parseInt($('wsgLightContentContainer').style.width);
	if(navigator.appName.indexOf("Microsoft")!=-1){			//DEALING WITH IE
		var adjustTo = document.documentElement.scrollTop?document.documentElement.scrollTop: document.body.scrollTop;
		$('wsgLight').style.top = adjustTo +'px';
		$('wsgLightContentContainer').style.top = parseInt((parseInt(myHeight/2 - blockHeight/2)-50)+parseInt(adjustTo)) + 'px';
	}else{
		$('wsgLight').style.top = window.pageYOffset+'px';
		$('wsgLightContentContainer').style.top = parseInt((parseInt(myHeight/2 - blockHeight/2)-50)+parseInt(window.pageYOffset)) + 'px';
		
	}
}
function wsgLightAppearNow(innerContent){
	wsgLightMoveForScroll();
	if(navigator.appName.indexOf("Microsoft")!=-1){			//DEALING WITH IE
		$('wsgLight').style.top = document.body.scrollTop+'px';
	}else{
		$('wsgLight').style.top = window.pageYOffset+'px';
	}
	$('wsgLightContentContainer').style.display = '';
	$('wsgLight').style.display = '';
	
	if(navigator.appName.indexOf("Microsoft")!=-1){			//DEALING WITH IE POSITIONING
		$('wsgLight').style.height = '100%';
		$('wsgLight').style.width = '100%';
	}
	
	if($('flashcontent')){
		$('flashcontent').innerHTML = '<img src="/units/drama/UniversityPlayers/uniplayers.nsf/flashPlayerDefault.jpg" alt="University of Windsor is thinking forward" border="0" />';
	}
	if(innerContent.length > 0){
		WSGLightSetSize(innerContent);
		WSGLightAlign();
		$('wsgLight').onclick = closeWSGLight;
		
		$('wsgLightContentContainer').style.border = '15px solid #FFF';
	}else{
		WSGLightAlign();	
	}
	
	
}
function WSGLightSetSize(setToID){
	wsgLightMoveForScroll();
	var myObject = $(setToID);
	if(parseInt(myObject.style.height) > 0){
		$('wsgLightContentContainer').style.height = parseInt(myObject.style.height)+'px';
	}else{
		$('wsgLightContentContainer').style.height = 'auto';
	}
	if(parseInt(myObject.style.width) > 0){
		$('wsgLightContentContainer').style.width = parseInt(myObject.style.width)+'px';
	}else{
		$('wsgLightContentContainer').style.width = 'auto';
	}
}
function WSGLightAlign(){
	wsgLightMoveForScroll();
	if(!$('wsgLight')){initWSGLightWindow();}
	var myWidth = 0, myHeight = 0, blockHeight = 0, blockWidth = 0;
  	if( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE
		myWidth = window.innerWidth;
		myHeight = window.innerHeight;
	  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth;
		myHeight = document.documentElement.clientHeight;
	  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		//IE 4 compatible
		myWidth = document.body.clientWidth;
		myHeight = document.body.clientHeight;
	  }
	blockHeight = parseInt($('wsgLightContentContainer').style.height);
	blockWidth = parseInt($('wsgLightContentContainer').style.width);
	if(blockHeight == 0 || blockWidth == 0 || isNaN(blockHeight) || isNaN(blockWidth)){
		$('wsgLightContentContainer').style.width = '300px';	
		$('wsgLightContentContainer').style.height = '200px';	
		blockHeight = 200;
		blockWidth = 300;
	}
	var scrolledHeight = 0;
	if(navigator.appName.indexOf("Microsoft")!=-1){			//DEALING WITH IE
		scrolledHeight = document.body.scrollTop;
	}else{
		scrolledHeight = window.pageYOffset;
	}
	$('wsgLightContentContainer').style.top = (parseInt(myHeight/2 - blockHeight/2)-50)+scrolledHeight + 'px';
	$('wsgLightContentContainer').style.left = parseInt(myWidth/2 - blockWidth/2) + 'px'; 
}
function closeWSGLight(){
	if(!$('wsgLight')){initWSGLightWindow();}
	$hide('wsgLight');	
	$hide('wsgLightContentContainer');	
	if($('flashcontent')){
		var so = new SWFObject("/uweb/newHome.nsf/SplashMediaView/C7390347FD07777A852575E10048AEE6/$File/mainpanel_revolveJpg.swf", "sotester", "438", "292", "9", "#FFFFFF");
		so.write("flashcontent");
	}
}
function initWSGLightWindow(){
	var forReturn = '';
	forReturn += '<div id="wsgLight" style="display:none; top:0px; left:0px; opacity: 0.7; ';
	forReturn += 'height:100%; width: 100%;';
	if(navigator.appName.indexOf("Microsoft")!=-1){			//DEALING WITH IE
		forReturn += 'filter:alpha(opacity=70);';
	}
	forReturn += 'z-index: 9998; height: 100%; width: 100%;"></div>';
	
	forReturn += '<div id="wsgLightContentContainer" style="display:none; top: 0px; left: 0px;';
	forReturn += 'height: 200px; width: 300px; z-index: 9999;"></div>';
	document.body.innerHTML += forReturn;
}
function WSGStartLoading(){
	var forReturn = 'Loading...Please Wait';
	forReturn += '<br />';
	forReturn += '<img src="/units/drama/UniversityPlayers/uniplayers.nsf/ajax-loader.gif" alt="Loading...Please Wait" /><br />';
	forReturn += '<br /><a href="#" ';
	forReturn += 'style="text-decoration: none; color: #fff; font-size: 12px;"';
	forReturn += 'onclick="cancelAJAX();" onkeypress="cancelAJAX();">cancel</a>';
	if($('wsgLightContentContainer')){
		$('wsgLightContentContainer').style.border = '0';
		$('wsgLightContentContainer').style.backgroundColor = '#005595';
		$('wsgLightContentContainer').style.color = '#FFF';
		$('wsgLightContentContainer').style.fontSize = '18px';
		$('wsgLightContentContainer').style.height = '90px';
		$('wsgLightContentContainer').innerHTML = forReturn;
		wsgLightAppearNow('');
	}
}
function WSGEndLoading(){
	var forReturn = '';
	if($('wsgLightContentContainer')){
		$('wsgLightContentContainer').style.border = '0';
		$('wsgLightContentContainer').style.backgroundColor = '#005595';
		$('wsgLightContentContainer').style.innerHTML = forReturn;
		$('wsgLightContentContainer').style.color = '';
		$('wsgLightContentContainer').style.fontSize = '';
		$('wsgLightContentContainer').style.height = '';
		closeWSGLight();
	}
}
function WSGEndLoadingNoHide(){
	var forReturn = '';
	if($('wsgLightContentContainer')){
		$('wsgLightContentContainer').style.border = '15px solid #FFF';
		$('wsgLightContentContainer').style.backgroundColor = '#005595';
		$('wsgLightContentContainer').style.innerHTML = forReturn;
		$('wsgLightContentContainer').style.color = '';
		$('wsgLightContentContainer').style.fontSize = '';
		$('wsgLightContentContainer').style.height = '';
	}
}

