var pic, row, txt;
qs	= document.location.search;
pic	= qs.match(/(pic=)(\d{2})(_)(\d{2})/g);
row	= RegExp.$2
row	= (row) ? row : "01";
pic	= RegExp.$4
pic	= (pic) ? pic : "01";

txt			= new Array();
txt["01"]	= "Obstbl&uuml;te";
txt["02"]	= "Gut Steinwehr";
txt["03"]	= "Rapsbl&uuml;te";
txt["04"]	= "Winter";

function picNav() {
	nr		= "";
	linktxt	= "";
	for (i=1; i<=6; i++) {
		nr		 = (i<10) ? "0" + i : i;
		css		 = (pic == nr) ? " class=\"hi\"" : "";
		linktxt += '<a href="#" id="pic' + nr + '" onclick="showPic(\'' + row + '\',\'' + nr + '\');" onfocus="this.blur();" title="Himbeerhof Steinwehr: ' + txt[row] + ' - Gro&szlig;ansicht"' + css + '><img src="/img/impressionen/thumbs/' + row + '_' + nr + '.jpg" width="120" height="73" alt="Himbeerhof Steinwehr: ' + txt[row] + '" /></a>\n';
	}
	return(linktxt);
}

function showPic(myrow, mypic) {
	pictxt = (mypic<10) ? mypic.substr(1,1) : mypic;
	
	$("a#pic" + pic).toggleClass("hi");
	$("a#pic" + mypic).toggleClass("hi");
	imgTag	= '<img src="/img/impressionen/' + myrow + '_' + mypic + '.jpg" width="480" height="290" alt="Himbeerhof Steinwehr - Impression" />';
	$("#thePic").fadeIn(1000);
	$("#thePic").html(imgTag);
	$("#capture").html("Bild " + pictxt + " von 6");
	pic = mypic;
}
