/**
 * Simply not for you ;)
 *
 * Licensed under the GPLv3 license - http://gnu.org/licenses/gpl-3.0.html
 * @author Sepehr Lajevardi - http://sepehr.ws/
 * @version 0.1
 * @requires jQuery $() and attr() functions.
 */
 
function CoffeeMug(mugLabel, mugLink){				
	this.labels = new Array();
	this.mug = $(mugLabel);
	this.link = $(mugLink);

	//initializing data
	this.labels[0] = new Array('http://img.cdn.sepehr.ws/root/mug/mug-linux-label.png', 'http://kernel.org');
	this.labels[1] = new Array('http://img.cdn.sepehr.ws/root/mug/mug-linux-inside-label.png', 'http://kernel.org');
	this.labels[2] = new Array('http://img.cdn.sepehr.ws/root/mug/mug-ubuntu-label.png', 'http://ubuntu.com');
	this.labels[3] = new Array('http://img.cdn.sepehr.ws/root/mug/mug-linuxbucks-label.png', 'http://kernel.org');
	this.labels[4] = new Array('http://img.cdn.sepehr.ws/root/mug/mug-debian-label.png', 'http://debian.org');
	this.labels[5] = new Array('http://img.cdn.sepehr.ws/root/mug/mug-gnome-label.png', 'http://gnome.org');
	this.labels[6] = new Array('http://img.cdn.sepehr.ws/root/mug/mug-gnu-linux-label.png', 'http://gnu.org');
	this.labels[7] = new Array('http://img.cdn.sepehr.ws/root/mug/mug-gnu-label.png', 'http://gnu.org');
	this.labels[8] = new Array('http://img.cdn.sepehr.ws/root/mug/mug-redhat-label.png', 'http://redhat.com');
	//increasing Ubuntu chance :)
	this.labels[9] = new Array('http://img.cdn.sepehr.ws/root/mug/mug-ubuntu-label.png', 'http://ubuntu.com');

	this.getThat = function(){
		this.that = Math.floor(Math.random()*10);
		return this;
	}
	
	this.init = function(){
		this.getThat();	
		this.mug.attr('src', this.labels[this.that][0]);
		this.link.attr('href', this.labels[this.that][1]);
		return this;
	}
}