// Code section for Track clicks to download links.
function dcsDownload(evt){
	evt=evt||(window.event||"");
	var agt=navigator.userAgent.toLowerCase();
	var major=parseInt(navigator.appVersion);
	var nn=((agt.indexOf("mozilla")!=-1)&&(agt.indexOf("compatible")==-1));
	var nn_e=(nn&&(major>=4));
	var click = false;
	if (nn_e){
		if (typeof(evt.keyCode) == 'undefined') {
			if (evt.which == 1) {
				click = true;
			}
		} else {
			if (evt.keyCode == 13) {
				click = true;
			}
		}
	} else {
		if (evt.keyCode == 13) {
			click = true;
		} else if (typeof(evt.button) != 'undefined') {
			if (evt.button == 1) {
				click = true;
			}
		}
	}
	if (click) {
		var e=dcsEvt(evt,"A");
		if (e.hostname&&dcsIsOnsite(e.hostname)){
			var types="zip,exe,tar,pdf";
			if (types.indexOf(e.pathname.substring(e.pathname.lastIndexOf(".")+1,e.pathname.length))!=-1){
				var qry=e.search?e.search.substring(e.search.indexOf("?")+1,e.search.length):"";
				if (qry.toUpperCase().indexOf("WT.SVL=")==-1){
					WT.svl=dcsParseSvl(e.name?e.name.toString():(e.onclick?e.onclick.toString():""));
				}
				var path=e.pathname?((e.pathname.indexOf("/")!=0)?"/"+e.pathname:e.pathname):"/";
				gHref="";
				dcsMultiTrack("DCS.dcssip",e.hostname,"DCS.dcsuri",path,"DCS.dcsqry",e.search||"","WT.ti","Download:"+(e.innerHTML||""),"WT.dl","1");
				DCS.dcssip=DCS.dcsuri=DCS.dcsqry=WT.ti=WT.svl=WT.dl="";
			}
		}
	}
}

// Code section for Track right clicks to download links.
function dcsRightClick(evt){
	evt=evt||(window.event||"");
	if (evt){
		var btn=evt.which||evt.button;
		if (btn!=1){
			var e=evt.target||evt.srcElement;
			if (dcsIsHttp(e)&&dcsIsOnsite(e.hostname)){
			var types="zip,exe,tar,pdf";
				if (types.indexOf(e.pathname.substring(e.pathname.lastIndexOf(".")+1,e.pathname.length))!=-1){
					var path=e.pathname?((e.pathname.indexOf("/")!=0)?"/"+e.pathname:e.pathname):"/";
					gHref="";
					dcsMultiTrack("DCS.dcssip",e.hostname,"DCS.dcsuri",path,"DCS.dcsqry","","WT.ti","Download:"+path,"WT.dl","1","WT.rc","1");
					DCS.dcssip=DCS.dcsuri=WT.ti=WT.dl=WT.rc="";
				}
			}
		}
	}
}
