
(function($){

	$(document).ready(function(){

		// set rollover.
		$('img[@class=over]')
			.hover(
				function(){
					this.src = this.preloaded.src;
				},
				function(){
					this.src = this.src.replace(/^(.+)_on(\.[a-z]+)$/, '$1$2');
				}
			)
			.each(function(){
				this.preloaded = new Image();
				this.preloaded.src = this.src.replace(/^(.+)(\.[a-z]+)$/, '$1_on$2');
			})
			;

		// set ON status.
		$('img[@class=on]').each(function(){
			this.src = this.src.replace(/^(.+)(\.[a-z]+)$/, '$1_on$2');
		});

		// open a external link in new window.
		$('a[@rel=external]').click(function(){
			window.open(this.href, '_blank');
			return false;
		});

		// open a link in popup window.
		$('#sidebar01 a[@class=popup], #content01 a[@class=popup]').click(function(){
			window.open(this.href, 'new', 'toolbar=yes,scrollbars=yes,width=400,height=400');
			return false;
		});

		// open a link in new fullscreen window.
		$('#content01 a[@class=fullscr]').click(function(){
			var w = screen.availWidth;
			var h = screen.availHeight;
			window.open(this.href, 'window1', 'top=0,left=0,width='+ w +',height='+ h);
			return false;
		});
	});

})(jQuery);
