/* preloading thumbnails */

prev = -1;
next = 1;

isIE40comp = navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.indexOf("4") >= 0;
isNS40comp = navigator.appName == "Netscape" && navigator.appVersion.indexOf("4") >= 0;



begin = 0;
middle = thumbpath.length / 2;




var thumb = new Array(thumbpath.length);
var info = new Array(thumbpath.length);

for (j=0; j<=thumbpath.length; j++) {
		thumb[j] = new Image();
		thumb[j].src = thumbpath[j];
		
		if ( infopath[j] ) {
			info[j] = new Image();
			info[j].src = infopath[j];
		}
}


function showinfo(n) {
	if (info[n+begin]) {
		document.infospace.src = info[n+begin].src;
	}
}

function hideinfo(n) {
	if (info[n+begin]) {
		document.infospace.src = "images/projekte/blank.gif";
	}
}

function showimage(n) {
	if ( thumblink[n+begin] != "" ) { 
		if (thumblink[n+begin].indexOf(">>") == 0 ) { 
			location.href = thumblink[n+begin].substr(2,thumblink[n+begin].length) } 
		else {
			if (isIE40comp) { view.filters.blendTrans.Apply(); } 
			document.view.src = thumblink[n+begin];
			if (isIE40comp ) { view.filters.blendTrans.Play(); } 
			}
	}
	this.focus();
}


function move(dir) {
	if ( ( dir == -1 && begin > 0 ) || (  dir == 1  && ( begin < (middle - 7) ) ) ) {
		begin = begin + dir;
		
		for (i = 0; i <= 6; i++) {
			if (isIE40comp) {
			thumbspace[i].filters.blendTrans.Apply();
			thumbspace[i+7].filters.blendTrans.Apply();
			}
			thumbspace[i].src = thumb[i+begin].src;
			thumbspace[i+7].src = thumb[i+middle+begin].src;

			if (isIE40comp) {
			setcursor(i);
			thumbspace[i].filters.blendTrans.Play();			
			setcursor(i+7);
			thumbspace[i+7].filters.blendTrans.Play();
			
			
			}
		}
		shownavigation();		
	}
	this.focus();
}

function shownavigation() {
	document.nav_prev.src = "images/projekte/nav_blank.gif"
	document.nav_next.src = "images/projekte/nav_blank.gif"
	
	if ( middle > 7 ) {
		if (begin > 0) { document.nav_prev.src = "images/projekte/prev.gif" }
		if (begin < ( middle-7 )) { document.nav_next.src = "images/projekte/next.gif" }
	}
}

function setcursor(n) { 
	a = n;
	if (n > 6) { a = n - 7 + middle; }
	if (isIE40comp) {
		if (thumblink[a+begin] != "") {
			thumbspacelink[n].style.cursor = "hand"; 
		}
		else {
			thumbspacelink[n].style.cursor = "default";
		}
	}
}



document.write('<table border="0" cellpadding="0" cellspacing="1" width="604" height="153" bgcolor="#535353"><tr>');

  	for (i = 0; i <=6; i++) {  		
   		document.write(' <td bgcolor="#848484" width="75" height="75"><a name="thumbspacelink" href="javascript:showimage('+i+')" onmouseover="showinfo('+i+')" onmouseout="hideinfo('+i+')"><img name="thumbspace" src="'+thumbpath[i]+'" border="0"  width="75" height="75"  style="filter:blendTrans(Duration=1)"></a></td>');
    }

document.write('    <td width="70" height="150" rowspan="2"><a href="javascript:move(next)"><img name="nav_next" src="images/projekte/nav_blank.gif" border="0" WIDTH="60" HEIGHT="75"></a><br><a href="javascript:move(prev)"><img name="nav_prev" src="images/projekte/nav_blank.gif" border="0" WIDTH="60" HEIGHT="75"></a></td> </tr><tr>')
    	 
	for (i = middle ; i <= middle + 6; i++) {
  	  	document.write(' <td bgcolor="#848484" width="75" height="75"><a name="thumbspacelink" href="javascript:showimage('+i+')"   onmouseover="showinfo('+i+')" onmouseout="hideinfo('+i+')"><img name="thumbspace" src="'+thumbpath[i]+'" border="0"  width="75" height="75"  style="filter:blendTrans(Duration=1)"></a></td>');
	}
    for (i=0; i<=13; i++) { setcursor(i) } 
document.write('</tr></table>');

