	/**
	 * Common js functions
     */


	/**
	 * jQuery commonly used functions including preloading images, rollovers...
	 * @source - http://www.texotela.co.uk/code/jquery/rollover/
	 */
	jQuery.preloadImages = function() {
		for(var i = 0; i<arguments.length; i++) {
			jQuery("<img>").attr("src", arguments[i]);
		}
	} // ef
	
	// preload images first (can run before page is fully loaded)
	$.preloadImages("../images/products_on.gif", "../images/products_off.gif");
	
	$(
		function()
		{
			// set up rollover on any image with the class 'rollover' when we hover over this element
			$("img.rollover").hover(
				function() 
				{
					this.src = this.src.replace("_off","_on");	// replace off with on in the filename
				},
				function()
				{
					this.src = this.src.replace("_on","_off");	// replace on with off in the filename
				}
			);
		}
	) // ef  
	     
	// confirm delete & redirect to URL if user confirms
	function confirmDelete(url) {
		var strMsg = 'Are you sure you want to delete this item ?';

		if (confirm(strMsg)) {
			window.location = url;
		}
	} // ef

	// confirm delete & redirect to URL if user confirms
	function confirmMailer(url) {
		var strMsg = 'Are you sure you want to dispatch this mailer?';

		if (confirm(strMsg)) {
			window.location = url;
		}
	} // ef
    
	// change URL on drop-down menu
	function jump(form) {
	var myindex=form.menu.selectedIndex
		if (form.menu.options[myindex].value != "0") {
			window.open(form.menu.options[myindex].value, target='_self');
		}
	}
