// Javaskript created by Peter Sang 2005

function getLanguage() {
	var i = 0;
	var query = "";
	i++;
	while (location.search.substring(i,i+1) != "") {
		query += location.search.substring(i,i+1);
		i++;
	};
	return query;
};
var langu = getLanguage();

function imgAlt() {
	var imgarr = document.getElementsByTagName('img');
	var i;
	for (i=0;i<imgarr.length;i++){
		if (imgarr[i].alt == "Klicka för större bild"){imgarr[i].alt = "Click to enlarge"};
	}
}

function mouseDown(e) {
	var msg = 'Vill du skriva ut den här sidan?';
	if (langu == "en"){msg = 'Do you want to print this page?'};
	if (parseInt(navigator.appVersion)>3) { 
		var clickType=1; 
		if (navigator.appName=="Netscape") clickType=e.which; 
		else clickType=event.button; 
		if (clickType!=1) { ans=confirm (msg)
			if (ans) { window.print(); }
		return false; } } 
	return true; } 
	if (parseInt(navigator.appVersion)>3) { 
		document.onmousedown = mouseDown; 
		if (navigator.appName=="Netscape") 
		document.captureEvents(Event.MOUSEDOWN); 
	}

function fixdat(dat){
	var dat = new Date(dat);
	var year = dat.getFullYear();
	var month = dat.getMonth() + 1;
	var day = dat.getDate();
	if (month < 10){month = "0" + month};
	if (day < 10){day = "0" + day};
	return (year + "-" + month + "-" + day);
}

function popup(FILE,txt,vidd,hojd) { 
	CONTENT = "<HTML><HEAD><TITLE>" + txt + "</TITLE></HEAD><BODY><CENTER><IMG SRC='" + FILE + "' BORDER=0><FORM><input type='button' value='Uppdatera' name='Btn' onclick='javascript:window.location.reload( true )'> <INPUT TYPE='BUTTON' VALUE='Stäng' onClick='window.close()'></FORM></CENTER></BODY></HTML>";
	pop = window.open("","",'width=' + vidd + ',height=' + hojd +',menubar=no,toolbar=no,status=no,location=no,resizable=yes,scrollbar=no');
	pop.document.open();
	pop.focus();
	pop.document.write(CONTENT);
	pop.document.close();
} 

function Npage(filnamn){
	var prnmsg = "Skriv ut";
	var bckmsg = "Tillbaka";
	if (langu == "en"){prnmsg = "Print"; bckmsg = "Back";};
	if (navigator.appName=="Microsoft Internet Explorer"){
		NewPage=document.open("");
		NewPage.write("<HTML><HEAD><TITLE>"+filnamn+"</TITLE></HEAD><BODY>");
		NewPage.write("<p align='center'><img src='"+filnamn+"'></p>");
		NewPage.write("<p align='center'><input type='button' value='<- " + bckmsg + "' name='Btn' onClick='JavaScript:history.back()'> <input type='button' value='" + prnmsg + "' name='Prn' onClick='JavaScript:window.print();'></p>");
		NewPage.write("</BODY></HTML>");
		NewPage.document.close();
	}else{
		window.open(filnamn)
		//CONTENT = "<HTML><HEAD><TITLE>Pict</TITLE></HEAD><BODY><CENTER><IMG SRC='" + filnamn + "' BORDER=0><FORM><INPUT TYPE='BUTTON' VALUE='Stäng' onClick='window.close()'></FORM></CENTER></BODY></HTML>";
		//pop = window.open("","",'width=1500,height=1000,menubar=no,toolbar=no,status=no,location=no,resizable=yes,scrollbar=no');
		//pop.document.open();
		//pop.focus();
		//pop.document.write(CONTENT);
		//pop.document.close();
	};
}

function ShowObj(obj,show){
	var vis = "hidden";
	if (show) {vis = "visible"};
	if (document.getElementById) {
		document.getElementById(obj).style.visibility = vis;
	} else if (document.all) {
		document.all[obj].style.visibility = vis;
	} else if (document.layers) {
		document[obj].visibility = vis;
	}
}

function AniBtn(btnText,link,btnWidth,btnHeight,scriptPath){
	if (typeof(scriptPath) == "undefined"){ scriptPath="" };
	document.write("<applet code='fphover.class' codebase='" + scriptPath + "./script' width='" + btnWidth + "' height='" + btnHeight + "'>");
	document.write("<param name='textcolor' value='#FFFFFF'>");
	document.write("<param name='text' value='" + btnText + "'>");
	document.write("<param name='effect' value='glow'>");
	document.write("<param name='url' valuetype='ref' value='" + link + "'>");
	document.write("<param name='color' value='#0000FF'>");
	document.write("<param name='hovercolor' value='#FF0000'>");
	document.write("</applet>");
}
