
function GetWindowSize(varr){
	var myWidth = 0, myHeight = 0;
	if( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE
		myWidth = window.innerWidth-20;
		myHeight = window.innerHeight;
	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth;
		myHeight = document.documentElement.clientHeight;
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		//IE 4 compatible
		myWidth = document.body.clientWidth;
		myHeight = document.body.clientHeight;
	}
  
	if (varr=="W") return parseInt(myWidth);
	if (varr=="H") return parseInt(myHeight);
}




var nr_imag=1;
var cnt_imag=0;

var window_W=GetWindowSize("W");
var window_H=GetWindowSize("H");

function ViewBigImage(tip) {
	var poz=document.getElementById('img_med');
	var lay=document.getElementById('lay4image');
	var l4i_img_cont=document.getElementById('l4i_img_cont');
	var l4i_img=document.getElementById('l4i_img');
	var l4i_menu=document.getElementById('l4i_menu');
	var l4i_loading=document.getElementById('l4i_loading');
	
	l4i_img_cont.src='img/pix.gif';
	//~ l4i_img_cont.className='';
	
	//l4i_img.style.display="none";
	
	l4i_loading.style.display='block';
	l4i_loading.style.left=Math.round((window_W - l4i_loading.offsetWidth )/2)+"px";
	l4i_loading.style.top=document.body.scrollTop + 40 +"px";
	
	//alert(l4i_loading.offsetWidth+'... top:...'+l4i_loading.style.top);
	
	lay.style.width=window_W+"px";
	lay.style.height=window_H+"px";
	lay.style.display="block";
	
	
	l4i_img.style.width=window_W+"px";
	l4i_img.style.display="block";
	
	if (tip!='') {
		var is_new_nr=1;
		if (cnt_imag==0) {	
			for (var x=1; x<path_pic_js.length; x++) if (path_pic_js[x].indexOf('/'+nr_imag+"_b.jpg")>-1) is_new_nr=x;
		}
		else is_new_nr=cnt_imag;
		if (tip=='+') {
			if((is_new_nr+2) > path_pic_js.length) is_new_nr=1;
			else is_new_nr++;
		}
		else {
			if((is_new_nr-1) == 0) is_new_nr=path_pic_js.length-1;
			else is_new_nr--;
		}
		cnt_imag=is_new_nr;
		l4i_img_cont.src=path_pic_js[is_new_nr];
	}
	else l4i_img_cont.src=document.getElementById('img_med').src.replace("_m.jpg","_b.jpg");
	//~ l4i_img_cont.className='poza_mare';
	
	l4i_menu.style.width=window_W+"px";
	l4i_menu.style.display='block';
	l4i_menu.style.top = window_H -l4i_menu.offsetHeight + document.body.scrollTop -10 +'px';
	
	
}

function ViewMediumImage(an,im) {
	var poz=document.getElementById('img_med');
	poz.src="images/pics/"+an+"/"+im+'_m.jpg';
	nr_imag=im;
}



function myScroll() { 
	var lay=document.getElementById('lay4image');
	var l4i_img=document.getElementById('l4i_img');
	var l4i_menu=document.getElementById('l4i_menu');
	var l4i_loading=document.getElementById('l4i_loading');
	if (lay.style.display=="block") {
		lay.style.top = document.body.scrollTop+'px';
		l4i_img.style.top = document.body.scrollTop+20+'px';
		l4i_menu.style.top = window_H - l4i_menu.offsetHeight + document.body.scrollTop - 10 + 'px';
		l4i_loading.style.top = document.body.scrollTop + 40 + 'px';
	}
	
}


function ClosePhotoGal() {

	document.getElementById('lay4image').style.display="none";
	document.getElementById('lay4image').style.top="0px";
	document.getElementById('l4i_img').style.display="none";
	document.getElementById('l4i_img').style.top="20px";
	document.getElementById('l4i_menu').style.display='none';
	document.getElementById('l4i_loading').style.display='none';
}

window.onscroll=myScroll;

