var myRequest = {
'tag': 'sunset'
};
// add disable clicks to the options
var myOptions = {
'disableDefaultEvents':[panoramio.events.EventType.PHOTO_CLICKED]
};
var widget = new panoramio.PhotoListWidget('wapiblock', myRequest, myOptions);
panoramio.events.listen(widget, panoramio.events.EventType.PHOTO_CLICKED, photoClicked);
widget.setPosition(0);// call after setting the listener
function photoClicked(event){
var photo=event.getPhoto();
if(photo){
MaximizeWindow(window.open(photo.getPhotoUrl())); // opens a new window
}
}
function MaximizeWindow(hWnd){
hWnd.moveTo(0,0);
hWnd.resizeTo(screen.width, screen.height);
}