$(document).ready(function(){
    
    var fullHeight = $("#sliderBox").innerHeight();
	//var fullHeight = "\""+fullHeight+"px\"";
	var fullHeight = fullHeight + "px";
	
	$("#blind").removeClass("nodisplay");
	$("#blind").addClass("blockdisplay");
	$("#sliderBox").addClass("toggleHeight");

	var open = 0;
	var smallHeight = "152px";
	
    compareWidgetHeights("#popularLinks", "#applicationLinks")
    	
    $("#blind").click(function(e) {
			
		if (open == 0) {
    		
		    $("#sliderBox").animate({height: fullHeight}, 700 );	
		    open = 1;
		    $("#blind").text('Less [-]');
		}
		
		else {
		    $("#sliderBox").animate({height: smallHeight}, 700 );
		    open = 0;
		    $("#blind").text('More [+]');
		}
        e.preventDefault();
	});
		
	setTips($('.helper'),"normal-helper");
	setTips($('.inline-helper'),"inline-content");
});


// FUNCTION TO COMPARE TWO ELEMENTS AND SET THE GREATEST HEIGHT ACROSS BOTH
function compareWidgetHeights(selector1, selector2) {
    var a = $(selector1).height();
    var b = $(selector2).height();
    
    if( a <= b ) {
        var setHeights = 'min-height: ' + b + 'px;height: auto !important; height: ' + b + 'px;';
    } else {
        var setHeights = 'min-height: ' + a + 'px;height: auto !important; height: ' + a + 'px;';
    } 

    $(selector1).attr('style',setHeights);
    $(selector2).attr('style',setHeights);
}