/******************************************************************************
*
* Filename:     ajax.php
*
* Description:  uses ajax 
*
* Author:       Somi
*
* Created on:   03/11/2006
*
******************************************************************************/
var xmlHttp;var ajaxloaderpath;
var xmlHttp1;var divtype;var xmlHttp2;var divtype1;
function passvalue(url,ajaxloaderpath1)
 { 
    xmlHttp=GetXmlHttpObject()
	ajaxloaderpath=ajaxloaderpath1;
    if (xmlHttp==null)
    {
       alert ("Browser does not support HTTP Request")
       return
    }
	
	  xmlHttp=GetXmlHttpObject(stateChanged);
	  
  	  xmlHttp.open("GET", url, true);
	  xmlHttp.setRequestHeader("Content-Type","text/html; charset=iso-8859-1"); 
      xmlHttp.onreadystatechange=stateChanged 
      xmlHttp.send(null) 
  }
  
 
function stateChanged() 
 { 
	/* code for loading state*/
	if (xmlHttp.readyState == 1 || xmlHttp.readyState=="loading")
    { 
        //Populate the innerHTML of the div with the results 
        document.getElementById('div_results').innerHTML = "<font color='red'><img src='"+ajaxloaderpath+"/ajax-loader.gif'>&nbsp;&nbsp;Loading...Please wait.</font>";
    }

    //alert(xmlHttp.readyState);
   if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
    { 
	    if(xmlHttp.responseText==0)
		{
			
			var bver = navigator.appVersion.indexOf("MSIE") 
			if(bver!=-1) 
			{ 
				bver=bver+5 
				var vernum = navigator.appVersion.substr(bver,3) 
				if(vernum>=5.5){ 
					window.location ="main.php";  
				} 
				else 
				{
					location.href="main.php";

				} 
			} 
			else 
			{
				 window.location ="main.php";  
			} 
		// window.location ="home.php";  
		}
	    else
	    {
	 		document.getElementById("div_results").innerHTML=xmlHttp.responseText;
			//alert(document.getElementById("div_results").innerHTML);
			//document.write(document.getElementById("div_results").innerHTML);
		
	   }

    } 
	
	
 } 

function new_passvalue(divid,url,ajaxloaderpath1)
 { 
	 divtype=divid;
    xmlHttp1=GetXmlHttpObject()
	ajaxloaderpath=ajaxloaderpath1;
    if (xmlHttp1==null)
    {
       alert ("Browser does not support HTTP Request")
       return
    }
	
	  xmlHttp1=GetXmlHttpObject(new_stateChanged);
	  
  	  xmlHttp1.open("GET", url, true);
	  xmlHttp1.setRequestHeader("Content-Type","text/html; charset=iso-8859-1"); 
      xmlHttp1.onreadystatechange=new_stateChanged 
      xmlHttp1.send(null) 
  }
  

function new_stateChanged() 
 { 
	/* code for loading state*/
	if (xmlHttp1.readyState == 1 || xmlHttp1.readyState=="loading")
    { 
        //Populate the innerHTML of the div with the results 
       document.getElementById(divtype).innerHTML = "<font color='red'><img src='"+ajaxloaderpath+"/ajax-loader.gif'>&nbsp;&nbsp;Loading...Please wait.</font>";
    }

    //alert(xmlHttp.readyState);
   if (xmlHttp1.readyState==4 || xmlHttp1.readyState=="complete")
    { 
	    if(xmlHttp1.responseText==0)
		{
			
			var bver = navigator.appVersion.indexOf("MSIE") 
			if(bver!=-1) 
			{ 
				bver=bver+5 
				var vernum = navigator.appVersion.substr(bver,3) 
				if(vernum>=5.5){ 
					window.location ="main.php";  
				} 
				else 
				{
					location.href="main.php";

				} 
			} 
			else 
			{
				 window.location ="main.php";  
			} 
		// window.location ="home.php";  
		}
	    else
	    {	//	alert(divtype+"new");
			document.getElementById(divtype).innerHTML=xmlHttp1.responseText;			
		
	   }

    } 
	
	
 } 
function new_passvalue1(divid,url,ajaxloaderpath1)
 { 
	 divtype1=divid;
	xmlHttp2=GetXmlHttpObject()
	ajaxloaderpath=ajaxloaderpath1;
    if (xmlHttp2==null)
    {
       alert ("Browser does not support HTTP Request")
       return
    }
	
	  xmlHttp2=GetXmlHttpObject(new_stateChanged1);
	  
  	  xmlHttp2.open("GET", url, true);
	  xmlHttp2.setRequestHeader("Content-Type","text/html; charset=iso-8859-1"); 
      xmlHttp2.onreadystatechange=new_stateChanged1 
      xmlHttp2.send(null) 
  }
  

