function switchText(php_page, ID1, ID2, divID, pointer)
{
	var obj = document.getElementById(divID);
	var url = php_page;
	var xmlHttp = null;
	var randomnumber=Math.floor(Math.random()*1001)

	try
	  {
		  // Firefox, Opera 8.0+, Safari
		  xmlHttp=new XMLHttpRequest();
	  }
	catch (e)
	  {
	  // Internet Explorer
	  try
	    {
	    	xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
	    }
	  catch (e)
	    {
	    	xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
	    }
	  }

	url=url+"?id1="+ID1;
	url=url+"&id2="+ID2;
	url=url+"&pointer="+pointer;
	url=url+"&x="+randomnumber;


	if (xmlHttp) {
		xmlHttp.open("GET",url,true);
	}

	xmlHttp.onreadystatechange= function()
	{
		if (xmlHttp.readyState == 4 && xmlHttp.status == 200)
		{
			obj.innerHTML=xmlHttp.responseText;
			delete xmlHttp;
			xmlHttp = null;
		}
	}
	xmlHttp.send(null);
}

function showWhy(str, divID)
{
	xmlHttp = GetXmlHttpObject();

	var url = str;
	var obj = document.getElementById(divID);
	xmlHttp.onreadystatechange=function()
	{
		if (xmlHttp.readyState==4)
		{
			obj.innerHTML=xmlHttp.responseText;
		}
	}
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function switchTextNew(php_page, ID1, ID2, divID, pointer)
{
	xmlHttp = new GetXmlHttpObject();
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request");
		return;
	}
	var obj = document.getElementById(divID);
	var url=php_page;
	url=url+"?id1="+ID1;
	url=url+"&id2="+ID2;
	url=url+"&pointer="+pointer;
	xmlHttp.open("GET",url,true);
	xmlHttp.onreadystatechange= function()
	{
		if (xmlHttp.readyState==4)
		{
			obj.innerHTML=xmlHttp.responseText;
			delete xmlHttp;
			xmlhttp = null;
		}
	}

	xmlHttp.send(null);
}

function GetXmlHttpObject()
{
	var xmlHttp=null;
	try
	  {
		  // Firefox, Opera 8.0+, Safari
		  xmlHttp=new XMLHttpRequest();
	  }
	catch (e)
	  {
	  // Internet Explorer
	  try
	    {
	    	xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
	    }
	  catch (e)
	    {
	    	xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
	    }
	  }
	return xmlHttp;
}

function toggle(id_text, id_hide, id_show, id_div_less, id_div_more)
{
	var ele_less = document.getElementById(id_div_less);
	var ele_more = document.getElementById(id_div_more);
	var text = document.getElementById(id_text);
	if(ele_less.style.display == "block")
	{
   		ele_less.style.display = "none";
   		ele_more.style.display = "block";
		text.innerHTML = id_hide;
  	}
	else
	{
		ele_less.style.display = "block";
		ele_more.style.display = "none";
		text.innerHTML = id_show;
	}
}