jQuery(document).ready(function () {

    /*top bar animation*/
    jQuery('.loginContent').toggle(function () {
        jQuery('#topBar').animate({ height: 'show' }, 400);
        jQuery(this).addClass('loginSelected');
    }, function () {
        jQuery('#topBar').animate({ height: 'hide' }, 200);
        jQuery(this).removeClass('loginSelected');
    });
	
	/*top bar search input*/
	jQuery('.searchIconTopBar').click(function () {
		jQuery(this).css('cursor', 'default');
		isSafari3 = false;
		if (window.devicePixelRatio) isSafari3 = true;
		if (isSafari3) {
			jQuery('.searchBoxAnimate').animate({ 'opacity': 'show', 'width': '150px' }, 20, function () {
				jQuery(this).css('width','auto');
			});
		} else {
			jQuery('.searchBoxAnimate').animate({ 'opacity': 'show' }, 20, function () {
				jQuery(this).css('width','auto');
			});
		}
		jQuery('.searchBoxTopBarTxt').animate({ 'width': '140px' }, 50).focus();
	});

    /*image replace on hover*/
    jQuery('.imgReplace').hover(function () {
        this.src = this.src.replace('-off', '-on');
    }, function () {
        this.src = this.src.replace('-on', '-off');
    });
	
	jQuery('#homeArrowLeft img').hover(function() {
		jQuery(this).stop().animate({'opacity':0.8}, 400);
	}, function() {
		jQuery(this).stop().animate({'opacity':1}, 200);
	});
	jQuery('#homeArrowRight img').hover(function() {
		jQuery(this).stop().animate({'opacity':0.8}, 400);
	}, function() {
		jQuery(this).stop().animate({'opacity':1}, 200);
	});

    /*footer social icons hover animation*/
    jQuery('.socialIcon').hover(function () {
        jQuery(this).stop().animate({ 'opacity': 0.7 }, 400);
    }, function () {
        jQuery(this).stop().animate({ 'opacity': 1 }, 200);
    });

    /*contact page*/
    jQuery('.contactTxtBox').focus(function () {
        jQuery(this).parents('.contactInputGroup').children('.contactTxt').fadeIn('slow');
    });
	
})
