
 
 /*-- Scroll To --*/ 
 
 
      $(document).ready(function(){

        $('a[href*=#]').click(function() {
   
          if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
   
          && location.hostname == this.hostname) {
  
            var $target = $(this.hash);
   
            $target = $target.length && $target
   
            || $('[name=' + this.hash.slice(1) +']');
   
            if ($target.length) {
   
              var targetOffset = $target.offset().top;
  
              $('html,body')
  
              .animate({scrollTop: targetOffset}, 1000);
  
             return false;
  
            }
  
          }
  
        });
  	
      });
	  
	  
	  /*---- Simple Slideshow ----*/
	  
	  function slideSwitch() {
    var $active = $('#header-left IMG.active');

    if ( $active.length == 0 ) $active = $('#header-left IMG:last');

    // use this to pull the images in the order they appear in the markup
    var $next =  $active.next().length ? $active.next()
        : $('#header-left IMG:first');

    // uncomment the 3 lines below to pull the images in random order
    
    // var $sibs  = $active.siblings();
    // var rndNum = Math.floor(Math.random() * $sibs.length );
    // var $next  = $( $sibs[ rndNum ] );


    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}

$(function() {
    setInterval( "slideSwitch()", 4000 );
});



//toggle #you-could-save with scollTo effect

jQuery(function($) {
	
	//toggle #you-could-save with scollTo effect
	$('.form').click( function() {
		$('#contact').fadeIn('slow');
		$.scrollTo( '#contact', 800);
		return false;
	});
	
	$('#hdr-contact').click( function() {
		$('#contact').fadeOut('fast');
		return false;
	});
	
	//clear input fields onfocus
	$('input[@type="text"]').focus( function() {
		if (this.defaultValue ==  this.value) { this.value = ''}
	}).blur( function() {
		if (this.value ==  '') { this.value = this.defaultValue }
	});

});
var qsON = false;
function qs() {
	var qsw = document.getElementById("quickSearchWrap");
	if(!qsON) {
		qsw.style.display="block";
		qsON = true;
	}
	else {
		qsw.style.display="none";
		qsON = false;
	}
}
