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(default_id){
    	var all_divs = document.getElementsByTagName('div');
    	var alert_string = '';
		for(var i = 0; i < all_divs.length; i++){
			var thisdiv = all_divs[i];
			thisdiv.className = ' ' + thisdiv.className + ' ';
			alert_string = alert_string + ' *' + thisdiv.className + '* ';
			//alert(thisdiv.className.indexOf('admin_toggle'));
			if(thisdiv.className && thisdiv.className.indexOf('admin_toggle') != -1){
				if(thisdiv.id==default_id){
					//do nothing
						
				}else{
					//alert('here');
					thisdiv.style.display = 'none';
				}
			}
		}
		//alert(alert_string);
    }
