var xmlHttp
var xmlHttp2
var xmlHttp3
var xmlHttp4
var xmlHttp5
var xmlHttp6


function zeDisplayRelated(strRecipeId)
{ 
    <!-- alert("ze display related recipex id " + strRecipeId); -->  

    if (strRecipeId > 0) { 
      var url="displayRelated.php?id=" + strRecipeId
      xmlHttp5=GetXmlHttpObject(stateChanged)
      xmlHttp5.open("GET", url , true)
      xmlHttp5.send(null)
    } else { 
      document.getElementById("relTxt").innerHTML=""
    } 
} 


function zeAddToFavs(strRecipeId)
{ 
    <!-- alert("ze add to favs for recipex id " + strRecipeId); -->  

    if (strRecipeId > 0) { 
      var url="myAddToFavorites.php?id=" + strRecipeId
      xmlHttp=GetXmlHttpObject(stateChanged)
      xmlHttp.open("GET", url , true)
      xmlHttp.send(null)
    } else { 
      document.getElementById("favTxt").innerHTML=""
    } 
} 

function zeAddToMenus(strRecipeId)
{ 
    <!-- alert("ze add to menus for recipex id " + strRecipeId); -->  

    if (strRecipeId > 0) { 
      var url="myAddToMenus.php?id=" + strRecipeId
      xmlHttp4=GetXmlHttpObject(stateChanged)
      xmlHttp4.open("GET", url , true)
      xmlHttp4.send(null)
    } else { 
      document.getElementById("menuTxt").innerHTML=""
    } 
} 

function zeRate(strRate,strRecipeId)
{ 
    <!-- alert("ze rate is " + strRate + ", for recipex id " + strRecipeId); -->

    if (strRate > 0) { 
      var url="myRate.php?id=" + strRecipeId + "&gr=" + strRate
      xmlHttp2=GetXmlHttpObject(stateChanged)
      xmlHttp2.open("GET", url , true)
      xmlHttp2.send(null)
    } else { 
      document.getElementById("rateTxt").innerHTML=""
    } 
} 

function zeInapprop(strRecipeId)
{ 
    <!-- alert("you flagged recipe with id " + strRecipeId + " as inappropriate"); -->

    if (strRecipeId > 0) { 
      var url="myFlagInapprop.php?id=" + strRecipeId
      xmlHttp3=GetXmlHttpObject(stateChanged)
      xmlHttp3.open("GET", url , true)
      xmlHttp3.send(null)
    } else { 
      document.getElementById("flagInappropTxt").innerHTML=""
    } 
} 

function zeListTopOrigin(strOrigin,strOriginCode)
{ 
    alert("ze list top origin " + strOrigin  + "(" + strOriginCode + ")" );   

    
    if (strRecipeId > 0) { 
      var url="myAddToFavorites.php?id=" + strRecipeId
      xmlHttp=GetXmlHttpObject(stateChanged)
      xmlHttp.open("GET", url , true)
      xmlHttp.send(null)
    } else { 
      document.getElementById("favTxt").innerHTML=""
    } 
    
} 





function stateChanged() 
{ 
if (xmlHttp != null && (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"))
{ 
document.getElementById("favTxt").innerHTML=xmlHttp.responseText 
}
if (xmlHttp2 != null && (xmlHttp2.readyState==4 || xmlHttp2.readyState=="complete"))
{ 
document.getElementById("rateTxt").innerHTML=xmlHttp2.responseText 
} 
if (xmlHttp3 != null && (xmlHttp3.readyState==4 || xmlHttp3.readyState=="complete"))
{ 
document.getElementById("flagInappropTxt").innerHTML=xmlHttp3.responseText 
} 
if (xmlHttp4 != null && (xmlHttp4.readyState==4 || xmlHttp4.readyState=="complete"))
{ 
document.getElementById("menuTxt").innerHTML=xmlHttp4.responseText 
}  
if (xmlHttp5 != null && (xmlHttp5.readyState==4 || xmlHttp5.readyState=="complete"))
{ 
document.getElementById("relTxt").innerHTML=xmlHttp5.responseText 
}  
if (xmlHttp6 != null && (xmlHttp6.readyState==4 || xmlHttp6.readyState=="complete"))
{ 
document.getElementById("zeTopOriginTxt").innerHTML=xmlHttp6.responseText 
}  

} 

function GetXmlHttpObject(handler)
{ 
var objXmlHttp=null

if (navigator.userAgent.indexOf("Opera")>=0)
{
alert("This example doesn't work in Opera") 
return 
}
if (navigator.userAgent.indexOf("MSIE")>=0)
{ 
var strName="Msxml2.XMLHTTP"
if (navigator.appVersion.indexOf("MSIE 5.5")>=0)
{
strName="Microsoft.XMLHTTP"
} 
try
{ 
objXmlHttp=new ActiveXObject(strName)
objXmlHttp.onreadystatechange=handler 
return objXmlHttp
} 
catch(e)
{ 
alert("Error. Scripting for ActiveX might be disabled") 
return 
} 
} 
if (navigator.userAgent.indexOf("Mozilla")>=0)
{
objXmlHttp=new XMLHttpRequest()
objXmlHttp.onload=handler
objXmlHttp.onerror=handler 
return objXmlHttp
}
} 
		
				
			
				
				
				
				
				
				
				
				
				
				
				
				
				
				
				
				
				
				

				
				
				
				
				
				
				
				
				