
(function($){

	"use strict";

	$(document).ready(function(){

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

		/* Setup print button. */
		$('#content p.print > img')
			.css('cursor', 'pointer')
			.click(function(){
				window.print();
			})
		;

		/* Setup close button. */
		$('#content p.close > a').click(function(){
			window.close();
			return false;
		});

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

		/* Open link as popups. */
		$('a[rel=popup], area.popup').click(function(){					
			window.open(this.href, '_blank',' status=no, toolbar=no, location=no, menubar=no, scrollbars=yes, resizable=no, width=700');
			return false;
		});
		$('a[rel=popup3]').click(function(){					
			window.open(this.href, 'popupx660','menubar=no,toolbar=no,location=yes,status=yes,resizable=yes,scrollbars=yes,width=700,height=500');
			return false;
		});

		$('a[rel=parent]').click(function(){
			if (window.opener) {
				window.opener.location.href = this.href;
				window.blur();
				window.opener.focus();
				return false;
			}
		});
		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);



