// JavaScript Document

var popupLeft = 100;
var popupTop = 100;
var popupWidth  = 500;
var popupHeight = 500;
var popupAutoClose = true;
if (parseInt(navigator.appVersion.charAt(0))>=4){
	var isNN=(navigator.appName=="Netscape")?1:0;
	var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;
}
var optNN='width='+popupWidth+',height='+popupHeight+',left='+popupLeft+',top='+popupTop+',scrollbars=no';
var optIE='width=150,height=100,left='+popupLeft+',top='+popupTop+',scrollbars=no';

function popup(imgObj){
	var theImg=imgObj.src;
	theImg=theImg.replace(/w=/gi,'w=1024&old_w=').replace(/h=/gi,'h=768&old_h=');
	
	if (isNN){theWin=window.open('','',optNN);}
	if (isIE){theWin=window.open('','',optIE);}
	with (theWin.document){
		writeln('<html><head><title>Visar bild...</title><style>body{margin:0px;}</style>');
		writeln('	<'+'script>');
		writeln('		var isNN,isIE;');
		writeln('		if (parseInt(navigator.appVersion.charAt(0))>=4){');
		writeln('			isNN=(navigator.appName=="Netscape")?1:0;');
		writeln('			isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
		writeln('		function reSizeToImage(){');
		writeln('			if (isIE){');
		writeln('				window.resizeTo(300,300);');
		writeln('				width=300-(document.body.clientWidth-document.images[0].width);');
		writeln('				height=300-(document.body.clientHeight-document.images[0].height);');
		writeln('				window.resizeTo(width,height);}');
		writeln('			if (isNN){');       
		writeln('				window.innerWidth=document.images["mmImage"].width;');
		writeln('				window.innerHeight=document.images["mmImage"].height;}}');
		writeln('	</'+'script>');
		if (!popupAutoClose) 
			writeln('</head><body bgcolor="#ffffff" scroll="no" onLoad="reSizeToImage();self.focus()">')
		else
			writeln('</head><body bgcolor="#ffffff" scroll="no" onload="reSizeToImage();self.focus()" onblur="self.close()">');
		writeln('<img name="mmImage" src='+theImg+' style="display:block; cursor:pointer;" onclick="window.close();"></body></html>');
		close();		
	}
}

function fixPosition(elemName){
	var elem=document.getElementById(elemName);
	if(elem){elem.style.position='static';elem.style.position='relative'}
}
