function popupwindow(WindowName, URL) {
var width = 640;
var height = 580;

window.open(URL,'_blank','menubar=no,toolbar=no,status=no,width='+width+',height='+height+',resizable=yes,scrollbars=yes');
}

function newWindow(showbasket) {
	bookWindow = window.open(showbasket, 'bookWin', 'width=640,height=580,scrollbars=1')
	bookWindow.focus()
}

// To resize the popup to fit the image; credit to Peter Todorov
function PopupPic(sPicURL) {
   window.open( "popup.htm?"+sPicURL, "",
   "resizable=1,HEIGHT=200,WIDTH=200,left=40,top=70");
    }
   
// These two functions are for the image-swapping on the gift pages
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
    }

function showImage(filename) {
	var obj = document.getElementById("productImage");
	obj.src = "images/" + filename;
    }
		
// These functions expand and contract the Shopping Cart
function makeInvisible() {
	var cartContent;
	cartContent = document.getElementById("expandable");
	cartContent.style.visibility = "collapse";
}

function expand() {
	var header;
	heading = document.getElementById("clickToExpand");
	var cartContent;
	cartContent = document.getElementById("expandable");
	
	if(heading.innerHTML.indexOf("View") === 0) {
	  heading.innerHTML = "Hide Cart Summary";
		cartContent.style.visibility = "visible";
	}
	else {
	  heading.innerHTML = "View Cart Summary";
		cartContent.style.visibility = "collapse";
	}
}