function tb_over(tb) { tb.style.borderColor = "#839b53"; }
function tb_out(tb) { tb.style.borderColor = "#d0d0d0"; }
function newwindow(picname, name) {
	pic = window.open('../bg/pic.php?pic_name_big='+picname, name, "location = 1, resizable = yes, status = 1, scrollbars = 1, width=600, height=750");
	pic.moveTo(100, 100);
}
function overpic(pic){ pic.style.borderColor="#839b53"; }function outpic(pic){ pic.style.borderColor="#D7C7B4"; }
function mouseOver(){
alert("fasdfasd");
}

/* ----------------------------- ocvetqvan ne numbers items ---------------------------------------*/
function overdiv(div){
	div.style.background = "#3b5998";
	div.style.color = "white";
}
function outdiv(div){
	div.style.background = "white";
	div.style.color = "#3b5998";
}



function(imageNum) {   
        
        this.activeImage = imageNum; // update global var
 
        // hide elements during transition
        if (LightboxOptions.animate) this.loading.show();
        this.lightboxImage.hide();
        this.hoverNav.hide();
        this.prevLink.hide();
        this.nextLink.hide();
		// HACK: Opera9 does not currently support scriptaculous opacity and appear fx
        this.imageDataContainer.setStyle({opacity: .0001});
        this.numberDisplay.hide();      
        
        var imgPreloader = new Image();
        
        // once image is preloaded, resize image container
        imgPreloader.onload = (function(){
        this.lightboxImage.src = this.imageArray[this.activeImage][0];
		var maxdims = getVisibleArea();
 
 
	//    window.alert( 'Width = ' + maxdims[0] );
	//	window.alert( 'Height = ' + maxdims[1] );
	var ph=0;
	var pw=0;
 
		var lb_max_width = maxdims[0]-20; //if you wish to constrain the width (set to 99999 for unlimited size)
		var lb_max_height = maxdims[1]-85; //if you wish to constring the height (set to 99999 for unlimited size)
		var dims = lb_scale_dims(imgPreloader.width, imgPreloader.height, lb_max_width, lb_max_height);
		this.lightboxImage.setStyle({ width: dims[0] + 'px', left: dims[1] + 'px' });
		this.resizeImageContainer(dims[0], dims[1]);
	//this.resizeImageContainer(imgPreloader.width, imgPreloader.height);
        }).bind(this);
        imgPreloader.src = this.imageArray[this.activeImage][0];
     	setTimeOut("this.AdvanceShow()", 5000);
    }

function() {
     //changes the image
     if (this.activeImage != (this.imageArray.length - 1))
	 {
           this.disableKeyboardNav();
           this.changeImage(this.activeImage + 1);
     }
}