jQuery(document).ready(function($) {
		 	
		 	$('ul.sf-menu').superfish({
		 		speed: 1,
		 		dropShadows:   false
		 	});
		 	
		 	$('.cycle').cycle({
		 		before: addCaption,
		 		pause: 1
		 	});
		 	function addCaption() { 
    			$('#cycle-caption').html('<p class="caption">' + this.alt + '</p>'); 
			}
		 			
			var filename = $.url.attr("file");
			if (filename){
				var file = filename.split(".");
				$('#wrapper > .content').attr("id", file[0]);
				$('#topnav a').each(function(){
	      			if( window.location.href.indexOf( $(this).attr('href') ) >= 0 && $(this).attr('href').length > 1 ) {
	        			$(this).parent().addClass("currentpage");
	      			}
	    		});
				$('#topnav li').hover(function() {
				  $(this).addClass('pretty-hover');
				}, function() {
				  $(this).removeClass('pretty-hover');
				});
			}
			
			if ( $("#columns").length > 0 ) { $("#columns").columnize({columns: 2}); }
				$('#network').dataTable();
				$("input,textarea").focus(function() {
					$(this).parent().addClass("curFocus");
				});
				$("input,textarea").blur(function() {
					$(this).parent().removeClass("curFocus")
				});
				$("#register").validate({
					rules: {
						name: "required",
						password: "required",
						password2: "required",
						username: "required",
						email: {
							required: true,
							email: true
						},
						organization: "required",
						weblinks: { url: true }
					},
					messages: {
						name: "Please enter your name.",
						password: "Please enter a password.",
						passowrd2: "Please confirm your password.",
						username: "Please enter a username.",
						email: "Please enter a valid email address.",
						organization: "Please enter your affiliation.",
						weblinks: "Please enter a valid URL."
					}
				});
		 });
