function toggleDiv(divName)
{
	var div = document.getElementById(divName);
	var icon = document.getElementById(divName + "Icon");

	if(div.style.display == "none")
	{
		div.style.display = "block";
		icon.src = "images/hideicon.gif";

	} else {
		div.style.display = "none";
		icon.src = "images/showicon.gif";
	}
}

function doSearch(searchval, fldname, folderunid)
{
    if (folderunid != "") {
	    var searchstring = "viewfolder.asp?unid=" + folderunid;
    } else {
	    var searchstring = "search.asp?searchtype=sp";
    }

    try {
        ph = document.getElementById('photographers').options[document.getElementById('photographers').selectedIndex].text;

        if (ph != "By these photographers:") {
            searchstring = searchstring + "&ph=" + ph;
        }
    } catch(e) {}

    try {
        ev = document.getElementById('events').options[document.getElementById('events').selectedIndex].text;

        if (ev != "From these events:") {
            searchstring = searchstring + "&ev=" + ev;
       }
    } catch(e) {}

    try {
        pe = document.getElementById('people').options[document.getElementById('people').selectedIndex].text;

        if (pe != "Of these people:") {
            searchstring = searchstring + "&pe=" + pe;
        }
    } catch(e) {}

    try {
        ca = document.getElementById('categories').options[document.getElementById('categories').selectedIndex].text;

        if (ca != "In these categories:") {
            searchstring = searchstring + "&ca=" + ca;
        }
    } catch(e) {}

    try {
        te = document.getElementById('teams').options[document.getElementById('teams').selectedIndex].text;

        if (te != "Of these teams:") {
            searchstring = searchstring + "&te=" + te;
        }
    } catch(e) {}

    try {
        st = document.getElementById('styles').options[document.getElementById('styles').selectedIndex].text;

        if (st != "Of the style:") {
            searchstring = searchstring + "&st=" + st;
        }
    } catch(e) {}

    try {
        te = document.getElementById('locations').options[document.getElementById('locations').selectedIndex].text;

        if (te != "At this location:") {
            searchstring = searchstring + "&lo=" + te;
        }
    } catch(e) {}

    window.location = searchstring
}
