/*
	ADRIAN NOWICKI
*/

function ImgSubstituter(objId, newObjId) {

	this.objId = objId;
	this.newObjId = newObjId;
	this.obj = document.getElementById(objId);	
	var constr = this;
	
	if (this.obj) {		
		this.obj.onmouseover = function() { constr.callbackOver(); };											
		this.obj.onmouseout  = function() { constr.callbackOut(); };			
	}//jesli istnieje
	
}//ImgSubstituter

ImgSubstituter.prototype.callbackOver = function() {
	
	if (this.obj) {

		this.obj.id = this.newObjId;
	}
}
	
ImgSubstituter.prototype.callbackOut = function() {
	
	if (this.obj) {
	
		this.obj.id = this.objId;
	}
}
//prototype


var imgSubstituters = new Array();


function init() {

	var imgs = ['d1', 'd2', 'd3', 'd4', 'd5', 'd6'];
	
	for (var i=0; i < imgs.length; i++) {
	
		imgSubstituters[imgs[i]] = new ImgSubstituter(imgs[i], 'off');
	}
	
	//imgSubstituters["garden_img"].callbackOver(null);
}


window.onload = init;