/* putFileInHead used in mobile view to apply mobile CSS after all stylesheets are disabled */
function putFileInHead(filename){
    if (filename.match(".js")) { //if filename is a external JavaScript file
        var fileref = document.createElement('script');
        fileref.setAttribute("type", "text/javascript");
        fileref.setAttribute("src", filename);
    }
    else 
        if (filename.match(".css")) { //if filename is an external CSS file
            var fileref = document.createElement("link");
            fileref.setAttribute("rel", "stylesheet");
            fileref.setAttribute("type", "text/css");
            fileref.setAttribute("href", filename);
        }
    if (typeof fileref != "undefined") 
        document.getElementsByTagName("head")[0].appendChild(fileref);
}

/* requires jquery-1.2.6.js 
   Controls on-over-off display of topnav elements */
$(document).ready(function() {
   $('#nav a').hover(function() {
    $(this).css({'background-position' : 'center left', 'cursor' : 'pointer'});
	}, function() {
	$(this).css('background-position','top left');
	});
	

if (globalNavLoc == 'home_index') {
$('.navHome').css('background-position', 'bottom left');
 $('.navHome').removeAttr('href');
 $('.navHome').html('<span>Home - selected </span>').attr({title:'Home - selected'});
   $('.navHome').hover(function() {
    $(this).css({'background-position' : 'bottom left', 'cursor' : 'default'});
	}, function() {
	$(this).css('background-position','bottom left');
	});
}

if (globalNavLoc == 'business_index') {
$('.navBusiness').css('background-position', 'bottom left');
 $('.navBusiness').removeAttr('href');
 $('.navBusiness').html('<span>Business - selected </span>').attr({title:'Business - selected'});
   $('.navBusiness').hover(function() {
    $(this).css({'background-position' : 'bottom left', 'cursor' : 'default'});
	}, function() {
	$(this).css('background-position','bottom left');
	});
}

if (globalNavLoc == 'business_section') {
$('.navBusiness').css('background-position', 'bottom left');
$('.navBusiness').html('<span>Business - selected </span>').attr({title:'Business - selected'});
   $('.navBusiness').hover(function() {
    $(this).css({'background-position' : 'center left', 'cursor' : 'pointer'});
	}, function() {
	$(this).css('background-position','bottom left');
	});
}

if (globalNavLoc == 'cityhall_index') {
$('.navCityhall').css('background-position', 'bottom left');
 $('.navCityhall').removeAttr('href');
 $('.navCityhall').html('<span>City Hall - selected </span>').attr({title:'City Hall - selected'});
   $('.navCityhall').hover(function() {
    $(this).css({'background-position' : 'bottom left', 'cursor' : 'default'});
	}, function() {
	$(this).css('background-position','bottom left');
	});
}

if (globalNavLoc == 'cityhall_section') {
$('.navCityhall').css('background-position', 'bottom left');
$('.navCityhall').html('<span>City Hall - selected </span>').attr({title:'City Hall - selected'});
   $('.navCityhall').hover(function() {
    $(this).css({'background-position' : 'center left', 'cursor' : 'pointer'});
	}, function() {
	$(this).css('background-position','bottom left');
	});
}

if (globalNavLoc == 'community_index') {
$('.navCommunity').css('background-position', 'bottom left');
 $('.navCommunity').removeAttr('href');
 $('.navCommunity').html('<span>Community - selected </span>').attr({title:'Community - selected'});
   $('.navCommunity').hover(function() {
    $(this).css({'background-position' : 'bottom left', 'cursor' : 'default'});
	}, function() {
	$(this).css('background-position','bottom left');
	});
}

if (globalNavLoc == 'community_section') {
$('.navCommunity').css('background-position', 'bottom left');
$('.navCommunity').html('<span>Community - selected </span>').attr({title:'Community - selected'});
   $('.navCommunity').hover(function() {
    $(this).css({'background-position' : 'center left', 'cursor' : 'pointer'});
	}, function() {
	$(this).css('background-position','bottom left');
	});
}

if (globalNavLoc == 'departments_index') {
$('.navDepartments').css('background-position', 'bottom left');
 $('.navDepartments').removeAttr('href');
 $('.navDepartments').html('<span>Departments - selected </span>').attr({title:'Departments - selected'});
   $('.navDepartments').hover(function() {
    $(this).css({'background-position' : 'bottom left', 'cursor' : 'default'});
	}, function() {
	$(this).css('background-position','bottom left');
	});
}

if (globalNavLoc == 'departments_section') {
$('.navDepartments').css('background-position', 'bottom left');
$('.navDepartments').html('<span>Departments - selected </span>').attr({title:'Departments - selected'});
   $('.navDepartments').hover(function() {
    $(this).css({'background-position' : 'center left', 'cursor' : 'pointer'});
	}, function() {
	$(this).css('background-position','bottom left');
	});
}

if (globalNavLoc == 'news_index') {
$('.navNews').css('background-position', 'bottom left');
 $('.navNews').removeAttr('href');
 $('.navNews').html('<span>News Center - selected </span>').attr({title:'News Center - selected'});
   $('.navNews').hover(function() {
    $(this).css({'background-position' : 'bottom left', 'cursor' : 'default'});
	}, function() {
	$(this).css('background-position','bottom left');
	});
}

if (globalNavLoc == 'news_section') {
$('.navNews').css('background-position', 'bottom left');
$('.navNews').html('<span>News Center - selected </span>').attr({title:'News Center - selected'});
   $('.navNews').hover(function() {
    $(this).css({'background-position' : 'center left', 'cursor' : 'pointer'});
	}, function() {
	$(this).css('background-position','bottom left');
	});
}

if (globalNavLoc == 'information_index') {
$('.navInformation').css('background-position', 'bottom left');
 $('.navInformation').removeAttr('href');
 $('.navInformation').html('<span>Information - selected </span>').attr({title:'Information - selected'});
   $('.navInformation').hover(function() {
    $(this).css({'background-position' : 'bottom left', 'cursor' : 'default'});
	}, function() {
	$(this).css('background-position','bottom left');
	});
}

if (globalNavLoc == 'information_section') {
$('.navInformation').css('background-position', 'bottom left');
$('.navInformation').html('<span>Information - selected </span>').attr({title:'Information - selected'});
   $('.navInformation').hover(function() {
    $(this).css({'background-position' : 'center left', 'cursor' : 'pointer'});
	}, function() {
	$(this).css('background-position','bottom left');
	});
}

if (globalNavLoc == 'leisure_index') {
$('.navLeisure').css('background-position', 'bottom left');
 $('.navLeisure').removeAttr('href');
 $('.navLeisure').html('<span>Leisure - selected </span>').attr({title:'Leisure - selected'});
   $('.navLeisure').hover(function() {
    $(this).css({'background-position' : 'bottom left', 'cursor' : 'default'});
	}, function() {
	$(this).css('background-position','bottom left');
	});
}

if (globalNavLoc == 'leisure_section') {
$('.navLeisure').css('background-position', 'bottom left');
$('.navLeisure').html('<span>Leisure - selected </span>').attr({title:'Leisure - selected'});
   $('.navLeisure').hover(function() {
    $(this).css({'background-position' : 'center left', 'cursor' : 'pointer'});
	}, function() {
	$(this).css('background-position','bottom left');
	});
}

if (globalNavLoc == 'services_index') {
$('.navServices').css('background-position', 'bottom left');
 $('.navServices').removeAttr('href');
 $('.navServices').html('<span>Services A-Z - selected </span>').attr({title:'Services A-Z - selected'});
   $('.navServices').hover(function() {
    $(this).css({'background-position' : 'bottom left', 'cursor' : 'default'});
	}, function() {
	$(this).css('background-position','bottom left');
	});
}

if (globalNavLoc == 'services_section') {
$('.navServices').css('background-position', 'bottom left');
$('.navServices').html('<span>Services A-Z - selected </span>').attr({title:'Services A-Z - selected'});
   $('.navServices').hover(function() {
    $(this).css({'background-position' : 'center left', 'cursor' : 'pointer'});
	}, function() {
	$(this).css('background-position','bottom left');
	});
}

if (globalNavLoc == 'visiting_index') {
$('.navVisiting').css('background-position', 'bottom left');
 $('.navVisiting').removeAttr('href');
 $('.navVisiting').html('<span>Visiting - selected </span>').attr({title:'Visiting - selected'});
   $('.navVisiting').hover(function() {
    $(this).css({'background-position' : 'bottom left', 'cursor' : 'default'});
	}, function() {
	$(this).css('background-position','bottom left');
	});
}

if (globalNavLoc == 'visiting_section') {
$('.navVisiting').css('background-position', 'bottom left');
$('.navVisiting').html('<span>Visiting - selected </span>').attr({title:'Visiting - selected'});
   $('.navVisiting').hover(function() {
    $(this).css({'background-position' : 'center left', 'cursor' : 'pointer'});
	}, function() {
	$(this).css('background-position','bottom left');
	});
}

});


