function popupPict(url, width, height)
{
   //alert("width: "+width + " height: "+ height);
   /*
   if (width == undefined || heigth == undefined)
   {
      width = 800;
      height = 600;
   }
   */
   width = (width < 315-20 ? 315 : width+20);
   height+=69;
   var win =  window.open( url, "Popup", "resizable=0,HEIGHT="+height+",WIDTH="+width+"\"");
   centerWindow(win, width, height);
}

function resizeWindow(width,height)
{
   width = (width < 315-20+6 ? 315+6 : width+20+6);
   height+=120;
   // IE gljux :
   if (navigator.appVersion.indexOf("MSIE")!=-1)
   {

      temp=navigator.appVersion.split("MSIE")
      version=parseFloat(temp[1])
      if (version < 7) height-=20; else height+=20;
      width+=3;
   }
   window.resizeTo(width, height);
   centerWindow(window,width-6, height-46);
}

function centerWindow(win, width, height)
{
   var ratio_x = screen.width/width
   var ratio_y = screen.height/height;
   win.moveTo((screen.width/2) - parseInt((screen.width/ratio_x)/2), (screen.height/2) - parseInt((screen.height/ratio_y)/2));
}

function popupNewsThumb(img_url, width, height)
{
   w = window.open("", "Popup", "resizable=0,HEIGHT="+height+",WIDTH="+width+"\"");
   var html = '<html><head><title>Bilde</title></head><body style = "margin:0px;"><img src = "'+img_url+'" width= "'+width+'" height = "'+height+'" alt = "" onClick = "window.close();" /></body> </html>';
   w.document.write(html);
}



