function addToEnquireList(mode, value) { //alert('Mode: '+mode); //alert('Value: '+value); var xmlHttp; try { // Firefox, Opera 8.0+, Safari xmlHttp=new XMLHttpRequest(); } catch (e) { // Internet Explorer try { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { alert("Your browser does not support AJAX!"); return false; } } } // each time the readystate changes... xmlHttp.onreadystatechange=function() { //var changeDiv = document.getElementById("changeAddAjax"); var changeDiv = document.getElementById("change_add_"+value); if(xmlHttp.readyState==4) { changeDiv.innerHTML=xmlHttp.responseText; refreshEnquireList(); } if(xmlHttp.readyState>0 && xmlHttp.readyState<4) { changeDiv.innerHTML = 'Adding Excursion...'; } } var randomnumber=Math.floor(Math.random()*100010); //build the string as the form would have done again var variables = "mode="+mode+"&value="+value; //alert(variables); //Now buid full url var url = "includes/ajax/addToEnquireList.php?"+variables+"&unique="+randomnumber+"&excursion_id="+value; //alert(url); xmlHttp.open("GET",url,true); xmlHttp.send(null); // ColorBox $.colorbox({width:"50%", href:"/includes/colorbox/content/add_excursion.php"}); // Record in Analytucs _gaq.push(['_trackEvent', 'Add to Enquire Lists', value]); } function refreshEnquireList() { var xmlHttp; try { // Firefox, Opera 8.0+, Safari xmlHttp=new XMLHttpRequest(); } catch (e) { // Internet Explorer try { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { alert("Your browser does not support AJAX!"); return false; } } } // each time the readystate changes... xmlHttp.onreadystatechange=function() { var changeDiv = document.getElementById("changeEnquireList"); if(xmlHttp.readyState==4){changeDiv.innerHTML=xmlHttp.responseText;} if(xmlHttp.readyState>0 && xmlHttp.readyState<4){changeDiv.innerHTML = 'Loading Enquire List...'; } } var randomnumber=Math.floor(Math.random()*100010); //Now buid full url var url = "includes/ajax/enquireList.php?unique="+randomnumber; //alert(url); xmlHttp.open("GET",url,true); xmlHttp.send(null); } function tb(tab) { document.getElementById("feat_included").style.display = "none"; document.getElementById("feat_details").style.display = "none"; document.getElementById("feat_recommend").style.display = "none"; document.getElementById("feat_included_lnk").className = ""; document.getElementById("feat_details_lnk").className = ""; document.getElementById("feat_recommend_lnk").className = ""; document.getElementById(tab).style.display = "block"; document.getElementById(tab+"_lnk").className = "cur"; }