var RecaptchaOptions = {
   theme : 'white'
};

function renderCommentFrame(threadid) {
	//add header
	insertElt('div', 'scs_comments_' + threadid, 'scs_header_' + threadid);
	document.getElementById('scs_header_' + threadid).style.fontSize = '12px';	
	document.getElementById('scs_header_' + threadid).style.fontWeight = 'bold';	
	
	document.getElementById('scs_header_' + threadid).style.marginBottom = '10px';		
		
	document.getElementById('scs_header_' + threadid).innerHTML = '<div style="float:left;width:100%;" onclick="toggleElt(' + threadid + ')" id="scs_count_' + threadid + '"><div class="commbutton" id="scs_share_' + threadid + '" style="float:right"><a href="#scs_anchor_' + threadid + '">Share comments </a></div><div class="commbutton" id="scs_close_' + threadid + '" style="float:right;display:none"><a href="#scs_anchor_' + threadid + '">Close comments</a></div></div><div style="clear:both;" />';
	
	//add iframe
	insertIFrame('scs_comments_' + threadid, 'scs_container_' + threadid, '/scs/threadcomments.php?tid=' + threadid + '&rand=' + Math.random(2));
	document.getElementById('scs_container_' + threadid).style.display = 'none';
	document.getElementById('scs_container_' + threadid).style.width = '480px';
	document.getElementById('scs_container_' + threadid).style.height = '410px';	
}

function insertElt(elttype, parentid, neweltid) {
	var eltID = document.getElementById(parentid);  
	var newElt = document.createElement(elttype);
	newElt.id = neweltid;
	eltID.appendChild(newElt);
}

function insertIFrame(parentid, neweltid, src) {
	var eltID = document.getElementById(parentid);  
	var newElt = document.createElement('iframe');
	newElt.id = neweltid;
	newElt.name = neweltid;
	newElt.src = src;
	newElt.style.border = '0';
	eltID.appendChild(newElt);
}

function toggleElt(eltid) {
	if (document.getElementById('scs_container_' + eltid).style.display == 'none') {
		document.getElementById('scs_container_' + eltid).style.display = 'block';
		document.getElementById('scs_close_' + eltid).style.display = 'block';
		document.getElementById('scs_share_' + eltid).style.display = 'none';
	} else {
		document.getElementById('scs_container_' + eltid).style.display = 'none';
		document.getElementById('scs_close_' + eltid).style.display = 'none';
		document.getElementById('scs_share_' + eltid).style.display = 'block';
	}
}

function hidePanes() {
	document.getElementById('commentpane').style.display = 'none';
	document.getElementById('postpane').style.display = 'none';
	document.getElementById('helppane').style.display = 'none';
}

function showPane(paneid) {	
	if((paneid != 'postpane') && (paneid != 'commentpane') && (paneid != 'helppane')) {
		paneid = 'commentpane';
	}
	hidePanes();
	document.getElementById(paneid).style.display = 'block';
}