
SSS = {
	// prefix for all "over" images
	imagebase : 'http://www.realamericanstories.com/wordpress/wp-content/themes/real-american-stories/images/btn_',
	
	// flag for IE
	IE6 : false,
			
	// Initialize all menus for rollover
	menuinit : function() {
		if (SSS.IE6) {
			selector = 'img';
		} else {
			selector = 'img';
		}
		
		$('div#slider ' + selector+'.scrollButtons').hover(function() {
			SSS.over(this);
		}, function() {
			SSS.out(this);
		});
	},
	// Swap image to non-rolled-over state
	out : function(elt) {
		if (SSS.IE6) {
			SSS.setpng(elt, SSS.imagebase + $(elt).attr('id') + '_off.gif');
		}else {
			SSS.setpng(elt, SSS.imagebase + $(elt).attr('id') + '_off.png');			
		}
	},
	
	// Swap image to rolled-over state
	over : function(elt) {
		if (SSS.IE6) {
			SSS.setpng(elt, SSS.imagebase + $(elt).attr('id') + '_on.gif');
		}else {
			SSS.setpng(elt, SSS.imagebase + $(elt).attr('id') + '_on.png');			
		}
	},

	// Preload rollover images and set the image name prefix.
	preloadimages : function() {
		base = arguments[0];
		SSS.imagebase = base;
		
		for(var i = 1; i<arguments.length; i++) {
			jQuery("<img>").attr("src", base + arguments[i]);
		}
	},
	
	// Set the source png for an element.
	setpng : function(elt, src) {
		/*if (SSS.IE6) {
			// this is the magic which loads a png, preserving transparency.
			$(elt).css('filter', "progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'" + src + "\', sizingMethod='scale');");
		} else {*/
			$(elt).attr('src', src);
		//}
	}
}
