/* Desque Javascript v1.0
 * (c) 2005 Daniel G. Farrelly
 * -------------------------------------------------------------------------------------------------------------------------- */ 
	var menu_on;

	function checkAll(form, name)
	{
	var el = form.elements;
	for (i = 0; i < el.length; i++)
		if (!name || (name && el.item(i).name == name))
		{
			el.item(i).checked = true;
		}
	}
	
	function uncheckAll(form, name)
	{
	var el = form.elements;
	for (i = 0; i < el.length; i++)
		if (!name || (name && el.item(i).name == name))
		{
			el.item(i).checked = false;
		}
	}
	
	function popUp( URL, wide, high, scroll )
	{
		day = new Date();
		id = day.getTime();
		if( ! scroll )
			scroll	=	0;
		eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars="+scroll+",location=0,statusbar=0,menubar=0,resizable=1,width="+wide+",height="+high+"');");
	}

/* Give Buttons a Background
 * -------------------------------------------------------------------------------------------------------------------------- */ 
	$(document).ready(function(){
		$("input.button")
			.wrap( '<div class="button_left"><div class="button_right"></div></div>' )
	});

/* Dropdown Menus
 * -------------------------------------------------------------------------------------------------------------------------- */ 
	function hidemenu()
	{
		$('div.menu_button').removeClass('select');
		$('div.menu_box').hide();
		$('div.menu_unclick').hide();
		menu_on = false;
	}

	function showmenu( id )
	{
		if( menu_on == true )
		{
			$('div.menu_button').removeClass('select');
			$('div.menu_box:visible').hide();
		}
		$('div.' + id ).addClass('select');
		$('div#' + id ).fadeIn();
		$('div.menu_unclick:hidden').show();
		menu_on = true;
	}
	
/* Real Text Format Editor
 * -------------------------------------------------------------------------------------------------------------------------- */ 
	tinyMCE.init({
		theme : "advanced",
		mode : "textareas",
		editor_selector: "mce_editor",
		theme_advanced_buttons1 : "bold,italic,strikethrough,separator,bullist,numlist,indent,outdent,separator,hr,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,link,unlink,separator,undo,redo,separator,code",
		theme_advanced_buttons2 : "",
		theme_advanced_buttons3 : "",
		theme_advanced_toolbar_location : "top",
		theme_advanced_toolbar_align : "left",
		extended_valid_elements : "a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]",
		content_css : "/modules/tinymce/jscripts/tiny_mce/mycontent.css"
	});
