Error Thrown: " + errorThrown);} }); } } function process_dlr_response(xml) { var msg = xml.getElementsByTagName("msg"); if (msg.length) { if (parseInt(msg[0].getAttribute('user'))) { var warn=''; } else { var warn=' We rely on cookies to keep track of your request - if you clear cookies or use a different browser or wait for more than 30 days your request will no longer be accessible.'; } alert('Your request has been noted. Remember you MUST go to "My Download Requests" (under Photo Gallery) and submit your request by clicking "Edit/Submit" and filling out the details.'+warn); jQuery("#dlr_status").text(msg[0].getAttribute('content')); jQuery("#dl_image_count").html('You have an open Download Request for '+msg[0].getAttribute('total')+' images.');	// Note this text is updated in sourcerer\download_request.php so if you update change it there as well if (parseInt(msg[0].getAttribute('add'))) { jQuery('.cancel_download').show(); jQuery('.cancel_text').show(); jQuery('.request_download').hide(); jQuery('.request_text').hide(); } else { jQuery('.cancel_download').hide(); jQuery('.cancel_text').hide(); jQuery('.request_download').show(); jQuery('.request_text').show(); } } } function download_request(add,period) { jQuery("#status").text("sending request..."); // if there is not a user then we rely on a cookie - if it does not exist then we must create it if (!birdlife_user) { // are cookies supported - if not then it is very hard if (!navigator.cookieEnabled) { alert("Sorry - we can only process download requests for logged-in users OR if you have cookies enabled"); return; } // Do we already have a cookie? if (document.cookie.split(';').some((item) => item.trim().startsWith('BIRDLIFE_dlr='))) { } // If not create one else { var exdate=new Date(); exdate.setDate(exdate.getDate() + period); var c_value=escape(birdlife_session) + ";path=/" + "; expires="+exdate.toUTCString();	// UPDATE 20120517 - all path document.cookie="BIRDLIFE_dlr=" + c_value; //alert("DC "+document.cookie); var j=document.cookie.indexOf("BIRDLIFE_dlr"); if (j<0) { alert("Sorry - we can only process download requests for logged-in users OR if you have cookies enabled"); return; } } } jQuery.ajax({ url: "https://www.birdlifephotography.org.au/components/com_blphotos/ajax/process_dlr.php",	type: "POST", data:{ user: birdlife_user, //	birdlife_session:birdlife_session, image:birdlife_image, add:add, '7f64a3b0e994be2e1c5ee38ad6e4aafb':1, }, success: function( xml) { process_dlr_response(xml); }, error: function(xmlHttpRequest, statusText, errorThrown){jQuery("#status").html("Error processing request.