$(document).ready(function() {
    $('input[type="text"]').addClass("idleField");
    $('input[type="text"]').focus(function() {
        $(this).removeClass("idleField").addClass("focusField");
        if (this.value == this.defaultValue) {
            this.value = '';
        }
        if (this.value != this.defaultValue) {
            this.select();
        }
    });
    $('input[type="text"]').blur(function() {
        $(this).removeClass("focusField").addClass("idleField");
        if ($.trim(this.value == '')) {
            this.value = (this.defaultValue ? this.defaultValue : '');
        }
    });
});

$(window).load(function() {
    $('#flash_header').orbit({
        animation: 'horizontal-slide',
        // fade, horizontal-slide, vertical-slide, horizontal-push
        animationSpeed: 800,
        // how fast animtions are
        timer: false,
        // true or false to have the timer
        advanceSpeed: 2000,
        // if timer is enabled, time between transitions 
        pauseOnHover: true,
        // if you hover pauses the slider
        startClockOnMouseOut: false,
        // if clock should start on MouseOut
        startClockOnMouseOutAfter: 1000,
        // how long after MouseOut should the timer start again
        directionalNav: false,
        // manual advancing directional navs
        captions: false,
        // do you want captions?
        captionAnimation: 'fade',
        // fade, slideOpen, none
        captionAnimationSpeed: 800,
        // if so how quickly should they animate in
        bullets: false,
        // true or false to activate the bullet navigation
        bulletThumbs: false,
        // thumbnails for the bullets
        bulletThumbLocation: 'img/',
        // location from this file where thumbs will be
        afterSlideChange: function() {} // empty function 
    });
});

$(document).ready(function() {
    $("#thumb1").cycle({
        fx: "fade",
        timeout: 4000,
        cleartype: true,
        cleartypeNoBg: true
    });
    $("#thumb2").cycle({
        fx: "fade",
        timeout: 5500,
        cleartype: true,
        cleartypeNoBg: true
    });
    $("#thumb3").cycle({
        fx: "fade",
        timeout: 2500,
        cleartype: true,
        cleartypeNoBg: true
    });
    $("#thumb4").cycle({
        fx: "fade",
        timeout: 7000,
        cleartype: true,
        cleartypeNoBg: true
    });
    $("#thumb5").cycle({
        fx: "fade",
        timeout: 2000,
        cleartype: true,
        cleartypeNoBg: true
    });
});

$(document).ready(function() {

    if ($('.trigger').length > 0) {
        $('.trigger').click(function() {
            if ($(this).hasClass('open')) {
                $(this).removeClass('open');
                $(this).addClass('close');
                $(this).next().fadeIn(1000);
                return false;
            } else {
                $(this).removeClass('close');
                $(this).addClass('open');
                $(this).next().fadeOut(1000);
                return false;
            }
        });
    }

});

$(document).ready(function() {
	//$('div.tog> p.element').hide();
	$('.tog .element').hide();
	
	$('.tog > .toggler').click(function() {
		$('.open').css("color", "#88A6C0").removeClass('open');
		$(this).addClass("open").next('.element').stop().slideToggle('slow').siblings('.element:visible').stop().slideUp('slow');
	});
	
	$('.tog> .toggler').hover(function() {
		 $(this).css("color", "#88A6C0");
	}, 
	
	function () {
		if($(this).hasClass("open")){
			return false;
		} else {
			$(this).css("color", "#88A6C0");
		}
	});
	
	$(".accClose").click(function(){
		$(this).parents(".element").stop().hide();
	})
	
});

$(document).ready(function() {
			/*
			var defaults = {
	  			containerID: 'moccaUItoTop', // fading element id
				containerHoverClass: 'moccaUIhover', // fading element hover class
				scrollSpeed: 1200,
				easingType: 'linear' 
	 		};
			*/
			
			$().UItoTop({ easingType: 'easeOutQuart' });
			
		});
