var CustomPopup = {
	//private functions
	//alt text should be 'title::text::size'
	_getDisplayTitle: function(string){
		var tmpArr = string.split("::");
		return tmpArr[0];
	},
	_getDisplayText: function(string){	
		var tmpArr = string.split("::");
		return tmpArr[1];
	},
	_getDisplaySize: function(string){
		var tmpArr = string.split("::");
		return tmpArr[2];
	},
	_resetKeyValues: function(){
		this.displayText = '';
		this.displayTitle = '';
		this.displaySize = 'medium';
	},
	displayTitle: '',
	displaySize:'medium',
	displayText: '',
	fadeTime: 3,
	offsetLeft: '0',
	offsetTop: '0',
	isActive: false,
	parentElement: '',
	initWithElement: function(element){
		if(!this.isActive){
			this.parentElement = element;
			var tmpStr = element.getAttribute('alt');
			this.displayTitle = this._getDisplayTitle(tmpStr);
			this.displayText = this._getDisplayText(tmpStr);
			this.displaySize = this._getDisplaySize(tmpStr);
			this.showMe();			
		}else{
			return;
		}
	},
	showMe: function(parent){
		console.log('fade in with text: ' + this.displayText + " size will be: " + this.displaySize);
		//create new popup div element
		var popup = document.createElement("div");
		popup.id ="popup";
		popup.className = this.displaySize;
		
		var popupTop = document.createElement("div");
			popupTop.className = 'top';
			
		var popupMid = document.createElement("div");
			popupMid.className = 'mid';
			popupMid.innerHTML = '<p class="popup">' + this.displayText + '</p>';
			
		var popupBot = document.createElement("div");
			popupBot.className = 'bot';
		
		this.parentElement.appendChild(popup);
		popup.appendChild(popupTop);
		popup.appendChild(popupMid);
		popup.appendChild(popupBot);
		this.isActive = true;
		
		//do a fade mebbe?
	},
	hideMe: function(){
	  	while (this.parentElement.childNodes[0]){
			this.parentElement.removeChild(this.parentElement.childNodes[0]);
		}
		this.isActive = false;
		this._resetKeyValues();
		//fade this mofo out
		//remove the tmpElement
		console.log('fade out');
	},
	
	moveMe: function(e){
	}
};
