/*******************************
 * @author Aron Filbert 03/13/09
 *******************************/

var SetPage = 0;

$(document).ready(function(){ 
	$("ul.sf-menu").superfish({	delay:  300 });	
	$('ul#mainMenu > li')
       .each(function(i) {
	   	var image = document.getElementById(this.id + "_img");
		var source = document.getElementById(this.id + "_img").src;
		if (image) {
			if (i != SetPage) {
	            $(this).mouseout(function(){
			    	image.src = source.substring(0, source.lastIndexOf("/") + 1) + this.id + source.substring(source.lastIndexOf("."), source.length); 
			    }).mouseover(function(){
			    	image.src = source.substring(0, source.lastIndexOf("/") + 1) + this.id + "on" + source.substring(source.lastIndexOf("."), source.length);
			    });
	        } else {
				image.src = source.substring(0, source.lastIndexOf("/") + 1) + this.id + "on" + source.substring(source.lastIndexOf("."), source.length);				
			}			
		}
   });
});	

function SetImageStatus(i) {
	SetPage = i;
}