function disp_html(text,link) {
link='http://localhost/interswitch.com/'+link;

$('#msg').append("<li>"+text+"::"+'<a href="'+link+'">'+link+"</a></li>");

}

(function($){ 


$.fn.navigationSuper = function(coloredImage, grayscaleImage, title, file, sideMenuFile, hideDivs, linkId) {

	$(this).click(function () {
							
		disp_html($(this).text(),file);
		//alert($(this).text()+"::"+file);
							
		// change the title
		$("span#menuHeaders").html(title);
			
		// change the background image to grayscale
		$("div#changingImages > img").attr({  
			  src: grayscaleImage
		}); 
		
		// Empty the content div
		$("#content").html("");
		
		// Reveal the menu and cotent area
		$('div#menu,div#content').slideDown('slow', function () {
												  
			// add new content
			$.ajax({ 
			  url: file,
			  cache: false,
			  success: function(html){ 
			  	$("#content").html("");
				$("#content").html(html); 
				window.location.hash = linkId;

			    //prevent link from returning
				$(".menu_nav_links","#content").click(function() {
					return false;
				}
				);
				
				
			  }
			});		
			
			
			$("#content,#sideNavigation").ajaxStop(function(){ 
					 return false;
			 });
			
			// add new side menu
			$.ajax({ 
			  url: sideMenuFile,
			  cache: false,
			  success: function(html){ 
			  	$("#sideNavigation").html("");
				$("#sideNavigation").html(html); 
				// This is where i tried binding the click event to an alert
				$(".menu_nav_links").bind("click", function () {
					$("a#" + this.id).sideNav($(this).text(),this.href,sideMenuFile);
					 $("a#" + this.id).removeAttr('href');
					 return false;

     			});
				
				

			  },
			  
			  error: function () { return false; }
			  
			  
			});		
			

		
												  
		});

		// Hide DIVs
		$(hideDivs).each(function () {
			$(this).fadeOut('fast'); 
		});
		
		
		
		 // change background image back to colored
		 $("#close").click(function () {
			$("#content").html("");				 
			$("div#changingImages > img").attr({  
				  src: coloredImage
			}); 
			$('div#menu').slideUp('slow')
		  });
		});
	
	
	
			$(".innerLinks").bind("click", function () {
			$("a#" + this.id).sideNav($(this).text(),this.href,sideMenuFile);
			 //$("a#" + this.id).removeAttr('href');
			 return false;

			 });

	
	return this;

}

// Bindings


})(jQuery); 
