// Utility functions

function formHandler(form){ 
	var URL = document.form.MonthCheck.options[document.form.MonthCheck.selectedIndex].value; 
	document.getElementById("Calendar").src = URL; 
} 

function toggleit() {
	var doc=document.getElementById("Menu");
	doc.style.display=(doc.style.display=='inline')?'none':'inline';
	return false;
}

function getObject(objectId) {
    // cross-browser function to get an object's style object given its id
    if(document.getElementById && document.getElementById(objectId)) {
	// W3C DOM
	return document.getElementById(objectId);
    } else if (document.all && document.all(objectId)) {
	// MSIE 4 DOM
	return document.all(objectId);
    } else if (document.layers && document.layers[objectId]) {
	// NN 4 DOM.. note: this won't find nested layers
	return document.layers[objectId];
    } else {
	return false;
    }
} // getObject

function getStyleObject(objectId) {
    // cross-browser function to get an object's style object given its id
    if(document.getElementById && document.getElementById(objectId)) {
	// W3C DOM
	return document.getElementById(objectId).style;
    } else if (document.all && document.all(objectId)) {
	// MSIE 4 DOM
	return document.all(objectId).style;
    } else if (document.layers && document.layers[objectId]) {
	// NN 4 DOM.. note: this won't find nested layers
	return document.layers[objectId];
    } else {
	return false;
    }
} // getStyleObject

function changeObjectVisibility(objectId, newVisibility) {
    // get a reference to the cross-browser style object and make sure the object exists
    var styleObject = getStyleObject(objectId);
    if(styleObject) {
	styleObject.visibility = newVisibility;
	return true;
    } else {
	// we couldn't find the object, so we can't change its visibility
	return false;
    }
} // changeObjectVisibility


function changeObjectDisplay(objectId, newVisibility) {
    // get a reference to the cross-browser style object and make sure the object exists
    var styleObject = getStyleObject(objectId);
    if(styleObject) {
	styleObject.display = newVisibility;
	return true;
    } else {
	// we couldn't find the object, so we can't change its visibility
	return false;
    }
} // changeObjectDisplay


// Popup window
var popupwin = null;
function popup(url,props) {
	if (!props) props = "width=300,height=100,scrollbars=no,resizable=no,menubar=no,statusbar=no";
	popupwin = window.open(url,"popupwin",props);
	return false;
}

var popupwinA = null;
function popupA(url,props) {
	if (!props) props = "width=730,height=600,scrollbars=yes,resizable=yes,menubar=yes,statusbar=yes";
	popupwinA = window.open(url,"popupwinA",props);
	return false;
}

var popupwinB = null;
function popupB(url,props) {
	if (!props) props = "width=730,height=600,scrollbars=yes,resizable=yes,menubar=yes,statusbar=yes";
	popupwinB = window.open(url,"newwin",props);
	return false;
}