// jQuery - Setting file

$(document).ready( function () {
	$('a[@href^="http"]').click(function(){
		window.open(this.href, '');
		return false;
	});


	/**
	 * Analytics
	 */
	var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
	$.getScript(gaJsHost + "google-analytics.com/ga.js", function() {
		var pageTracker = _gat._getTracker("UA-7202200-1");
		pageTracker._trackPageview();
	});


	/**
	 * Rollover
	 */
	initRollOverImages();

	$('#movie a').click(function() {
		window.open(this.href +'/500/375', 'movieWindow', [
			'width=500',
			'height=375',
			'center=no',
			'location=no',
			'toolbar=no',
			'status=no',
			'menubar=no',
			'scrollbars=no',
			'directories=no',
			'resizable=no',
			'maximize=no'
		].join(','));
		return false;
	});

});

function initRollOverImages()
{
	var image_cache = new Object();
	$('#gNavi a img').not('[@src*="_on."]').each(function(i) {
		var imgsrc = this.src;
		var dot = this.src.lastIndexOf('.');
		var imgsrc_on = this.src.substr(0, dot) + '_on' + this.src.substr(dot, 4);
		image_cache[this.src] = new Image();
		image_cache[this.src].src = imgsrc_on;
		$(this).hover(
			function() { this.src = imgsrc_on; },
			function() { this.src = imgsrc; }
		);
	});
}
