//	General Functions
///////////////////////////////////////////////////////////////////////////

function sI(imageID, newURL) {			// Shortcut za funkcijo swapImage;
	swapImage(imageID, newURL);
}

function swapImage(imageID, newURL) {
	var objImage = document.getElementById(imageID);
	if (objImage != null && newURL != '') objImage.src = newURL;
}

function adjustOpacity(aObj, newOpacity) {
	if (aObj == null || aObj.style == null) return false;
	aObj.style.opacity = (newOpacity / 100);
	aObj.style.MozOpacity = (newOpacity / 100);
	aObj.style.KhtmlOpacity = (newOpacity / 100);
	aObj.style.filter = 'alpha(opacity=' + newOpacity + ')';
}

function imgFader(objectID) {
	this.objectID = objectID;
	this.objectHandle = document.getElementById('mpImg_'+objectID);
	this.timer = null;
	this.step = 0;
	this.currentOpacity = 0;
	this.minOpacity = 40;
	
	this.fade = function () {
		this.currentOpacity += this.step;
		if (this.currentOpacity <= this.minOpacity) {
			clearInterval(this.timer);
			this.currentOpacity = this.minOpacity;
		}
		 else if (this.currentOpacity >= 100) {
			clearInterval(this.timer);
			this.currentOpacity = 100;
		 }
		 adjustOpacity(this.objectHandle, this.currentOpacity);
	}
}