function onMac() {
ua = navigator.userAgent.toLowerCase();
if(navigator.plugins["Default Plugin Carbon.cfm"] || ua.indexOf("omniweb") != -1 || ua.indexOf('os x') != -1) {
    var container = document.getElementById( 'mainmenudiv' );
    var collection = container.getElementsByTagName( 'a' );
    var j;
    for (j=0; j < collection.length; j++) {
    	collection[j].style.padding = "0 5px 0 5px";	
        }
    }
return;
}
function showpic(isrc, iw, ih){
//shows image in iframe, called from onclick on thumbnail
document.getElementById("display").style.visibility="hidden"
document.getElementById("ibigpic").src=isrc
document.getElementById("ibigpic").height=ih
document.getElementById("ibigpic").width=iw
document.getElementById("display").style.visibility="visible"
}

function search_term_display(i){
//makes search term list disappear if overwrite box is checked
var theid = 'overwrite'+i
if (document.getElementById(theid).checked == true)
{   
	document.getElementById('search_word['+i+']').style.visibility='hidden';
}
else
{   
	document.getElementById('search_word['+i+']').style.visibility='';
}
}

//=============================================================
function activate( contID, elemTag, thisID ) {
var container = document.getElementById( contID );
var collection = container.getElementsByTagName( elemTag );
var j;
for (j=0; j < collection.length; j++) {
	collection[j].setAttribute('className', '');
	collection[j].setAttribute('class', '');
}
var currElem = document.getElementById(thisID);
currElem.setAttribute('className', 'active');
currElem.setAttribute('class', 'active');
return;
}

//=============================================================
function swap_image( imgID, source, whichTD, whichLabel, whichPos ) {
var targetImg = document.getElementById( imgID );
targetImg.src = source;
// figure out nth td element that is the one chosen
var container = document.getElementById( 'tabbed' );
var collection = container.getElementsByTagName( 'td' );
var j, flip;
if ( whichTD ){
	for (j=0; j < collection.length; j++) {
        var tdId = collection[j].id;
        if ( tdId == whichTD ) {
            flip = j;
            }
	}
}
else flip=0;

// set proper image for right/left edges of tab so all tabs recede into back from one showing
for (j=0; j < collection.length; j++) {
    var tdClass = collection[j].className;
    
    //   set all bottom borders, except for big image td
    if ( ! tdClass.match("image") ) {
        collection[j].style.borderBottom="1px solid #787878";
    }
    if ( tdClass.match("tabm") ) {
        if ( j < flip ) {
        collection[j].style.background = "url(../../images/tab_overlap_r.gif)";
        }
        else {
            collection[j].style.background = "url(../../images/tab_overlap.gif)";
        }
    }
	//  remove border bottom on chosen position tab
    if ( tdClass.match(whichPos) ) {
        collection[j].style.borderBottom="0px";
    }
}


// if whichTD not set then it is the leftmost tab, nothing is changed
if (whichTD) {
	var tabTD = document.getElementById( whichTD );
	tabTD.style.background = "url(../../images/tab_overlap_r.gif)";
}

// change color of writing on tabs
var acollection = container.getElementsByTagName( 'a' );
for (j=0; j < acollection.length; j++) {
    var tdClass = acollection[j].className;
    if ( tdClass == "tab" ) {
        acollection[j].style.color = "black";
        }
}    
whichLabel.style.color = "#A71716";


return;
}

