(function($){ 
	jQuery(function(){
		tooltip();
		
		// Advanced CSS
		$('#contact label[for="ec_url"]').parent().remove();
		$('#contact #ec_url').parent().remove();
		
		// Order Status Form Changes
		var $phoneField;
		$phoneField = '<div class="form-label"><label for="ec_phone">Phone</label></div>';
		$phoneField += '<div class="form-input">';
		$phoneField += '<input id="ec_phone_1" name="ec_phone_1" class="text optional" type="text" value="" size="3" maxlength="3" /> - ';
		$phoneField += '<input id="ec_phone_2" name="ec_phone_2" class="text optional" type="text" value="" size="3" maxlength="3" /> - ';
		$phoneField += '<input id="ec_phone_3" name="ec_phone_3" class="text optional" type="text" value="" size="4" maxlength="4" />';
		$phoneField += '</div>';
		$('#order-status label[for="ec_url"]').attr('label','ec_company').text('Company');
		$('#order-status #ec_url').attr('id','ec_url').attr('name','ec_url').parent().append($phoneField);
		
		// Form Styles
		$('input[type="radio"]').addClass('radio');
		$('input[type="checkbox"]').addClass('checkbox');
		$('#navigation li:last').addClass('last');
		
		// WYSIWYG Fixes
		$('div.entry *').removeAttr('style');
		$('div.entry table').attr('width','100%');
		
		// Cufon
		Cufon.replace('h2.post-title', { hover: true, fontFamily: 'Futura' });
		Cufon.replace('#content h1', { hover: true, fontFamily: 'Futura' });
		Cufon.replace('.homebox h2', { hover: true, fontFamily: 'Futura' });
		Cufon.replace('.blogtweet h2', { hover: true, fontFamily: 'Futura' });
		Cufon.replace('#stripe p span', { hover: true, fontFamily: 'Futura Heavy' });
		Cufon.replace('#stripe p.phone', { hover: true, fontFamily: 'Futura Heavy' });
		Cufon.replace('#blog-title', { hover: true, fontFamily: 'Futura Heavy' });
		Cufon.replace('#logos h2', { hover: true, fontFamily: 'Futura' });
		Cufon.replace('.footerbox h2', { hover: true, fontFamily: 'Futura' });
		Cufon.replace('#team h2', { hover: true, fontFamily: 'Futura' });
		Cufon.replace('#team h3.team-title', { hover: true, fontFamily: 'Futura' });
	
	
		
		// Firefox Opacity Fix
		if (($.browser.mozilla && parseFloat($.browser.version) < 1.9) && (navigator.appVersion.indexOf('Mac') !== -1)) {
			$('body').css({'opacity': '0.9999'});
		}
		
		// Create "default" Attribute
		$('input').each(function(){
			var $value = $(this).attr('value');
			$(this).attr('default',$value);
		});
		
		// Submit Hovers
		$('input.submit').hover(function(){
			$(this).addClass('hover');
		},function(){
			$(this).removeClass('hover');
		});
		
		// Rotating Quotes
		if ($('#quotes').length > 0){
			$('#quotes').cycle({ 
				fx: 'fade',
				cleartype: false,
				delay: 15000 // Control the amount of time in between transitions
			});
		}
		
		// Homepage Clearing
		if ($('#state-specific').length > 0){
			$('#state-specific li:odd').addClass('last').next().addClass('clearboth');
		}
		
		//Hide big list of states
		$('#togglee').hide(0);
		$('a#toggler').toggle(
			function () {
				$(this).text("Hide");
				$('#togglee').slideToggle(400);
				return false;
			},
			function () {
				$(this).text("Show all states");
				$('#togglee').slideToggle(400);
				return false;
			}
		);
	
		//Team page click drop-down
		$('#team li .team-descr').removeClass('hidden').slideUp(0);
		$('#team li .team-right, #team li .team-left').toggle(
			function (e) {
				$(this).parent().find('.team-left img').stop().animate( { width:"300px" }, 300 );
				$(this).parent().find('.team-right .team-descr').stop().slideDown(300);
				
				return false;
		},
			function() {
				$(this).parent().find('.team-left img').stop().animate( { width:"80px" }, 300 );
				$(this).parent().find('.team-right .team-descr').stop().slideUp(300);
				
				return false;
		});
	});
})(jQuery);

	