(function($){
	$.fn.imageRollover = function(options) {
		var defaults = {
			off : '_off',
			on  : '_on'
		};
		var settings = $.extend(defaults, options);
		this.each(function() {
			if ( $(this).attr('src').lastIndexOf(settings.off) == -1 ) return;
			$('<img />').attr('src', $(this).attr('src').replace(settings.off, settings.on));
			$(this).hover(function() {
				$(this).attr('src',$(this).attr('src').replace(settings.off, settings.on));
			},function() {
				$(this).attr('src',$(this).attr('src').replace(settings.on, settings.off));
			});
		});
		return this;
	};
})(jQuery);

(function($){
	$.fn.pageScroller = function(options) {
		var defaults = {
			duration   : 795,
			easing     : 'easeOutExpo',
			scrollLeft : false
		},
			html = document.documentElement,
			body = document.body,
			settings = $.extend(defaults, options);
		this.each(function() {
			if ($(this).attr('href').indexOf('#') == -1 || !$($(this).attr('href')).size()) return;
			$(this).click(function(e){
				e.preventDefault();
				var target       = $($(this).attr('href')),
					targetY      = target.offset().top || 0,
					targetX      = target.offset().left || 0,
					windowHeight = html.clientHeight || body.clientHeight,
					windowWidth  = html.clientWidth || body.clientWidth,
					pageHeight   = html.scrollHeight || body.scrollHeight,
					pageWidth    = html.scrollWidth || body.scrollWidth;
				if (document.compatMode == 'BackCompat') {
					pageHeight = body.scrollHeight, pageWidth = body.scrollWidth;
				};
				if (windowHeight + targetY > pageHeight) targetY -= (windowHeight + targetY) - pageHeight;
				if (windowWidth + targetX > pageWidth) targetX -= (windowWidth + targetX) - pageWidth;
				if (! settings.scrollLeft ) {
					$('html,body').animate({
						scrollTop: targetY
					}, settings.duration, settings.easing);
				} else {
					$('html,body').animate({
						scrollTop: targetY,
						scrollLeft: targetX
					}, settings.duration, settings.easing);
				};
			});
		});
		return this;
	};
})(jQuery);

$(function(){
	$('a[href$=pdf]').attr("target","_blank");
	$('img, input:image').imageRollover();
	$('a').pageScroller();
	
	if($('a.fancy').length){
		$("a.fancy").fancybox({
			'width'	: '640',
			'height' : '480',
			'titlePosition'	: 'inside',
			'overlayColor'		: '#000',
			'overlayOpacity'	: 0.7
		});
	}
});

function open_movie01(){
win1=window.open("/lineup/movie01.php","new1","width=500,height=255");
win1.focus();
}

function open_movie02(){
win2=window.open("/lineup/movie02.php","new2","width=500,height=255");
win2.focus();
}


