// JavaScript Document
/*
 * main JS Document for Nashville Cyclist
 * Copyright (c) 2009 Jess Brown | jess@brownwebdesign.com
 * http://www.brownwebdesign.com
 */


//get height of body if taller so the left can be the same
function getHeight () { 

	if($j('.sec-rcol-sp').length) {
			var left = $j('.sec-lcol-sp').height(); 
			var right = $j('.sec-rcol-sp').height(); 
			if($j('.photo_gallery').length > 0) {
				return false;	
			}
			if(left > right) {  
					$j('.sec-rcol-sp').css('height', (left) + 'px');
			}
			else { 
					$j('.sec-lcol-sp').css('height', (right) + 'px');
			}  
		 }
}

//get height of homepage columns if taller so the left & right can be the same
function getHeightHome () { 
	if($j('#home-MainNews').length) {
			var main = $j('#home-MainNews').height(); 
			var side = $j('.home-b').height(); 
			//alert('sorry for the test...will be gone in a min' + main + "side  " + side);
			if(main > side) {  
					$j('.home-b').css('min-height', (main) + 'px');
			}
			if (side > main) { 
					$j('#home-MainNews').css('min-height', (side) + 'px');
			}  
		 }
}





//jQuery Stuff
var $j = jQuery
$j(document).ready(function(){ 
						   
// MENU

   function show() {
         $j(this).find('ul:first').css({visibility: "visible",display: "none"}).slideDown(250);
       }
      
       function hide() { 
        $j(this).find('ul:first').slideUp(200);
      }
	  
	  $j("#topMenu .menu-topMenu li ul").css({visibility: "visible",display: "none"});
    
      $j("#topMenu .menu-topMenu li").hoverIntent({
        sensitivity: 2, // number = sensitivity threshold (must be 1 or higher)
        interval: 100,   // number = milliseconds for onMouseOver polling interval
        over: show,     // function = onMouseOver callback (required)
        timeout: 200,   // number = milliseconds delay before onMouseOut
        out: hide       // function = onMouseOut callback (required)
      });



//menu links
$j('.menu li a').hover(function () {
  $j(this).stop().animate({
    marginLeft : 4, color : '#F00'
  }, 250);
}, function () {
  $j(this).stop().animate({
    marginLeft : 0, color : '#333'
  }, 250);
});


});

