if (window.attachEvent) {window.attachEvent('onload', shared);}
else {window.addEventListener('load', shared, false);}


function shared() {
	opener();
}

function opener() {
	var links = document.getElementsByTagName('a');
	for (i=0;i<links.length;i++) {
		var linkclass = links[i].className;
		if (linkclass.search('opener') != -1) {
			links[i].onclick = function() {
				var thisclass = this.className;
				if (thisclass.search('closed') != -1) {
					this.className = thisclass.replace(/\bclosed\b/,'open');
					
				} else {
					this.className = thisclass.replace(/\bopen\b/,'closed');
				}
				this
				var divs = this.parentNode.getElementsByTagName('div');
				for (x=0;x<divs.length;x++) {
					var divclass = divs[x].className;
					if (divclass.search('opener-popup') != -1) {
						if (divs[x].style.display == '' || divs[x].style.display == 'none') {
							divs[x].style.display = 'block';
						} else {
							divs[x].style.display = 'none';
						}
					}
				}
				return false;
			}
		}
	}
}

function publishDraft() {
	document.vbform.status.value = 'publish_now';
	document.vbform.submit();
}

function confirmDelete() {
	var answer = confirm('Are you sure you wish to delete this post? This action cannot be undone.');
	if (answer) {
		return true;
	} else {
		return false;
	}
}


