// JavaScript Document
<!--


var req = 0; 
function loadXMLDoc(url)
 {
 //branch for native XMLHtpRequest ojbect
//alert('i called successfully');

 if (window.XMLHttpRequest) {
//alert('i called successfully');
  
	  req = new XMLHttpRequest();
  req.onreadystatechange = processReqChange;
// alert(document.getElementById("loadind").attributes[0].name);
//style.visibility = 'hidden';
document.getElementById("loadind").style.visibility = 'visible';
 
  req.open("GET",url,true);
  req.send(null);
 }
 else if ( window.ActiveXObject) {

  req = new ActiveXObject("Microsoft.XMLHTTP");

if (req) {
 //alert(url);
 req.onreadystatechange = processReqChange;
 req.open("GET",url,true);
 document.getElementById("loadind").style.visibility = 'visible';

 req.send();

         } 
     }

}
function hide(a)
{
	document.getElementById(a).innerHTML  = '';
	return;
}
  // JavaScript Document
//called from addcrmmessage.cfm
function inoutdone()
{
document.getElementById('submitbutton').innerHTML = '<input type="submit" value="Add Message" />' ;
return;
}
function http(args) {
 var iedcache = Math.random();
 
iedcache = iedcache*1000;
 iedcache = Math.round(iedcache*1000) + 1.00;

var url = 'http://www.forcesofindia.com/headhunting/switch.cfc?method=action&'+args ;
var v = "<img src='http://www.forcesofindia.com/headhunting/images/loadingindicator.gif' border='0' align='bottom'     vspace='0'  style='margin:0px'  alt='' />&nbsp;<a style='text-decoration:none' href='" + url+ "'>...</a>";

document.getElementById("loadind").innerHTML  = v;

//alert(v);
url = url  + '&iedcache=' + iedcache  ;
//alert(url);
loadXMLDoc(url);

return;
}




function processReqChange() {
if (req.readyState == 4) {
if (req.status == 200 ) {
 
var good = 0;
/*
if (req.responseXML)
{
if (req.responseXML.documentElement)  // for mozilla we need to test for req.response itself and this one is for IE
{
good = 1;
}
}
*/
if (window.DOMParser) // our CFC is sending in xml disguised as text. this we had to do  because when we try to send in XML content (http header text/xml) then it creates problems for normal cfmx pages since then the browser believes everything else is also xml compliant
{
parser=new DOMParser();
xmlDoc=parser.parseFromString(req.responseText,"text/xml");
}
else // Internet Explorer
{
xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async="false";
xmlDoc.loadXML(req.responseText);
} 
if (xmlDoc)	{
	if (xmlDoc.documentElement)  // for mozilla we need to test for req.response itself and this one is for IE
	{
		good = 1;
	}
}
if (good == 1) {

	var 		destination = xmlDoc.getElementsByTagName("span")[1].childNodes[1].textContent;
				text = "textContent";

	if (destination == undefined)
	{
		destination = xmlDoc.getElementsByTagName("span")[1].childNodes[0].text;
		text = "text";
	}
	if (destination == "")
		 destination = "mainbody";
	 var length = xmlDoc.getElementsByTagName("head")[0].childNodes.length;
   try{
	 for (i =0 ; i < length; i++)
		 try {  
		 //document.getElementsByTagName('head')[0].appendChild(xmlDoc.getElementsByTagName("head")[0].childNodes[i].cloneNode(true));
			 eval(eval("xmlDoc.getElementsByTagName('head')[0].childNodes["+i+"]."+text)); // eval to get the text, then eval the text
		 }
	 catch (e)
	 {
	 }
   }
   catch(e)
   {
	   var x = 1;
   }
	    
		 document.getElementById(destination).innerHTML = "";
		 $(destination).hide("slow");
		 var buffer = "";
		 
		 length = xmlDoc.getElementsByTagName("span")[1].childNodes.length;

		 for (i =0 ; i < length; i++)
			   if (xmlDoc.getElementsByTagName("span")[1].childNodes[i].nodeType == 4 )
				   		buffer = buffer + eval('xmlDoc.getElementsByTagName("span")[1].childNodes[i].'+text) ;

		 document.getElementById(destination).innerHTML = buffer;
        	try{var jsfoi =	 document.getElementById(destination);
			
			 var scriptscount = jsfoi.getElementsByTagName("script").length
			 for (i=0;i < scriptscount;i++)
			          try{
					  
				    eval(eval('jsfoi.getElementsByTagName("script")[i].'+text));
					var oScript = document.createElement('script'); 
    				  oScript.text = eval('jsfoi.getElementsByTagName("script")[i].'+text); 
				      document.getElementsByTagName("head").item(0).appendChild(oScript); 
					}
					catch(e)
					{
					/*google add scripts come with html commenting guards which causes error in eval
					so one option can be to replace them using javascript
					*/
					}
	     }
		 catch(d)
		 {
		 }
	      $('document').trigger('ready');
		 		 $(destination).show("slow");
		 document.getElementById("loadind").style.visibility = 'hidden';


			}
		}
	}
} 
-->  
  
 
