var ie = (function(){ var undef, v = 3, div = document.createElement('div'), all = div.getElementsByTagName('i'); while ( div.innerHTML = '<!--[if gt IE ' + (++v) + ']><i></i><![endif]-->', all[0] ); return v > 4 ? v : undef; }());
var log; if(window.console && typeof console.debug==="function"){log=function(){console.debug.apply(console,arguments);};}else{log=function(){return;}}
$.fn.log = function (msg) { window.console ? console.log("%s: %o", msg, this) : null; return this; };
$.expr[':'].external  = function(obj) { return !obj.href.match(/^mailto:/) && (obj.hostname != document.location.hostname); };
$.expr[':'].mailto  = function(obj) { return obj.href.match(/^mailto:/); };
document.onclick = function(event) {
	event = event || window.event;
	var target = event.target || event.srcElement, element = target.tagName.toLowerCase();
	if (element == "a") { var href = target.getAttribute("href"), urlHost = document.domain.replace(/^www\./i,""); var urlPattern = "^(?:https?:)?\/\/(?:(?:www)\.)?" + urlHost + "\/?"; checkEvent(href,urlPattern); }
	function checkEvent(href,urlPattern) {
		if ((href.match(/^https?\:/i)) && (!href.match(urlPattern))){
			if (href.match(/^.*\.(pdf|jpg|png|gif|zip|mp3|txt|doc|rar|js|py)$/i)) { _gaq.push(['_trackEvent', 'Download', 'click', href]); } 
			else { _gaq.push(['_trackEvent', 'External', 'click', href]); } } 
		else if (href.match(/^mailto\:/i)) { _gaq.push(['_trackEvent', 'Email', 'click', href.substr(7)]); } 
		else if (href.match(/^.*\.(pdf|jpg|png|gif|zip|mp3|txt|doc|rar|js|py)$/i)) { _gaq.push(['_trackEvent', 'Download', 'click', href]); }
	}
};
/* if(!Modernizr.input.placeholder){$("input").each(function(){if($(this).val()=="" && $(this).attr("placeholder")!=""){$(this).val($(this).attr("placeholder"));$(this).focus(function(){if($(this).val()==$(this).attr("placeholder")) $(this).val(""); this.select()});$(this).blur(function(){if($(this).val()=="") $(this).val($(this).attr("placeholder"));});}});} */


