// NLC Code.

function dropdownredirect(dropdown)

{

    var URL = dropdown.options[dropdown.selectedIndex].value;

    document.frmRedirect.action = URL;

    document.frmRedirect.submit();

}



function doClear(theText) {

    if (theText.value == theText.defaultValue)

 	{

         theText.value = ""

	}

}

 

// The code below was created by CCS Developer - John Wallace



// Retrieve an object (backward compatible to NN4 and IE4).

function getElement(obj) {

   if (document.getElementById)

      if (typeof obj == "string") {

         return document.getElementById(obj);

      }

      else {

         return obj;

      }



   if (document.all)

      if (typeof obj == "string")

         return document.all(obj);

      else

         return obj;



   if (document.layers)

      if (typeof obj == "string")

         // just one layer deep

         return document.layers[obj];

      else

         // can be a nested layer

         return obj;

}





// Redirect to url associated with selected option in select element.

function selectOnChangeRedirect(select){

    if (select) {

        var url = select.options[select.selectedIndex].value;

//        window.location.href = url;

        document.frmRedirect.action = url;

        document.frmRedirect.submit();

    }

}





// Redirect to url associated with selected option in select element.

function selectOnChangeRedirect2(select){

    if (select) {

        var url = select.options[select.selectedIndex].value;

        window.location.href = url;

//        document.frmRedirect.action = url;

//        document.frmRedirect.submit();

    }

}





// Redirect to url associated with selected option in select element.

function selectOnChangeRedirectHandler(evt){

    evt = (evt) ? evt : ((window.event) ? window.event : null);

    if (evt) {

        var select = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null);

        if (select) {

            var url = select.options[select.selectedIndex].value

            window.location.href = url 

        }

    }

}





// This function redirects the specified select element.  Either the element

// can be given, or the id of the element.

function forwardDropdownLink(element)

{

    var select = getElement(element);

    if (select)

        select.onchange = selectOnChangeRedirectHandler;

}







// Open url associated with selected option in a pop up window.

function selectOnChangePopUp(select){

    if (select) {

        var url = select.options[select.selectedIndex].value;

        var day = new Date();

        var id = day.getTime();

        window.open(url, id, select.openOptions);

    }

}





// Open url associated with selected option in a pop up window.

function selectOnChangePopUpHandler(evt){

    evt = (evt) ? evt : ((window.event) ? window.event : null);

    if (evt) {

        var select = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null);

        if (select) {

            var url = select.options[select.selectedIndex].value;

            var day = new Date();

            var id = day.getTime();

            window.open(url, id, select.openOptions);

        }

    }

}







// This function sets up popping up a window in response to selecting an option in the specified 

// select element.  Either the element can be given, or the id of the element.

function popUpDropdownLink(element, popUpWidth, popUpHeight)

{

    var select = getElement(element);

    if (select)

    {

        select.onchange = selectOnChangePopUpHandler;

        select.openOptions = 

            'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0'

            + ',width=' + (popUpWidth ? popUpWidth : '450')

            + ',height=' + (popUpHeight ? popUpHeight : '350')

    }

}







// Open the given url in a pop up window.

function popUp(url){

    var day = new Date();

    var id = day.getTime();

    window.open(url, id, 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=450,height=350');

}



function collapse_block (block, close, open){ 

    close = document.getElementById(close);

    open = document.getElementById(open);

    comment_body = document.getElementById(block);

    if (comment_body.style.display=='block' || !comment_body.style.display) {

        comment_body.style.display = 'none';

        close.style.display = 'none';

        open.style.display = 'block';

    }

    else {

        comment_body.style.display = 'block';

        close.style.display = 'block';

        open.style.display = 'none'; 

    }

}