
$(document).ready(function() {
$('.two_column .left_section blockquote').after('<div class="blockquote_close" style="margin-top:20px"></div>');

/*
	$("ul.menu li").mouseover(function() {

		$(this).find("ul.sub-menu").stop().animate({"height": "show", "opacity": "show"}, 800, "swing");
 
		$(this).hover(function() {}, function(){
			$(this).find("ul.sub-menu").animate({"height": "hide", "opacity": "hide"}, "slow");
		});
	});
*/





$('#Nav ul.menu > li').each(function(index) {
	var $spans = $('ul');
   $(this).find($spans).parent().addClass('has_sub');
  });



		function formatText(index, panel) {
    		  return index + "";
    	  };



		$(function() {
			
		$('#accordion3').bind('accordionchange', function(event, ui) {
		  $.scrollTo( '.ui-state-active', {duration:1000}); 
		});

		$( "#accordion3" ).accordion({
			autoHeight: false,
			collapsible: true,
			navigation: true,
			active: false,
			header: 'h2'
			
			});

//SLIDER //

           $('.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: 2600,             // 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: " ",                // Start text
    		        stopText: " ",               // Stop text
    		        navigationFormatter: formatText // Details at the top of the file on this use (advanced use)
            });

           $('.anythingSlider2').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: 7000,                    // How long between slide transitions in AutoPlay mode
                startStopped: false,            // If autoPlay is on, this can force it to start stopped
                animationTime: 500,             // 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: " ",                // Start text
    		        stopText: " ",               // Stop text
    		        navigationFormatter: formatText, // Details at the top of the file on this use (advanced use)
					moveType:true
			});
	
           $('.anythingSlider3').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:7000,                    // How long between slide transitions in AutoPlay mode
                startStopped: false,            // If autoPlay is on, this can force it to start stopped
                animationTime: 500,             // 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: " ",                // Start text
    		        stopText: " ",               // Stop text
    		        navigationFormatter: formatText // Details at the top of the file on this use (advanced use)

			});

	});







//CLEAR SEARCH BOX

/*
    $('input[name=s]').bind("focus blur",function(){
        if ($(this).attr("value") == 'SEARCH')
        {
            $(this).attr("value","");
        }
        else if ($(this).attr("value") == '')
        {
            $(this).attr("value","SEARCH");
        }
    });

  */ 
    
    //CV form functions
    
    $("form.wpcf7-form input, form.wpcf7-form textarea").focus(function(){
        var newValue = '';
        
        if ($(this).attr("name") == 'cv_name' && $(this).attr("value") == 'Name') {
                $(this).attr("value",newValue);
        }
        
        if ($(this).attr("name") == 'cv_email' && $(this).attr("value") == 'Email') {
                $(this).attr("value",newValue);
        }

        
        if ($(this).attr("name") == 'cv_subject' && $(this).attr("value") == 'Subject') {
                $(this).attr("value",newValue);
        }
        
        if ($(this).attr("name") == 'cv_comments' && $(this).attr("value") == 'Comments') {
                $(this).attr("value",newValue);
        }
        
    });

    $("form.wpcf7-form input, form.wpcf7-form textarea").blur(function(){
        if ($(this).attr("name") == 'cv_name' && $(this).attr("value") == '') {
                $(this).attr("value","Name");
        }

        if ($(this).attr("name") == 'cv_email' && $(this).attr("value") == '') {
                $(this).attr("value","Email");
        }
        if ($(this).attr("name") == 'cv_subject' && $(this).attr("value") == '') {
                $(this).attr("value","Subject");
        }
        if ($(this).attr("name") == 'cv_comments' && $(this).attr("value") == '') {
                $(this).attr("value","Comments");
        }
    });


})//END




