<!--
// ----------------------------------------------------------------------------------------
// the following are some simple scripts, which enhance the functionality of the site
// if you encounter any problems or have questions
// please refer to Cedric Haindl of Haindl Mediendesign http://www.haindl.ch cedi@haindl.ch
//
// please also note, that the path to the images has to be correct!
// ----------------------------------------------------------------------------------------

// workaround for the infamous Netscape CSS- and Layer-bug:
// reloads the window on resize

if (document.layers) {
origWidth = innerWidth;
origHeight = innerHeight;}
function reDo() {
if (innerWidth != origWidth || innerHeight != origHeight)
location.reload();}
//if (document.layers) onresize = reDo;

// ----------------------------------------------------------------------------------------
// scripts for the rollover-effect in the  navigation bar
// ----------------------------------------------------------------------------------------

<!--

var selectedtopic = 0;
var selectedSubTopic = 0;
var topicsPresent = 7;
var subTopicsPresent = 0;
var path = "de/";

URL = location.href
if (URL.indexOf("/de/") != -1) path = "../";

if (document.images)  {
	picturesDef = new Array();
		for (i = 1; i <= topicsPresent ; i++)   {
			picturesDef[i] = new Image();
			picturesDef[i].src = path + "images/nav/nav_"  + i + "d.gif";}
	
	picturesHi = new Array();
		for (i = 1; i <= topicsPresent; i++)   {
			picturesHi[i] = new Image();
			picturesHi[i].src = path + "images/nav/nav_"  + i + "h.gif";}
}

function changePic(picNum)   {
	if (document.images)  {
	eval("document.topic" + picNum + ".src = picturesHi[picNum].src;");
    }        
}

function changeSubPic(picNum)   {
	if (document.images)  {
	eval("document.subtopic" + picNum + ".src = picturesSubHi[picNum].src;");
    }        
}

function resetPic()   {
	if (document.images)  {
		for (i = 1; i <= topicsPresent; i++)   {
		if ( i != selectedtopic) {
		eval("document.topic" + i + ".src = picturesDef[i].src;");
        }
        }
	}
}

function checkTopic() {
	URL=location.href
	if (document.images) { 
	resetPic(); 
	
               
	if (URL.indexOf("/aktuell/") != -1) selectedtopic = 1;
	if (URL.indexOf("/judo/") != -1) selectedtopic = 2;
	if (URL.indexOf("/portrait/") != -1) selectedtopic = 3;
	if (URL.indexOf("/turniere/") != -1) selectedtopic = 4;
	if (URL.indexOf("/forum/") != -1) selectedtopic = 5;
	if (URL.indexOf("/links/") != -1) selectedtopic = 6;
	if (URL.indexOf("/kontakt/") != -1) selectedtopic = 7;
	      
	if (selectedtopic != 0) {
		eval("document.topic" + selectedtopic + ".src = picturesHi[selectedtopic].src;");}
    }  
}


/*
function WinOpen(WinName,url) {
		        newWindow = window.open(url, 'Mitglieder','scrollbars,resizable,width=240,height=320,screenX=500,screenY=200');
				//newWindow.focus();
		}
*/

// ----------------------------------------------------------------------------------------
// Window Handler für Portrait:
// ----------------------------------------------------------------------------------------

function openportrait(image, pagetitle, name, grad, eintritt, erfolg) {
URL = location.href;
// calcs the position of the window:
var width = screen.width;
 var height = screen.height;
 var bn = navigator.appName;
 if (bn == "Netscape"){
  w = self.outerWidth;
  h = self.outerHeight;
 }
 else {
  w = document.body.clientWidth;
  h = document.body.clientHeight;
  w = w + 30;
  h = h + 120;
 }
  w = w/2;
  h = h/2;
  h = h + 30;
  width = width/2;
  height = height/2;
  width = width - w;
  height = height - h;
  
eval ("portraitwin = window.open('', 'portrait', 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizeable=0,width=350,height=260,screenX=" + width + ",screenY=" + height + "');");

 portraitwin.document.open();
 // now creates the page
 with (portraitwin.document) {
write("<html><head><title>" + pagetitle + "</title>");
write("<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'>");
write("<link rel='stylesheet' href='../../css/fuji.css' type='text/css'>");
write("<script language='JavaScript'>");
write("setTimeout('self.close()', 10000);");
write("</script></head><body bgcolor='#ffffff' text='#000000'>");
write("<table width='300' border='0' cellspacing='0' cellpadding='2' class='text'>");
write("<tr><td><img src='images/" + image + "' width='160' height='160' border='0'></td>");
write("<td valign='top'><p><b>" + name + "</b></p>");
write("<p>Grad:" + grad + "</p>");
write("Eintritt:" + eintritt + "</td></tr>");
write("<tr><td colspan='2'>Erfolge:<br>" + erfolg + "</td></tr>");
write("</table></body></html>");
 }
 
portraitwin.document.close();
 if (document.layers){
 } else {
  portraitwin.moveTo(width,height)
 }
 portraitwin.focus();

}

// ----------------------------------------------------------------------------------------
// Window Handler für Bildergalerie:
// ----------------------------------------------------------------------------------------

function openpicture(image, pagetitle) {
URL = location.href;
// calcs the position of the window:
var width = screen.width;
 var height = screen.height;
 var bn = navigator.appName;
 if (bn == "Netscape"){
  w = self.outerWidth;
  h = self.outerHeight;
 }
 else {
  w = document.body.clientWidth;
  h = document.body.clientHeight;
  w = w + 30;
  h = h + 120;
 }
  w = w/2;
  h = h/2;
  h = h + 30;
  width = width/2;
  height = height/2;
  width = width - w;
  height = height - h;
  
eval ("portraitwin = window.open('', 'portrait', 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizeable=0,width=500,height=405,screenX=" + width + ",screenY=" + height + "');");

 portraitwin.document.open();
 // now creates the page
 with (portraitwin.document) {
write("<html><head><title>" + pagetitle + "</title>");
write("<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'>");
write("<link rel='stylesheet' href='../../css/fuji.css' type='text/css'>");
write("<script language='JavaScript'>");
write("</script></head><body bgcolor='#ffffff' text='#000000'>");
write("<table width='500' border='0' cellspacing='0' cellpadding='0'>");
write("<tr><td><img src='images/" + image + "' width='500' height='375' border='0'></td></tr>");
write("<tr><td align='center'><a href='javascript:window.close()' class='mainlink'>schliessen</a></td></tr>");
write("</table></body></html>");
 }
 
portraitwin.document.close();
 if (document.layers){
 } else {
  portraitwin.moveTo(width,height)
 }
 portraitwin.focus();

}
