
(function($){

	"use strict";

	$(document).ready(function(){

		/* Set rollover. */
		$('img.over, input.over').rollover({
			suffix: '_over'
		});

		/* Activate current page. */
		$('img.on').each(function(){
			this.src = this.src.replace(/^(.+)(\.[a-z]+)$/, '$1_over$2');
		});

		/* Open link as '_blank'. */
		$('a[rel=external], .blank').click(function(){					
			window.open(this.href, '_blank');
			return false;
		});

		/* Open link as popups. */
		$('a[rel=popup]').click(function(){					
			window.open(this.href, 'popupx660','menubar=no,toolbar=no,location=yes,status=yes,resizable=yes,scrollbars=yes,width=700');
			return false;
		});
		$('a[rel=popup2]').click(function(){					
			window.open(this.href, 'popupx900','menubar=no,toolbar=no,location=yes,status=yes,resizable=yes,scrollbars=yes,width=940');
			return false;
		});
		$('a[rel=popup3]').click(function(){					
			var w = window.open(this.href, 'popupx500','menubar=no,toolbar=no,location=yes,status=yes,resizable=yes,scrollbars=yes,width=550,height=650');
			w.focus();
			return false;
		});
		$('a[rel=popup4]').click(function(){					
			var w = window.open(this.href, 'popupx920','menubar=no,toolbar=no,location=yes,status=yes,resizable=yes,scrollbars=yes,width=950');
			w.focus();
			return false;
		});
		$('a[rel=popup5]').click(function(){					
			window.open(this.href, 'popupx730','menubar=no,toolbar=no,location=yes,status=yes,resizable=yes,scrollbars=yes,width=770');
			return false;
		});
		$('a[rel=popup6]').click(function(){					
			window.open(this.href, 'popupx730','menubar=no,toolbar=no,location=yes,status=yes,resizable=yes,scrollbars=yes,width=850');
			return false;
		});
		
		$('a[href=""]').addClass('nohref');

		fixIE();

	});

	/**
	 * Fix ie problem.
	 */
	function fixIE() {
		if (!$.browser.ie) {
			return;
		}

		/* Background flicker. */
		try {
			document.execCommand('BackgroundImageCache', false, true);
		}
		catch(e) {}
	}

})(jQuery);



/*
 * jQuery tiny rollover plugin.
 *
 * @param {Object} Several options.
 * @return {Object} jQuery object.
 */
(function(a){a.fn.rollover=function(c){var d="$1"+a.extend({suffix:"_on"},c).suffix+"$2";return a(this).each(function(){var b=new Image;b.src=this.src.replace(/^(.+)(\.[a-z]+)$/,d);a(this).data("rolloverImage",{defaultImage:this.src,hoverImage:b.src}).hover(function(){this.src=a(this).data("rolloverImage").hoverImage},function(){this.src=a(this).data("rolloverImage").defaultImage})})}})(jQuery);



