var body_loaded = false;
var cs = null;
var wr;

var comment = 'pc-0';
var pid = 0;

document.onload = function() {

	body_loaded = true;

}

setTimeout("checkBody();", 100);

function fopen (e) {

	window.open ( e.src );

}

function checkBody() { 

	if ( !body_loaded )

		if ( e = document.getElementById("rmenu") ) 

			for (var i = 0; i < e.children.length; i++) {

				cs = e.children[i];
				if (cs.className == 'c' || cs.className == 'p') {

					cs.onmouseover = function(e) { this.className = "c"; }
					cs.onmouseout = function(e) { this.className = "p"; }
					cs.onclick = function(e) { document.location = this.children[0].children[0]; }

				}
			}

		else setTimeout("checkBody();", 100);

}

function cmt(id) { 

	if (comment != "e-" + id) {

		var pc = document.getElementById(comment);
		var ac = document.getElementById("pc-" + id);

		if (id) {

			comment = "e-" + id;
			ac.innerHTML = '<div class="postcomment" id="e-' + id + '">' + pc.innerHTML + '</div><div class="iehold"></div>';
			document.getElementById("aa-" + id).style.display = 'none';
			document.getElementById("ar-" + id).style.display = 'inline';
			document.getElementById("pc-0").className = '';
			document.getElementById("iehold").className = '';


		}
		else	{

			ac.innerHTML = pc.innerHTML;
			comment = "pc-0";
			document.getElementById(comment).className = 'postcomment';
			document.getElementById("iehold").className = 'iehold';

		}

		if (pid) {

			document.getElementById("aa-" + pid).style.display = 'inline';
			document.getElementById("ar-" + pid).style.display = 'none';
			document.getElementById("pc-" + pid).innerHTML = '';

		}
		else	pc.innerHTML = '';

		document.getElementById("parentid").value = id;

		pid = id;

	}


}

function zshared() {

	var Y = document.getElementsByClassName("b-share__text");
	try {
		Y[0].style.background = "url(/wp-content/themes/atmosphere-2010/images/b-share.png)";
		Y[0].style.backgroundRepeat = 'no-repeat';
	} catch (e) { }

	setTimeout("zshared()", 250);
}
setTimeout("zshared()", 250);
