// JavaScript Document


var theImages = new Array()

//Random-loading images
theImages[0] = 'images/photos/photo1.gif' // replace with names of images
theImages[1] = 'images/photos/photo2.gif' // replace with names of images
theImages[2] = 'images/photos/photo3.gif' // replace with names of images
theImages[3] = 'images/photos/photo4.gif' // replace with names of images
theImages[4] = 'images/photos/photo5.gif' // replace with names of images
theImages[5] = 'images/photos/photo6.gif' // replace with names of images
theImages[6] = 'images/photos/photo7.gif' // replace with names of images
theImages[7] = 'images/photos/photo8.gif' // replace with names of images
theImages[8] = 'images/photos/photo9.gif' // replace with names of images


var j = 0
var p = theImages.length;
var preBuffer = new Array()

for (i = 0; i < p; i++){
preBuffer[i] = new Image()
preBuffer[i].src = theImages[i]
}
var whichImage = Math.round(Math.random()*(p-1));

function showImage(){
if(whichImage==0){
document.write('<a href ="index.html"><img src="'+theImages[whichImage]+'" border=0  width="325" height="220"></a>');
}
else if(whichImage==1){
document.write('<a href ="index.html"><img src="'+theImages[whichImage]+'" border=0  width="325" height="220"></a>');
}
else if(whichImage==2){
document.write('<a href ="index.html"><img src="'+theImages[whichImage]+'" border=0  width="325" height="220"></a>');
}
else if(whichImage==3){
document.write('<a href ="index.html"><img src="'+theImages[whichImage]+'" border=0  width="325" height="220"></a>');
}
else if(whichImage==4){
document.write('<a href ="index.html"><img src="'+theImages[whichImage]+'" border=0 width="325" height="220"></a>');
}
else if(whichImage==5){
document.write('<a href ="index.html"><img src="'+theImages[whichImage]+'" border=0 width="325" height="220"></a>');
}
else if(whichImage==6){
document.write('<a href ="index.html"><img src="'+theImages[whichImage]+'" border=0 width="325" height="220"></a>');
}
else if(whichImage==7){
document.write('<a href ="index.html"><img src="'+theImages[whichImage]+'" border=0 width="325" height="220"></a>');
}
else if(whichImage==8){
document.write('<a href ="index.html"><img src="'+theImages[whichImage]+'" border=0 width="325" height="220"></a>');
}
else if(whichImage==9){
document.write('<a href ="index.html"><img src="'+theImages[whichImage]+'" border=0 width="325" height="220"></a>');
}

}




function cmvChangeMenu(id){
var indexTreeArray=new Array('2','3','3#1','3#2','3#2#5','3#3','4','5');
for (i=0; i<indexTreeArray.length; i++){
var objClose=document.getElementById('idBlock'+indexTreeArray[i]);
objClose.style.display='none';
}
var level=(id.length+1)/2;
for (i=0; i<level; i++){
var objOpen=document.getElementById('idBlock'+id.substr(0,id.length-i*2));
objOpen.style.display='block';
}
}









