//replace tag input field with category checklist
var tag_el;

window.addEvent('domready', function(){
	//Hide Category Drop-Down
	if( $('content_blog_sections')){
	var cat_el = $('content_blog_sections').getElement('label[for=categories]');
	if(cat_el){
		cat_el.setStyle('display', 'none');
	}
	//Replace Tags input field with specific checkboxes
	var tag_el = $('content_blog_sections').getElement('label[for=tags]');
	if(tag_el){
		var tags  = ['Nighttime leg cramps','Calf Pain', ' RLS (Restless Leg Syndrome)', 'Hip Pain', 'Cancer', 'Diet and Nutrition', 'Medical Interaction' , 'Pregnancy', 'Hydration', 'Stretching and Exercise', 'Sports', 'Medication', 'Vitamins', 'Quinine', 'Homeopathic', 'Natural'];
		var output = '';
		tags.each(function(item, index){
			output += ' <input type="checkbox" name="tags[]" value="'+item+'" /> '+item + "<br />";
		});
		output = 'Categories to associate with your post:<br />'+output+'';
		tag_el.setHTML(output);
		$('content_blog_sections').getElements('form[class=tdomf_form]').addEvent('submit', function(e) {
			//new Event(e).stop();
			var tags = tag_el.getElements('input');
			var output = '';
			tags.each(function(item, index){
				if(item.checked==true){
					output += item.getValue()+',';
				}
			});
			output='Tags (separate multiple tags with commas: cats, pet food, dogs):<br/><input type="textfield" id="tags" name="tags" size="60" value="'+output+'" />';
			tag_el.setHTML(output);
		});
	}
}
}
);
