
$(document).ready(function(){
  document.pageManager = new PageManager();
	document.pageManager.init();
});

function PageManager(){};

PageManager.prototype = {
	init: function() {
		// Menu rollovers		
		$('a.rollover').each(function(){
			$(this).children('img').each(function() {
				var img = new Image();
				img.src = this.src.replace('.gif','-sel.gif');			
			});
		}).bind('mouseover', function() {
			$(this).children('img').each(function(){
				if(this.src.indexOf('-sel.gif') == -1) this.src = this.src.replace('.gif','-sel.gif');
			});
		}).bind('mouseout', function() {
			$(this).children('img').each(function(){
				this.src = this.src.replace('-sel.gif','.gif');
			});
		});

		// Portfolio rollover
		$('a.prollover').each(function(){
			$(this).children('img').each(function() {
				var img = new Image();
				img.src = this.src.replace('-s.jpg','.jpg');							
			});
		})
			.hover(
				function(){
					$(this).children('img').each(function(){
						this.src = this.src.replace('-s.jpg','.jpg');
					});
				}, 
				function(){
					$(this).children('img').each(function(){
						if(this.src.indexOf('-s.jpg') == -1) this.src = this.src.replace('.jpg','-s.jpg');
					});
				}
		);		

	}
}
