function CreateObjectIndex()
{
 http_request = false;
      if (window.XMLHttpRequest) { // Mozilla, Safari,...
         http_request = new XMLHttpRequest();
         if (http_request.overrideMimeType) {
            http_request.overrideMimeType('text/html');
         }
      } else if (window.ActiveXObject) { // IE
         try {
            http_request = new ActiveXObject("Msxml2.XMLHTTP");
         } catch (e) {
            try {
               http_request = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) {}
         }
      }
      if (!http_request) {
         alert('Cannot create XMLHTTP instance');
         return false;
      }
return http_request;
}
//*************** Advance Search Box ********
function fNormal()
{  document.getElementById("divSerchBox").innerHTML="";  
         document.getElementById("divButSearch").innerHTML="<a href='javascript:fAdvance();' class='ds-innerlinks4a'>Advance Search</a>";  
    
	}

function fAdvance()
{
	var url = "ajaxSearchBoxes.asp";  
 var parameters = "id=1"; 
 var xmlHttp=new CreateObjectIndex();
 xmlHttp.open("POST", url, true);  
 //Send the proper header information along with the request  
 xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");  
 xmlHttp.setRequestHeader("Content-length", parameters .length);  
 xmlHttp.setRequestHeader("Connection", "close");  
 xmlHttp.onreadystatechange = function() {//Handler function for call back on state change.  
     if(xmlHttp.readyState == 4) { 
         document.getElementById("divSerchBox").innerHTML=xmlHttp.responseText;  
         //document.getElementById("divButSearch").innerHTML="<a href='javascript:fNormal();' class='ds-innerlinks4a'>Normal Search</a>";  
         //document.getElementById("divButSearch").innerHTML="";  
     }  
 }  
 xmlHttp.send(parameters); 
}

//*************************** Insert Keywords into dictionary **********
function mainTopic(id,spanId)
	{
 var url = "ajaxCoreTopic.asp";  
 var parameters = "id="+id; 
 var xmlHttp=new CreateObjectIndex();
 xmlHttp.open("POST", url, true);  
 //Send the proper header information along with the request  
 xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");  
 xmlHttp.setRequestHeader("Content-length", parameters .length);  
 xmlHttp.setRequestHeader("Connection", "close");  
 xmlHttp.onreadystatechange = function() {//Handler function for call back on state change.  
     if(xmlHttp.readyState == 4) { 
         document.getElementById(spanId).innerHTML=xmlHttp.responseText;  
     }  
 }  
 xmlHttp.send(parameters); 
}

function changeTopicIndex(id)
	{

 var url = "ajaxCatIndex.asp";  
 var parameters = "id="+id; 
 var xmlHttp=new CreateObjectIndex();
 xmlHttp.open("POST", url, true);  
 //Send the proper header information along with the request  
 xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");  
 xmlHttp.setRequestHeader("Content-length", parameters .length);  
 xmlHttp.setRequestHeader("Connection", "close");  
 xmlHttp.onreadystatechange = function() {//Handler function for call back on state change.  
     if(xmlHttp.readyState == 4) { 
         document.getElementById("catDropIndex").innerHTML=xmlHttp.responseText; 
		 document.getElementById("subCatDropIndex").innerHTML="<select name='subCatIdIndex' size='1' class='ds-dropdown-small' id='subCatIdIndex' style='width:162px;'><option value=''>-- Select --</option></style>";
     }  
 }  
 xmlHttp.send(parameters); 
}

function changeCatIndex(id)
	{
 var url = "ajaxSubcatIndex.asp";  
 //document.getElementById("catidVal").value=id;
// document.getElementById("subcatidVal").value="";
 //var parameters = "id="+encodeURI(document.getElementById("catId").value)+"&subCatId="+encodeURI(document.getElementById("subcat").value);
 var parameters = "id="+id;
// alert(parameters);  
 var xmlHttp=new CreateObjectIndex();
 xmlHttp.open("POST", url, true);  
 //Send the proper header information along with the request  
 xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");  
 xmlHttp.setRequestHeader("Content-length", parameters .length);  
 xmlHttp.setRequestHeader("Connection", "close");  
 xmlHttp.onreadystatechange = function() {//Handler function for call back on state change.  
     if(xmlHttp.readyState == 4) {  
         document.getElementById("subCatDropIndex").innerHTML=xmlHttp.responseText;  
     }  
 }  
 xmlHttp.send(parameters); 
}


function setSubcat(id)
	{
		 //document.getElementById("subcatidVal").value=id;
	}
