//  Browser detection
var nVer = navigator.appVersion;
var nAgt = navigator.userAgent;
var browserName  = navigator.appName;
var fullVersion  = ''+parseFloat(navigator.appVersion); 
var majorVersion = parseInt(navigator.appVersion,10);
var nameOffset,verOffset,ix;

// In MSIE, the true version is after "MSIE" in userAgent
if ((verOffset=nAgt.indexOf("MSIE"))!=-1) {
 browserName = "Microsoft Internet Explorer";
}
// In Opera, the true version is after "Opera" 
else if ((verOffset=nAgt.indexOf("Opera"))!=-1) {
 browserName = "Opera";
}
// In Chrome, the true version is after "Chrome" 
else if ((verOffset=nAgt.indexOf("Chrome"))!=-1) {
 browserName = "Chrome";
}
// In Safari, the true version is after "Safari" 
else if ((verOffset=nAgt.indexOf("Safari"))!=-1) {
 browserName = "Safari";
}
// In Firefox, the true version is after "Firefox" 
else if ((verOffset=nAgt.indexOf("Firefox"))!=-1) {
 browserName = "Firefox";
}
// In most other browsers, "name/version" is at the end of userAgent 
else if ( (nameOffset=nAgt.lastIndexOf(' ')+1) < (verOffset=nAgt.lastIndexOf('/')) ) 
{
 browserName = nAgt.substring(nameOffset,verOffset);
 if (browserName.toLowerCase()==browserName.toUpperCase()) {
  browserName = navigator.appName;
 }
}


//	Select style sheet 
	switch (browserName)
		{
		case "Firefox":
			document.writeln ("<link rel='stylesheet' type='text/css' href='css/munten_firefox.css'/>");
			function no_rightclick(e)
			{
				if ((document.layers||document.getElementById&&!document.all) && (e.which==2||e.which==3))
				{
				alert_message();
				return false;
				}
			}
			if (document.layers)
				{
				document.captureEvents(Event.MOUSEDOWN);
				document.onmousedown=no_rightclick;
				}	
			document.oncontextmenu=new Function("alert_message();return false");
		break;
		default:
			document.writeln ("<link rel='stylesheet' type='text/css' href='css/munten.css'/>");
			document.onmousedown=click;
			function click() 
				{
				if (event.button==2 || event.button==3) 
					{
					alert_message();
					}
				}	
		}


// Set alert message box when right mouse is clicked
	function alert_message()			
		{
		switch(pagelanguage)
			{
			case "uk":
				alert('This function is disabled by RX-Webdesign');
				break;
			case "nl":
				alert('Deze functie is uitgeschakeld door RX-Webdesign');
				break;
			case "uknl":
				alert('This function is disabled by RX-Webdesign / Deze functie is uitgeschakeld door RX-Webdesign');
				break;
			default:
				alert('This function is disabled by RX-Webdesign / Deze functie is uitgeschakeld door RX-Webdesign');
			}	
		}
			

// Functions for dropdown menus
function visiblemenu(elmnt)
  {
  document.getElementById(elmnt).style.visibility="visible";
  }
function hidemenu(elmnt)
  {
  document.getElementById(elmnt).style.visibility="hidden";
  }


// Set background sounds for lists with duplicates coins
//	if (pagetype == 1) 
//		{
//		if (destination == "dubbelen")
//			{
//			document.writeln("<bgsound src='sound/money.mid' loop=0>")
//			}
//		}

		
//  Goto top of the page
	function GotoTop(theUrl, windowprops)
		{
		var popup = window.open(theUrl, destination);
		}
		

