// JavaScript Document

function addToCart(itemID) {
	theAction = 'Add';
	theSourcePub = 'Hildegard Publishing Company';
	theSourceURL = 'http://www.hildegard.com';
	theURL = 'http://www.presser.com/e-Store/Cart/externalCart.cfm?Action='+theAction+'&ItemID='+itemID+'&SourceSite='+escape(theSourcePub)+'&SourceURL='+escape(theSourceURL);
	if(typeof(presserCartWindow)=='undefined') {
		presserCartWindow = window.open(theURL,'presserCart','height=300,width=600,scrollbars,resizable,status,menubar');
	} else {
		if(!presserCartWindow.closed) {
			presserCartWindow.location.href = theURL;
		} else {
			presserCartWindow = window.open(theURL,'presserCart','height=300,width=600,scrollbars,resizable,status,menubar');
		}
	}
	presserCartWindow.focus();
}


/*function addToCart_new(itemID) {
		theURL = 'http://www.presser.com/e-Store/Cart/externalCart.cfm?Action=Add&ItemID='+itemID+'&SourceSite='+escape('Carl Fischer Music')+'&SourceURL='+escape('http://www.carlfischer.com/Fischer/welcome.html')
		if(typeof(CFCartWindow)=='undefined') {
			alert ("Please Note: You are now leaving CarlFischer.com and will be taken to Presser.com for this transaction. Please note that Carl Fischer's Privacy Policy and Terms Of Use are no longer applicable while you are on the Presser.com site.");
	  		CFCartWindow = window.open(theURL,'CFCart','height=300,width=600,scrollbars,resizable,status,menubar');
	  	} else {
	   		if(!CFCartWindow.closed) {
				CFCartWindow.location.href = theURL;
	   		} else {
	   			CFCartWindow = window.open(theURL,'CFCart','height=300,width=600,scrollbars,resizable,status,menubar');
	   		}
	  	}
	  	CFCartWindow.focus();
}*/

function addToCart_rev(itemID){
	if(typeof(hpcCartWindow)=='undefined') {
		hpcCartWindow = window.open("add_to_cart.php?itemID="+itemID,'hpcCart','height=300,width=600, scrollbars, resizable, status, menubar');
		/*hpcCartWindow = window.open(theURL,'presserCart','height=300,width=600,scrollbars,resizable,status,menubar');*/
	} else {
		if(!hpcCartWindow.closed) {
			hpcCartWindow.location.href = "add_to_cart.php?itemID="+itemID;
		} else {
			hpcCartWindow = window.open("add_to_cart.php?itemID="+itemID,'hpcCart','height=300,width=600, scrollbars, resizable, status, menubar');
		}
	}
	hpcCartWindow.focus();
}

function addToCart_sub(itemID){
	if(typeof(hpcCartWindow)=='undefined') {
		hpcCartWindow = window.open("../add_to_cart.php?itemID="+itemID,'hpcCart','height=300,width=600, scrollbars, resizable, status, menubar');
		/*hpcCartWindow = window.open(theURL,'presserCart','height=300,width=600,scrollbars,resizable,status,menubar');*/
	} else {
		if(!hpcCartWindow.closed) {
			hpcCartWindow.location.href = "../add_to_cart.php?itemID="+itemID;
		} else {
			hpcCartWindow = window.open("../add_to_cart.php?itemID="+itemID,'hpcCart','height=300,width=600, scrollbars, resizable, status, menubar');
		}
	}
	hpcCartWindow.focus();
}
