// @(#) Default Java Script library for the website www.e-bachmann.dk
// @(#) Edited by Erik Bachmann (e_bachmann@hotmail.com

site="http://www.e-bachmann.dk"
window.onresize = new Function("window.location.reload()")

//*** Title ***
function write_title()
{
	//doc_title = "<H1>" + document.title + "</H1>"
	doc_title = " " + document.title + " "
	
	document.write( doc_title ) ;
}//*** write_title() ***


//*** Header ***
function write_header()
{
	var header = "<P><IMG ALIGN=Right SRC='/pics/howdysm.gif'>" +
	"<A HREF='index.htm'>Til forsiden</A>" +
	"| <A HREF='javascript:history.back()'>Back</A></P>"

	document.write( header ) ;
}	//*** write_header() ***

function two_digit(value)
{
	var newvalue = "";
	if ( value <= 9 )
	{
		//document.write( '0' )
		newvalue += '0' ;
	}
//	document.write( value )
	newvalue += value ;
	return newvalue
}	//*** two_digit() ****

function iso_lastModified()
{
	var isodate = new Date(Date.parse(document.lastModified)) 
	
	var datestr = isodate.getFullYear() 

	datestr += '-' + two_digit( isodate.getMonth() ) ;

	datestr += '-' + two_digit( isodate.getDate() )

	datestr += '/' + two_digit( isodate.getHours() )

	datestr += ':' + two_digit( isodate.getMinutes() )

	datestr += ':' + two_digit( isodate.getSeconds() )
	
	return datestr 
}	//*** iso_lastModified() ***


//*** Footer ***
function write_footer( value )
{
	var img_height	= 64
	var img_width	= 64

	var logo_height	= 48
	var logo_width	= 90

	if ( ! value )
	{
		value = iso_lastModified() ;
	}
	
	footer = 
	"<!--HR--><!-- Horsontal line ------------------------------------>"
+	"<TABLE BORDER=0 ID='footer' name='footer' class='footer' WIDTH='100%'>"
+	"<TR>"
+	"	<TD ALIGN=Left VALIGN=MIDDLE><SPAN>"	
+	"		[" + value + "] / "
+	"		<A HREF='MailTo:e_bachmann@hotmail.com?subject="
+	document.title
+	"&body="
+	document.URL
+	"'>Erik Bachmann</A>" 
+	"</SPAN>"
+	"	</TD>"
+	"	<TD ALIGN=RIGHT VALIGN=MIDDLE>" 
+	"	<SPAN>URL: <a href=\""
+	document.URL
+	"\" tooltip='A link to the current page'>"
+	document.URL
+	"	</SPAN></a>"
+	"	</TD>"
+	"</TR>"
+	"</TABLE><!--HR-->"
	
	// *** footer ***

	document.write( footer ) ;
}	//*** write_footer() ***

//	"	<TD ALIGN=RIGHT VALIGN=MIDDLE>" +
//	"		<SPAN CLASS='footer' ID='txt'>This page is hosted by "+
//	"		<A HREF='http://www.ehuset.com'>"+
//	"		<IMG SRC='/pics/ehuset.gif' BORDER=0 align=center width=" + logo_width + " height=" + logo_height + " ALIGN=ABSMIDDLE></A></SPAN>"+
//	"	</TD>"+