//  Date last modified
	function file_modified_date(filedate)
		{
		var LastModDate = new Date(filedate);
		switch (pagetype)
			{
			case 1:
				document.write("<span id='tekst3'>");
			break;
			case 6:
				document.write("<span id='tekst3rood'>");  
			break;
			default:
				document.write("<span id='tekst3rood'>");
			}
		switch(pagelanguage)
			{
			case "uk":
			case "uknl":
				function initArray()
					{
					this.length = initArray.arguments.length;
					for (var i = 0; i < this.length; i++)
						this[i+1] = initArray.arguments[i];
					}
					var MOYArray = new initArray("January","February","March","April","May","June","July","August","September","October","November","December");
//					var LastModDate = new Date(filedate);
					document.write("Last update: ");
					switch (pagetype)
						{
						case 0:
						break;
						default:
							document.write("<br />"); 
						}	
					document.write(MOYArray[(LastModDate.getMonth()+1)]," ");
					document.write(LastModDate.getDate(),", ",(LastModDate.getFullYear()));
					document.write(".");
				break;
			case "nl":
			    function initArray()
			        {
					this.length = initArray.arguments.length;
						for (var i = 0; i < this.length; i++)
							this[i+1] = initArray.arguments[i];
					}
					var MOYArray = new initArray("januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december");
//					var LastModDate = new Date(filedate);
					document.write("Laatste update: ");
					switch (pagetype)
						{
						case 0:
						break;
						default:
							document.write("<br />"); 
						}
					document.write(LastModDate.getDate()," ");
					document.write(MOYArray[(LastModDate.getMonth()+1)]," ");
					document.write(LastModDate.getFullYear());
					document.write(".");
					break;
			}
		document.write("</span>");
		}

	
//  Jump to named tag in list
	function jmp(newLoc, windowprops)
		{
		var country = newLoc.options[newLoc.selectedIndex].value;
		var popup = window.open(country, destination);
		}


//  Open pop-up window with additional info or image		
	function detail_view(link) 
		{
		var type = link.slice(0,link.indexOf(".htm"));
		var size = "";
		switch (type)
			{
			case "commemoratives1": //euro preview
				size = "width=124,height=150,top=0,left=0";
			break;
			case "commemoratives2": // nl preview
				size = "width=584,height=250,top=0,left=0";
			break;
			case "nationalekant": // nat preview
				size = "width=520,height=540,top=0,left=0";
			break;
			case "uk_era": // era
			case "nl_era": // era
				size = "height=225,width=480,top=0,left=0";
			break;
			}
			var bookWindow = window.open(link, "new1", size);
			if (bookWindow.open) 
				{
				bookWindow.close;
				}
			}


//  Display disclaimer
	function disclaimer()
		{
		document.write("<span id='tekst3rood'>");
		switch(pagelanguage)
			{
			case "uk":
			case "uknl":
				document.write("Disclaimer: All hyperlinks on this page are checked before they were placed. However I can not except any liability for their proper functioning or the content of the related websites.");
			break;
			case "nl":	
				document.write("Disclaimer: Alle links op deze pagina zijn gecontroleerd voordat zij vermeld werden. Ik aanvaard echter geen aansprakelijkheid voor de werking of de inhoud van de betreffende sites.");
				break;
			}	
		document.write("</span>");
		}



//	Link page header
	function linkpage_header(header_label)
		{
		document.write("<tr><td class='pagina_rij1'>");
		document.write("<table class='links_header'><tr><td class='header_links>");
		file_modified_date(document.lastModified);
		document.write("</td><td class='header_midden'>");
		document.write("<span id='tekst1rood'>");
		document.write(header_label);
		document.write("</span></td><td class='header_rechts'>&nbsp;</td></tr></table>");
		disclaimer();
		document.write("</td></tr>");
		}
		
		
//  Display page header
	function display_header(header_label_1, header_label_2, page_language)
		{
		document.write  ("<tr><td class='pagina_rij1'>");
		document.write  ("<table class='links_header' border=0>");
		document.write  ("<tr><td class='header_links'><span id='tekst3rood'>");
		file_modified_date(document.lastModified);
		document.write  ("</span></td><td class='header_midden'><span id='tekst1rood'>");
		document.write  (header_label_1);
		if (header_label_2 == "disclaimer")
			{
			document.write("<br />");
			disclaimer();
			header_label_2 = ""			;
			}
		document.write  ("</span></td><td class='header_rechts'>");
		document.write  (header_label_2);
		document.write  ("</td></tr></table></td></tr>");
		}


