//Fotogalery
function ch_class(id, cl_name)
{
if(id != actpage) document.getElementById(id).className = cl_name;
}

function visible(id) {
	obj = document.getElementById(id);
	if (obj)
		obj.style.visibility = "visible";
}
function hidden(id) {
	obj = document.getElementById(id);
	if (obj)
		obj.style.visibility = "hidden";
}

function display(id){
obj = document.getElementById(id);
if(obj)
obj.style.display = "block";
}

function hide(id){
obj = document.getElementById(id);
if(obj)
obj.style.display = "none";
}

function hide_all()
{
	for(i = 0; i < 1000; i++){
		obj1 = document.getElementById('l_'+i);
		if(obj1) {obj1.style.display = "none";}
	}
}
var actpage="p1";

function deactive_page_all()
{
	for(i = 0; i < 15; i++){
		obj1 = document.getElementById('p'+i);
		if(obj1) {obj1.className = "l_norm";}
	}
}

function hide_banner_all()
{
	for(i = 0; i < 1000; i++){
		obj1 = document.getElementById('banner_'+i);
		obj2 = document.getElementById('glass');
		if(obj1) {obj1.style.display = "none";}
		if(obj2) {obj2.style.display = "none";}
	}
}

//Large photo preview
function do_send(i)
{
var skroll_height = document.body.scrollHeight;

var out = {
	banner: document.getElementById('banner_'+i),
	glass: document.getElementById('glass'),
	body: document.getElementById('body')
    };

	with(out.glass.style)
	{
		display = 'block';
        //width = out.body.scrollWidth > out.body.clientWidth ? out.body.scrollWidth : out.body.clientWidth;
        //height = out.body.scrollHeight > out.body.clientHeight ? out.body.scrollHeight : out.body.clientHeight;
		height = skroll_height > out.body.clientHeight ? skroll_height : out.body.clientHeight;
	}
	with(out.banner.style)
	{
		display = 'block';
		margin = '-'+out.banner.offsetHeight/2+'px 0 0 -'+out.banner.offsetWidth/2+'px';
	}
	//setTimeout('out.banner.style.display = "none";out.glass.style.display = "none";', 5000);
}


//Change pictures on inside page
var img_list = "inpic1.png, inpic2.png, inpic3.png, inpic4.png, inpic5.png";

function printRandImage(imagesF){
	img_arr = img_list.split(", ");
	rk = Math.floor(Math.random()* img_arr.length);

	img_src = imagesF + img_arr[rk];
	document.write("<img alt='' src='" +img_src+ "' />");
	//document.getElementById('pict_ins').style.background = "url('"+img_src+"')";
}


//Change pictures on homepage
var idPic;
var t;
var v;


function getBrowserInfo() {
if (window.opera) t = 'Opera';
 else if (document.all) {
  t = 'IE';
  var nv = navigator.appVersion;
  var s = nv.indexOf('MSIE')+5;
  v = nv.substring(s,s+1);
 }
 else if (navigator.appName) t = 'Netscape';
 return {type:t,version:v};
}



function setTimerPic(){
if (window.highlight) clearInterval(highlight);
timerPic=setInterval("high()",8000);
}



function high(){
clearInterval(timerPic);
if (!idPic) { idOldPic = 1; idPic = 2; } 
else { 
if (idPic==5) { idOldPic = 5; idPic = 1; } else { idOldPic = idPic; idPic = idPic+1; } 
}
alfa_op=0; 
highlight=setInterval("highlightPic(idPic, idOldPic)",50)
}

function highlightPic(idPic, idOldPic){

nameidPic = 'pic'+idPic;
nameidOldPic = 'pic'+idOldPic;
nameidTxt = 'txt'+idPic;
nameidOldTxt = 'txt'+idOldPic;

document.getElementById(nameidTxt).style.zIndex="13";
document.getElementById(nameidPic).style.zIndex="12";
document.getElementById(nameidOldTxt).style.zIndex="11";
document.getElementById(nameidOldPic).style.zIndex="10";

document.getElementById(nameidPic).style.display = 'block';
document.getElementById(nameidOldTxt).style.display='none';
document.getElementById(nameidTxt).style.display = 'block';

if (alfa_op<100) {
alfa_op+=10; 
alfa_op_op = alfa_op/100;

if (b.type == 'IE' && b.version >= 4) { document.getElementById(nameidPic).filters.alpha.opacity=alfa_op; /*document.getElementById(nameidTxt).filters.alpha.opacity=alfa_op;*/ }
else { 
document.getElementById(nameidPic).style.opacity=alfa_op_op; /*document.getElementById(nameidTxt).style.opacity=alfa_op_op; */
document.getElementById(nameidPic).style.KhtmlOpacity=alfa_op_op; /*document.getElementById(nameidTxt).style.KhtmlOpacity=alfa_op_op;*/ 
document.getElementById(nameidPic).style.MozOpacity=alfa_op_op; /*document.getElementById(nameidTxt).style.MozOpacity=alfa_op_op;*/ 
}
}
else if (window.highlightPic) {

document.getElementById(nameidOldPic).style.display='none';

document.getElementById(nameidTxt).style.zIndex="11";
document.getElementById(nameidPic).style.zIndex="10";

clearInterval(highlight);

setTimerPic();

}

}

var b=getBrowserInfo();
setTimerPic();

//do_send(2);

















