	function validate_required(field,alerttxt){
		with (field){
			if (value==null||value==""||options[selectedIndex].value==""){
				alert(alerttxt);
				return false;
			}else{
				return true;
			}
		}
	}

    function getItem(id)
    {
        var itm = false;
        if(document.getElementById)
            itm = document.getElementById(id);
        else if(document.all)
            itm = document.all[id];
        else if(document.layers)
            itm = document.layers[id];

        return itm;
    }

    function toggleItem(id)
    {
        itm = getItem(id);

        if(!itm)
            return false;

        if(itm.style.display == 'none')
            itm.style.display = '';
        else
            itm.style.display = 'none';

        return false;
    }
    
    function hideItem(id)
    {
        itm = getItem(id);

        if(!itm)
            return false;

        itm.style.display = 'none';

        return false;
    }
    
    function showItem(id)
    {
        itm = getItem(id);

        if(!itm)
            return false;

        itm.style.display = '';

        return false;
    }
    
    function highlight(id,color) {
        itm = getItem(id);

        if(!itm)
            return false;

        itm.style.backgroundColor = color;

        return false;
    }
    
    function setnav(){
    	hideItem('send_friend');
    	hideItem('advanced_admin');
    	hideItem('product_admin');
    	hideItem('inv_admin');
    	hideItem('user_admin');
    	hideItem('layout_admin');
    	hideItem('shipping_admin');
    	hideItem('discount_admin');
    	hideItem('dump_admin');
    	hideItem('otherbox');
    }
    
    function copyaddress(thisform){
		document.registration_form.s_company.value = document.registration_form.b_company.value
		document.registration_form.s_city.value = document.registration_form.b_city.value
		document.registration_form.s_state.value = document.registration_form.b_state.value
		document.registration_form.s_zip.value = document.registration_form.b_zip.value
		document.registration_form.s_add1.value = document.registration_form.b_add1.value
		document.registration_form.s_add2.value = document.registration_form.b_add2.value
		document.registration_form.s_country.value = document.registration_form.b_country.value
	}