	function AddToWishlist(ID,CC,IPA)
	{
		if(IPA != "")
		{
			var url = 'http://www.irelandupclose.com/soap/wls.php';
			var params = {imageDesc:ID,countryCode:CC,ip:IPA};
			SOAP.q_async(url, 'urn:WishList', 'ATWL', params, awl_ok, awl_nok);
			alert("This image has been added to your Wishlist. \n\nTo view your wishlist click on the Wishlist button.\n\nNote: do not delete your browser cookies if you would like to keep your wishlist.");
		}else
			alert("We cannot add this image to your wishlist because you do not have a valid ID.  Please clear your browser history (cookies and temporary internet files), restart your browser and try again.\n\nIf you still cannot add images to your wishlist please send an email to info@SceneShifts.com");
	}

	function RemoveFromWishlist(ID,IPA)
	{
//		alert("Removing from Wishlist");
		var url = 'http://www.irelandupclose.com/soap/wls.php';
		var params = {imageDesc:ID,ip:IPA};
		SOAP.q_async(url, 'urn:WishList', 'RFWL', params, rwl_ok, rwl_nok);
		alert("This image has been removed from your Wishlist. \n\nYour Wishlist will be re-displayed after a few seconds. Or click on 'My Wishlist' to refresh now.");
	}
	
	function awl_ok(responseobject)
	{
		var xml = responseobject.responseXML;
//		var ret = dom_rtext(dom_ftag(xml,'retval'));				// Get return value as string
		var retval  = parseInt(dom_rtext(dom_ftag(xml,'retval')));	// Get return value as integer
		if(retval != 1) alert("Add to Wishlist Failed");// else alert("Added to Wishlist");
	}

	function awl_nok(responseobject)
	{
		alert("Add to Wishlist Failed");
	}
	
	function rwl_ok(responseobject)
	{
		var xml = responseobject.responseXML;
//		var ret = dom_rtext(dom_ftag(xml,'retval1'));				// Get return value as string
		var retval  = parseInt(dom_rtext(dom_ftag(xml,'retval1')));	// Get return value as integer
		if(retval != 1) alert("Remove from Wishlist Failed");
		window.open("http://www.irelandupclose.com/index.php?pf=98&pfName=SearchResult","_self");
	}

	function rwl_nok(responseobject)
	{
		alert("Remove from Wishlist Failed");
	}
	
//	This way we call a php page in a separate window/browser
	function callphp(iref,redisp) 
	{
		mywindow = window.open(iref,"mywindow","menubar=0,resizable=0,width=1,height=1");						// Call php page to update the database and remove the item from the wishlist
		if(redisp == 1)location.reload(true);					// Refresh this page
		return;
	}
