/* BROWSER WINDOW CONTROLS */

/* : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : function
- launch a popup window
- when adding a scrollbar increase (+) width by [ 16px ]
- example:
<a href="#" onclick="windowOpen('__URL__','__NAME__',655,500,0,0);"> - link - </a><br />
*/
function windowOpen(url, name, width, height, scroll, resize) {
	if (scroll == "") { scroll = "0"; }
	if (resize == "") { resize = "0"; }
	var options = "width=" + width + ",height=" + height + ",status=0,toolbar=0,menubar=0,location=0,scrollbars=" + scroll + ",resizable=" + resize;
	
	window.open(url,name,options);	// self.focus();
	return false;
}


/* : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : function
- link from popup to parent browser
- example:
<a href="#" onclick="toParent('url.html');"> - link - </a><br />
*/
function toParent(url) {
    opener.location.href = url; 
    window.close();
}


/* : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : function
- Ad refresh function for Story Maker templates.
- rotate_count controls how often an ad should be refreshed
*/
var nav_click_count = 0;
var rotate_count = 3;
function onShowNewFocus(id, oldFocus, newFocus) {
	nav_click_count++;
	if (nav_click_count == rotate_count) {
		nav_click_count = 0;
		interactiveReload();
	}

}
/* END CONTROLS */