this.main = function(){
  $(document).ready(function(){
    	$("img.nav").hover(function(){
		var v = (this.src);
		var d = (v.indexOf('_'));
		var b = (v.substr(d+4));
		var c = (v.substr(0,d)+b);
		this.src = c;
   	 },
	function(){
		var v = (this.src);
		var x = (v.indexOf('m'));
		var y = (v.substr(x));
		var d = (y.indexOf('.'));
		var c = (y.substr(0,d)+"_out.gif");
		this.src = c;
	});
	$("img.nav").click(function(){
		if(this.title == "home"){
			$("div.navbar").find("span:last").remove();
			$("div.navbar").fadeOut("slow");
			theeye.location='blank.html';
		}
		else if(this.title == "art"){
			$("div.navbar").find("span:last").remove();
			$("div.navbar").fadeOut("slow");
			theeye.location='art/art.html';

		}
		else if(this.title == "programs"){
			$("div.navbar").find("span:last").remove();
			$("div.navbar").fadeOut("slow");
			theeye.location='programs/lifeGame.html';
		}
		else{
			var placeHolder = (this.title);
			var placeHolder = ("art/"+placeHolder+".html");
			theeye.location=placeHolder;
		}  
	});
  });			
};


// starting the script on page load
$(document).ready(function(){
	main();
});