function new_stateChanged1() 
 { 
	/* code for loading state*/
	if (xmlHttp2.readyState == 1 || xmlHttp2.readyState=="loading")
    { 
        //Populate the innerHTML of the div with the results 
        document.getElementById(divtype1).innerHTML = "<font color='red'><img src='"+ajaxloaderpath+"/ajax-loader.gif'>&nbsp;&nbsp;Loading...Please wait.</font>";
    }

    //alert(xmlHttp.readyState);
   if (xmlHttp2.readyState==4 || xmlHttp2.readyState=="complete")
    { 
	    if(xmlHttp2.responseText==0)
		{
			
			var bver = navigator.appVersion.indexOf("MSIE") 
			if(bver!=-1) 
			{ 
				bver=bver+5 
				var vernum = navigator.appVersion.substr(bver,3) 
				if(vernum>=5.5){ 
					window.location ="main.php";  
				} 
				else 
				{
					location.href="main.php";

				} 
			} 
			else 
			{
				 window.location ="main.php";  
			} 
		
		}
	    else
	    {
			
	 		document.getElementById(divtype1).innerHTML=xmlHttp2.responseText;			
		
	   }

    } 
	
	
 } 

function GetXmlHttpObject()
{ 
   var objXMLHttp=null
   
   if (window.XMLHttpRequest)
   {
      objXMLHttp=new XMLHttpRequest()
   }
   else if (window.ActiveXObject)// code for IE
  	{
		try
		{
		  objXMLHttp = new ActiveXObject("Msxml2.XMLHTTP")
		} 
		catch (e) {
		  try
		  {
			objXMLHttp = new ActiveXObject("Microsoft.XMLHTTP")
		  } 
		  catch (E) {
			objXMLHttp=false
		  }
      }
  }
 //  else if (window.ActiveXObject)
  // {
  //     objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
 //  }
   
   return objXMLHttp
}

function passvaluee(url,ajaxloaderpath1)
 { 
 	
    xmlHttp=GetXmlHttpObject()
	ajaxloaderpath=ajaxloaderpath1;

    if (xmlHttp==null)
    {
       alert ("Browser does not support HTTP Request")
       return
    }
	
	  xmlHttp=GetXmlHttpObject(stateChangedd);
	  
  	  xmlHttp.open("GET", url, true);
	  xmlHttp.setRequestHeader("Content-Type","text/html; charset=iso-8859-1"); 
      xmlHttp.onreadystatechange=stateChangedd 
      xmlHttp.send(null)
	 
	 
  }
  

function stateChangedd() 
 { 
    /* code for loading state*/
	if (xmlHttp.readyState == 1 || xmlHttp.readyState=="loading")
    { 
        //Populate the innerHTML of the div with the results 
        document.getElementById('div_combo').innerHTML = "<font color='red'><img src='"+ajaxloaderpath+"/ajax-loader.gif'>&nbsp;&nbsp;Loading...Please wait.</font>";
    }

    if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
    { 
	    if(xmlHttp.responseText==0)
		{
			
			var bver = navigator.appVersion.indexOf("MSIE") 
			if(bver!=-1) 
			{ 
				bver=bver+5 
				var vernum = navigator.appVersion.substr(bver,3) 
				if(vernum>=5.5){ 
					window.location ="home.php";  
				} 
				else 
				{
					location.href="home.php";

				} 
			} 
			else 
			{
				 window.location ="home.php";  
			} 
		}
	    else
	    {
			
	 		document.getElementById("div_combo").innerHTML=xmlHttp.responseText;
		}

    } 
/* code for loading state
	if (xmlHttp.readyState == 1 || xmlHttp.readyState=="loading")
    { 
        //Populate the innerHTML of the div with the results 
        document.getElementById('div_results').innerHTML = 'LOADING...';
    }*/
	
 } 
 
 function passvalue3(url,ajaxloaderpath1)
 { 
    xmlHttp=GetXmlHttpObject()
	ajaxloaderpath=ajaxloaderpath1;
	
    if (xmlHttp==null)
    {
       alert ("Browser does not support HTTP Request")
       return
    }
	
	  xmlHttp=GetXmlHttpObject(stateChanged3);
	  
  	  xmlHttp.open("GET", url, true);
	  xmlHttp.setRequestHeader("Content-Type","text/html; charset=iso-8859-1"); 
      xmlHttp.onreadystatechange=stateChanged3 
      xmlHttp.send(null)
	 
	 
  }
  

