var websiteUrl = "http://www.gardenandhome.net/";

function canAjax(){
  var ro;
  var browser = navigator.appName;
  if(browser == 'Microsoft Internet Explorer'){
    ro = new ActiveXObject("Microsoft.XMLHTTP");
  }else{
    ro = new XMLHttpRequest();
  }
  return ro;
}

function deleteItem(id){
  if(confirm('Are you sure you want to delete\nthis item from your basket?')){
		//var myAjax = new Ajax('basket.php?action=delete&ajax=1&id='+id, {method: 'get', update: $('container')}).request();
                  window.location = 'basket.php?action=delete&ajax=1&id='+id;
	}
}

function page(prodUrl){
	var myAjax = new Ajax(prodUrl, {method: 'get', update: $('container')}).request();
}

function popImg(prodUrl){
	var image = window.open(prodUrl, 'imgpop', 'scrollbars=no, menubars=no, statusbar=no');
	image.focus();
}

function reduceQty(id){
	//var myAjax = new Ajax(websiteUrl + 'basket.php?action=reduce&ajax=1&id='+id, {method: 'get', update: $('container')}).request();
window.location = websiteUrl + 'basket.php?action=reduce&id='+id;
}

function increaseQty(id){
	//var myAjax = new Ajax(websiteUrl + 'basket.php?action=increase&ajax=1&id='+id, {method: 'get', update: $('container')}).request();
window.location = websiteUrl + 'basket.php?action=increase&id='+id;
}

function updateMyBasket(){
  var myAjax = new Ajax(websiteUrl + 'basket.php?updatebasket=1', {method: 'get', update: $('container')}).request();
}

function selectImg(image, largeimg){
	document.getElementById("MainImg").src = image;
	document.getElementById("MainLink").href = largeimg;
}