//////////////////////////////////////////////////////////////////////////////////////////
////GENERAL FUNCTIONS
//////////////////////////////////////////////////////////////////////////////////////////
function equalHeight(group) {
	tallest = 0;
	group.each(function() {thisHeight = $(this).height();if(thisHeight>tallest){tallest=thisHeight;}});
	group.height(tallest);
}
//glo_pagepath


$(document).ready(function() {
	/*SIGN-IN BUTTON*/
	$('#btn_signin').click(function(){$('#pods_signin div').slideToggle('fast');});
	/*SIGN-IN BUTTON*/
	function addMega(){$(this).children('div').show();}
    function removeMega(){$(this).children('div').hide();}
    var megaConfig = {interval: 0,sensitivity: 2,over: addMega,timeout: 0,out: removeMega};
    $("li.megadouble").hoverIntent(megaConfig);
	$("li.megadoubleleft").hoverIntent(megaConfig);
	$("li.megasingle").hoverIntent(megaConfig);
	
	
	
	/*SEARCH LIST*/
	$('#searchterm').keyup(function(){
		var keywords = $('#searchterm').val();
		if(keywords.length>=3){
			$('#search div').show();
			var resultsdata=null;
			$.get(glo_pagepath+"assets/includes/content/search_results.php?keywords="+keywords, function(data){
				$('#search div').html(data);		
			});							 
				$(document).click(function(){								 
					 if(currentFocus==''){//clicked elsewhere on screen so don't show
						$('#search div').html('');
						$('#search div').hide();
					 }
				});
		}//end if greater than 3
	});
	var currentFocus = null; 
	$('#search div').mouseover( function() {  	currentFocus = 'searchresults';
	}).mouseout( function() {	currentFocus = '';}); 
	
	
	
	
});
