var PictopiaPaperId = morristown;     // You MUST replace your pictopia id!


function goPtp(artNo, title, imageUrl) {
	var PictopiaPaperNS = 'morristown';
	var newWindow = true;
	
	if (imageUrl.match(/\&Ref=/i)) {
		var ref = imageUrl.replace(/.*\&Ref=/,'');
      	ref = ref.replace(/\&.*/, '');
		artNo += '-' + ref;
	}
	var loc = "http://pictopia.com/perl/ptp/" + PictopiaPaperNS 
            + "?photo_name=" + artNo 
            + "&title=" + title
            + "&embedded=y"
            + "&t_url=" + escape(imageUrl)
            + "&fs_url=" + escape(imageUrl);

	if (newWindow) {
		//to open in a new window
		var  win = window.open(loc, 'ptp');
		win.focus();
	} else {
		// to open in same window:
		location.href = loc;
	}
}