﻿// Fix for 404.aspx to correct missing page URL
//Can also be used for other special situations.
var GoogleAnalysticsSubstitute = null;
var pageTitle = document.title;
if (pageTitle.indexOf('Page Not Found') > 0) {
	GoogleAnalysticsSubstitute = '/MissingPageRequest';
} else {
	GoogleAnalysticsSubstitute = null;
}
//Functions
function PDFOpen(Location, GoogleAnPath){
//OpenPDFs in same and count them
	w=window.open(Location,'lccatwindow', 'resizable=1, scrollbars=1, height=768,width=800');
	_gaq.push(['_trackPageview','/Documents/' + GoogleAnPath]);
	w.focus();
}
function URLOpen(URL, Desc){
    //For menu entries that transfer to another page adding http:// where needed, hopefully everywhere
//This will ensure that they get counted
	if (URL.indexOf('http://') < 0){
		URL = 'http://' + URL;
	}
	WindowResult = window.open(URL, 'lccatwindow', 'height=800, width=1024, resizable=yes, scrollbars=yes, status=yes, toolbar=yes');
	_gaq.push(['_trackPageview','/Links/' + Desc]);
	WindowResult.focus();
}
function BingIt (Street, City, State, Zip) {
// Open Bing Map in New Window & Count It
	if (navigator.userAgent.indexOf('Windows Phone OS') >= 0) {
        URL = 'maps:' + Street + ',' + City + ',' + State + ',' + Zip + ',USA';}
    else {
	    URL = 'http://bing.com/maps/default.aspx?v=2&where1=' + Street + ',' + City + ',' + State + ',' + Zip + ',USA';
    }
	WindowResult=window.open(URL,'lccatwindow', 'height=800, width=1024, resizable=yes, scrollbars=yes, status=yes, toolbar=yes');
	_gaq.push(['_trackPageview','/Links/BingMaps']);
	WindowResult.focus();
}

