// JavaScript Document
 $(function() {
				if (!location.hash){
					location.hash = '#Home';
				}			
			
				$('a.Remote').remote('#Main', function() {
					$('body').colorBlend([{fromColor:$('body').css('background-color'), toColor:$('img', this).css('color'), param:'background-color', cycles:1, isFade:false, fps:5}]);
				
					document.title = 'softflo/pathglo | '+$(this).attr('title');
				});
				
				
                $.ajaxHistory.initialize();
            });
$(document).ready(function() { 
	
	//FADE INS
	$('#Main').ajaxComplete(function(request, settings){
		
		$(this).fadeIn(250);
	});
	
	$('#Main').ajaxStart(function(){
		$(this).fadeOut(125);
	});

	//NAVIGATION ROLLOVERS
		$("#Navigation #Middle a img").each(function() {										 
			rollsrc = $(this).attr("src");
			rollON = rollsrc.replace(/.png$/ig,"_Over.png");
			$("<img>").attr("src", rollON);
			
		});
		$("#Navigation #Middle a").mouseover(function(){
			imgsrc = $(this).children("img").attr("src");
			matches = imgsrc.match(/_over/);
			
			// don't do the rollover if state is already ON
			if (!matches) {
			imgsrcON = imgsrc.replace(/.png$/ig,"_Over.png"); // strip off extension
			$(this).children("img").attr("src", imgsrcON);
			}
			
		});
		
		$("#Navigation #Middle a").mouseout(function(){
			$(this).children("img").attr("src", imgsrc);
		});

	
});
