var xmlHttp;

function GetXmlHttpObject()
{ 
	var objXMLHttp=null;
	if (window.XMLHttpRequest)
	{
	objXMLHttp=new XMLHttpRequest();
	}
	else if (window.ActiveXObject)
	{
	objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	return objXMLHttp;
}

function stateChanged() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("ilx_data").innerHTML=xmlHttp.responseText; 
	} 
} 


function getData(symb, level, doc){
    xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request");
		return;
	} 
	var start = document.getElementById("start_date").value;
	var end = document.getElementById("end_date").value;
	var symb = document.getElementById("symbol").value;
	var doc = document.getElementById("doc").value
	if(start==''){
		start = ' ';
	}
	if(end==''){
		end = ' ';
	}
	if(symb==''){
		symb = ' ';
	}
	var url='/id/' + doc + '/start/' + start + '/end/' + end + '/act_symb/' + symb + '/rnd/' + Math.random() + '/';
	xmlHttp.onreadystatechange=stateChanged; 
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function getComments(text){
	newWindow=window.open("","Comments", "resizable=no,scrollbars=yes,width=300,height=100"); //open blank window and write to it
	newWindow.document.open() //open document stream
	newWindow.document.write(text)
	newWindow.document.close()
	
	if (newWindow != null && newWindow.opener == null)
		newWindow.opener=window;
	newWindow.focus();
}

function showtip(current,e,text){
	if (document.all){
		thetitle=text.split('<br>')
		if (thetitle.length>1){
			thetitles=''
			for (i=0;i<thetitle.length;i++)
				thetitles+=thetitle[i]
				current.title=thetitles
			}
		else
			current.title=text
		}
	else if (document.layers){
		document.tip.document.write('<layer bgColor="white" style="border:1px solid black;font-size:12px;">'+text+'</layer>')
		document.tip.document.close()
		document.tip.left=e.pageX+5
		document.tip.top=e.pageY+5
		document.tip.visibility="show"
	}
}

function hidetip(){
	if (document.layers)
		document.tooltip.visibility="hidden"
}

function toggleTabs(id,parent) {
	
	var tabobj = document.getElementById(id);
	var divs = document.getElementsByTagName("div");

	for(i=0; i< divs.length; i++) {
		
		if( divs[i].parentNode.id == parent) {
			divs[i].className = "fL comp_subnav_tab";
		}
	}	
	
	if(tabobj.className=="fL comp_subnav_tab") {
		tabobj.className = "fL comp_subnav_active";
	}

}

function toggleSectionDivs(id,parent) {

	var sectobj = document.getElementById(id);
	
	var divs = document.getElementsByTagName("div");

	for(i=0; i< divs.length; i++) {
		
		if( divs[i].parentNode.id == parent) {
			divs[i].style.display = "none";
		}
	}	
	
	sectobj.style.display = "block";
}

