<!-- SCRIPTING BROWSERS ONLY 
var wins = new Array;
var aktwin=0;
var n=0;
var bend=52;
var NOW= new Date();
// fuer tests das Bild 42 reicht vom 15.10 bis 21.10.
// also ist es vom 22.10. 13:00 bis
// 29.10. 12:59 das aktuelle Bild
// gettime returns milliseconds since epoch date (jan1st 1970) 
//NOW = new Date(97,9,23,13,0,0); // this is for testing
thisyear=NOW.getYear();
thisyear=2002;
janone = new Date(thisyear,0,1,16,0,0);
if (thisyear <1900 ) {thisyear+= (thisyear >90) ? 1900 : 2000};


function playfile(head,trailer,n,begin,frametime,type,fixstep) {
//  if fixstep ='0' alles einzeln als monatsfiles
//  if fixstep ='12' jahresfiles
// last four chars in head must be the year
// determine n for the actual year
//if (thisyear == parseInt(head.substring(head.length-4,head.length))) {
//  today = parseInt((NOW.getTime()/100000 - janone.getTime()/100000)/36/24);
//  offset = 3 - NOW.getDay();
//  weekno = Math.floor((today-offset)/7);
//  alert("we are in 1997\n"+NOW.getDay()+"\n week:"+ weekno +"\noffset"+offset);
//  n = weekno;  
//}
browserName = navigator.appName;
browserVer  = parseInt (navigator.appVersion);
if (fixstep == '0') bild=head+begin+"10"+trailer;
if (fixstep == '12') bild=head+begin+""+trailer;
gtsign=">"; 
var liste =  new Array (   '1978','1979',
                           '1980','1981','1982','1983','1984','1985','1986','1987','1988','1989',
			   '1990','1991','1992','1993','1994','1995','1996','1997','1998','1999',
			   '2000','2001','2002','2003','2004','2005','2006','2007','2008','2009',
			   '2010','2011','2012','2013','2014','2015','2016','2017','2018','2019',
			   '2020','2021');
var daylist =  new Array (   '01','02',
                           '03','04','05','06','07','08','09','10','11','12',
			   '13','14','15','16','17','18','19','20','21','22',
			   '23','24','25','26','27','28','29','30');

if ( browserVer >= 3) {

	aktwin=0;
	height=760;  // ANTARCTIC window height
	if (head == "monthly/ARCTIC/n") height=880;
	aktwin = window.open("","SST"+type,"width=550,toolbar=yes,scrollbars=yes");
	
	with (aktwin.document) {
	open();
	write("<html><head><title>BSH "+type+" </title>"+
		"<SCRIPT LANGUAGE='JAVASCRIPT'>"+
		"var page=0;"+
		"var start= "+ String(begin) + ";" +
		"var number= "+ thisyear + "-1977;" +
		"var delay = "+ String(frametime) + ";"+
		"var nameheader = '"+  head + "';"+
		"var step=1 ;"+
		"var nametrailer = '"+ trailer + "';"+
		"var firstpage = 0;");
	write(	"var image = new Array ( '1978',"+
		"    '1979','1980','1981','1982','1983','1984','1985','1986','1987','1988','1989',"+
		"	   '1990','1991','1992','1993','1994','1995','1996','1997','1998','1999',"+
		"	   '2000','2001','2002','2003','2004','2005','2006','2007','2008','2009',"+
		"	   '2010','2011','2012','2013','2014','2015','2016','2017','2018','2019',"+
		"	   '2020','2021'); "+
		"var monat = new Array ('01','02','03','04','05','06','07','08','09','10','11','12');"+
                "var tage = new Array ('01','02','03','04','05','06','07','08','09','10',"+
                "                      '11','12','13','14','15','16','17','18','19','20',"+
                "                      '21','22','23','24','25','26','27','28','29','30','31'); "+
                "var steps = new Array (1,2,3,12);"+
		"var bild = new Array;"+
		"var timerId =0;"+
		"var l = firstpage;");
	if (fixstep == '0') write("var lastpage  = parseInt(number)*12;");
	if (fixstep == '12') write("var lastpage  = parseInt(31); monat[0]='';");
	write(
		"for (i=0 ; i<lastpage; i++,l++) "+
                " {k=Math.floor(l/12);j=l-k*12;");
 	if (fixstep == '12') write(" k=i;j=0;");
	if (fixstep == '0' ) write(        
		"    bild[i] = nameheader+String(image[k])+monat[j]+nametrailer;"+
		"}");
	if (fixstep == '12' ) write(        
		"    bild[i] = nameheader+String(tage[k])+monat[j]+nametrailer;"+
		"}");
	if (fixstep =='12') write(	
		"function setFVals(p) {"+
		"	 document.forms[0].jahrlist.selectedIndex= p;}");
	if (fixstep =='0') write(	
		"function setFVals(p) {"+
		"        jr=Math.floor(p/12);"+
		"        mo=p-jr*12;"+
		"	 document.forms[1].jahrlist.selectedIndex= jr;"+
		"	 document.forms[2].monalist.selectedIndex= mo;}");
	write(	"function stop() {"+
		"	 document.Stop.src = '/aktdat/mk/icons/p_stop.gif';"+
		"	 document.Fback.src = '/aktdat/mk/icons/back.gif';"+
		"	 document.Fforw.src = '/aktdat/mk/icons/forw.gif';"+
		"        page = (page < 0 ) ? lastpage : page;"+
		"        page = (page > lastpage ) ? 0 : page;"+
		"	clearTimeout(timerId);"+
		"	document.anImage.src = bild[page];"+
		"       setFVals(page);"+
		"	}"+
		"function ffwd () {"+
		"	 document.Stop.src = '/aktdat/mk/icons/stop.gif';"+
		"	 document.Fback.src = '/aktdat/mk/icons/back.gif';"+
		"	 document.Fforw.src = '/aktdat/mk/icons/p_forw.gif';"+
		"        page = ((page += step) >= lastpage ) ? page-lastpage : page;"+
		"               "+
		"	 document.anImage.src = bild[page];"+
		"                setFVals(page);"+
		"	 clearTimeout(timerId);"+
		"        timerId = setTimeout('ffwd()',delay);"+
		"	}"+
		"function sfwd () {"+
		"	 document.Stop.src = '/aktdat/mk/icons/stop.gif';"+
		"	 document.Fback.src = '/aktdat/mk/icons/back.gif';"+
		"	 document.Fforw.src = '/aktdat/mk/icons/forw.gif';"+
		"                setFVals(page);"+
		"        page = ((page += step) >= lastpage ) ? page-lastpage : page;"+
		"	"+
		"	document.anImage.src = bild[page];"+
		"                setFVals(page);"+
		"	clearTimeout(timerId);"+
		"	}"+
		"function fbwd () {"+
		"	 document.Fback.src = '/aktdat/mk/icons/p_back.gif';"+
		"	 document.Stop.src = '/aktdat/mk/icons/stop.gif';"+
		"	 document.Fforw.src = '/aktdat/mk/icons/forw.gif';"+
		"        page = ((page -=step) < 0 ) ? lastpage+page : page;"+
		" "+
		"	 document.anImage.src = bild[page];"+
		"                setFVals(page);"+
		"	 clearTimeout(timerId);"+
		"        timerId = setTimeout('fbwd()',delay);"+
		"	}"+
		"function sbwd () {"+
		"	 document.Fback.src = '/aktdat/mk/icons/back.gif';"+
		"	 document.Stop.src = '/aktdat/mk/icons/stop.gif';"+
		"	 document.Fforw.src = '/aktdat/mk/icons/forw.gif';"+
		"       page = ((page -= step)< 0 ) ? lastpage+page : page;"+
		"       ;"+
		"	document.anImage.src = bild[page];"+
		"                setFVals(page);"+
		"	clearTimeout(timerId);"+
		"	}"+
		"function first () {"+
		"	 document.Fback.src = '/aktdat/mk/icons/back.gif';"+
		"	 document.Stop.src = '/aktdat/mk/icons/stop.gif';"+
		"	 document.Fforw.src = '/aktdat/mk/icons/forw.gif';"+
		"        page =  0 ;"+
		"	document.anImage.src = bild[page];"+
		"                setFVals(page);"+
		"	clearTimeout(timerId);"+
		"	}"+
		"function last () {"+
		"	 document.Fback.src = '/aktdat/mk/icons/back.gif';"+
		"	 document.Stop.src = '/aktdat/mk/icons/stop.gif';"+
		"	 document.Fforw.src = '/aktdat/mk/icons/forw.gif';"+
		"        page = lastpage-1;"+
		"	document.anImage.src = bild[page];"+
		"                setFVals(page);"+
		"	clearTimeout(timerId);"+
		"	}"+
		"function showSlide(page) {"+
		"	 document.Stop.src = '/aktdat/mk/icons/stop.gif';"+
		"	 document.Fback.src = '/aktdat/mk/icons/back.gif';"+
		"	 document.Fforw.src = '/aktdat/mk/icons/forw.gif';"+
		"       document.anImage.src = bild [page] ;"+
		"	clearTimeout(timerId);"+
		"       }"+
		"function setJahr(f) {"+
		"       jr = f.jahrlist.selectedIndex;"+
		"       mo = page - 12*Math.floor(page/12);"+
		"       page = jr*12+mo;");
 	if (fixstep == '12') write(" page=jr;");
        write(
                "       showSlide(page);"+
		"	}"+
		"function setMonat(f) {"+
		"       jr = Math.floor(page/12);"+
		"       mo = f.monalist.selectedIndex;"+
		"       page = jr*12+mo;"+
                "       showSlide(page);"+
		"	}"+
		"function setStep(f) {"+
		"       step = steps[f.steplist.selectedIndex];"+
		"	}"+
		"</"+
		"SCRIPT>"+
			"</head>"+
		"<body bgcolor=white><font face=arial,helvetica>"+
                "  <H6><P ALIGN=Right>  Bundesamt f&uuml;r Seeschifffahrt und Hydrographie </H6><hl><div>");
	if (fixstep == '0'  && type == 'ICE_MAP_SH') write(
        	"<table align=center><img src="+"'" +bild+ "' name='anImage' width=449 height=511></table>");
	if (fixstep == '0'  && type == 'ICE_MAP_NH') write(
        	"<table align=center><img src="+"'" +bild+ "' name='anImage' width=432 height=636></table>");
	if (fixstep == '12'  && type == 'NRTSI_SH') write(
        	"<table align=center><img src="+"'" +bild+ "' name='anImage' width=449 height=511></table>");
	if (fixstep == '12'  && type == 'NRTSI_NH') write(
        	"<table align=center><img src="+"'" +bild+ "' name='anImage' width=432 height=636></table>");

                write(
        	"<br>&nbsp;<br>"+
		"<table border=0 width=100%>"+
		"<tr>"+
		"<th colspan =8><font size=2>Video Mode :</th></tr><tr>"+
		"<td align='center'><a href='javascript:first()'><img src='/aktdat/mk/icons/first.gif' name='First' alt='First' border=0></a></td>"+
		"<td align='center'><a href='javascript:fbwd()' ><img src='/aktdat/mk/icons/back.gif' name='Fback' alt='Play bwd' border=0></a></td>"+
		"<td align='center'><a href='javascript:sbwd()' ><img src='/aktdat/mk/icons/stepb.gif' name='Sback' alt='Step bwd' border=0></a></td>"+
		"<td align='center'><a href='javascript:stop()'><img src='/aktdat/mk/icons/stop.gif' name='Stop' alt='Stop' border=0></a></td>"+
		"<td align='center'><a href='javascript:sfwd()'><img src='/aktdat/mk/icons/stepf.gif' name='Sforw' alt='Step fwd' border=0></a></td>"+
		"<td align='center'><a href='javascript:ffwd()'><img src='/aktdat/mk/icons/forw.gif' name='Fforw' alt='Play fwd' border=0></a></td>"+
		"<td align='center'><a href='javascript:last()'><img src='/aktdat/mk/icons/last.gif' name='Last' alt='Last' border=0></a></td>"+
		"<td align='center'><a href='javascript:self.close()'><img src='/aktdat/mk/icons/ende.gif' name='Ende' alt='Close' border=0></a></td>"+
		"</tr>"+
		"</table>&nbsp;<br>\n");
	if (fixstep == '0') { write(
		"<table border=0 width=100%><tr>"+
		"<th colspan=3><font size=2>Select Step Year Month:</th></tr>"+
		"<tr>"+
		"<td><font size=2><form> <select name='steplist' value=0 onChange='setStep(this.form)'>"+
                "<option selected> each month </option>\n"+
                "<option> every 2nd month </option>\n"+
                "<option> each quarter </option>\n"+
                "<option> each year</option>\n"+
                "</select></form>\n"+
		"<p align=right><font size=1>&nbsp;"+
		"</td>\n"+
		"<td><font size=2><form> <select name='jahrlist' onChange='setJahr(this.form)'>");
	for ( l=0; l < parseInt(thisyear-1977); l++)   write("<option> "+liste[l]);
	write("</select></form>"+
		"<p align=right><font size=1>&nbsp;"+
		"</td>\n"+
		"<td><font size=2><form> <select name='monalist' onChange='setMonat(this.form)'>"+
                "<option selected> January </option>\n"+
                "<option> February </option>\n"+
                "<option> March </option>\n"+
                "<option> April </option>\n"+
                "<option> May </option>\n"+
                "<option> June </option>\n"+
                "<option> July </option>\n"+
                "<option> August </option>\n"+
                "<option> September </option>\n"+
                "<option> October </option>\n"+
                "<option> November </option>\n"+
                "<option> December </option>\n"+
                "</select></form>\n"+
		"<p align=right><font size=1>&copy; BSH Design KJ"+
		"</td>"+
		"</tr>"+
		"</table>\n");
		} // end fixstep= 0
	if (fixstep == '12') { write(
		"<table border=0 width=100%><tr>"+
		"<th><font size=2>Select Day:</th>"+
		""+
		"<td><font size=2><form> <select name='jahrlist' onChange='setJahr(this.form)'>");
	for ( l=0; l < parseInt(31); l++)   write("<option> "+daylist[l]);
	write("</select></form>"+
		"</td>\n"+
		"</tr>"+
		"</table>\n")};
	write("	 "+
		"</div></body></html>");
		
	close();
		}

	}

}
// from here all browsers -->
