$jq = jQuery.noConflict();//This line allows $ to be assigned to prototype, and $jq assigned to jquery function record_media_download(theMediaType, theMediaName, theMediaID){ $jq.ajax({ type: "POST", url: "ajax--record_media_download", data: "mediaType=" + theMediaType + "&mediaID=" + theMediaID + "&mediaName=" + theMediaName //, //success: function(msg){ // alert( "Data Saved: " + msg ); //}, //error: function(msg){ // alert( "Data Error: " + msg ); // } }); } function record_media_image_download(theMediaID, site){ //Put this in, as currently the js file (product--script-imagebrowser-new.js) for handleing the initial setup of samedaymusic //product images does not set k on the page load, only after an alternative image is clicked, thus we //need to load up k (like zzounds does on page load) and grab the text content afterwards. //Also test between sameday and zzounds, as IE can record value for zzounds but not sameday. //Also, if on a single image is present, no mediaName is set in html or javascript so neither browser can get mediaName. if (site=='sameday'){ //sameday if (window.k && window.k.id){ //sameday already clicked on alt image, k is set. if (k.textContent){ //Firefox theMediaName = k.textContent; } else { //IE theMediaName = ''; } } else {//sameday first time without switching any image, thus k is not set. k = $("additionalImage1"); if (k){//See if we can get any image information... If there is > 1 image, and using firefox, we should be able to get info k.className = "additionalImageActive"; if (k.textContent){//Firefox browsers will be able to get k.textContent theMediaName = k.textContent; } else {//IE can't get k.textContent, so set it to null until this is fixed. theMediaName = ''; } } else {//if there is only a single image without any alt images, thus image name information is set in html/javascript, so set name to empty theMediaName = ''; } } } else if (site=='zzounds'){//zzounds if (window.k && window.k.id){ //media name is set theMediaName = k.firstChild.nodeValue;//IE and Firefox } else {//No media name set in html/javascript for all browsers- case where there is only a single image without any alt images. theMediaName = ''; } } $jq.ajax({ type: "POST", url: "ajax--record_media_download", data: "mediaType=image&mediaName=" + theMediaName + "&mediaID=" + theMediaID }); }