	// JavaScript functions to hide and display submenu
	$(document).ready(function(){ 
		setTimeout(function() {
    		$('.loader').hide();
		}, 12000);	
		$("ul.sf-menu").superfish({
  		delay:       400,																				// one second delay on mouseout 
			animation:   {opacity:'show',height:'show'},  					// fade-in and slide-down animation 
			speed:       'fast'                          						// faster animation speed 
		});

	  $(".toggleField").each( function()
	  {
	    $(this).data( "labelName", $(this).val() );
	  });
	
	  $('.toggleField').focus(function(){
	  if ( $(this).val() == $(this).data("labelName") )
	  {
	    $(this).val("");
	  }
	  }).blur(function(){
	    if ( $(this).val() == "" )
	    {
	      $(this).val($(this).data("labelName"));
	    }
	  });		

		// Logo Image Fading
		$("#logo").hover(function(){
			$(this).stop().fadeTo(250, 0.8);			
		},function(){
			$(this).stop().fadeTo(250, 1);
		});    
		// Top-level menu item highlighting
		$("#mainNav li").hover(function(){$(this).addClass('active');},function(){$(this).removeClass('active');});
		$("#mainNav li.active").hover(function(){$(this).addClass('active');},function(){$(this).addClass('active');});
		
		$("#homeLink, #contactLink, #blogLink, #careerLink, #myQuirkLink").fadeTo(500, 0.5);
		$("#quickLinks ul li").hover(function(){
			$(this).stop().fadeTo(500, 1);			
		},function(){
			$(this).stop().fadeTo(500, 0.5);
		});    
		
	// Smooth Back to top scrolling
    $('.backtotop').click(function(){
      $('html, body').animate({scrollTop:0}, 1500);
      return false;
    });
		
	});

	function formatText(index, panel) {
	  return index + "";
  }

	/*$(function () {
			$('.anythingSlider').anythingSlider({
					easing: "easeInOutExpo",        // Anything other than "linear" or "swing" requires the easing plugin
					autoPlay: true,                 // This turns off the entire FUNCTIONALY, not just if it starts running or not.
					delay: 5000,                    // How long between slide transitions in AutoPlay mode
					startStopped: false,            // If autoPlay is on, this can force it to start stopped
					animationTime: 600,             // How long the slide transition takes
					hashTags: true,                 // Should links change the hashtag in the URL?
					buildNavigation: true,          // If true, builds and list of anchor links to link to each slide
			pauseOnHover: true,             // If true, and autoPlay is enabled, the show will pause on hover
			startText: "Go",             // Start text
			stopText: "Stop",               // Stop text
			navigationFormatter: formatText       // Details at the top of the file on this use (advanced use)
			});
			
			$("#slide-jump").click(function(){
					$('.anythingSlider').anythingSlider(6);
			});
	});
	*/	
	
	/* write out the email address to protect from spam harvesters*/
	var emailLinkStart = "<a href=\"mailto:";
	var emailLinkMiddle = "\" id=\"mailtolink\">";
	var emailLinkImage = "<img src=\"/images/hello@quirk.gif\" alt=\"Email\" border=\"0\" align=\"top\" style=\"margin-bottom:\-3px;\"/>";
	var emailLinkEnd = "</a>";

	function email( name, domain )
	{
		document.write( emailLinkStart + name + "@" + domain + emailLinkMiddle + name + "@" + domain + emailLinkEnd );
	}

	function emailImage( name, domain )
	{
		document.write( emailLinkStart + name + "@" + domain + emailLinkMiddle + emailLinkImage + emailLinkEnd );
	}		// JavaScript Document
