var xmlhttp=false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
// JScript gives us Conditional compilation, we can cope with old IE versions.
// and security blocked creation of the objects.
 try {
  xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
 } catch (e) {
  try {
   xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (E) {
   xmlhttp = false;
  }
 }
@end @*/
if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
	try {
		xmlhttp = new XMLHttpRequest();
	} catch (e) {
		xmlhttp=false;
	}
}
if (!xmlhttp && window.createRequest) {
	try {
		xmlhttp = window.createRequest();
	} catch (e) {
		xmlhttp=false;
	}
}



var please_wait="Loading...."

function open_subcategory(url,targid)
{
		//alert(url);
	xmlhttp=GetXmlHttpObject()
	if (xmlhttp==null)
	  {
	  alert ("Your browser does not support XML HTTP Request");
	  return;
	  }
	  
		xmlhttp.onreadystatechange=stateChanged ;
		xmlhttp.open("GET",url,true);
		xmlhttp.send(null);
	
	function stateChanged()
	{
	if (xmlhttp.readyState==4)
	  {
		// alert(xmlhttp.responseText);
		  document.getElementById(targid).innerHTML=xmlhttp.responseText;
	  }
	}

}





function postdata(url,targetId) {
	
	
	  if(!xmlhttp)GetXmlHttpObject();
	  	 
    var e=document.getElementById(targetId);if(!e)return false;
	 	   if(please_wait)e.innerHTML ="<img src=images/ajax-loader.gif >";
		     			 
						 
	
	//alert(xmlhttp.status);
	

    xmlhttp.open("GET", url, true);//initialize the request
	
	//alert(url);
	
    xmlhttp.onreadystatechange = function() { response_2(url,targetId); }
    try{
      xmlhttp.send(null);
    }catch(l){
    while(e.firstChild)e.removeChild(e.firstChild);//e.innerHTML="" the standard way
    e.appendChild(document.createTextNode("request failed"));
  }
}
function response_2(url,targetId) {
	
  if(xmlhttp.readyState != 4)return;
    var tmp= (xmlhttp.status == 200 || xmlhttp.status == 0) ? xmlhttp.responseText : "Ooops!! A broken link! Please contact the webmaster of this website ASAP and give him the following error code: " + xmlhttp.status+" "+xmlhttp.statusText;


   	var e=document.getElementById(targetId).innerHTML=tmp;
	
    
	
}





function post_login(url) {
	
	alert(url);
	 if(!xmlhttp)GetXmlHttpObject();
	
    xmlhttp.open("GET", url, true);//initialize the request
	
	alert(url);
	
    xmlhttp.onreadystatechange = function() { 
	if(xmlhttp.readyState != 4)return;
    var tmp= (xmlhttp.status == 200 || xmlhttp.status == 0) ? xmlhttp.responseText : "Ooops!! A broken link! Please contact the webmaster of this website ASAP and give him the following error code: " + xmlhttp.status+" "+xmlhttp.statusText;
		alert(tmp);
		if(tmp)
			{
					window.location='http://www.need4biz.com/index.php'
			}
			else
			{
					alert('Wrong Username or Password Try Again!Thanks');
			}

   	 }
    try{
      xmlhttp.send(null);
    }catch(l){
    while(e.firstChild)e.removeChild(e.firstChild);//e.innerHTML="" the standard way
    e.appendChild(document.createTextNode("request failed"));
  }
}




function checkemail(email,targid)
{
	xmlhttp=GetXmlHttpObject()
	if (xmlhttp==null)
	  {
	  alert ("Your browser does not support XML HTTP Request");
	  return;
	  }
	  
		var url="server_side.php";
		url=url+"?email="+email;
		xmlhttp.onreadystatechange=stateChanged ;
		xmlhttp.open("GET",url,true);
		xmlhttp.send(null);
	function stateChanged()
	{
	if (xmlhttp.readyState==4)
	  {
		 	  document.getElementById(targid).innerHTML=xmlhttp.responseText;
	  }
	}

}



function open_products(id,targetid)
{

	xmlhttp=GetXmlHttpObject()
	if (xmlhttp==null)
	  {
	  alert ("Your browser does not support XML HTTP Request");
	  return;
	  }
	  
		subcatid=id;
		var url="server_side.php";
		url=url+"?subcategoryid="+subcatid;
		xmlhttp.onreadystatechange=stateChanged2 ;
		xmlhttp.open("GET",url,true);
		xmlhttp.send(null);
	
	
	function stateChanged2()
	{
	if (xmlhttp.readyState==4)
	  {
	  document.getElementById(targetid).innerHTML=xmlhttp.responseText;
	  }
	}

}





function post_poll(targitid,lodedurl)
{
	xmlhttp=GetXmlHttpObject()
	if (xmlhttp==null)
	  {
	  alert ("Your browser does not support XML HTTP Request");
	  return;
	  }
	  	frm=document.frmpoll;
		qid=frm.txtquestionid.value;
		ansid=frm.txtansid.value;
		var url="server_side.php";
		url=url+"?update_poll=true&txtansid="+ansid+"&txtqid="+qid+"";
		xmlhttp.onreadystatechange=stateChanged3;
		xmlhttp.open("GET",url,true);
		xmlhttp.send(null);
	
	function stateChanged3()
	{
	xmlhttp1=xmlhttp;	
	if (xmlhttp1.readyState==4)
	  {
		  document.getElementById(targitid).innerHTML=xmlhttp.responseText;
		  r=xmlhttp1.responseText;
		  // alert(r);
		   xmlhttp1.open("GET",r,true);
		  open_url(r,'pol_response');
		  xmlhttp1.send(null);

	  }
	}

}



