/* putFileInHead allows css file to be inserted in head after mobile view disables all stylesheets */
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 */

$(document).ready(function() {
   $('#nav a').hover(function() {
    $(this).css({'background-position' : 'center left', 'cursor' : 'pointer'});
	}, function() {
	$(this).css('background-position','top left');
	});
	

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

if (loc == 'home_section') {
$('.navHome').css('background-position', 'bottom left');
$('.navHome').html('<span>Mayor Home - selected </span>');
   $('.navHome').hover(function() {
    $(this).css('background-position', 'bottom left');
    $(this).attr({title:'Mayor Home - selected'});
	}, function() {
	$(this).css('background-position','bottom left');
	});
}

if (loc == 'about_index') {
$('.navAbout').css('background-position', 'bottom left');
 $('.navAbout').removeAttr('href');
 $('.navAbout').html('<span>About Mayor Sanders - selected </span>');
   $('.navAbout').hover(function() {
    $(this).css({'background-position' : 'bottom left', 'cursor' : 'default'});
    $(this).attr({title:'About Mayor Sanders - selected'});
	}, function() {
	$(this).css('background-position','bottom left');
	});
}

if (loc == 'about_section') {
$('.navAbout').css('background-position', 'bottom left');
$('.navAbout').html('<span>About Mayor Sanders - selected </span>');
   $('.navAbout').hover(function() {
    $(this).css('background-position', 'bottom left');
    $(this).attr({title:'About Mayor Sanders - selected'});
	}, function() {
	$(this).css('background-position','bottom left');
	});
}

if (loc == 'contact_index') {
$('.navContact').css('background-position', 'bottom left');
 $('.navContact').removeAttr('href');
 $('.navContact').html('<span>Contact My Office - selected </span>');
   $('.navContact').hover(function() {
    $(this).css({'background-position' : 'bottom left', 'cursor' : 'default'});
    $(this).attr({title:'Contact My Office - selected'});
	}, function() {
	$(this).css('background-position','bottom left');
	});
}

if (loc == 'contact_section') {
$('.navContact').css('background-position', 'bottom left');
$('.navContact').html('<span>Contact My Office - selected </span>');
   $('.navContact').hover(function() {
    $(this).css('background-position', 'bottom left');
    $(this).attr({title:'Contact My Office - selected'});
	}, function() {
	$(this).css('background-position','bottom left');
	});
}

if (loc == 'agenda_index') {
$('.navAgenda').css('background-position', 'bottom left');
 $('.navAgenda').removeAttr('href');
 $('.navAgenda').html('<span>Mayor\'s Agenda - selected </span>');
   $('.navAgenda').hover(function() {
    $(this).css({'background-position' : 'bottom left', 'cursor' : 'default'});
    $(this).attr({title:'Mayor\'s Agenda - selected'});
	}, function() {
	$(this).css('background-position','bottom left');
	});
}

if (loc == 'agenda_section') {
$('.navAgenda').css('background-position', 'bottom left');
$('.navAgenda').html('<span>Mayor\'s Agenda - selected </span>');
   $('.navAgenda').hover(function() {
    $(this).css('background-position', 'bottom left');
    $(this).attr({title:'Mayor\'s Agenda - selected'});
	}, function() {
	$(this).css('background-position','bottom left');
	});
}

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

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

});


