//change cursor to hand
function hand(theId) {
	
	if (document.all) {
	
	document.all(theId).style.cursor ='hand';
	}
	else {
	document.getElementById(theId).style.cursor ='pointer';

	}
}

// 'getElementsWithClass' function
function getElementsWithClass(containingEl, tagName, className){
    
    var returnedCollection = new Array(0);

    var collection  = (containingEl.all && tagName == "*") ? 
     containingEl.all : containingEl.getElementsByTagName(tagName);
     
    for(var i = 0; i < collection.length; i++)
        if(collection[i].className == className)
            returnedCollection[returnedCollection.length] = collection[i];

    return returnedCollection;
}

// open new window
function openPopup(file,theWidth,theHeight) {
	popup = window.open(file,'_blank','width='+theWidth+','+'height='+theHeight+',top=30,left=60,status=no,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=yes'); 
	popup.focus(); }

// change color of elements
function theColor(theId, theColor) {

	document.getElementById(theId).style.color = theColor;
}

// change background-color of elements
function bgdColor(theId, theColor) {

	document.getElementById(theId).style.background = theColor;
}


// change border-color of elements
function brdColor(theId,theColor) {

	document.getElementById(theId).style.borderColor = theColor;
}

// change background-image of elements
function bgdImage(theId,thePath) {

	document.getElementById(theId).background.src = 'media/gray30.png';
	//alert (thePath);
}


// turn display of an element on
function displayOn(theId) {
	
	document.getElementById(theId).style.display = 'block';
}


// turn display of an element off
function displayOff(theId) {
	
	document.getElementById(theId).style.display = 'none';
}

// set display style of elements of one class

function setDisplay(tagName, className, theStyle) {
 
 	var theElements = getElementsWithClass(document, tagName, className);
 	for(i = 0;i<theElements.length;i++) {		
		theElements[i].style.display = theStyle;
	}
}

// set the color of element of one class

function setColor(tagName, className, theColor) {
 
 	var theElements = getElementsWithClass(document, tagName, className);
 	for(i = 0;i<theElements.length;i++) {
		theElements[i].style.color = theColor;
	}
}