$(document).ready(function(){
	var topMenuTimeout;
	$('#jixedToolbar > ul > li').hover(
		function(){
			clearTimeout( topMenuTimeout );
			$('#jixedToolbar > ul > li').removeClass('hover');
			$('#jixedToolbar > ul ul').hide();
			$(this).addClass('hover');
			$(this).children('ul').show();
		},
		function(){
			topMenuTimeout = setTimeout( function() {
				$('#jixedToolbar > ul > li').removeClass('hover');
				$('#jixedToolbar > ul ul').hide();
			}, 700 );
		}
	);
	
	$( '.tipTip' ).tipTip();
		
	$('.tabsMenu a').click(function(){
		if ( $(this).not('.active').length==1 ){
			$(this).parent().children().removeClass('active');
			$(this).addClass('active');
			$(this).parent().next().children().hide();
			$('#' + $(this).attr('href') ).fadeIn();
		}
		return false;
	});
	
	$('.inputText, textarea').focus(function(){ $(this).addClass('formElementActive'); });
	$('.inputText, textarea').blur(function(){ $(this).removeClass('formElementActive'); });



	$( '#socialmedia a, #right ul a' ).hover(
		function() {
			if ( ! $.browser.msie ) {
				$( this ).stop( false, true ).animate( { opacity: 0.7 }, 300 );
			}
		},
		function() {
			if ( ! $.browser.msie ) {
				$( this ).stop( false, true ).animate( { opacity: 1 }, 300 );
			}
		}
	);
	$( 'input[type="text"], input[type="password"], textarea' ).live( 'focus blur', function() {
		$( this ).toggleClass( 'fieldActive' );
	} );
	$( '.btn' ).live( 'hover', function() {
		$( this ).toggleClass( 'btnHover' );
	} );
	$( 'input[type="text"]' ).each( function() {
		$( this ).addClass( 'inputText' );
	} );

});
