
//Cover object
function Cover(url, msg, img){
	this.url = url;
	this.msg = msg;
	this.img = new Array();

	//no message
	if(!this.msg){
		this.msg = false;
	}

	//additional Cover
	function addCover(img){
		var p = this.img.length;

		this.img[p] = new String(img);
	}
	
	//get Cover imag
	function getCover(){
		var p = 0;
	
		if(this.img.length > 1){
			p = Math.floor((this.img.length) * Math.random());
		}

		return this.img[p];
	}
	
	//image initializ	
	function setImages(img){
		var imageType = typeof(img);
	
		if (imageType == 'undefined'){
	    return false;
		} else if(imageType == 'string'){
	    this.setCover(img);
		} else {
	    for(var i=0;i<img.length;i++){
	      this.setCover(img[i]);
			}
		}
	}
	
	//prototype
	Cover.prototype.setImages      = setImages;
	Cover.prototype.addCover      = addCover;
	Cover.prototype.getCover      = getCover;

	this.setImages(img);

	return this;
}

