var xmlHttp;var myDate=new Date();var mytime=myDate.toLocaleTimeString();function createXmlHttpRequest(){if(window.XMLHttpRequest){xmlHttp=new XMLHttpRequest();if(xmlHttp.overrideMimeType){xmlHttp.overrideMimeType("text/xml");}}else if(window.ActiveXObject){try{xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}}if(!xmlHttp){window.alert("Can't use XMLhttpRequest");}return xmlHttp;}function cartadd(sid){createXmlHttpRequest();var url="http://www.beijingholiday.com/attractions/cart.html?time="+mytime+"&add="+sid;xmlHttp.open("GET",url,true);xmlHttp.onreadystatechange=showResult;xmlHttp.send(null);}function cartdel(sid){createXmlHttpRequest();var url="http://www.beijingholiday.com/attractions/cart.html?time="+mytime+"&del="+sid;xmlHttp.open("GET",url,true);xmlHttp.onreadystatechange=showResult;xmlHttp.send(null);}function cartget(sid){createXmlHttpRequest();var url="http://www.beijingholiday.com/attractions/cart.html?time="+mytime+"&gets="+sid;xmlHttp.open("GET",url,true);xmlHttp.onreadystatechange=showResult;xmlHttp.send(null);}function cartcos(){createXmlHttpRequest();var url="http://www.beijingholiday.com/attractions/cart.html?time="+mytime+"&chos=1";xmlHttp.open("GET",url,true);xmlHttp.onreadystatechange=showResult;xmlHttp.send(null);}function cartcoss(sid){createXmlHttpRequest();var url="http://www.beijingholiday.com/attractions/cart.html?time="+mytime+"&chos=1&s="+sid;xmlHttp.open("GET",url,true);xmlHttp.onreadystatechange=showResult;xmlHttp.send(null);}function displaynone(){if(document.getElementById("cartmsg"))document.getElementById("cartmsg").style.display="none";}function showResult(){if(xmlHttp.readyState==4){if(xmlHttp.status==200){document.getElementById("cartinfo").innerHTML=xmlHttp.responseText;setTimeout("displaynone()",3000);}else if(xmlHttp.status==404){alert(xmlHttp.responseText);}}}
