function NewWindow_photo1(mypage,myname,w,h,pos,infocus)
{
if(pos=="random"){myleft=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;mytop=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){myleft=(screen.width)?(screen.width-w)/2:100;mytop=(screen.height)?(screen.height-h)/2:100;}
else if((pos!='center' && pos!="random") || pos==null){myleft=0;mytop=20}
settings="width=" + w + ",height=" + h + ",top=" + mytop + ",left=" + myleft + ",scrollbars=yes,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=yes";

var arr_sections = mypage.split("/");
//document.write(arr_sections);
//document.write(arr_sections[arr_sections.length-1] + "<br/>");


var win=window.open("",myname,settings);
win.focus();

//win.document.write("<html><head><title>" + "Image Viewer" +"</title></head><body><p style='text-align:center'><b>" + arr_sections[arr_sections.length-1] + "</b></p><br/><img src='"+mypage+"'></body></html>");
win.document.write("<html><head><title>" + "Image Viewer" +"</title></head><body><img src='"+mypage+"'></body></html>");

}

function NewWindow_photo1_overriden(mypage,myname,w,h,pos,infocus)
{
alert('I am here with ' + myname);
}