jQuery(function() {
	
	$('table').attr('cellspacing', 0);
	
	$('input.hintValue').each(function(i) {
		$(this).data('hint', $(this).attr('value'));
	});
	
	$('input.hintValue').focus(function() {
		var hint = $(this).data('hint');
		var value = $(this).attr('value');
		if (value == hint) {
			$(this).attr('value', '');
		}
	});
	$('input.hintValue').blur(function() {
		var hint = $(this).data('hint');
		var value = $(this).attr('value');
		if (value == '') {
			$(this).attr('value', hint);
		}
	});
	
	$(".dropDownMenu > li").mouseenter(function () {
		$(this).find("ul.sub").fadeIn(150);
	});
	$(".dropDownMenu > li").mouseleave(function () {
		$(this).find("ul.sub").fadeOut(100);
	});
	
	
	
//*******************************************************************//
//								TABS
//*******************************************************************//

	$('.tabcontent').css('display', 'none');
	
	if(window.location.hash!=''){
		$(window.location.hash).fadeIn(200);
		$(window.location.hash).addClass('visible');
		
		$('.tabframe a').each(function(){
			if( $(this).attr('href') == window.location.hash ) {
				$(this).addClass('active');
			}
		});
	} else {
		var firstTab = $('.tabframe a').first();
		firstTab.addClass('active');
		showTab($(firstTab.attr('href')));
	}
	
	$('.tabframe a').click(function(){
		if( ! $(this).hasClass('active')) {
			var target = $(this).attr('href');
			changeTab(target);
		}
	});
	
	$('.changeTabLink').click(function(){
		var target = $(this).attr('href');
		changeTab(target);
	});
	
	function changeTab (id) {
		$('.tabframe a.active').removeClass('active');
		
		$('.tabframe a').each(function(){
			if( $(this).attr('href') == id ) {
				$(this).addClass('active');
			}
		});
		hideTab(id);
	};
	function hideTab (id) {
		$('.tabcontent.visible').fadeOut(200, function(){
			$('.tabcontent.visible').removeClass('visible');
			showTab(id);
		});
	};
	function showTab (id) {
		$(id).fadeIn(200, function(){
			$(id).addClass('visible');
		});
	};


});



