// Click tracking function, takes href from the executing URL, cleans it, and makes request to trackclick.asp for record of click
function trackclick(href2,referrer2,type2){

href2 = href2.replace('http://','');
href2 = href2.replace('https://','');
href2 = href2.replace('www.','');
href2 = href2.replace(new RegExp(/\/$/),"");

	if(href2.indexOf("/")==href2.length-1){
		href2 = href2.replace('/','');
	}

var currentTime = new Date();
var curryear = currentTime.getFullYear();
var currmonth = currentTime.getMonth();
var currday = currentTime.getDate();
var currhour = currentTime.getHours();
var currmin = currentTime.getMinutes();
var currsec = currentTime.getSeconds();

if(document.images){
(new Image()).src='http://www.explorewisconsin.com/trackclick.asp?url='+href2+'&referrer='+referrer2+'&type='+type2+'&ts='+curryear+currmonth+currday+currhour+currmin+currsec;
}
return true;

}


// Function to report JS errors
window.onerror = function(msg, err_url, line) {
	alert('A JavaScript error has occured.\nSupport personel have been notified.');
		if(document.images){
			(new Image()).src='/includes/js/js_error_email.asp?err_url='+err_url+'&message='+msg+'&line='+line
		}
	}