function stateChanged3() 
 { 
    /* code for loading state*/
	if (xmlHttp.readyState == 1 || xmlHttp.readyState=="loading")
    { 
        //Populate the innerHTML of the div with the results 
        document.getElementById('div_combocity').innerHTML = "<font color='red'><img src='"+ajaxloaderpath+"/ajax-loader.gif'>&nbsp;&nbsp;Loading...Please wait.</font>";
    }

    if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
    { 
	    if(xmlHttp.responseText==0)
		{
			
			var bver = navigator.appVersion.indexOf("MSIE") 
			if(bver!=-1) 
			{ 
				bver=bver+5 
				var vernum = navigator.appVersion.substr(bver,3) 
				if(vernum>=5.5){ 
					window.location ="home.php";  
				} 
				else 
				{
					location.href="home.php";

				} 
			} 
			else 
			{
				 window.location ="home.php";  
			} 
		}
	    else
	    {
	 		document.getElementById("div_combocity").innerHTML=xmlHttp.responseText;
		}

    } 
/* code for loading state
	if (xmlHttp.readyState == 1 || xmlHttp.readyState=="loading")
    { 
        //Populate the innerHTML of the div with the results 
        document.getElementById('div_results').innerHTML = 'LOADING...';
    }*/
	
 } 




///////////




function passvalueFCK(url)
 { 
    xmlHttp=GetXmlHttpObject()
	
    if (xmlHttp==null)
    {
       alert ("Browser does not support HTTP Request")
       return
    }
	
	  xmlHttp=GetXmlHttpObject(stateChangedFCK);
	  
  	  xmlHttp.open("GET", url, true);
	  xmlHttp.setRequestHeader("Content-Type","text/html; charset=iso-8859-1"); 
      xmlHttp.onreadystatechange=stateChangedFCK; 
      xmlHttp.send(null)
	 
	 
  }
  

function stateChangedFCK() 
 { 
 	/* code for loading state*/
	/*if (xmlHttp.readyState == 1 || xmlHttp.readyState=="loading")
    { 
        //Populate the innerHTML of the div with the results 
        document.getElementById('div_results').innerHTML = "<img src='"+ajaxloaderpath+"/ajax-loader.gif'>&nbsp;&nbsp;Loading...Please wait.";
    }
*/
    
    if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
    { 
	    if(xmlHttp.responseText==0)
		{
			
			var bver = navigator.appVersion.indexOf("MSIE") 
			if(bver!=-1) 
			{ 
				bver=bver+5 
				var vernum = navigator.appVersion.substr(bver,3) 
				if(vernum>=5.5){ 
					window.location ="main.php";  
				} 
				else 
				{
					location.href="main.php";

				} 
			} 
			else 
			{
				 window.location ="main.php";  
			} 
		// window.location ="home.php";  
		}
	    else
	    {
			FCKeditorAPI.__Instances['txtContent'].SetHTML(xmlHttp.responseText)
		
	   }

    } 
	
 } 
 


function passvaluecity(url,ajaxloaderpath1)
 { 
 	
    xmlHttp=GetXmlHttpObject()
	ajaxloaderpath=ajaxloaderpath1;

    if (xmlHttp==null)
    {
       alert ("Browser does not support HTTP Request")
       return
    }
	
	  xmlHttp=GetXmlHttpObject(stateChangedd);
	  
  	  xmlHttp.open("GET", url, true);
	  xmlHttp.setRequestHeader("Content-Type","text/html; charset=iso-8859-1"); 
      xmlHttp.onreadystatechange=stateChangeCity
      xmlHttp.send(null)
	 
	 
  }
  

function stateChangeCity() 
 { 
    /* code for loading state*/
	if (xmlHttp.readyState == 1 || xmlHttp.readyState=="loading")
    { 
        //Populate the innerHTML of the div with the results 
        document.getElementById('div_combocity').innerHTML = "<font color='red'><img src='"+ajaxloaderpath+"/ajax-loader.gif'>&nbsp;&nbsp;Loading...Please wait.</font>";
    }

    if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
    { 
	    if(xmlHttp.responseText==0)
		{
			
			var bver = navigator.appVersion.indexOf("MSIE") 
			if(bver!=-1) 
			{ 
				bver=bver+5 
				var vernum = navigator.appVersion.substr(bver,3) 
				if(vernum>=5.5){ 
					window.location ="home.php";  
				} 
				else 
				{
					location.href="home.php";

				} 
			} 
			else 
			{
				 window.location ="home.php";  
			} 
		}
	    else
	    {
			
	 		document.getElementById("div_combocity").innerHTML=xmlHttp.responseText;
		}

    } 
/* code for loading state
	if (xmlHttp.readyState == 1 || xmlHttp.readyState=="loading")
    { 
        //Populate the innerHTML of the div with the results 
        document.getElementById('div_results').innerHTML = 'LOADING...';
    }*/
	
 } 
