course = new Image();
course.src = "images/b_course_on.gif";
date = new Image();
date.src = "images/b_date_on.gif";
faqs = new Image();
faqs.src = "images/b_faqs_on.gif";
seminars = new Image();
seminars.src = "images/b_seminars_on.gif";
registration = new Image();
registration.src = "images/b_registration_on.gif";

if (document.images) {

    var b1_over = new Image();
  b1_over.src = "images/toplink1_over.gif";
    var b2_over = new Image();
  b2_over.src = "images/toplink2_over.gif";
    var b3_over = new Image();
  b3_over.src = "images/toplink3_over.gif";
    var b4_over = new Image();
  b4_over.src = "images/toplink4_over.gif";
    var b5_over = new Image();
  b5_over.src = "images/toplink5_over.gif";
    var b6_over = new Image();
  b6_over.src = "images/toplink6_over.gif";
    var b7_over = new Image();
  b7_over.src = "images/toplink7_over.gif";
  
}

function actMenuItem(imgName) {
  act(imgName);
  inact(defImg);
}

function inactMenuItem(imgName) {
  inact(imgName);
  act(defImg);
}

function act(imgName) {
  if (document.images) 
    document.images[imgName].src = eval(imgName + "_over.src");
}

function inact(imgName) {
  if (document.images)
    document.images[imgName].src = eval(imgName + ".src");
}


function changeImages() {
if (document.images) {
for (var i=0; i<changeImages.arguments.length; i+=2) {
document[changeImages.arguments[i]].src = eval(changeImages.arguments[i+1] + ".src");
}}} 



// resize fix for ns4
var origWidth, origHeight;
if (document.layers) {
	origWidth = window.innerWidth; origHeight = window.innerHeight;
	window.onresize = function() { if (window.innerWidth != origWidth || window.innerHeight != origHeight) history.go(0); }
}

var cur_link;
function doLinkClass(lnk) {
  if (lnk && lnk.blur) lnk.blur();	
  if (!lnk || cur_link == lnk) return;
  if (cur_link) cur_link.className = "admin-tab-inactive";
  lnk.className = "admin-tab-active";
  cur_link = lnk;
}

var cur_lyr;	// holds id of currently visible layer
function swapLayers(lnk,id) {
  doLinkClass(lnk);	
  if (cur_lyr) hideLayer(cur_lyr);
  showLayer(id);
  cur_lyr = id;
}

function showLayer(id) {
  var lyr = getElemRefs(id);
  if (lyr && lyr.css) lyr.css.visibility = "visible";
}

function hideLayer(id) {
  var lyr = getElemRefs(id);
  if (lyr && lyr.css) lyr.css.visibility = "hidden";
}

function getElemRefs(id) {
	var el = (document.getElementById)? document.getElementById(id): (document.all)? document.all[id]: (document.layers)? getLyrRef(id,document): null;
	if (el) el.css = (el.style)? el.style: el;
	return el;
}

// get reference to nested layer for ns4
// from old dhtmllib.js by Mike Hall of www.brainjar.com
function getLyrRef(lyr,doc) {
	if (document.layers) {
		var theLyr;
		for (var i=0; i<doc.layers.length; i++) {
	  	theLyr = doc.layers[i];
			if (theLyr.name == lyr) return theLyr;
			else if (theLyr.document.layers.length > 0) 
	    	if ((theLyr = getLyrRef(lyr,theLyr.document)) != null)
					return theLyr;
	  }
		return null;
  }
}

function init(id,lyr) {
  var lnk = getElemRefs(id);
  swapLayers(lnk,lyr);
}


function openPassword()
{
/*window.open("Password.aspx","Password","width=350,height=175,left=50,top=50");*/
window.open("Password.aspx","Password","width=450,height=300,left=500,top=300");

}
function openRegistration()
{
window.open("RegistrationForm.aspx","Registration","width=700,height=425,left=50,top=50,scrollbars,resizable, menubar");
}
function openWindow(eventId)
{
window.open("RegistrationForm.aspx?EventID=" + eventId,"Registration","width=660,height=425,left=50,top=50,scrollbars,resizable, menubar");
}
function openSampleArithmeticLesson()
{
window.open("SampleArithmeticLessons.htm","SampleLesson","width=700,height=425,left=50,top=50,scrollbars,resizable, menubar");
}
function openSampleAlegbraLesson()
{
window.open("SampleAlegbraLessons.htm","SampleLesson","width=700,height=425,left=50,top=50,scrollbars,resizable, menubar");
}

function openNewForm(formname)
{
	window.open(formname,"Registration","width=700,height=425,left=50,top=50,scrollbars,resizable, menubar");
}

function openNewChildWindow(formname)
{
	//window.open(formname,"Registration","width=720,height=640,left=300,top=280,scrollbars=0,resizable=0, status=0, toolbar=0, menubar=0");
	window.showModalDialog(formname,'','dialogWidth:760px;dialogHeight:520px;dialogLeft:500;dialogTop:300;scrollbars:no;resizable:no; status:no; toolbar:no; menubar:no');
}



