// Go to Top
function gotoTop(chk) {
if (!(chk == 1)){

	document.write("<div id=D1 style='Z-INDEX: 1; POSITION: absolute; visibility: visible;'>");
	document.write("<a href='javascript:GoTop();'><img src='images/button_top.gif' border='0'></a>");
	document.write("</div>");
	
	MovePosition();
	}
}

function GoTop() {
	window.scrollTo(0,0);
}

function CheckUIElements() {
	var chk_i;
	var yMenu1From, yMenu1To, yOffset, timeoutNextCheck;
	var wndWidth = parseInt(document.body.clientWidth);
	yMenu1From = parseInt (D1.style.top, 10);
	yMenu1To = document.body.scrollTop + 350;
	timeoutNextCheck = 500;

	if ( yMenu1From != yMenu1To ) {
		yOffset = Math.ceil( Math.abs( yMenu1To - yMenu1From ) / 20 );
		if ( yMenu1To < yMenu1From )
			yOffset = -yOffset;
		
		if ((yOffset > 0) && ((parseInt (D1.style.top, 10)) < (chk_vlue=document.body.scrollHeight - (150)))){
			D1.style.top = parseInt (D1.style.top, 10) + yOffset;
		}

		else if ((yOffset < 0) && ((parseInt (D1.style.top, 10)) > 400)){
			D1.style.top = parseInt (D1.style.top, 10) + yOffset;
		}
		
		timeoutNextCheck = 10;

	}
	D1.style.left = 590; 
	setTimeout ("CheckUIElements()", timeoutNextCheck);
	
}

function MovePosition() {
	var wndWidth = parseInt(document.body.clientWidth);
	

	D1.style.top = document.body.scrollTop + 400;
	D1.style.left = 590;
	D1.style.visibility = "visible";
	
	// initializing UI update timer
	CheckUIElements();
	
	return true;
}


//Popup Window
function aniViewer01()
                {
                mini1 = window.open('pu_take_course.html ', 'aniViewer', 'width='+'460'+',height='+'465'+',marginwidth=10,marginheight=0,border=0,scrollbars=no,resizable=no');
                }
function aniViewer02()
                {
                mini1 = window.open('pu_try_course.html ', 'aniViewer', 'width='+'460'+',height='+'480'+',marginwidth=10,marginheight=0,border=0,scrollbars=no,resizable=no');
                }


//New Window Pop Up. Function takes three variables; full file name including path, width & height.//
//sample call: <a href="javascript:newwin('harvclubb.jpg',250,350)">Text or image</a>//

function newwin(filename,wd,ht,docloc)
{

var TopPosition=0;
var LeftPosition=0;
var defwd=400;   //sets a default window width if no width is passed
var defht=300;    //sets a default window height if no height is passed
var padwd=20;   //sets extra padding for the width
var padht=25;    //sets extra padding for the height
var newwinpict=null;

	if(wd==null)wd=defwd;else wd+=padwd;
	if(ht==null)ht=defht;else ht+=padht;
 	if(newwinpict && !newwinpict.closed)newwinpict.close();
 	LeftPosition = (screen.width) ? (screen.width-wd)/2 : 0; 
	TopPosition = 20;
	newwinpict = window.open(filename,"newwin1",'toolbar=no,location=no,directories=no,menuebar=no,width='+wd+',height='+ht+',top='+TopPosition+', left='+LeftPosition+',resizable=yes,scrollbars=yes');
	newwinpict.focus();
}


//ROLLOVER FOR CONTENT PAGE HEADERS
//BROWSER DETECT
browserName = navigator.appName;
 browserVer = parseInt(navigator.appVersion);
 if((browserName == "Netscape" && browserVer >=3)||(browserName == "Microsoft Internet Explorer" && browserVer >=4))version = "rollovergood";
 else version = "rolloverbad";


//ROLLOVER IMAGEPRELOAD
if (version == "rollovergood")
{
pointerover=new Image(10,10);
pointerover.src='images/pointer.gif';
spacerout=new Image(10,10);
spacerout.src='images/spacer.gif';
}

//ROLLOVER MOUSEOVER AND MOUSEOUT
 function imgover(imgName)
 {
    if(version=="rollovergood") document[imgName].src = pointerover.src;
 }

function imgout (imgName)
{
   if(version=="rollovergood") document[imgName].src = spacerout.src;
}





