var Affiliates = {
	_mouseover : null,
	big_pic : null,
	title : null,
	text : null,
	golink : null,
	selected : null,
	displayed : null,
	initialized : false,
	
	initialize : function() {
		if (!this.initialized) {
			this._mouseover = this.mouseover.bindAsEventListener(this);
			this.big_pic = $$('.affiliates .displayed .image')[0];
			this.title = $$('.affiliates .displayed .title')[0];
			this.text = $$('.affiliates .displayed .text')[0];
			this.golink = $$('.affiliates .displayed .go')[0];
			this.displayed = $$('.displayed')[0];
			this.createObservers();
			this.initialized = true;
		}
	},
	
	createObservers : function() {
		var lis = $$('.affiliates ul li');
		for (var i=0, c=lis.length; i<c; i++) {
			if (i==0) {
				this.mouseover(lis[i]);
			}
			lis[i].observe('mouseover', this._mouseover);
		}
	},
	
	mouseover : function(event) {
		var elem = event.nodeName ? event : Event.findElement(event, 'li');
		var cls = elem.className;
		if (this.selected) {
			this.big_pic.removeClassName(this.selected);
		}
		this.selected = cls;
		this.big_pic.addClassName(this.selected);
		this.title.innerHTML = affiliate_title[cls];
		this.text.innerHTML = affiliate_text[cls];
		this.golink.href = affiliate_link[cls];
	}
}
Event.observe(window, 'load', function() {
	Affiliates.initialize();
});
/*var Affiliates = {
	_mouseout : null,
	initialized : false,
	
	initialize : function() {
		if (!this.initialized) {
			this._mouseover = this.mouseover.bindAsEventListener(this);
			this._mouseout = this.mouseout.bindAsEventListener(this);
			this.initialized = true;
		}
	},
	
	mouseover : function(event) {
		var elem = Event.findElement(event, 'table');
		elem.setStyle({
			backgroundImage: "url('/assets/logo_bg_over.gif')"
		});
	},
	
	mouseout : function(event) {
		var elem = Event.findElement(event, 'table');
		elem.setStyle({
			backgroundImage: "url('/assets/logo_bg.gif')"
		});
	}			
}
Event.observe(window, 'load', function() {
	Affiliates.initialize();
});

function swapSlide(slide) {
	ajax = new Ajax.Updater(
	         'large',        		// DIV id must be declared before the method was called
	         '/about-us/meet-our-clients-and-partners', // URL
	         {method:'get',parameters:'action=change&id='+slide}
		);
}
*/