// JavaScript Document
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function PopupPic(strURL) { 
    window.open('image_viewer.aspx?img='+strURL,'imgViewer','width=400,height=400,resizable,scrollbars=no,status=0');
} 

//FOLLOWING FUNCTION RESIZES POPUP WINDOW TO SAME DIMENSIONS AS THE IMAGE THAT IT CONTAINS
function fitPic() {
    window.moveTo(200,200);
    if (window.innerWidth){
        iWidth = window.innerWidth;
        iHeight = window.innerHeight;
    }else{
        iWidth = document.body.clientWidth;
        iHeight =document.body.clientHeight;
    }
    iWidth = document.images[0].width - iWidth;
    iHeight = document.images[0].height - iHeight;
    window.resizeBy(iWidth, iHeight);
};
