/*
Elxis CMS - plugin pagebreak
*/

function pgbreakOnLoadInterface() {
	if (!document.getElementById('conpgbraddlink')) { return; }
	document.getElementById('conpgbraddlink').addEventListener('click', function(e){ e.preventDefault(); addPluginCode('{pagebreak}{/pagebreak}'); }, false);
}

if (document.getElementById('conpgbraddlink')) {
	pgbreakOnLoadInterface();
} else {
	if (document.readyState != 'loading') {
		pgbreakOnLoadInterface();
	} else if (document.addEventListener) {
		document.addEventListener('DOMContentLoaded', function(){ pgbreakOnLoadInterface(); });
	} else {
		document.attachEvent('onreadystatechange', function() { if (document.readyState == 'complete') { pgbreakOnLoadInterface(); } });
	}
}
