Changer = function(images, container){
	this.images = images
	this.container = container
	this.currentIndex = 0
	this.change()
}
Changer.prototype.change = function(){
	
	makeSwitch = function(s){
		return function(){
			s.currentIndex++
			$("a", s.container).attr("href", s.images[s.currentIndex % s.images.length].href)
			$("img", s.container).attr("src", s.images[s.currentIndex % s.images.length].src)
			s.container.fadeTo(200, 1)
		}
	}
	this.container.fadeTo(200, .1, makeSwitch(this))
}
$(document).ready(function(){
	switcher1 = new Changer([
			{
				src: "images/product/ads/M20_platinum.png",
				href: "products/m20-airwave-suspension"
			}
		],
		$("#ad_switcher_1")
	)
	//setInterval(function(){switcher1.change()}, 7500)
	switcher2 = new Changer([
			{
				src: "images/product/ads/airwave.jpg",
				href: "products/m20-airwave-suspension"
			},
			{
				src: "images/product/ads/M10_SS.sale.png",
				href: "documents/M-10%20SS%20RELEASE%20BLACK.pdf"
			},
			{
				src: "images/product/ads/RAV-TEK.jpg",
				href: "documents/RAV-TEK%20Kits%20%20PRODUCTS%20WEB%20.%20091410BLKNEW.pdf"
			},
			{
				src: "images/product/ads/spyder.jpg",
				href: "products/spyder-airwave-suspension"
			}
		],
		$("#ad_switcher_2")
	)
	setInterval(function(){switcher2.change()}, 5500)
});






