var $j = jQuery.noConflict();

// runs at load and on resize to hide ads that will clutter display
function hideDiv(){
	if ($j(window).width() < 800) {
		//console.log($j(window).width() + ' - is the window size and is too small to show side ads');
		$j("#right-follow-scroll").fadeOut("slow");
	} else {
		//console.log($j(window).width() + ' - is the window size and is large enough to show side ads');
		$j("#right-follow-scroll").fadeIn("slow");
	}
}

function checkScroll(){
}


$j(function(){

	$j(window).scroll(function(){
		// get the height of #wrap
		var h = $j('#wrapper').height();
		var y = $j(window).scrollTop();
		if( y > 1200 && ($j(window).width() > 800) ){
		// if we are show keyboardTips
	$j("#right-follow-scroll").fadeIn("slow");
		} else {
			$j('#right-follow-scroll').fadeOut('slow');
			$j('#closed-ad').fadeOut('slow');
		}
	});



	// user clicked remove ad so remove and show smaller box
    $j('.close-ad').click(function(){
    	$j(this).parent().hide();
        $j('#closed-ad').fadeIn('medium');
    });

	// user clicked smaller box text remove and show full center ad box
    $j('.closed-ad-text, #recommended-by').click(function(){
        $j(this).parent().hide();
        $j('#center-follow-scroll').fadeIn('slow');
    });



    // on load check and hide ads if screen is too small
    hideDiv();

    // on resize check and hide ads if screen is too small
    $j(window).resize(function(){
        hideDiv();
    });

});


