$(function(){
	
	//add class .inputfield to all text and pw inputs ie6 browsers
	if (jQuery.browser.msie) {
		if (parseInt(jQuery.browser.version) < 7) {
			$("#navigation ul li").mouseover(
				function(){
					menuHover(this,1);
				});
			$("#navigation ul li").mouseout(
				function(){
					menuHover(this,0);
				});
		}
	}
					 
	$('.tabcontent').css('display','none');		
	$('.tabcontent:first').css('display','block');	
	$('#tabs li').click(function(){
		tabSwap(this);
	});
	
	$('input.clearform').focus(function(){
		if(this.value == this.defaultValue) { 
			this.value = '';
		}
	});
	$('input.clearform').blur(function(){
		if(this.value == '') { 
			this.value = this.defaultValue;
		}
	});
});



var menuHover = function(el,state){
	if(state == 1) { 
		$(el).addClass('navhover');
	} 
	else { 
		$(el).removeClass('navhover');
	}
}

var activeTab = 1;

var tabSwap = function(e){
	var tabId = e.id;
	var tabIdNum = tabId.replace('tab','');
	if(tabIdNum != activeTab) { 
		$('#tab' + activeTab).removeClass('active');
		$('#tabcontent' + activeTab).css('display','none');
		$(e).addClass('active');
		$('#tabcontent'+tabIdNum).css('display','block');
		activeTab = tabIdNum;
	}
}