/*
    Copyright David Trewern Design         :: www.dtdesign.com ::
    Unauthorised modification / use is a criminal offence, and
    will be prosecuted to the fullest extent permitted by law.
    All Rights Reserved
*/


function BturnOn(imageName) {
    if (document.images) {
        var imageNumber = "";
        if (arguments.length > 1) imageNumber = arguments[1];
        document [imageName + imageNumber].src = eval("b" + imageName + "1.src");
    }
}

function BturnOff(imageName) {
    if (document.images) {
        var imageNumber = "";
        if (arguments.length > 1) imageNumber = arguments[1];
        document [imageName + imageNumber].src = eval("b" + imageName + "0.src");
    }
}

function loginPopup(path) {
    if (path) {
        window.open("login.aspx", "popup", "width=229, height=330, toolbar=no, status=no, scrollbars=no, resizable=yes");
    }
}
function helpPopup(path) {
    if (path) {
        window.open("help.aspx", "popup", "width=400, height=420, toolbar=no, status=no, scrollbars=no, resizable=no");
    }
}
function ddRedirect(dd) {
    if (dd.options[dd.selectedIndex].value != "") self.location = dd.options[dd.selectedIndex].value;
}


function showHide(obj, state){
    if (state == "show") {
        document.getElementById(obj).style.display = 'block';
    } else {
        document.getElementById(obj).style.display = 'none';
    }
}


function toggle(obj) {
    el = document.getElementById(obj);
    
    if (el != null) {
        if (el.style.display == "" || el.style.display == "block") {
            el.style.display = "none";
        }
        else {
            el.style.display = "block";
        }
    }
}

function hidedivsbyclass(classname) {
    var divs = document.getElementsByTagName("DIV");

    for (i = 0; i < divs.length; i++) {
        if (divs[i].className == classname) {
            divs[i].style.display = "none";
        }
    }
}

function showdivsbyclass(classname) {
    var divs = document.getElementsByTagName("DIV");

    for (i = 0; i < divs.length; i++) {
        if (divs[i].className == classname) {
            divs[i].style.display = "block";
        }
    }
}

function changeclassnamedivsbyclass(oldclassname, newclassname) {
    var divs = document.getElementsByTagName("DIV");

    for (i = 0; i < divs.length; i++) {
        if (divs[i].className == oldclassname)
        {
            divs[i].className = newclassname;
        }
    }
}


function toggleCollapsablecontent(index)
{
	if (document.getElementById)
	{
		var el = document.getElementById("collapsablecontentcontainer_" + index);
		
		if (el)
		{
			if (el.className == "contentnotvisible")
			{
				el.className = "contentvisible";
			}
			else
			{
				el.className = "contentnotvisible";
			}
		}
	}
}

