
	function logDownload(fileName, category, product) {
		//alert('inside');
		var category = (category == null) ? "No Category" : category;
        var product = (product == null) ? "No Product" : product;
        var nameEQ = 'tsgRegistration=';

		var ca = document.cookie.split(';');
		var userEmail = 'User did not register';
		for(var i=0;i < ca.length;i++) {
			var c = ca[i];
			while (c.charAt(0)==' ') {
				c = c.substring(1,c.length);
			}
			if (c.indexOf(nameEQ) == 0) {
				userEmail = c.substring(c.indexOf('=') + 1,c.length);
			}
		}
		
			if (window.XMLHttpRequest) {
				req = new XMLHttpRequest();
			} else if (window.ActiveXObject) {
				req = new ActiveXObject("Microsoft.XMLHTTP");
			}

			
			if (window.XMLHttpRequest) {
				req2 = new XMLHttpRequest();
			} else if (window.ActiveXObject) {
				req2 = new ActiveXObject("Microsoft.XMLHTTP");
			}

			var url = '/servlets/downloadFile?email=' + escape(userEmail) + '&fileName=' + escape(fileName) + "&category=" + escape(category) + "&product=" + escape(product);
			alert(url);
			req.open("GET", url, true);
			req.onreadystatechange = callback;
			req.send(null);
			//callback();
			
			//url = 'http://touchpoint.tsgrp.com/touchpoint_v2/updateUserDownloadHistory.htm?email=' + escape(userEmail) + '&download=' + escape(fileName) + "&category=" + escape(category) + "&product=" + escape(product);
			//alert(url);
			//req2.open("GET", url, true);
			//req2.onreadystatechange = callback;
			//req2.send(null);
			//alert("done")
			//callback();
			
			return false;

	}

	function callback() {
		//alert('inside callback');
	}
