// JavaScript Document

//function send2friend() {
//	if($("sendtofriend_link")) {
//		$("sendtofriend_link").href="javascript:showS2fForm();";
//		Element.hide("sendtofriend");
//	}
//}

//function showS2fForm() {
//	Element.show("sendtofriend");
//}


// List items should be key/value pair delimited string
// tab delimits items and command delimites key/value
// ie., 'home,740-632-9999<tab>work,800-888-3333<tab>cell,4124442323'
function populateDropDown(dropdownid, listItems)
{
    dropdown = document.getElementById(dropdownid);
    itemArray = listItems.split('\t');
    var value = '';
    var text = '';
    var cpos = 0;

    // clear current list
    dropdown.options.length = 1;
    dropdown.options[0] = new Option('Select', '0');
    
    for (i = 0; i < itemArray.length; i++)
    {
        if (itemArray[i] != '')
        {
            cpos = itemArray[i].indexOf(',');
            value = itemArray[i].substring(0, cpos);
            text = itemArray[i].substring(cpos+1, itemArray[i].length);
            dropdown.options.length = (i+1);
            dropdown.options[dropdown.options.length] = new Option(text, value);
        }
    }
}

// used by the quick finder left nav section to load brands/manufactures drop down
function qfOptionClick()
{
	if (document.getElementById('qfindtype1').checked) {
		// populate brands
		populateDropDown('qfinditem', brandslist);
	} else {
		// populate manufactures
		populateDropDown('qfinditem', manuflist);
	}
}


//Event.observe(window, 'load', send2friend, false);