$(document).ready(function() {
						   
// DROP DOWN NAVINFTION
$('li.drop').hover (
	function() {$(this).addClass('active');	},		  
	function() {$(this).removeClass('active');}
);

// DYNAMIC LEAD
$('#lead').append('<div id="thumbs">').cycle({  
	speed:  900, 
    timeout: 4000,
	height: 248,
	width: 688,
	fit: 1,
    pager:  '#thumbs',
	cleartype:  1,
	slideExpr: '.lead-content',
	pause: 1,
	pagerAnchorBuilder: function(idx, slide){
        return '<a href="#">' + idx + '</a>';  
	}
});


// COMMUNITY TABS
$('#community-content') 
.before('<div id="tabs">') 
.cycle({ 
	speed: 'fast',
    timeout: 0, 
    pager:  '#tabs',
	pagerAnchorBuilder: function(idx, slide){
        return '<a href="#">' + $(slide).attr('title') + '</a>'; 
	}
});

});


/*==========================================================*/
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

/*==========================================================*/
function trapEnter_IE()
{
if(window.event.keyCode==13)
    {
    return false;
    }
} 



/*==========================================================*/
function trapEnter_FF()
{
    var browserName=navigator.appName;
    if (browserName != 'Microsoft Internet Explorer')
    {
        document.onkeypress = function (evt) 
        {

            if(evt.keyCode == 13)
            { 
                return false; 
            }
            else
            {
                return evt.keyCode;
            }
 
        } 
    }
} 


/*==========================================================*/
function NF_Search(text, url, queryKey)
{
	var newLocation = url + '?' + queryKey + '=' + escape(text);
	/* Commented alert line below - 6/17/09 - RC/PL */
	/* alert(newLocation); */
	window.location.href = newLocation; 
}


/*==========================================================*/
function NF_SearchText(e)
{
    if (e.keyCode==13)
    {
		document.getElementById('found-search-btn').click();
    }
}



/*==========================================================*/
function NC_SearchText(e)
{
    if (e.keyCode==13)
    {
		document.getElementById('comm-search-btn').click();
    }
}

