//All Javascript written by Joseph Szymborski 2011
//Utilizes jQuery, a jQuery Form Plugin (http://jquery.malsup.com/form/) and a jQuery Deep Link Plugin (http://www.asual.com/jquery/address/)
//Thanks for taking interest in the source!
//I'M COMMENTIN

$(document).ready(function() {

	$("#quote").hover(
	  function () {
		$("#cecil").attr("src","img/cecilpoint.gif");
	  },
	  function () {
	   $("#cecil").attr("src","img/cecil.gif");
	  }
	);
	
                $.address.change(function(event) {
					
                    if (event.value=="/"||event.value==null){
						$("#centerstage").hide();
						$("#load").show();
						$("#centerstage").load("http://naj-p.com/front.php", function(){
						$("#centerstage").fadeIn();
						$("#load").hide();
						$("#quote").show();
						
					piwikTracker.setDocumentTitle("ajax/index");
					piwikTracker.trackPageView();
					});
						
					}else{
					$("#quote").hide();
					$("#centerstage").hide();
					$("#load").show();
					$("#centerstage").load("http://naj-p.com/"+event.value+".php", function(){
						$("#centerstage").fadeIn();
						$("#load").hide();
						piwikTracker.setDocumentTitle("ajax/"+event.value);
						piwikTracker.trackPageView();
						
					});
							
					}
					
                });
				
				/*
				$.address.init(function(event) {
					
                    if (event.value=="/"){
						$("#centerstage").load("http://naj-p.com/labs/naj/iedeep/front.php");
					}else{
					$("#centerstage").hide();
					$("#load").show();
					$("#centerstage").load("http://naj-p.com/labs/naj/iedeep"+event.value, function(){
						$("#centerstage").fadeIn();
						$("#load").hide();
						
					});
					
					}
					
                });*/
				
                $('a').click(function() {
                    $.address.value($(this).attr('id'));
					
					
                });	
				$("#javascript").hide();
				 $('#quote').click(function() {
                    $.address.value("quote");
					
					return false;
                });
				
	

});
	$("#screen-name").hide();
	$("#centerstage").show();
	
// Preloading images...
if (document.images) {
    img1 = new Image();
    img1.src = "img/loading.gif";
    img2 = new Image();
    img2.src = "img/cecilpoint.gif";
}


