// JavaScript Document
 
function getsub(currentid)
{
		/*if(Ajax.activeRequestCount>=2){
		alert("Too many requests made. If the problem persists please refresh the page and try again! !");
		return false;
	}*/	
	var url ="";	
//	url="getpagelist.php?id="+divIndex+"&selval="+selval+"&sid="+sid; //alert(url);	
	//alert(currentid);
	
	if(currentid==0)
	{
		url="/getsubpages.php?cid=0";
	}
	else
	{
		url="/getsubpages.php?cid="+currentid;
	}
	
	//$("imagehide").style.display="block";
	//$("list_container").hide();
	var ajaxObj= new Ajax.Request(url,{
			asynchronus:false,
			method: 'get',			
			onComplete: function(request){_onCompleteHandlerChild(request,currentid);}
			});			
	return false;
}
function _onCompleteHandlerChild(request,currentid){
	
	//$("imagehide").style.display="none";
	var arr1=document.getElementsByClassName('rowclass');
	var i =0;
	for(i=0;i<arr1.length;i++)
	{
		var obj = arr1[i];
		var a=obj.id;
		if(a!=currentid)
			obj.style.display="none";
	}

	$("divpage"+currentid).innerHTML =request.responseText;
	//$("rowpage"+currentid).className="rowclasson";
	$("rowpage"+currentid).show();

	
}

function getsub_main(currentid)
{
	/*	if(Ajax.activeRequestCount>=2){
		alert("Too many requests made. If the problem persists please refresh the page and try again !");
		return false;
	}*/		
	var url ="";	
	
	url="/getIndexPage.php?cid="+currentid;
	
	var ajaxObj= new Ajax.Request(url,{
			asynchronus:false,
			method: 'get',			
			onComplete: function(request){_onCompleteHandlerChild_main(request,currentid);}
			});			
	return false;
}

function _onCompleteHandlerChild_main(request,currentid){
	
	var obj = document.getElementById('t_content_current');
	obj.style.display = 'none';
	$("t_content_index").innerHTML = request.responseText;
	$("t_content_index").show();

	
}
