function LoadUpMenu(SectionName)
{
	if(SectionName == "Nyheder")
	{
		window.parent.menu.document.location = "/menus/nyheder.htm";
	}

	if(SectionName == "Turneringen")
	{
		window.parent.menu.document.location = "/menus/turneringen.htm";
	}

	if(SectionName == "Traening")
	{
		window.parent.menu.document.location = "/menus/traening.htm";
	}

	if(SectionName == "Klubben")
	{
		window.parent.menu.document.location = "/menus/klubben.htm";
	}

	if(SectionName == "Kontakt")
	{
		window.parent.menu.document.location = "/menus/kontakt.htm";
	}

	if(SectionName == "Galleri")
	{
		window.parent.menu.document.location = "/menus/galleri.htm";
	}

	if(SectionName == "Admin")
	{
		window.parent.menu.document.location = "/menus/admin.htm";
	}

	if(SectionName == "Kalender")
	{
		window.parent.menu.document.location = "/menus/kalender.htm";
	}

	if(SectionName == "Hovedmenu")
	{
		window.parent.menu.document.location = "/menus/main.htm";
	}

	if(SectionName == "Kontingenter")
	{
		window.parent.menu.document.location = "/menus/kontingenter.htm";
	}

	if(SectionName == "Sponsorer")
	{
		window.parent.menu.document.location = "/menus/sponsorer.htm";
	}

	if(SectionName == "Registrering")
	{
		window.parent.menu.document.location = "/menus/registrering.htm";
	}

}

function CheckMenu(SectionName)
{
//	alert(window.parent.menu.MenuID + "\n" + SectionName);
	if(window.parent.menu.MenuID != SectionName)
	{
		LoadUpMenu(SectionName);
	}
}

function PrintLastModified()
{
	var Datostring = document.lastModified;
	var Dag=Datostring.substr(3,2);
	var MaanedTemp=Datostring.substr(0,2);
	var Aar=Datostring.substr(6,4);
	var Maanednavne = new Array("januar", "februar", "marts", "april", "maj", "juni", "juli", "august", "september", "oktober", "november", "december");

	if (MaanedTemp.substr(0,1) == 0)
	{
		MaanedTemp = MaanedTemp.substr(1,1);
	}

	if (Dag == "11" || Dag == "12" || Dag == "13")
	{
		var Denounce = "th";
	}
	else if (Dag.substr(1,1) == 1)
	{
		var Denounce = "st";
	}

	else if (Dag.substr(1,1) == 2)
	{
		var Denounce = "nd";
	}

	else if (Dag.substr(1,1) == 3)
	{
		var Denounce = "rd";
	}

	else
	{
		var Denounce = "th";
	}

	if (Dag.substr(0,1) == 0)
	{
		Dag = Dag.substr(1,1);
	}

	var MaanedInt = MaanedTemp-1;
	var Maaned = Maanednavne[(MaanedInt)];

	document.writeln(Dag + ". " + Maaned + ", " + Aar + ".");
}


function show_pagefooter()
{
	document.writeln('<HR WIDTH="100%" SIZE="1" noshade>');
	document.writeln('<TABLE WIDTH="100%" CLASS="pagefooter" CELPADDING=0 CELLSPACING=0><TR><TD VALIGN="TOP" CLASS="pagefooter">');
	document.writeln('Denne side er sidst opdateret ');
	PrintLastModified();
	document.writeln('<BR>Copyright &#169; HGI Basketball, 2006.<BR>HGI Basketball er en underafdeling af <a href="http://www.hgi.dk/" target="_blank">HGI</A>.');
	document.writeln('<BR><script language="JavaScript">InsertWebmasterEmail();</script>');
	document.writeln('</TD><TD VALIGN="TOP" ALIGN="RIGHT" CLASS="pagefooter">');
	document.writeln('<a href="javascript:nothing();"><img src="../../../pic/knap_udskriv.jpg" width="125" height="15" onClick="PrintDocument();" border="0"></a>');
	var tempstring = "<br><a HREF=\"javascript:Nothing();\" onClick=\"this.style.behavior='url(#default#homepage)';this.setHomePage('http://www.hilleroedbasket.dk/');\">";
	document.writeln(tempstring + '<img src="../../../pic/knap_homepage.jpg" width="125" height="15" border="0"></a>');
	document.writeln('</TD></TR></TABLE>');
}

