$().ready(function(){

TopNav("#topnav");
NavSlide("#sliding-nav", 25, 15, 150, .8);
LoadFlash();
MSoCleanUp();

}); // dom ready

// Top Nav
function TopNav(NavID){
	var NavLinkID = NavID + " a";
	$(NavLinkID).each(function(i){$(this).hover(
	function(){NavAttrID = $(this).attr("id");$(NavID).addClass(NavAttrID);},
	function(){NavAttrID = $(this).attr("id");$(NavID).removeClass(NavAttrID);});
	});
};

// Nav Sliding
function NavSlide(navigation_id, pad_out, pad_in, time, multiplier) {
	var listEles = navigation_id + " li";
	var linkEles = listEles + " a";
	var timer = 0;
	$(listEles).each(function(i){
		$(this).css("margin-left","-20px");
		timer = (timer*multiplier + time);
		$(this).animate({ marginLeft: "0" }, timer);
		$(this).animate({ marginLeft: "0" }, timer);
		$(this).animate({ marginLeft: "0" }, timer);
	});
	$(linkEles).each(function(i) {$(this).hover(
	function(){$(this).animate({ paddingLeft: pad_out }, 150);},
	function(){$(this).animate({ paddingLeft: pad_in }, 150);});
	});
};

// I hate to do this...
function MSoCleanUp(){
$(".Body").removeAttr("style").removeAttr("face").children().removeAttr("style").removeAttr("face");
$(".MsoNormal").removeAttr("style").removeAttr("face").children().removeAttr("style").removeAttr("face");
$(".Apple-style-span").removeAttr("style").removeAttr("face").children().removeAttr("style").removeAttr("face");
};

// swfObject
function LoadFlash(){
var so = new SWFObject("_assests/uvld_master.swf?"+SWFHeadInfo, "HeaderGallery", "940", "241", "9", "#000000");
//so.addVariable("xmlpath", "use this please"); 
so.addParam("menu","false");
so.addParam("wmode", "opaque");
so.write("UVLDHeaderGallery");
};