//function GoHome( Navn )
//{
//        // Hvis der *ikke* findes en ramme (frame) med navnet Main
//        if (!top.main)
//        {
////		window_b = window.open("", "window_b","height=toolbar=yes,statusbar=yes");
//                // Genskriv skærmbillede med rammer
//		document.writeln("<SCRIPT LANGUAGE='JavaScript1.2' SRC='/bin/e-bachmann.js'></SCRIPT>");
//		document.writeln("<LINK REL=STYLESHEET HREF='/bin/e-bachmann.css' TYPE='text/css'>");
//
////                document.writeln("<FRAMESET frameborder=no ROWS=\"100%\" COLS=\"25%,*\">") ;
//                document.writeln("<FRAMESET ROWS=\"100%\" COLS=\"25%,*\">") ;
//                document.writeln("<FRAME NAME=\"menu\" SRC=\"/menu.htm\" SCROLLING=\"AUTO\">") ;
////                document.writeln("<FRAME NAME=\"main\" SRC=\"" ) ;
//                // Vis det kaldende dokument i siderammen
////                document.writeln( Navn ) ;
////                document.writeln( "\" SCROLLING=\"AUTO\">")
//		document.write("<FRAME NAME=\"main\" SRC=\"" + Navn + "\" SCROLLING=\"AUTO\">")
//		document.write("<script>frame.location.reload();</SCRIPT>")
//
//                document.writeln("</FRAMESET>");
//		document.writeln("<NOFRAMES>Please enable frames to view this page</NOFRAMES></HTML>");
//        }
//}       // GoHome()

// gohome.js
/********************************************************************************
 GoHome()
 Tester om der findes en ramme med navnet "Main" i det aktuelle vindue.
 Hvis IKKE gentegnes vinduet med to rammer og det kaldende dokument læses
 ind i siderammen.
********************************************************************************/
function GoHome2( Navn )
{
        // Hvis der *ikke* findes en ramme (frame) med navnet Main
        if (!top.main)
        {
        	
                // Genskriv skærmbillede med rammer
		document.writeln("<SCRIPT LANGUAGE='JavaScript1.2' SRC='/bin/e-bachmann.js'></SCRIPT>");
		document.writeln("<LINK REL=STYLESHEET HREF='/bin/e-bachmann.css' TYPE='text/css'>");

//                document.writeln("<FRAMESET frameborder=no ROWS=\"100%\" COLS=\"25%,*\">") ;
                document.writeln("<FRAMESET ROWS=\"100%\" COLS=\"25%,*\">") ;
                document.writeln("<FRAME NAME=\"menu\" SRC=\"/menu.htm\" SCROLLING=\"AUTO\">") ;
//                document.writeln("<FRAME NAME=\"main\" SRC=\"" ) ;
                // Vis det kaldende dokument i siderammen
//                document.writeln( Navn ) ;
//                document.writeln( "\" SCROLLING=\"AUTO\">")
		document.writeln("<FRAME NAME=\"main\" SRC=\"" + Navn + "\" SCROLLING=\"AUTO\">")
		document.writeln("</FRAMESET>");
		document.writeln("<NOFRAMES>Please enable frames to view this page</NOFRAMES></HTML>");
        }
}       // GoHome()


/********************************************************************************
 UTCtime()
 Updates UTC time information in isoclock form

	<body onload="UTCtime()">

	[<form name=isoclock>
		<input type=text name=display size=50 style="border:0;"> 
	</form>]
********************************************************************************/

function UTCtime()
{
	var today = new Date();
	var year  = today.getYear();
	if (year < 2000)    // Y2K Fix, Isaac Powell
		year = year + 1900; // http://onyx.idbsu.edu/~ipowell
	var month = today.getMonth() + 1;
	var day  = today.getDate();
	var hour = today.getHours();
	var hourUTC = today.getUTCHours();
	var minuteUTC = today.getUTCMinutes();
	var second = today.getSeconds();

	if (month <= 9)
		month = "0" + month;
	if (day <= 9)
		day = "0" + day;
	if (hourUTC <= 9)
		hourUTC = "0" + hourUTC;
	if (minuteUTC <= 9)
		minuteUTC = "0" + minuteUTC;
	if (second <= 9)
		second = "0" + second;


	time = year
	+	"-"
	+	month
	+	"-"
	+	day
	+	"T"
	+	hourUTC
	+	":"
	+	minuteUTC
	+	":"
	+	second
	+	"Z";

	document.isoclock.display.value = time;
	window.setTimeout("UTCtime();", 500);
}	//*** UTCtime() ***



//*** End Of File *****************************************************************/
