function popUp(obj, bredde, hoegde){
//	var bilde=new Image();
//	bilde.src=obj.href;
    var popUp=window.open("",'mywindow','width='+bredde+',height='+hoegde+',status=no');
	popUp.document.body.style.padding="0";
	popUp.document.body.style.margin="0";
	var bilde=popUp.document.createElement("img");
	bilde.onload=function(){
		if(bilde.width && bilde.height && bilde.width>0 && bilde.height>0){
			juster(popUp ,bilde.width, bilde.height);
		}
	};
	bilde.src=obj.href;
    while(popUp.document.body.hasChildNodes()){
	    popUp.document.body.removeChild(popUp.document.body.firstChild);       
    } 
	popUp.document.body.appendChild(bilde);
	popUp.moveTo(0,0);
	popUp.moveBy(200,20);
    popUp.focus();
    return false;
}

function juster(win ,nyBredde, nyHoegde){
    var indreBredde=0;
    var indreHoegde=0;

    if( typeof( win.window.innerWidth ) == 'number' ) {
        //Non-IE
        indreBredde = win.window.innerWidth;
        indreHoegde = win.window.innerHeight;
    } else if( win.document.documentElement && ( win.document.documentElement.clientWidth || win.document.documentElement.clientHeight ) ) {
        //IE 6+ in 'standards compliant mode'
        indreBredde = win.document.documentElement.clientWidth;
        indreHoegde = win.document.documentElement.clientHeight;
    } else if( win.document.body && ( win.document.body.clientWidth || win.document.body.clientHeight ) ) {
        //IE 4 compatible
        indreBredde = win.document.body.clientWidth;
        indreHoegde = win.document.body.clientHeight;
    }
    var x=nyBredde-indreBredde;
    var y=nyHoegde-indreHoegde;
    win.window.resizeBy(x, y);
}
