var $j = jQuery.noConflict(); 
$j(document).ready(function() {
	var highestCol = Math.max($j('#featured-product').height(),$j('#vib-challenges').height());
	$j('.equal').height(highestCol);
	
	Cufon.replace("h1, h2, h3, h4, h5, .custom_meta strong");

	$j('.wpsc_buy_button').hover(function() {
		$j(this).addClass('hover');
		}, function() {
		$j(this).removeClass('hover');
	});
	
// orig. from home.php on lines 4-23
	$j("div.clickable").click(function() {  
		window.location = $j(this).find("a").attr("href");  
	});
	$j("div.clickable").hover(  
		function() {  
			$j(this).addClass("hover");  
		},  
 		function() {  
		$j(this).removeClass("hover");  
 	});
// end js orig. from home.php

  	// find the div.fade elements and hook the hover event
 	$j('div.fade').hover(function() {
    // on hovering over, find the element we want to fade *up*
    	var fade = $j('> div', this);
    // if the element is currently being animated (to a fadeOut)...
    	if (fade.is(':animated')) {
     	// ...take it's current opacity back up to 1
      	fade.stop().fadeTo(250, 1);
    	} else {
      	// fade in quickly
      	fade.fadeIn(250);
    	}
  	}, function () {
    	// on hovering out, fade the element out
    	var fade = $j('> div', this);
    	if (fade.is(':animated')) {
      		fade.stop().fadeTo(3000, 0);
    	} else {
      	// fade away slowly
      		fade.fadeOut(3000);
    	}
  	});

    $j("li.hasmore").hover(function(){
        $j(this).addClass("hover");
        $j('ul:first',this).fadeIn("fast");
    }, function(){
        $j(this).removeClass("hover");
        $j('ul:first',this).fadeOut("medium");
    });


// orig. from footer.php below MailChimp scripts
	$j("label.inlined + input.input-text").each(function (type) {

		$j(this).focus(function () {
			$j(this).prev("label.inlined").addClass("focus");
		});

		$j(this).keypress(function () {
			$j(this).prev("label.inlined").addClass("has-text").removeClass("focus");
		});

		$j(this).blur(function () {
			if($j(this).val() == "") {
				$j(this).prev("label.inlined").removeClass("has-text").removeClass("focus");
			}
		});
	});
	$j('#mc-embedded-subscribe').hover(function() {
		$j(this).addClass('hover');
	}, function() {
		$j(this).removeClass('hover');
	});
//end js orig. from footer.php	

});
