function mediaSubCat(Category, Symbol, CompanyID){
	var url;
	var response;
	var responseHTML="";
	switch(Category){
		//  this is if they go back to "Select".  It should clear all options away
		case '1':
			$('subcategory').innerHTML = '';
			break;
		//  this is the case of a news release
		case '2':
			url="/media/news_release_titles/"+Symbol;
			//alert(url);
			new Ajax.Request
			(url, 
				{
					method: 'get', 
					onCreate:function()
					{
						//alert('onCreate');
					},
					onSuccess: function(transport) 
					{
						response=transport.responseText.evalJSON();
						responseHTML="<div id=\"newsreleases\"><br/><strong>Choose the press releases you want to add the media to:</strong>";
						for(i=0; i<response.jsonTitles.length; i++)
						{
							responseHTML=responseHTML+"<div style=\" clear: both; width:100%; margin-bottom: 5px;\">";
							
							//  as a note, "story_id" is not actually the quotemedia assigned ID.  Need to use the actual newsfeed_id in order for 
							//  associations to work properly
							responseHTML=responseHTML+"<input style=\"clear:both; float:left;margin-right:5px;\" type=\"radio\" name=\"subCategory\" value=\""+response.jsonTitles[i].story_id+"\">";
							responseHTML=responseHTML+"<span style=\"width:450px; display:block; float: left;\" title=\""+response.jsonTitles[i].title+"\"> "+response.jsonTitles[i].title.truncate(80)+"</span>";
							responseHTML=responseHTML+"<span style=\"width:90px; display:block; float:left;\">"+response.jsonTitles[i].date.truncate(10, "")+"</span></div>";
							
						}
						responseHTML=responseHTML+"</div>";
						$('subcategory').innerHTML=responseHTML;
					}
				}
			);
		break;
		//  this is the case of a business focus
		case '3':
			url="/media/focus_titles/"+CompanyID;
			//alert(url);
			new Ajax.Request
			(url, 
				{
					method: 'get', 
					onCreate:function()
					{
						//alert('onCreate');
					},
					onSuccess: function(transport) 
					{
						response=transport.responseText.evalJSON();
						responseHTML="<div id=\"focus_titles\"><br/><strong>Choose the focus you want to add the media to:</strong>";
						for(i=0; i<response.jsonTitles.length; i++)
						{
							responseHTML=responseHTML+"<div style=\" clear: both; width:100%; margin-bottom: 5px;\">";
							responseHTML=responseHTML+"<input style=\"clear:both; float:left;margin-right:5px;\" type=\"radio\" name=\"subCategory\" value=\""+response.jsonTitles[i].focus_id+"\">";
							responseHTML=responseHTML+"<span style=\"width:300px; display:block; float: left;\"> "+response.jsonTitles[i].name.truncate(45)+"</span>";
							responseHTML=responseHTML+"<span style=\"width:90px; display:block; float:left;\">"+response.jsonTitles[i].date.truncate(10, "")+"</span></div>";
							
						}
						responseHTML=responseHTML+"</div>";
						$('subcategory').innerHTML=responseHTML;
					}
				}
			);
		break;
		//  this is the case of a director
		case '4':
			url="/media/director_names/"+CompanyID;
			//alert(url);
			new Ajax.Request
			(url, 
				{
					method: 'get', 
					onCreate:function()
					{
						//alert('onCreate');
					},
					onSuccess: function(transport) 
					{
						response=transport.responseText.evalJSON();
						responseHTML="<div id=\"focus_titles\"><br/><strong>Choose the director you want to add the media to:</strong>";
						for(i=0; i<response.jsonTitles.length; i++)
						{
							responseHTML=responseHTML+"<div style=\" clear: both; width:100%; margin-bottom: 5px;\">";
							responseHTML=responseHTML+"<input style=\"clear:both; float:left;margin-right:5px;\" type=\"radio\" name=\"subCategory\" value=\""+response.jsonTitles[i].management_id+"\">";
							responseHTML=responseHTML+"<span style=\"width:300px; display:block; float: left;\"> "+response.jsonTitles[i].name+"</span>";
							responseHTML=responseHTML+"</div>";
							
						}
						responseHTML=responseHTML+"</div>";
						$('subcategory').innerHTML=responseHTML;
					}
				}
			);
		break;
		//  this is the case of events
		case '5':
			url="/media/event_list/"+CompanyID;
			//alert(url);
			new Ajax.Request
			(url, 
				{
					method: 'get', 
					onCreate:function()
					{
						//alert('onCreate');
					},
					onSuccess: function(transport) 
					{
						response=transport.responseText.evalJSON();
						responseHTML="<div id=\"focus_titles\"><br/><strong>Choose the director you want to add the image to:</strong>";
						for(i=0; i<response.jsonTitles.length; i++)
						{
							responseHTML=responseHTML+"<div style=\" clear: both; width:100%; margin-bottom: 5px;\">";
							responseHTML=responseHTML+"<input style=\"clear:both; float:left;margin-right:5px;\" type=\"radio\" name=\"subCategory\" value=\""+response.jsonTitles[i].event_id+"\">";
							responseHTML=responseHTML+"<span style=\"width:300px; display:block; float: left;\"> "+response.jsonTitles[i].name.truncate(45)+"</span>";
							responseHTML=responseHTML+"<span style=\"width:90px; display:block; float:left;\">"+response.jsonTitles[i].start.truncate(10, "")+"</div>";
							
						}
						responseHTML=responseHTML+"</div>";
						$('subcategory').innerHTML=responseHTML;
					}
				}
			);
		break;
		}
	}
	
	
	AIM = {
 
	frame : function(c) {
 
		var n = 'f' + Math.floor(Math.random() * 99999);
		var d = document.createElement('DIV');
		d.innerHTML = '<iframe style="display:none" src="about:blank" id="'+n+'" name="'+n+'" onload="AIM.loaded(\''+n+'\')"></iframe>';
		document.body.appendChild(d);
 
		var i = document.getElementById(n);
		if (c && typeof(c.onComplete) == 'function') {
			i.onComplete = c.onComplete;
		}
 
		return n;
	},
 
	form : function(f, name) {
		f.setAttribute('target', name);
	},
 
	submit : function(f, c) {
		AIM.form(f, AIM.frame(c));
		if (c && typeof(c.onStart) == 'function') {
			return c.onStart();
		} else {
			return true;
		}
	},
 
	loaded : function(id) {
		var i = document.getElementById(id);
		if (i.contentDocument) {
			var d = i.contentDocument;
		} else if (i.contentWindow) {
			var d = i.contentWindow.document;
		} else {
			var d = window.frames[id].document;
		}
		if (d.location.href == "about:blank") {
			return;
		}
 
		if (typeof(i.onComplete) == 'function') {
			i.onComplete(d.body.innerHTML);
		}
	}
 
}

		function startCallback() {
			// make something useful before submit (onStart)
			return true;
		}
 
		function completeCallback(response) {
			// make something useful after (onComplete)
			document.getElementById('nr').innerHTML = parseInt(document.getElementById('nr').innerHTML) + 1;
			document.getElementById('r').innerHTML = response;
		}

