
var j$ = jQuery.noConflict();

j$(document).ready(function(){

	// set rollover.
	j$('img[@class=over]').hover(
		function(){
			this.src = this.src.replace(/^(.+)(\.[a-z]+)$/, '$1_over$2');
		},
		function(){
			this.src = this.src.replace(/^(.+)_over(\.[a-z]+)$/, '$1$2');
		})
		.each(function(){
			this.preloaded = new Image;
			this.preloaded.src = this.src.replace(/^(.+)(\.[a-z]+)$/, '$1_over$2');
		}
	);

	// set active states.
	j$('img[@class=current]').each(function(i){
		this.src = this.src.replace(/^(.+)(\.[a-z]+)$/, '$1_over$2');
	});

	// open the external links in new window.
	j$('a[@rel=external]').click(function(){
		window.open(this.href, '_blank');
		return false;
	});
	
	// popup window open
	j$('a.popup').click(function(){
		window.open(this.href, 'popup',' status=no, toolbar=no, location=no, menubar=no, scrollbars=yes, resizable=yes, width=670');
		return false;
	});
	
	// popup window close
	j$('img.close').click(function(){
		window.close();
	});
	

});
