function LoadImages(name){
	this.pathToImages="images/";
	this.Img=new Array();
	this.c=0;
	this.ifLoaded=0;
	this.name=name;
}
LoadImages.prototype.setPath=function(nPath){
	this.pathToImages=nPath;
}
LoadImages.prototype.loadImage=function(pImg){
	this.Img[this.c]=new Image();
	this.Img[this.c++].src=this.pathToImages+pImg;
}
LoadImages.prototype.loadImages=function(){
	for (var i=0;i<arguments.length;i++){
		this.loadImage(arguments[i]);
	}
}
LoadImages.prototype.checkImages=function(){
	var i=0;
	var ok=1;
	while ((i<this.c) && (ok)){
		(!this.Img[i++].complete) && (ok=0);
	}
	(ok)? this._whenLoaded():setTimeout(this.name+".checkImages()",1000);
}
LoadImages.prototype._whenLoaded=function(){
	this.ifLoaded=1;
	this.createEvents();
}

LoadImages.prototype.createEvents=function(){
	if(document.getElementById("btn1")){
		document.getElementById("btn1").onmouseover=function(){
			changeBgOver(1);
		}
		document.getElementById("btn1").onmouseout=function(){
			changeBgOut(1);
		}
	}
	if(document.getElementById("btn2")){
		document.getElementById("btn2").onmouseover=function(){
			changeBgOver(2);
		}
		document.getElementById("btn2").onmouseout=function(){
			changeBgOut(2);
		}
	}
	if(document.getElementById("btn3")){
		document.getElementById("btn3").onmouseover=function(){
			changeBgOver(3);
		}
		document.getElementById("btn3").onmouseout=function(){
			changeBgOut(3);
		}
	}
	if(document.getElementById("btn4")){
		document.getElementById("btn4").onmouseover=function(){
			changeBgOver(4);
		}
		document.getElementById("btn4").onmouseout=function(){
			changeBgOut(4);
		}
	}
	if(document.getElementById("btn5")){
		document.getElementById("btn5").onmouseover=function(){
			changeBgOver(5);
		}
		document.getElementById("btn5").onmouseout=function(){
			changeBgOut(5);
		}
	}
	if(document.getElementById("btn6")){
		document.getElementById("btn6").onmouseover=function(){
			changeImagesOver(6);
		}
		document.getElementById("btn6").onmouseout=function(){
			changeImagesOut(6);
		}
	}
	if(document.getElementById("btn7")){
		document.getElementById("btn7").onmouseover=function(){
			changeImagesOver(7);
		}
		document.getElementById("btn7").onmouseout=function(){
			changeImagesOut(7);
		}
	}
	if(document.getElementById("btn8")){
		document.getElementById("btn8").onmouseover=function(){
			changeImagesOver(8);
		}
		document.getElementById("btn8").onmouseout=function(){
			changeImagesOut(8);
		}
	}
	if(document.getElementById("btn9")){
		document.getElementById("btn9").onmouseover=function(){
			changeBgOver(9);
		}
		document.getElementById("btn9").onmouseout=function(){
			changeBgOut(9);
		}
	}
	if(document.getElementById("btn10")){
		document.getElementById("btn10").onmouseover=function(){
			changeBgOver(10);
		}
		document.getElementById("btn10").onmouseout=function(){
			changeBgOut(10);
		}
	}
	if(document.getElementById("btn11")){
		document.getElementById("btn11").onmouseover=function(){
			changeBgOver(11);
		}
		document.getElementById("btn11").onmouseout=function(){
			changeBgOut(11);
		}
	}
	if(document.getElementById("btn12")){
                document.getElementById("btn12").onmouseover=function(){
                        changeBgOver(12);
                }
                document.getElementById("btn12").onmouseout=function(){
                        changeBgOut(12);
                }
        }
	if(document.getElementById("btn13")){
                document.getElementById("btn13").onmouseover=function(){
                        changeBgOver(14);
                }
                document.getElementById("btn13").onmouseout=function(){
                        changeBgOut(14);
                }
        }
        if(document.getElementById("btn14")){
                document.getElementById("btn14").onmouseover=function(){
                        changeBgOver(14);
                }
                document.getElementById("btn14").onmouseout=function(){
                        changeBgOut(14);
                }
        }
        if(document.getElementById("btn15")){
                document.getElementById("btn15").onmouseover=function(){
                        changeBgOver(15);
                }
                document.getElementById("btn15").onmouseout=function(){
                        changeBgOut(15);
                }
        }
        if(document.getElementById("btn16")){
                document.getElementById("btn16").onmouseover=function(){
                        changeBgOver(16);
                }
                document.getElementById("btn16").onmouseout=function(){
                        changeBgOut(16);
                }
        }
        if(document.getElementById("btn17")){
                document.getElementById("btn17").onmouseover=function(){
                        changeBgOver(17);
                }
                document.getElementById("btn17").onmouseout=function(){
                        changeBgOut(17);
                }
        }
        if(document.getElementById("btn18")){
                document.getElementById("btn18").onmouseover=function(){
                        changeBgOver(18);
                }
                document.getElementById("btn18").onmouseout=function(){
                        changeBgOut(18);
                }
        }
        if(document.getElementById("btn19")){
                document.getElementById("btn19").onmouseover=function(){
                        changeBgOver(19);
                }
                document.getElementById("btn19").onmouseout=function(){
                        changeBgOut(19);
                }
        }


}

