
function showLoaderGraphic(thisID) {
		jQuery("#loadingGIF").removeClass("hidden");
		$("#loadingGIF ~ input").remove();
	}


jQuery(document).ready( function () {

	//Set up Tiny MCE textarea elements
	jQuery('textarea.tinymce').tinymce({
		script_url : 'lib/js/tiny_mce/tiny_mce.js',
		theme : "advanced",
		plugins : "advhr,advlink,insertdatetime,layer,nonbreaking,noneditable,paste,searchreplace,visualchars,xhtmlxtras",
		theme_advanced_buttons1 : "pasteword,|,link,unlink,anchor,|,cleanup,code,|,undo,redo,|,charmap,advhr,nonbreaking,|,forecolor,backcolor",
		theme_advanced_buttons2 : "bold,italic,underline,strikethrough,removeformat,|,justifyleft,justifycenter,justifyright,justifyfull,|,bullist,numlist,indent,|,sub,sup",
		theme_advanced_buttons3 : "",
		content_css : "skin/admin.css",
		gecko_spellcheck : "true",
		theme_advanced_toolbar_location : "top",
		theme_advanced_toolbar_align : "left",
		theme_advanced_path_location : "bottom",
		plugin_insertdate_dateFormat : "%Y-%m-%d",
		plugin_insertdate_timeFormat : "%H:%M:%S",
		extended_valid_elements : "hr[class|width|size|noshade],span[class|align|style]",
		file_browser_callback : "fileBrowserCallBack",
		theme_advanced_resize_horizontal : false,
		theme_advanced_resizing : true,
		convert_fonts_to_spans : true,
		nonbreaking_force_tab : true,
		apply_source_formatting : false,
		force_p_newlines : true,
		relative_urls : false,
		convert_urls : false,
		remove_script_host : true
	});
	
	//If a .dropdown type element is clicked, this function runs to determine what sub-options should be visible
	jQuery(".dropdown").change( function() {
		var thisID = jQuery(this).attr("id");									//Calling Dropdown Id (Name)
		var parentOptName = jQuery(this).attr("value");				//Calling Dropdown Value
		var thisRegID = jQuery("#mod_reg_id").attr("value");	//Reg_Id

		if (parentOptName != undefined) {		
			jQuery.get("lib/getViaJQ.asp", {'dataQueryType':'reg_sub_option', 'parentName':thisID,'parentOptName':parentOptName, 'reg_id':thisRegID}, 
			function(data){
				//If no errors were sent back, then this is a valid parent dropdown making the call
				if (jQuery(data).find("error").text() == "none") {
					var elementName = "#" + jQuery(data).find("valid_element").text();
					var vOptions = jQuery(data).find("valid_option").text();
					var optionNames = new Array();
					optionNames = vOptions.split("|");
					//First, make all children hidden				// use disabled
					jQuery(elementName).children().addClass("hidden").attr("disabled","disabled");
					//Then only show the valid children
					for (j = 0; j < optionNames.length; j++){	jQuery(elementName).children('option[value='+optionNames[j]+']').removeClass("hidden").removeAttr("disabled");}
					jQuery(elementName+' > option:first-child').focus().attr("selected", "selected");			//+' > option:first-child'
				}
			});
		}
		else {
			jQuery.get("lib/getViaJQ.asp", {'dataQueryType':'reset_sub_option','parentName':thisID,'reg_id':thisRegID}, 
				function(data){
					var elementName = "#" + jQuery(data).find("valid_element").text();
					jQuery(elementName).children().addClass("hidden").attr("disabled","disabled");
					jQuery(elementName+' > option:first-child').attr("selected", "selected");
				});
		} //End IF
		return false;
	});
	
	
	//------------------------------------------------------------------------------------------
	jQuery('.tooltip').tooltip({track: true, showURL: false, fade: 150, delay: 0, showBody: " | "});

});


