//##############################################################################
//##  DOM																	  ##
//##############################################################################
$(document).ready( externalLinks );
$(document).ready(function() {
	if (jQuery.isFunction($.getURLParam)) {
	  var event_id = $.getURLParam("event_id");
	  if(event_id){
		$.ajax({
		  type: "POST",
		  url: "http://www.wmstadium.com/public/php/get_event_header.php",
		  data: "event_id=" + event_id,
		  success: function(data) {
			if(data)
				//alert(data);
				$('#header_image').html('<img src="' + data +'" alt="" />');
			}
		  });
	  }
	}
});
/*###########################################
##  Dropdown Menus						   ##
###########################################*/
/* Options */
var __global_menuObject = '.navigation';
/* Controls */
$(document).ready(function() {
	  var lis = $(__global_menuObject).children('li').get();
      $.each(lis, function(){
        $(this).hover(
	      function () { //on
	        $(this).addClass("sfhover")
	      }, 
	      function () { //off
	        $(this).removeClass("sfhover")
	      }
	    );
      });
});
//##############################################################################
//##############################################################################
//##  User Handler Functions												  ##
//##############################################################################
function externalLinks() {
  var exs = $('a[rel=external]');
  $.each(exs, function() {
    if ($(this).attr('href')) { $(this).attr('target','_blank'); }
  });
  //non-jQuery version:
  /*if (!document.getElementsByTagName) return;
  var anchors = document.getElementsByTagName("a");
  for (var i=0; i<anchors.length; i++) {
    var anchor = anchors[i];
    if ((anchor.getAttribute("href")) && (anchor.getAttribute("rel") == "external"))
     anchor.target = "_blank";
  }*/
}
//##############################################################################
//##############################################################################
//##  Image Slideshow Functions												  ##
//##############################################################################
/* Options */
var __global_showObject = { target: '#featurePhoto',
							speed: '2000',
							timeout: '6500'
						  };
/* Controls */
$(document).ready(function() {	
  if (jQuery.isFunction(jQuery.fn.cycle)) {
	$(__global_showObject.target).cycle({ 
    	fx:    		'fade', 
    	speed:		__global_showObject.speed,
    	timeout:	__global_showObject.timeout,
    	pause: 1
	});
  }
});
//##############################################################################
//##############################################################################