//////////////// Global Variables ////////////////
var site = "NJASB";
var section = "HOME";
var gnsSite = "app";
var affil_domain = "app";
var g_affilSstatId = "gpaper107";


//////////////// Pictopia Code ////////////////
var ptpServer = "www.pictopia.com";
var namespace = 'asburypark';
var PictopiaPaperId = 355;

function goPtp(artNo, title, imageUrl, caption) {
	if (imageUrl.match(/\&Ref=/)) {
		var ref = imageUrl.replace(/.*\&Ref=/,'');
		ref = ref.replace(/\&.*/, '');
		artNo += '-' + ref;
	}

	var loc = "http://pictopia.com/perl/ptp?provider_id="
		+ PictopiaPaperId
		+ "&photo_name="+ artNo
		+ "&title=" + title
		+ "&embedded=y"
		+ "&thumbnail_url=" + escape(imageUrl)
		+ "&fs_url=" + escape(imageUrl)
		+ (typeof(caption) != 'undefined' ? "&m_caption="+ escape(caption) : '');
		
		var ptpWin = window.open(loc, "_blank");
}


function goPtp_2(artNo, title, imageUrl) {
	var PictopiaPaperNS = 'asburypark';
	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"
            + "&thumbnail_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;
	}
}

/**************************************************************************
	ARTICLE TEXT SIZER
**************************************************************************/

function chgFont(dir) {
		if (!document.getElementById) return;
		
		fSize = parseInt(document.getElementById('article-txt').style.fontSize);
		
		if (!fSize) {
			fSize = 12;
		}
		
		switch (dir) {

			case "up":
				++fSize;
				break;
				
			case "down":
				--fSize;
				break;
				
			case "reset":
				fSize = 12;
		}
		
		document.getElementById('article-txt').style.fontSize = fSize + "px";
			
}

function txtSizeBar() {
 document.write('<div id="txtSizeBar"><strong>Text Size:</strong><a href="javascript:void(0);" onmouseover="window.status=\'Enlarge Text\'; return true;" onmouseout="window.status=\'\'; return true;" onclick="chgFont(\'up\'); this.blur();" title="Increase"><img src="/graphics/icons/font_increase.gif" width="16" height="16" alt="A+" border="0" /></a>|<a href="javascript:void(0);" onmouseover="window.status=\'Reset Text\'; return true;" onmouseout="window.status=\'\'; return true;" onclick="chgFont(\'reset\'); this.blur();" title="Normal"><img src="/graphics/icons/font_reset.gif" width="16" height="16" alt="A" border="0" /></a>|<a href="javascript:void(0);" onmouseover="window.status=\'Shrink Text\'; return true;" onmouseout="window.status=\'\'; return true;" onclick="chgFont(\'down\'); this.blur();" title="Decrease"><img src="/graphics/icons/font_decrease.gif" width="16" height="16" alt="A-" border="0" /></a></div>');
}



/**************************************************************************
	BOARDWALKS POPUPS
**************************************************************************/

function popUp(URL,wWidth,wHeight,type) {
		var wResize = 1;
		var wScroll = 0;
		var wLeft = 137;
		var wTop = 109;
		
		switch (type) {
			case "main":
				wWidth = 750;
				wHeight = 550;
				wResize = 1;
				break;
		
			case "article":
				wWidth = 450;
				wHeight = 300;
				wResize = 1;
				wScroll = 1;
				break;
			
			case "map":
				wWidth = 400;
				wHeight = 550;
				wResize = 1;
				wScroll = 1;
				break;
				
			case "video":
				wWidth = 460;
				wHeight = 325;
				break;
			
			case "slideshow":
				wWidth = 750;
				wHeight = 550;
				break;
		}
		
		eval("win_" + type + " = window.open(URL, '" + type + "', 'toolbar=0,scrollbars=" + wScroll + ",location=0,statusbar=0,menubar=0,resizable=" + wResize + ",width=" + wWidth + ",height=" + wHeight + ",left=" + wLeft + ",top=" + wTop + "');");
		
		eval("win_" + type + ".focus();");
}