function switchImage(sign)
{
	var fg = document.getElementById('fotogallery'),
		cF = document.getElementById('currentFoto'),
		fC = document.getElementById('fotoContainer'),
		tit = document.getElementById('titleC'),
		descrC = document.getElementById('descrC');
		
		
	
	if(fg)
	{		
		fC.style.width = '100%';
		//fC.style.height = '100%';
		fC.style.position = 'absolute';
		fC.style.top = '0';
		fC.style.left = '0';
		fC.style.background = 'url(/images/transp2.png) repeat';
		
		if(sign == 'plus')
			if(currentP < maxP)
				currentP++;
				//fg.src = pictures[currentP+1];
			else
				currentP = 1;
				//fg.src = pictures[1];
				
				
		if(sign == 'minus')
			if(currentP > 1)
				currentP--;
				//fg.src = pictures[currentP-1];
			else
				currentP = maxP;
				//fg.src = pictures[maxP];

		fg.src = '';
		fg.src = pictures[currentP];
		cF.innerHTML = currentP;
		tit.innerHTML = titles[currentP];
		descrC.innerHTML = descr[currentP];
		//fg.style.visibility = 'hidden';
		
		//alert(fg.src);
		
//		fg.style.top = '50%';
//		fg.style.left = '50%';
//		fg.style.marginLeft = '-'+fg.clientWidth/2+'px';
//		fg.style.marginTop = '-'+fg.clientHeight/2+'px';
		
		/*
		fg.onload = function()
		{
			this.style.visibility = 'visible';
			this.style.top = '50%';
			this.style.left = '50%';
			this.style.marginLeft = '-'+this.clientWidth/2+'px';
			this.style.marginTop = '-'+this.clientHeight/2+'px';
			
		}
		*/
	}
	
	//document.location = document.location + '#'+currentP;
	document.location = Ruri + '#' + currentP;
	
	
	var xmlhttp;
	
	if (window.XMLHttpRequest)
	  {
	  // code for IE7+, Firefox, Chrome, Opera, Safari
	  xmlhttp=new XMLHttpRequest();
	  }
	else if (window.ActiveXObject)
	  {
	  // code for IE6, IE5
	  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	  }
	/*
	xmlhttp.onreadystatechange=function()
	{
	if(xmlhttp.readyState==4)
	  {
	  alert(xmlhttp.responseText);
	  }
	}*/
	xmlhttp.open("GET",Ruri,true);
	xmlhttp.send(null);
	
	return false;
}
