var height = screen.height;
var width = screen.width;
var leftpos = width / 2 - 50;
var toppos = height / 2 - 50;
function encode(str){ // Netscape fix thanks to Cyanide_7
return escape(str.replace(/ /g,'+'));
}
function view(what) {
//var url = 'viewer.html?pic='+encode(what);
window.open(what,'WIN','scrollbars=no,status=no,toolbar=no,resizable=yes,location=no,menu=no,width=300,height=300,left=' + leftpos + ',top=' + toppos);
}
function view_vr(what) {
window.open(what,'WIN','scrollbars=no,status=no,toolbar=no,resizable=yes,location=no,menu=no,width=400,height=250,left=' + leftpos + ',top=' + toppos);
}
function resize(h,w) {
 var name = navigator.appName
 if (name == "Microsoft Internet Explorer") {
   myHeight = h + 30;
   myWidth = w + 12;
 }
 else if (name == "Opera") {
   myHeight = h + 29;
   myWidth = w + 10;
 }
 else if (navigator.userAgent.indexOf("Gecko") != -1) {
   myHeight = h + 29;
   myWidth = w + 10;
 }
 else {
   myHeight = h;// + 9;
   myWidth = w;
 } 
 var height = screen.height;
 var width = screen.width;
 var leftpos = width / 2 - myWidth / 2;
 var toppos = height / 2 - myHeight / 2;
 self.moveTo(leftpos, toppos);
 self.resizeTo(myWidth, myHeight);
}


