/**
* This object makes it possible to create a
* large-picture-preview, when either clicking
* or activating objects public methods.
*
*
* @name picturePreview.js
* @created 29-05-2007 12:59
* @version 1.00
* @author Alin
*/

/**
* Create a new instance of PicturePreview
*
* @usage
*		- Create new instance of PicturePreview
*		- Use setContainer(c) to set the container that
*		must display a larger picture.
*
* @return object
*/ 
function PicturePreview (c){
	this.divContainerID;
	this.divObj;
	
	/**
	* Set the container where the picture must be displayed
	*
	* @param string c	| container id, where a "large" pictures must be displayed.
	*/
	this.setContainer = function(c){
		this.divContainerID = c;
		this.divObj = document.getElementById(this.divContainerID);		
	}
	
	/**
	* Display a picture
	* Method returns false if the path is
	* an empty string or container is not set.
	*
	* @param string path	|	path to the picture
	*
	* @return boolean
	*/
	this.displayPic = function (path) {
		if(path != "" && this.divContainerID != ""){
			var h = "<img src=\""+path+"\" alt=\"\" title=\"\" />";
			this.divObj.innerHTML = h;
			
			return true;
		}
		return false;
	}
	
	/**
	* Remove the picture from the container.
	* Method returns false if container is not set.
	*
	* @return boolean
	*/
	this.removePic = function (){
		if(this.divContainerID != ""){
			this.divObj.innerHTML = "";
			return true;
		}
		return false;
	}
}
