var newsActive = 0;


function homePageNews(id)
{
	if (id!=newsActive)
	{
		if (newsActive!=0)
			document.getElementById('newsText'+newsActive).style.display='none';
		document.getElementById('newsText'+id).style.display='block';
		newsActive = id;
	}
	else
	{
		document.getElementById('newsText'+newsActive).style.display='none';
		newsActive = 0;
	}
}

function showAllNews()
{
	document.getElementById('allNews').style.display='block';
	document.getElementById('allNewsLink').style.display='none';
}

function shiftPhoto(count)
{
	if (curImage+count>=0 && curImage+count<imgGal.length)
	{
		curImage = curImage + count;
		$("#curImage").attr('src',imgGal[curImage]);
		if ($("#curDate"))
			$("#curDate").html(imgDate[curImage]);
		$("#curCounter").html(curImage+1);
	}		
}


function popup(pik,wdt,hgt,d_text)
{

   var dest='a';
   dest=dest+Math.round(Math.random()*1000000);
   if (wdt>700)
    {
     scale=wdt/700;
     wdt=Math.round(wdt/scale)-1;
     hgt=Math.round(hgt/scale)-1;
    }
   if (hgt>500)
   {
    scale=hgt/500;
    wdt=Math.round(wdt/scale)-1;
    hgt=Math.round(hgt/scale)-1;
   }

   myWin=open("",dest,"location=no,toolbar=no,scrollbars=no,left=400,top=300,width=" + wdt + ", height=" + hgt);
   myWin.document.open();
   myWin.document.write("<html><head><title>");
   myWin.document.write(d_text);
   myWin.document.write("</title></head><body marginwidth=0 marginheight=0 leftmargin=0 topmargin=0>");
   myWin.document.write("<img border=0 src=");
   myWin.document.write(pik);
   myWin.document.write(" width=");
   myWin.document.write(wdt);
   myWin.document.write(">");
   myWin.document.write("</body></html>");
   myWin.document.close();  
}
