
jQuery(function(){
		//top navigation
	$('#header ul').nmcDropDown();
	$('#header div>ul li:has("ul")').addClass('dropdown');
	$('#header ul li li:last-child').addClass('last');
	$('#header ul li li:last-child').addClass('last');
	$('#header li:last').addClass('noBorder');

	//Fix for BC selected state
	


	$('#header li ul li').parents("li").mouseover(function(){$(this).addClass('dropdown')});
	$('#header li ul li').parents("li").mouseout(function(){$(this).addClass('dropdown')});


$('#header ul li.dropdown li a').hover(function() {
	$(this).animate({
		paddingLeft: "10px"
		}, 100);
	}, function() {
		$(this).animate({
			paddingLeft: "0"
			}, 100);
		});
		

//side menu
/*$('#sideMenu div>ul>li:not(.active)>ul').hide();
$('#sideMenu div>ul>li a').click(function() {
	if ($(this).attr('href') == '#') {
		$('#sideMenu div>ul ul:visible').slideUp();
		$('#sideMenu div>ul li.active').removeClass('active');
		$(this).siblings('ul').slideDown();
		$(this).parent().addClass('active');
		return false;
	} else {
		return true;
	}
});*/

//email spam protection
$('.email').each(function() {
	var $email = $(this);
	var address = $email.text()
	.replace(/\s*\[at\]\s*/, '@')
	.replace(/\s*\[dot\]\s*/g, '.');
	$email.html('<a href="mailto:' + address + '">'+ address +'</a>');
});

//form focus styling
$('input[type="text"]').focus(function() {  
	$(this).addClass("focusField");  
	if (this.value == this.defaultValue){  
		this.value = '';  
	}  
	if(this.value != this.defaultValue){  
		this.select();  
	}  
});  
$('input[type="text"]').blur(function() {  
	$(this).removeClass("focusField");  
});

//Form Field Value Swap
swapValues = [];
$("#footer form input[type='text']").each(function(i){
	swapValues[i] = $(this).val();
	$(this).focus(function(){
		if ($(this).val() == swapValues[i]) {
			$(this).val("");
		}
	}).blur(function(){
		if ($.trim($(this).val()) == "") {
			$(this).val(swapValues[i]);
		}
	});
});




//top menu
/*$('#header>ul>li>a').hover(function() {
	$(this).parent().prepend('<div class="hoverBg"></div>');
}, function() {
	$('.hoverBg').remove();
	});*/


// Client List
	//$('ul.client-list li:first-child').addClass('head');


//cms compare table
$('.cmsCompare tr:nth-child(odd)').addClass('alt');
$('.cmsCompare tr:last').addClass('bottom');

});