function GetXmlHttpObject()
{
if (window.XMLHttpRequest)
  {
  // code for IE7+, Firefox, Chrome, Opera, Safari
  return new XMLHttpRequest();
  }
if (window.ActiveXObject)
  {
  // code for IE6, IE5
  return new ActiveXObject("Microsoft.XMLHTTP");
  }
return null;
}
var please_wait="Loading...."

function open_url(url,targetId) {
	
	  //alert(url);
	  if(!xmlhttp)return false;
	  	 
    var e=document.getElementById(targetId);if(!e)return false;
	   if(please_wait)e.innerHTML ="<img src=images/ajax-loader.gif>";

    xmlhttp.open("GET", url, true);//initialize the request
    xmlhttp.onreadystatechange = function() { response(url, e); }
    try{
      xmlhttp.send(null);
    }catch(l){
    while(e.firstChild)e.removeChild(e.firstChild);//e.innerHTML="" the standard way
    e.appendChild(document.createTextNode("request failed"));
  }
}
function response(url, e) {
	//alert(xmlhttp.responseText);
	
  if(xmlhttp.readyState != 4)return;
    var tmp= (xmlhttp.status == 200 || xmlhttp.status == 0) ? xmlhttp.responseText : "Ooops!! A broken link! Please contact the webmaster of this website ASAP and give him the following error code: " + xmlhttp.status+" "+xmlhttp.statusText;
    var d=document.createElement("div");
    d.innerHTML=tmp;
	
    setTimeout(function(){
      while(e.firstChild)e.removeChild(e.firstChild);//e.innerHTML="" the standard way
      e.appendChild(d);
    },10)
	
}



var xmlhttp=false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
// JScript gives us Conditional compilation, we can cope with old IE versions.
// and security blocked creation of the objects.
 try {
  xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
 } catch (e) {
  try {
   xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (E) {
   xmlhttp = false;
  }
 }
@end @*/
if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
	try {
		xmlhttp = new XMLHttpRequest();
	} catch (e) {
		xmlhttp=false;
	}
}
if (!xmlhttp && window.createRequest) {
	try {
		xmlhttp = window.createRequest();
	} catch (e) {
		xmlhttp=false;
	}
}



function open_url_1(url,targetId) {
	
	  //alert(url);
	  if(!xmlhttp)GetXmlHttpObject();
	  	 
    var e=document.getElementById(targetId);if(!e)return false;
	 	   if(please_wait)e.innerHTML ="<img src=images/ajax-loader.gif >";
		     			 
						 
	
	//alert(xmlhttp.status);
	

    xmlhttp.open("GET", url, true);//initialize the request
	
	//alert(url);
	
    xmlhttp.onreadystatechange = function() { response_1(url,targetId); }
    try{
      xmlhttp.send(null);
    }catch(l){
    while(e.firstChild)e.removeChild(e.firstChild);//e.innerHTML="" the standard way
    e.appendChild(document.createTextNode("request failed"));
  }
}
function response_1(url,targetId) {
	
  if(xmlhttp.readyState != 4)return;
    var tmp= (xmlhttp.status == 200 || xmlhttp.status == 0) ? xmlhttp.responseText : "Ooops!! A broken link! Please contact the webmaster of this website ASAP and give him the following error code: " + xmlhttp.status+" "+xmlhttp.statusText;


///alert(targetId);
   	var e=document.getElementById(targetId).innerHTML=tmp;
	
    
	
}




var xmlhttp=false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
// JScript gives us Conditional compilation, we can cope with old IE versions.
// and security blocked creation of the objects.
 try {
  xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
 } catch (e) {
  try {
   xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (E) {
   xmlhttp = false;
  }
 }
@end @*/
if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
	try {
		xmlhttp = new XMLHttpRequest();
	} catch (e) {
		xmlhttp=false;
	}
}
if (!xmlhttp && window.createRequest) {
	try {
		xmlhttp = window.createRequest();
	} catch (e) {
		xmlhttp=false;
	}
}





function open_url_2(url,targetId) {
	
	  //alert(url);
	  if(!xmlhttp)GetXmlHttpObject();
	  	 
    var e=document.getElementById(targetId);if(!e)return false;
	 	   if(please_wait)e.innerHTML ="<img src=images/ajax-loader.gif >";
		     			 
						 
	
	//alert(xmlhttp.status);
	

    xmlhttp.open("GET", url, true);//initialize the request
	
	//alert(url);
	
    xmlhttp.onreadystatechange = function() { response_1(url,targetId); }
    try{
      xmlhttp.send(null);
    }catch(l){
    while(e.firstChild)e.removeChild(e.firstChild);//e.innerHTML="" the standard way
    e.appendChild(document.createTextNode("request failed"));
  }
}
function response_2(url,targetId) {
	
  if(xmlhttp.readyState != 4)return;
    var tmp= (xmlhttp.status == 200 || xmlhttp.status == 0) ? xmlhttp.responseText : "Ooops!! A broken link! Please contact the webmaster of this website ASAP and give him the following error code: " + xmlhttp.status+" "+xmlhttp.statusText;


///alert(targetId);
   	var e=document.getElementById(targetId).innerHTML=tmp;
	
    
	
}





