var currOpenFrm = '';
function replyform()
{
	if(currOpenFrm != '')
	{
		if(currOpenFrm == arguments[0])
		{
			document.getElementById('addmessage'+arguments[0]).style.display = 'none';
			currOpenFrm = '';
		} else {
			document.getElementById('addmessage'+currOpenFrm).style.display = 'none';
			document.getElementById('addmessage'+arguments[0]).style.display = 'block';
			currOpenFrm = arguments[0];
		}
	} else {
		document.getElementById('addmessage'+arguments[0]).style.display = 'block';
		currOpenFrm = arguments[0];
	}
	return false;
}
var currentChildren = '';
function showReplys()
{
	if(currentChildren != '')
	{
		if(currentChildren == arguments[0])
		{
			newstyle = 'questiontitlehide';
			currentChildren = '';
			changeClass(arguments[0],newstyle);
		} else {
			newstyle = 'questiontitle';
			currentChildren = arguments[0];
			changeClass(arguments[0],newstyle);
		}
	} else {
		currentChildren = arguments[0];
		newstyle = 'questiontitle';
		changeClass(arguments[0],newstyle);
	}
	
	return false;
}

function changeClass()
{
	try
	{
		var children = getElementsByName_iefix('div',arguments[0]);
		
		var childrens = document.getElementsByTagName(arguments[0]); 
		//alert(elements.length + ' ' + arguments[0]);
		for(x = 0;x < children.length;x++)
		{
			newclass = (children[x].className == 'questiontitle')?'questiontitlehide':'questiontitle';
			//alert(children[x].className + ' ' + newclass);
			children[x].className = newclass;
		}
	} catch(e) {
		aler(e.message);
	}
}
function getElementsByName_iefix(tag, name) {
	var elem = document.getElementsByTagName(tag);
	var arr = new Array();
	for(i = 0,iarr = 0; i < elem.length; i++) {
		att = elem[i].getAttribute("name");
		if(att == name) {
		     arr[iarr] = elem[i];
		     iarr++;
		}
	}
	return arr;
} 
function addentryajax()
{
	var divContent = document.getElementById(arguments[0]+'_holder').innerHTML;
	divContent += '<div style="border solid 5px red">some new content</div>';
	//document.getElementById(arguments[0]+'_holder').innerHTML = divContent;
	//alert(divContent);
	return true;
}