$(document).ready(
	function(){
		$(".nav-slide").click(
			function() {
				$("#nav").slideToggle("slow");
				return false;
			}
		);

		$("#s").click(
			function() {
				$(this).val("");
			}
		);

		$("#s").focus(
			function() {
				$(this).val("");
			}
		);


		$("#index-s").click(
			function() {
				$(this).val("");
			}
		);

		$("#index-s").focus(
			function() {
				$(this).val("");
			}
		);
		$("#home").hover(
			function() {
				$("#home").fadeTo("slow", 0);
				$("#home").fadeTo("fast", 100);
			},
			function() {}
		);

		$(".nav").accordion({
			event: "mouseover",
			autoHeight: false,
			navigation: true
		});

		// Add pdf icons to pdf links
		$("a[href$='.pdf']").addClass("pdf");

		// Add txt icons to document links (doc, rtf, txt)
		$("a[href$='.doc'], a[href$='.txt'], a[href$='.rft']").addClass("txt");

		// Add zip icons to Zip file links (zip, rar)
		$("a[href$='.zip'], a[href$='.rar']").addClass("zip"); 

		// Add email icons to email links
		$("a[href^='mailto:']").addClass("email");

		//Add external link icon to external links - 
		$('a').filter(function() {
			//Compare the anchor tag's host name with location's host name
			return this.hostname && this.hostname !== location.hostname;
		}).addClass("external");
	}
);