// Display right part of duplicates header
	function display_duplicates_header(TopOfPage, pagelanguage)
		{
		filename = "excelfiles/"+TopOfPage.slice(0,TopOfPage.indexOf(".htm"))+".xls";
		switch(pagelanguage)
			{
			case "uk":
				download = "Download duplicates as Excel file";
				monitor  = "Monitor this page for changes";
				button   = "Monitor changes";
			break;
			case "nl":
				download = "Download lijst als Excel bestand";
				monitor  = "Monitor deze pagina voor wijzigingen";
				button   = "Monitor wijzigingen";
			break;
			}
		document.writeln("<td class='header2' rowspan='3'>");
		file_modified_date(document.lastModified);
		document.writeln("</td><td class='header3' rowspan='3'><a target='_new' href="+filename+"><img src='graphics/excel.gif' alt='"+download+"'></a>");
		document.writeln("</td><td class='header4'>");
//      <!-- Begin ChangeDetection.com Panel HTML -->
		document.writeln("<!-- ChangeDetection.com id=d8jkmqzvdq -->");
		document.writeln("<span id='tekst3'>"+monitor+"</span></td></tr>");
		document.writeln("<tr><td class='header4'><form action='http://www.ChangeDetection.com/detect.html' method='get' target=ChangeDetectionWiz>");
		document.writeln("<input type='submit' name='enter' value='"+button+"' onclick='window.open('','ChangeDetectionWiz','resizable=yes,scrollbars=yes,width=624,height=460');return true'>");
		document.writeln("</td></tr>");
		document.writeln("<tr><td class='header4'><span id='tekst3'>");
		document.writeln("<a href='http://www.ChangeDetection.com/privacy.html' target=ChangeDetectionPrivacy onclick='window.open('http://www.ChangeDetection.com/privacy.html', 'ChangeDetectionPrivacy', 'resizable=yes,scrollbars=yes,width=624,height=400');return false'>");
		document.write   ("it's private");
		document.writeln("</a>&nbsp;by&nbsp;<a href='http://www.ChangeDetection.com/' target=_blank>ChangeDetection</a></span></td></tr></form>");
//      <!-- End ChangeDetection.com Panel HTML -->
		document.writeln ("</tr></table>");
		} 

//  Display page header and body
	function display_header_body(TopOfPage)
		{
		document.writeln("<tr><td class='pagina_rij1'  style='height: 530px'>");
		document.writeln("<iframe class='midden' allowtransparency='1' frameborder='0' name='header' scrolling='no' target='inhoud'");
		document.writeln("src=" + TopOfPage.slice(0,TopOfPage.indexOf("#"))+ ">");
		document.writeln("</iframe>");
		document.writeln("</td></tr>");
		}
		
		
//  Display page body
	function display_body(TopOfPage)
		{
		document.writeln("<tr><td class='pagina_rij2'>");
		document.writeln("<iframe class='midden' allowtransparency='1' frameborder='0' name='dubbelen' scrolling='auto' target='inhoud'");
		document.writeln("src=" + TopOfPage.slice(0,TopOfPage.indexOf("#"))+ ">");
		document.writeln("</iframe>");
		document.writeln("</td></tr>");
		}
		
		
//  Display buttons
	function display_buttons(pagelanguage)
		{
		document.writeln("<tr><td class='pagina_rij3'>");
		document.writeln("<iframe class='onder' allowtransparency='1' frameborder='0' name='knoppen' scrolling='no'");
		switch(pagelanguage)
			{
			case "uknl":
			case "uk":
				document.writeln("src='buttons.htm'");
			break;
			case "nl":
				document.writeln("src='knoppen.htm'");
			break;
			}
		document.writeln("target='inhoud'></iframe></td></tr>");
		}
		
		
		
