$(document).ready(function() {
	equalHeight($(".item p"));
	$(".home_widgets .widget:first").css("margin-left", "0");
	$(".footernav  li:last").css("border-right", "0");
	$(".navigation .alignleft:empty").hide();
	$(".navigation .alignright:empty").hide();
	$(".comment-nav .alignright:empty").hide();
	$(".comment-nav .alignleft:empty").hide();
	$(".navigation:empty").hide();
	$(".comment-nav:empty").hide();
	$('ul.sf-menu').superfish();
});
DD_roundies.addRule('#gallery', '0 0 10px 10px', true);
DD_roundies.addRule('.container, .qbutton a, blockquote,.comment-reply-link', '10px', true);
DD_roundies.addRule('.button, button, input[type=submit], input[type=button], #commentSubmit', '10px', true);
DD_roundies.addRule('input[type=text], textarea, select, span.wpcf7-not-valid-tip', '4px', true);
DD_roundies.addRule('.navigation a, .comment-nav a', '20px', true);
DD_roundies.addRule('#sidebarsearch div', '10px', true);
DD_roundies.addRule('.wp-caption,.portfnav a', '5px', true);
DD_roundies.addRule('.commentlist li', '10px', true);
Cufon.replace('#pagenav a', {
	textShadow: '1px 1px #ffffff'
});

Cufon.replace('h1');
Cufon.replace('h2');
Cufon.replace('h3');
Cufon.replace('h4');
Cufon.replace('h5');
Cufon.replace('#main .container .slogan .qbutton', {
	textShadow: '0 1px #365360'			  
});


function equalHeight(group) {
	tallest = 0;
	group.each(function() {
		thisHeight = $(this).height();
		if(thisHeight > tallest) {
			tallest = thisHeight;
		}
	});
	group.height(tallest);
}

/*
Sliding labels is open source code by Tim Wright of CSSKarma.com
Use as you see fit, I'd like it if you kept this in the code, but
basically share it and don't be a jerk.
Support:
http://www.csskarma.com/blog/sliding-labels-v2
Version: 1.1
*/

$(function(){
	$('.wpcf7 form .labelslider label, #commentform .labelslider label').each(function(){
		var labelColor = '#999';
		var restingPosition = '5px';
		// style the label with JS for progressive enhancement
		$(this).css({
			'color' : labelColor,
			'position' : 'absolute',
			'top' : '1px',
			'left' : restingPosition,
			'display' : 'inline',
			'z-index' : '99'
		});
		var inputval = $(this).next().val();
		// grab the label width, then add 5 pixels to it
		var labelwidth = $(this).width();
		var labelmove = labelwidth + 5 +'px';
		//onload, check if a field is filled out, if so, move the label out of the way
		if(inputval !== ''){
			$(this).stop().animate({ 'left':'-'+labelmove }, 1);
		}
		// if the input is empty on focus move the label to the left
		// if it's empty on blur, move it back
		$('.wpcf7 form input, .wpcf7 form textarea, #commentform input, #commentform textarea').focus(function(){
			var label = $(this).parent().prev('label');
			var width = $(label).width();
			var adjust = width + 5 + 'px';
			var value = $(this).val();
			if(value == ''){
				label.stop().animate({ 'left':'-'+adjust }, 'fast');
			} else {
				label.css({ 'left':'-'+adjust });
			}
		}).blur(function(){
			var label = $(this).parent().prev('label');
			var value = $(this).val();
			if(value == ''){
				label.stop().animate({ 'left':restingPosition }, 'fast');
			}
		});
	}); // End "each" statement
}); // End loaded jQuery
