
function createObject() {
var request_type;
var browser = navigator.appName;
if(browser == "Microsoft Internet Explorer"){
request_type = new ActiveXObject("Microsoft.XMLHTTP");
}else{
request_type = new XMLHttpRequest();
}
return request_type;
}

var http = createObject();




var nocache = 0;


function addtoshortlist(intDisplayObjectId,intDODOId) {

nocache = Math.random();

http.open('get', '/actions/addtoshortlist_action.cfm?do='+intDisplayObjectId+'&dd='+intDODOId+'&nocache = '+nocache);
http.onreadystatechange = function() {
    ReloadList(intDisplayObjectId,intDODOId);
};
http.send(null);
}




function ReloadList(intDisplayObjectId,intDODOId) {
if(http.readyState == 4){ 

nocache = Math.random();

http.open('get', 'ajax.cfm?page=shortlist_inc&nocache = '+nocache);
http.onreadystatechange = function() {
    displayshortlistincReply(intDisplayObjectId,intDODOId);
};
http.send(null);
}
}


function displayshortlistincReply(intDisplayObjectId,intDODOId) {
if(http.readyState == 4){ 
var response = http.responseText;
getaddtoReply(intDisplayObjectId,intDODOId);

{
document.getElementById('shortlist_inc').innerHTML = response;
}
}
}


function getaddtoReply(intDisplayObjectId,intDODOId) {
if(http.readyState == 4){ 

nocache = Math.random();

http.open('get', 'ajax.cfm?page=add_to&do='+intDisplayObjectId+'&dd='+intDODOId+'&nocache = '+nocache);
http.onreadystatechange = function() {
    displayaddtoReply(intDisplayObjectId,intDODOId);
};
http.send(null);
}
}


function displayaddtoReply(intDisplayObjectId,intDODOId) {
if(http.readyState == 4){ 
var response = http.responseText;
{
document.getElementById('addto'+intDisplayObjectId).innerHTML = response;
}
}
}








function addtobasket(intDisplayObjectId,intDODOId) {

nocache = Math.random();

http.open('get', '/actions/addtobasket_action.cfm?do='+intDisplayObjectId+'&dd='+intDODOId+'&nocache = '+nocache);
http.onreadystatechange = function() {
    Reloadbasket(intDisplayObjectId,intDODOId);
};
http.send(null);
}


function Reloadbasket(intDisplayObjectId,intDODOId) {
if(http.readyState == 4){ 

nocache = Math.random();

http.open('get', 'ajax.cfm?page=basket_inc&nocache = '+nocache);
http.onreadystatechange = function() {
    displaybasketincReply(intDisplayObjectId,intDODOId);
};
http.send(null);
}
}


function displaybasketincReply(intDisplayObjectId,intDODOId) {
if(http.readyState == 4){ 
var response = http.responseText;
getaddtoReply(intDisplayObjectId,intDODOId);

{
document.getElementById('basket_inc').innerHTML = response;
}
}
}






















function removefrombasket(intDemandId) {

nocache = Math.random();

http.open('get', '/actions/removefrombasket_action.cfm?d='+intDemandId+'&nocache = '+nocache);
http.onreadystatechange = function() {
    getremoveReply();
};
http.send(null);
}

function getremoveReply() {
if(http.readyState == 4){ 


window.location.reload();
}
}













function updatedemand(intDemandId,intDemandQty,intDODOId) {

var qty = (intDemandQty.value)

nocache = Math.random();

http.open('get', '/actions/update_demand_action.cfm?d='+intDemandId+'&q='+qty+'&nocache = '+nocache);
http.onreadystatechange = function() {
    getupdateReply(intDemandId);
};
http.send(null);
}



function getupdateReply(intDemandId,intDODOId) {
if(http.readyState == 4){ 

nocache = Math.random();

http.open('get', 'ajax.cfm?page=demand_inc&d='+intDemandId+'&nocache = '+nocache);
http.onreadystatechange = function() {
    displaydemand_inc(intDemandId,intDODOId);
};
http.send(null);
}
}




function displaydemand_inc(intDemandId,intDODOId) {
if(http.readyState == 4){ 
var response = http.responseText;
	getbasketvalue(intDODOId);
{
document.getElementById('demand_inc'+intDemandId).innerHTML = response;
}
}
}




function getbasketvalue(intDODOId) {
if(http.readyState == 4){ 

nocache = Math.random();

http.open('get', 'ajax.cfm?page=basket_value_inc&nocache = '+nocache);
http.onreadystatechange = function() {
    display_basketvalue_inc(intDODOId);
};
http.send(null);
}
}




function display_basketvalue_inc(intDODOId) {
if(http.readyState == 4){ 
var response = http.responseText;
	Reloadbasket(intDODOId);
	
{
document.getElementById('basket_value').innerHTML = response;
}
}
}
