<!--
function makeObject(){
var x;
    var browser = navigator.appName;
    //detect the client browser
    if(browser == "Microsoft Internet Explorer"){
        x = new ActiveXObject("Microsoft.XMLHTTP");
    }
    else{
        x = new XMLHttpRequest();
    }
    return x;
}

//call the function makeObject()
var request = makeObject();
var gobalCId = false;
var globalPId = false;



//function send request
function ajaxGoTo(cId){
return true;
    globalCId = cId;
    dhtmlHistory.add(cId,'sitechange');
    request.open('get','ajaxscripts/getcartinfo.ajax.php?cId='+cId);
    request.onreadystatechange = parseInfoProductInfo;
    request.send('');
    return false;
}
function ajaxDisplaySpecials(){     return true;
    dhtmlHistory.add('specials','sitechange');
    request.open('get','ajaxscripts/specialoffers.ajax.php');
    request.onreadystatechange = parseInfoProductInfo;
    request.send('');
    return false;
}
function ajaxViewProduct(pId){     return true;
    globalPId = pId;
    historyId = "pId_" + pId;
    dhtmlHistory.add(historyId,'sitechange');
    request.open('get','ajaxscripts/viewproduct.ajax.php?pId='+pId);
    request.onreadystatechange = parseInfoViewProduct;
    request.send('');
    return false;
}
function ajaxAddToCart(pId){      return true;
    getstring = 'addthis_productId='+pId+'&';
    quantity = document.getElementById(pId + '_quantity').value;
    getstring += 'addthis_quantity='+quantity;
    if(document.getElementById(pId + '_optionId')) {
        option  = document.getElementById(pId + '_optionId').options[document.getElementById(pId + '_optionId').selectedIndex].value;
        getstring += '&addthis_optionId='+option;
    }

    request.open('post','ajaxscripts/addtocart.ajax.php?'+getstring);
    request.onreadystatechange = parseInfoAddToCart;
    request.send('');
    return false;
}
function ajaxViewCart(){    return true;
    dhtmlHistory.add('viewcart','viewcart');
    request.open('get','ajaxscripts/updatecart.ajax.php');
    request.onreadystatechange = parseInfoViewCart;
    request.send('');
    return false;
}
function ajaxClearCart(){      return true;
    request.open('get','ajaxscripts/updatecart.ajax.php?clear=true');
    request.onreadystatechange = parseInfoUpdateCart;
    request.send('');
    return false;
}
function ajaxUpdateCart(){     return true;
    getstring = loopForm('cartform');
    getstring = getstring + "update=true";
    request.open('get','ajaxscripts/updatecart.ajax.php?'+getstring);
    request.onreadystatechange = parseInfoUpdateCart;
    request.send('');
    return false;
}

function ajaxRemoveItem(pId){     return true;
    request.open('get','ajaxscripts/updatecart.ajax.php?removeme='+pId);
    request.onreadystatechange = parseInfoUpdateCart;
    request.send('');
    return false;
}
function ajaxDeliveryDetails(){      return true;
    dhtmlHistory.add('deliverydetails','deliverydetails');
    request.open('get','ajaxscripts/deliverydetails.ajax.php');
    request.onreadystatechange = parseInfoDeliveryDetails;
    request.send('');
    return false;
}
function ajaxSendDeliveryDetails(){     return true;
    getstring = loopForm('deliveryform');
    request.open('get','ajaxscripts/senddeliverydetails.ajax.php?'+getstring);
    request.onreadystatechange = parseInfoDeliveryDetails;
    request.send('');
    return false;
}

function historyChangex(newLocation, historyData) {
    if(newLocation.substring(0,4) == 'pId_'){
        ajaxViewProduct(newLocation.substring(4));
    }
    else if(newLocation == 'viewcart'){
        ajaxViewCart();
    }
    else if(newLocation == 'deliverydetails'){
        ajaxDeliveryDetails();
    }
    else if(newLocation == 'goto_top'){
        return false;
    }
    else if(newLocation == 'specials'){
        ajaxDisplaySpecials();
    }
    else { ajaxGoTo(newLocation);}
}
// -->
