var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;

function openImg(img, width, height) {
	var x = (screen.availWidth - width) / 2;
	var y = (screen.availHeight - height - 100) / 2 ;

    var date = new Date();
    var inc = date.getSeconds();

    theURL = img;
    theName = 'win_' + inc;
    theScrollbars = 'scrollbars=no';
    theAttributes = 'location=no,status=no,resizable=no,scrolling=no,scrollbars=no,left=25,top=25,screenX=2,screenY=2,height=' + height + ',width=' + width;

    WindowObj = window.open(theURL,theName,theAttributes);
    
  	if(InternetExplorer) { WindowObj.moveTo(x,y); }

	WindowObj.focus()

}
