

/*	****************************************************
				Common Functions
	**************************************************** */


$(document).ready(function() {
	// load up the flash
	
	$('#subnav div').each(function() {
	    var $this = $(this);
	    var $link = $('a', this);
    	var id = $this.attr("id");
    	var flashvars = new Object();
    	flashvars.url = $link.attr('href');
    	flashvars.text = $link.text();
    	swfobject.embedSWF("images/subnav.swf", id, "129", "19", "9.0.0", "", flashvars, { menu: "false", wmode: "transparent" }, {id: id, name: id});
	});
	
	$('h1').each(function() {
	    var $this = $(this);
	    var id = "h1";
	    $this.attr('id', id);
	    var flashvars = new Object();
    	flashvars.text = $this.text();
    	swfobject.embedSWF("images/h1.swf", id, "350", "31", "9.0.0", "", flashvars, { menu: "false", wmode: "transparent" }, {id: id, name: id});
	});
});


function stickSub(sub) {
    if(sub != '') {
        $("#"+sub).get(0).stick();
    }
}

function stickNav(nav) {
	document.getElementById(nav).className = "navStick";
}

function changeImages() {
	if (document.images) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

function getFlashMovie(movieName) {
    var isIE = navigator.appName.indexOf("Microsoft") != -1;
    return (isIE) ? window[movieName] : document[movieName];
}
