/* executes double click tracking */
function trackDoubleclick(srcParam) {
	var container = document.getElementById("doubleclickTrackingContainer");
	
	if(container == null) {
		container = document.createElement("div");
		container.setAttribute("id", "doubleclickTrackingContainer");

		document.body.appendChild(container);
	}
	
  var tmpNum = Math.random() + "";
 	var a = tmpNum * 10000000000000;
  var container = document.getElementById("doubleclickTrackingContainer");
	
	if(srcParam != undefined && srcParam != "") {
		try {
			container.innerHTML='<img src="' + srcParam + ';num=' + a + '?" width="1" height="1" alt=""/>';
		} catch(e) {}
	}
}

/* executes double click tracking and refers to the specified url */
function trackDoubleclickAndGoTo(doubleclickSrc, targetUrl, targetFrame) {
	if(typeof doubleclickSrc != 'undefined' && doubleclickSrc != "") {
		trackDoubleclick(doubleclickSrc);
	}
	
	if(typeof targetUrl != 'undefined' && targetUrl != "") {
		if(typeof targetFrame != 'undefined') {
			switch(targetFrame) {
				case "top":
					top.location.href = targetUrl;
					break;
				case "blank":
					window.open(targetUrl);
					break;
			  default:
					self.location.href = targetUrl;
					break;
			}
		}
	}
}
