<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
//-->

function populateDateAJAX(type) 
{
	var game_type = type;
	var position = document.form.season.selectedIndex;
	var season = parseInt(document.form.season.options[position].value);

	$('#date').html('<option>Loading .. </option>');
		
	var loadDatesURL = "/admin/functions/filters/matchDates.php?season=thisisnotaseasonid&type="+ game_type+"";
	
	var loadDatesURL = loadDatesURL.replace("thisisnotaseasonid", season);
	
	$.get("/admin/functions/filters/matchDates.php", { season: season, type: game_type },
  		function(data){
			//alert(data);
			data =  '<option value="">ALL</option>' + data ;
			$('#date').html(data);
  		}
	);

}

function populateTeamAJAX()
{
	
	var position = document.form.season.selectedIndex;
	var season = parseInt(document.form.season.options[position].value);
	
	var position2 = document.form.div.selectedIndex;
	var div = parseInt(document.form.div.options[position2].value);

	$('#team').html('<option>Loading .. </option>');
		
	var loadDatesURL = "/admin/functions/filters/teamDivs.php?div="+ div+"";
	
	var loadDatesURL = loadDatesURL.replace("thisisnotaseasonid", season);
	
	$.get("/admin/functions/filters/teamDivs.php", { div: div },
  		function(data){
			//alert(data);
			data =  '<option value="" SELECTED >ALL</option>' + data ;
			$('#team').html(data);
  		}
	);

}


/*----------
| AJAX Library Functions... 
----------*/
function createRequestObject () {
		
	// Define request object as requestObject...
	var requestObject = false;	
	// Setup request object for Mozilla, Safari, etc...
    if (window.XMLHttpRequest) { 			
        requestObject = new XMLHttpRequest();
        if (requestObject.overrideMimeType) {
            requestObject.overrideMimeType('text/xml');
        }		
	// Setup request object for IE...		
    } else if (window.ActiveXObject) {
        try {
            requestObject = new ActiveXObject('Msxml2.XMLHTTP');
        } catch (e) {
            try {
                requestObject = new ActiveXObject('Microsoft.XMLHTTP');
            } catch (e) {}
        }
    }	
	
	// If unable to create a request object...
    if (!requestObject) {		
		// Display error message...
        window.defaultStatus = 'AJAX Error: Could not create an XMLHTTP instance';
        return false;
    } else {
		return requestObject;
	}
	
}

function AJAX_Pull(url, callback) {
	serverPull('TEXT', url, callback);
}	

function AJAX_Pull_XML(url, callback) {
	serverPull('XML', url, callback);
}	

function serverPull(returnType, url, callback) {	
	// Get a request object...

	httpRequest = createRequestObject();	
	
	// Make the actual request to the server...
    httpRequest.open('GET', url, true);

	httpRequest.setRequestHeader("If-Modified-Since","Sat, 1 Jan 2000 00:00:00 GMT");     
	 httpRequest.send(null);		
	// Deal with the server response...
	httpRequest.onreadystatechange = function() {	
	
		// If response recieved...
        if (httpRequest.readyState == 4) {				
			// If request successfull...
			
	    	if (httpRequest.status == 200) {
				if (returnType == 'TEXT') {
					callback(httpRequest.responseText);
				} else if (returnType == 'XML') {
					callback(httpRequest.responseXML);
				}
			} else {
         	   	window.defaultStatus = 'AJAX Error: Server request failed... Status: ' + httpRequest.status;
	        }					
        }
	}
}

function AJAX_Push(url, queryString, callback) {
	serverPush('TEXT', url, queryString, callback);
}

function AJAX_Push_XML(url, queryString, callback) {
	serverPush('XML', url, queryString, callback);
}

function serverPush(returnType, url, queryString, callback) {
	// Get a request object...
	httpRequest = createRequestObject();	
	// Post the data...
	httpRequest.open('POST', url, true);
	httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');	
	httpRequest.send(queryString);
	// Deal with server response...
	httpRequest.onreadystatechange = function() {			
		// If response recieved...
        if (httpRequest.readyState == 4) {		
			if (returnType == 'TEXT') {
				callback(httpRequest.responseText);
			} else if (returnType == 'XML') {
				callback(httpRequest.responseXML);
			}		
        }
	}
}

//Browser Support Code
function ajaxFunction(){
	var ajaxRequest;  // The variable that makes Ajax possible!
	
	try{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
}
//-->

/*----------
| End of AJAX Library Functions... 
----------*/

function BaseFunctions() {
// this function fixes the ie click to activate annoyance

	this.fixIE = function(el){

	var objects;

		if (el) {
			objects = el.getElementsByTagName("object");

		} else {
			objects = document.getElementsByTagName("object");
		}

		for (var i = objects.length-1; i > -1; i--){

			var object = objects.item(i);
			// Fix flash object

			if (object.type == "application/x-shockwave-flash"){
				if (object.getAttribute("data")){object.removeAttribute( "data" );}
				object.outerHTML = object.outerHTML;
				
			}

		}

		$('object').css('display','inline');
	}

}



 <!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
//-->

// JavaScript Document
function getChildElements(elemName) {
   nodesList = elemName.childNodes;
   var childElems = new Array();
   var counter = 0;
   for (var m = 0; m < nodesList.length; m++) {
   if (nodesList[m].nodeType == 1) {
   childElems[counter] = nodesList[m];
   counter = counter + 1;
   }
   }  
   return childElems;
}

sfHover = function() {
	var sfEls = document.getElementById("mainNav").getElementsByTagName("li");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);


function addLoadEvent(func) {
	var oldonload = window.onload;
	  	if (typeof window.onload != 'function') {
    	window.onload = func;
  	} else {
    	window.onload = function() {
    	oldonload();
    	func();
    	}
	}
}
 
function hideSelects() {
	$('select').css({ 'visibility' : 'hidden' });
}

function showSelects() {
	$('select').css({ 'visibility' : 'visible' });
}

rotateTopStory = function(){
	clearInterval(window.golfinterval)

			var p=1;													   
			var pos = $('#story-container .story-nav li').index($('#story-container .story-nav li.story-on')[0]);
			
			
			if(pos==4){pos=-1;}
			
			$('#story-container .story-nav li').eq(pos+1).trigger('click','x');
			
			window.golfinterval = setInterval("rotateTopStory()",7000);
	}

topStory = function(){
	//$('.count').html("1 of 5");
	
	var first = $('#story-container li.story-content:eq(4)').clone();

	$('#story-container .story-scroll').prepend(first).css({marginLeft:-480});

	rotateTopStory();
	
	$('#story-container .story-nav li').click(function(click,p){
	

		var pos = $('#story-container .story-nav li').index($(this));
		
		pos = pos;
		
		if(pos==4 && p=='x'){
			$('#story-container .story-scroll').animate({marginLeft:((480*pos)*-1)-480},800,function(){
				
				$('#story-container .story-scroll').css({'marginLeft':0})
			});
		} else{
			$('#story-container .story-scroll').animate({marginLeft:((480*pos)*-1)-480},{duration:800,queue:false});
		}

		$('#story-container .story-nav li').removeClass('story-on');
		$(this).addClass('story-on');
		if(p!='x'){
			clearInterval(window.golfinterval)
			//$('.TStimer').css('width',1);
		}
		return false;
													   
})

}



$(document).ready(function(){
	topStory()
});