function show_pagefooter_match_report()
{
	document.writeln('<HR WIDTH="100%" SIZE="1" noshade>');
	document.writeln('<TABLE WIDTH="100%" CLASS="pagefooter" CELPADDING=0 CELLSPACING=0><TR><TD VALIGN="TOP">');
	document.writeln('Denne side er sidst opdateret ');
	PrintLastModified();
	document.writeln('<BR>Copyright &#169; HGI Basketball, 2006.<BR>HGI Basketball er en underafdeling af <a href="http://www.hgi.dk/" target="_blank">HGI</A>.');
	document.writeln('<BR><script language="JavaScript">InsertWebmasterEmail();</script>');
	document.writeln('</TD><TD VALIGN="TOP" ALIGN="RIGHT">');
	document.writeln('<a href="javascript:nothing();"><img src="../../../pic/knap_udskriv.jpg" width="103" height="15" onClick="PrintDocument();" border="0"></a>');
	document.writeln('<BR><a href="../../resultater.asp"><img src="../../../pic/knap_tilbage_til_resultater.jpg" width="103" height="15" border="0"></a>');
	document.writeln('</TD></TR></TABLE>');
//	document.writeln('</SPAN>');
}

function PrintDocument()
{
	window.print();
}

function nothing()
{
}

function MatchReportFooter()
{
	document.writeln('<p align="CENTER">');
	document.writeln('<a href="../../resultater.asp"><img src="../../../pic/knap_tilbage_til_resultater.jpg" width="98" height="15" border="0"></a>');
	document.writeln('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;');
	document.writeln('<a href="javascript:nothing();"><img src="../../../pic/knap_udskriv.jpg" width="91" height="15" onClick="PrintDocument();" border="0"></a>');
}



/*
	-------------------------------------------
	FUNCTIONS FOR OPENING IMAGE IN A NEW WINDOW
*/

var image;
var urlquery;
var urlterms;
var img;
var imgheight;
var imgwidth;
	
function ViewImage(Url)
{
	window.open(Url, 'ImageWindow', "status=1,menubar=0,location=0,toolbar=0,directories=0,resizable=1,scrollbars=1");
}

function Pause(milliseconds)
{
	setTimeout("nothing()", milliseconds); 
}


function LoadImage()
{
	// Fetch relative path to image from URL

	urlquery = location.href.split("?")
	urlterms = urlquery[1].split(",")

	img = urlterms[0];
	image = new Image();
	image.src = img;

/*
	imgheight = image.height;
	imgwidth  = image.width;

	var WaitCounter;
	WaitCounter = 0;
	
	while(imgwidth == 0)
	{
		Pause(500);
		imgheight = image.height;
		imgwidth  = image.width;
		WaitCounter++;
		if(WaitCounter == 20)
		{
			document.location.reload();
		}
	}
*/
//	alert(img + ", " + image + ", " + imgheight + ", " + imgwidth);

	// Write image-tag with width and height included for smoother download
	document.writeln('<center><img src="' + img + '"></center>');
	document.writeln('<center class="txt"><a href="javascript:window.close()">Luk vinduet</A></center>');
}

function CreateImagePage()
{
	// Extract image width and height and decide window size

	imgheight = image.height;
	imgwidth  = image.width;

	var windowheight = imgheight + 120;
	var windowwidth = imgwidth + 35;
	
	// Check if window size exceeds screen resolution

	if (screen.availWidth <= windowwidth)
	{
		windowwidth = screen.availWidth - 5;
	}

	if (screen.availHeight <= (windowheight + 50))
	{
		windowheight = screen.availHeight;
	}

	// Adjust window size and center it

	window.resizeTo(windowwidth, windowheight);
	window.moveTo(((screen.availWidth - windowwidth) / 2), ((screen.availHeight - windowheight) / 2));
	window.focus();
	
//	pause(500);
	
	imgheight = image.height;
	imgwidth  = image.width;

	windowheight = imgheight + 120;
	windowwidth = imgwidth + 35;
	
	window.resizeTo(windowwidth, windowheight);
	window.moveTo(((screen.availWidth - windowwidth) / 2), ((screen.availHeight - windowheight) / 2));
}

function InsertWebmasterEmail()
{
	document.writeln('<img src=/pic/envelope.gif width=14 height=10 border=0 ALIGN="ABSMIDDLE"> <a href="#" onClick="OpenWebmasterEmail();">Kontakt webmaster</a>.');
}

function OpenWebmasterEmail()
{
	window.open('mailto:jahnsen@hgibasketball.dk', '_blank');
//	window.open(mailto:)document.writeln('<a href="mailto:jahnsen@hgibasketball.dk">kontakt Webmaster</a>.');
}