function findElement(elemID)
{
	var obj;
	
	if (document.getElementById) {
		obj = document.getElementById(elemID);
	} else if (document.all) {
		obj = document.all(elemID);
	} else if (document.layers) {
		obj = document.layers[elemID];
	}
	return obj;
}

function toolbarButtonOver(button)
{
    button.className = 'toolbarButtonHighLight';
    window.status = button.title;
}

function toolbarButtonOut(button)
{
    button.className = 'toolbarButton';
    window.status = '';
}

function clickScrollUp(btnID)
{
	var qty = findElement(btnID);
	var val = isNaN(parseInt(qty.value)) ? 1 : parseInt(qty.value);
	if( val < 999 ) val++;
	else val = 999;
	qty.value = val;
}

function clickScrollDown(btnID)
{
	var qty = findElement(btnID);
	var val = isNaN(parseInt(qty.value)) ? 1 : parseInt(qty.value);
	if( val > 1 ) val--;
	else val = 1;
	qty.value = val;
}

function getForm(formName)
{
	if (window.navigator.appName.toLowerCase().indexOf("netscape") > -1) {
		return document.forms[formName];
	}
	else {
		return document[formName];
	}
}

function countSelected()
{
    var item;
    var itemCount = 0;

    for( var i = 0; i < document.all.length; i++ )
    {   
        item = document.all[i];
        
        if( item.type && ( item.type == "checkbox" && item.checked ) )
        {
            itemCount++;
        }            
    }
        
    return itemCount;
}

