﻿var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-3774595-4']);
_gaq.push(['_trackPageview']);

(function() {
	var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
	ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
	var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();

function GetImg(path, style, vspace, hspace, align) {
	var txt = '<img src="' + baseUrl + path + '"';

	if (typeof style != "undefined") {
		txt = txt + 'style="' + style + '"';
	}

	if (typeof vspace != "undefined") {
		txt = txt + 'vspace="' + vspace + '"';
	}

	if (typeof hspace != "undefined") {
		txt = txt + 'hspace="' + hspace + '"';
	}

	if (typeof align != "undefined") {
		txt = txt + 'align="' + align + '"';
	}

	txt = txt + '"/>';
	document.write(txt);
}

function AttachEventToLinks() {
	var links = document.getElementsByTagName("a");
	var i;
	var link = '';
	for (i = 0; i <= links.length; i++) {
		if (links[i] != null) {
			link = links[i].toString();

			if ((link.length > 0) && (link.indexOf('javascript') == -1) && ((link + '/').indexOf(baseUrl) == -1)) {
				links[i].onclick = callLinkTag;
				if (links[i].captureEvents) links[i].captureEvents(Event.CLICK);
			}
		}
	}
}

function callLinkTag(e) {
	if (!e) var e = window.event;
	
	if (e.target) targ = e.target;
	else if (e.srcElement) targ = e.srcElement;

	if (targ.target == '_blank')
		ntptLinkTag('ev=linkclick&lc=' + encodeURIComponent(document.URL));
	else
		ntptEventTag('ev=linkclick');
}

function addEvent(obj, evType, fn) {
	if (obj.addEventListener) {
		obj.addEventListener(evType, fn, false);
		return true;
	} else if (obj.attachEvent) {
		var r = obj.attachEvent("on" + evType, fn);
		return r;
	} else {
		return false;
	}
}

//addEvent(window, 'load', AttachEventToLinks);

//prevent DNN from highjacking enter key press
$(function () {
    $("form").bind("keypress", function (e) {
        if (e.keyCode == 13) return false;
    });
});
