// header stuff that needs to be done always
function header(){
	// jump out of frames
	if (window!=top){
		top.location.href=location.href;
	}
}

// do stuff for certain browsers
// variable 'name' can be any of the following:
//	'ie', shows 'get firefox' button for IE users (and ignores Opera masquerading as IE)
// 	'safari', shows friendly hello to Safari users
//	'ns4', bounces Netscape 4 users to upgrade page
function browser(name){
 	if (name=='ie'){
		this.ua = navigator.userAgent.toLowerCase(); 
		if ((navigator.appName=="Microsoft Internet Explorer")&&(this.ua.indexOf('opera') == -1)){
			document.write('<div style="float:right;position:relative;top:-1.5em;right:30px;"><a href="http://www.getfirefox.com"><img style="border:0px;" src="pics/image_firefox.png" title="Get FireFox - Take back the web!" alt="" /></a></div>')
		}
	}
	if (name=='safari'){
		if (navigator.vendor=="Apple Computer, Inc."){
			document.write('<div style="position:absolute;left:750px;top:10px"><img src="pics/image_safari.png" alt="" /></div>');
		}
	}
	if (name=='ns4'){
		if ((navigator.appName=="Netscape")&&(parseFloat(navigator.appVersion)<5)){
			window.location="browser.html";
		}
	}
}

// create popup windows for images
// three arguments are required:
//	'name', the name/location of the picture
//	'width'
//	'height'

function picture(name,width,height){
	var url='./pics/'+name;
	var windowname='window'+width+height;
	//if (navigator.vendor=="Apple Computer, Inc."){
	//	width=width+10;
	//	height=height+10;
	//}
	var parameters='width='+width+',height='+height+',resizable=yes';
	imgWin=window.open('',windowname,parameters) ;
	imgWin.window.document.write('<html><head><title></title></head>');
	imgWin.window.document.write('<body><a href="javascript:window.close()" title="Klik om te sluiten"><center><img src="'+url+'" border="0" alt="Foto" /></center></a></body>');
	imgWin.window.document.write('</html>');
	return false;
}
 

// make title of page a bit more descriptive
function title(){
 	var filename = location.search.substring(1); 
	filename = filename.substring(8);
	if (filename!="index" && filename!=""){
		var first = filename.substring(0,1).toUpperCase();
		var rest = filename.substring(1,filename.length).toLowerCase();
		filename = (first+rest)+' - ';	
		var title='<title>'+filename+'Apotheek Nauta</title>';
		document.write(title);
	}
}

// print current year
function date(){	
	var now=new Date();
	var year=now.getYear();
	if (year<2000){
		year=year+1900;
	}
	document.write(year);
}

// end
