﻿// Capitalize first letter of a string

function ucFirst(str){
	str += '';
    var f = str.charAt(0).toUpperCase();
    return f + str.substr(1);
}

$(document).ready(function(){

	// Menu-Mouseovers
	
	$('.menuLink').each(
		function(){
			$(this).bind('mouseover',
				function(){
					var t = $(this).attr('href');
					
					t = t.replace('.php','');
					
					t = "arrow" + ucFirst(t);
					
					if($('#' + t).attr('src') != "pics/arrow.png")
						$('#' + t).attr('src','pics/arrow.png');
				}
			);
			
			$(this).bind('mouseout',
				function(){
					var t = $(this).attr('href');
					
					t = t.replace('.php','');
					t = "arrow" + ucFirst(t);
					
					if($('#' + t).attr('src') != "pics/arrow_blank.png")
						$('#' + t).attr('src', 'pics/arrow_blank.png');
				}
			);
		}
	);
	
});
