//////////////////////////////////////////////////////
//
//	The purpose of this file is to
//	apply a hover class on mouseover
//	on the <li> elements in the nav.
//	This is because IE doesn't put
//	the pseudo class :hover on <li> elements
//
//	This is code that uses the
//	jquery javascript library (http://jquery.com/)
//
//////////////////////////////////////////////////////
$(window).load(function() {
	if (document.all&&document.getElementById) {
		// this is needed for the IE 6 pseudo hover class bug
		$(".navtop li").hover(function () {
			$(this).addClass("hover");
		},function () {
			$(this).removeClass("hover");
		});
	} else {
		// this is need for safari when nav covers flash
		$(".navtop li ul").hover(function () {
			$(this).addClass("redraw");
		},function () {
			$(this).removeClass("redraw");
		});
	}
	
	/*
	$(".sponsor").click(function(){	
			$(this).children(".block").toggleClass("open");
	});
	*/
	
	$(".sponsor").click(function(){
		$(this).children(".block").toggleClass("open");		
		$(this).siblings(".sponsor").children(".open").toggleClass("open");
	});
	
	//rotate the ad area in the right hand column
	$('.random').rotimage({initial_timeout: 2500, timeout: 10000});

	
	
	var myfeed = $(".feed ul");
	if (myfeed.length > 0){
		jQuery.getFeed({
		   url: 'http://www.aafutah.com/cmsxml/events-upcoming-events.rss',
		   dataType: ($.browser.msie) ? "text" : "xml",
		   success: function(feed) {
			   var length = feed.items.length;
			   var theHTML = "";
				for(var x = 0; x < length; x++ )
				{
					theHTML = theHTML + '<li><a href="' + feed.items[x].link + '">' + feed.items[x].title + '</a><p>' + feed.items[x].description + '</p></li>'
					var bob = feed.items[x];
				}
				myfeed.html(theHTML);
				}
			});
		
	}
	
	

	
	
	
	
});

function inTweakCms()
{
 if( window.location.hostname.indexOf("cms") < 0)
  return false;
 else 
  return true;
}

