// JavaScript Document

var reqObj = null;
function createRequest()
{
	try {
	   reqObj = new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch (err)	{
	   try {
		reqObj = new ActiveXObject("Microsoft.XMLHTTP");
	   }
	   catch (err2) {
		try {
		   reqObj = new XMLHttpRequest();
		}
		catch (err3) {
		   reqObj = null;
		}
	   }
	}
	return reqObj;
}

function calltext(str)
{
	xmlhttp = createRequest();
	if(xmlhttp != null)
	{
		// call open with GET or POST, the URL, and true for asynchronous
		xmlhttp.open("GET",str+"&rand="+Math.random(1,10), true);
		xmlhttp.onreadystatechange = calltextvalue;
		xmlhttp.send(null);
	}	
}
function page_nav_js(str)
{
	xmlhttp = createRequest();
	if(xmlhttp != null)
	{
		// call open with GET or POST, the URL, and true for asynchronous
		xmlhttp.open("GET",str+"&rand="+Math.random(1,10), true);
		xmlhttp.onreadystatechange = calltextvalue;
		xmlhttp.send(null);
	}	
}
var tabclicked = 1;
function calltextvalue()
{

	if (xmlhttp.readyState == 4) {
	  if (xmlhttp.status == 200) {
		 // document.getElementById("tabs").innerHTML = "<img src='{{config_hpath}}images/progress.gif' border='0' >";
		var text1  = xmlhttp.responseText;
		document.getElementById('tabs').innerHTML = text1;
		if(tabclicked == 0)
			location.href="#tabbs";
	  }
	}
}
function main_nav_js(str, tab, hm)
{
	if(hm == 0)
		tabclicked = 0;

  	document.getElementById('tab1').className = 'shadetabslk';
  	document.getElementById('tab2').className = 'shadetabslk';
  	document.getElementById('tab3').className = 'shadetabslk';
  	document.getElementById('tab4').className = 'shadetabslk';
	tab.className = 'selectedtab';
	categoryloadProgress()
	xmlhttp = createRequest();
	if(xmlhttp != null)
	{
		// call open with GET or POST, the URL, and true for asynchronous
		xmlhttp.open("GET",str+"&rand="+Math.random(1,10), true);
		xmlhttp.onreadystatechange = calltextvalue;
		xmlhttp.send(null);
	}	
}
