$().ready(function() {
	$('#menu_container a[title]').qtip({
		show: 'mouseover',
		hide: { when: 'mouseout', fixed: true, delay: 100 },
		content: { prerender: true },
		text: false, // Use each elements title attribute
		position: {
			corner: {
				target: 'bottomLeft',
				tooltip: 'topLeft'
			},
			adjust: { x: 0, y: 0 }
		},
		style: {
			border: {
				width: 1,
				radius: 1
			},
			padding: 0,
			tip: { // Now an object instead of a string
				corner: 'topLeft', // We declare our corner within the object using the corner sub-option
				color: '#e3e3e3',
				size: {
					x: 5, // Be careful that the x and y values refer to coordinates on screen, not height or width.
					y : 9 // Depending on which corner your tooltip is at, x and y could mean either height or width!
				}
			},

			name: 'light' // Style it according to the preset 'cream' style
		}
	});

	$('#content_table').css('opacity', 0.01);
	$('#content_table').fadeTo(500, 1.0);

	$('a').click(function() {
		var url = $(this).attr('href').toString();
		if (url.search(PAGE_PATH)!=-1 && !$(this).hasClass('fancy')) {
			$('#content_table').fadeTo(500, 0.01);
			setTimeout(function() {
				document.location.href = url;
			}, 500);
			return false;
		}
	});
	
	$('img.captify').captify({
		// all of these options are... optional
		// ---
		// speed of the mouseover effect
		speedOver: 'fast',
		// speed of the mouseout effect
		speedOut: 'fast',
		// how long to delay the hiding of the caption after mouseout (ms)
		hideDelay:30,
		// text/html to be placed at the beginning of every caption
		prefix: '',		
		// opacity of the caption on mouse over
		opacity: '0.5',					
		// the name of the CSS class to apply to the caption box
		className: 'caption-bottom',	
		// position of the caption (top or bottom)
		position: 'bottom',
		// caption span % of the image
		spanWidth: '100%'
	});
});
