var cid = 0;
function pictext(id) {

	var a = document.getElementById('fototext' + id);
	var b = document.getElementById('fototext' + cid);
	if(b){
		b.style.display='none';
	}
	a.style.display='block';

	cid = id;
}

function pictexth(id,hide) {

	var a = document.getElementById('fototext' + id);
	if(hide){
		a.style.display='none';
	}else{
		a.style.display='block';
	}

}

function setyear(year)
{
//alert(trackbar.getObject('two').years[year] + ' ' + year);
	trackbar.getObject('two').updateLeftValue(year);
	changeContentByRuler(year);
}

var curYear = -1;
function changeContentByRuler(year)
{

	num = Math.round(year/100);
	//alert(num);
	if(num != curYear){
		
		if(a = document.getElementById('year_' + trackbar.getObject('two').years[num])){
			document.getElementById('year_content').innerHTML = a.innerHTML;
		}
		//if(curYear != -1){
		if (b = document.getElementById('y_' + parseInt(curYear*100)))
		b.className = 'year_span';
		if (c = document.getElementById('y_' + num*100))
		c.className = 'year_span_red';
		//}

		var newlv = 0;
		if(Math.abs(num*100-year)>2){
			newlv = num*100 - ((num*100-year)/Math.abs(num*100-year))*Math.round(Math.abs(num*100-year)*3/4);
			trackbar.getObject('two').updateLeftValue(newlv);
			setTimeout("changeContentByRuler("+newlv+")",20);
		}else{
			curYear = num;
			trackbar.getObject('two').updateLeftValue(num*100);
		}

	}
}

  function popUp(URL) {
      var width = 750;
      var height = 600;
      var left = (screen.width - width) / 2;
      var top = (screen.height - height) / 2;
      eval("var page = window.open(URL, 'anmeldung', 'toolbar=0,scrollbars=1,location=1,statusbar=0,menubar=0,resizable=0,width="+width+",height="+height+",left="+left+",top="+top+"');");
      page.focus();
    }
    
    function popUpEinblick(URL) {
      var width = 640;
      var height = 480;
      var left = (screen.width - width) / 2;
      var top = (screen.height - height) / 2;
      eval("var page = window.open(URL, 'einblick', 'toolbar=0,scrollbars=0,location=no,statusbar=no,menubar=0,resizable=no,width="+width+",height="+height+",left="+left+",top="+top+"');");
      page.focus();
}
