$(document).ready(function(){
   
$("#mainNav li a").each(function () {

    if ($(this).attr("href").length > 0) {
        var link = $(this).attr("href");
        var currenturl = window.location.href;
		
		if (currenturl.indexOf('come_visit/about_us.html') != -1) {
			var linktext = 'aboutusPage';				   
			$("body").attr("id", linktext);
			//$("body").attr("id", schedule');
		}
		else if (currenturl.indexOf('/about_us/') != -1) {
			var linktext = 'aboutus';				   
			$("body").attr("id", linktext);
			//$("body").attr("id", schedule');
		}
        else if (currenturl.indexOf(link) != -1) {
            $(this).addClass("here");
            var linktext = $(this).text().replace(/ /g,"").toLowerCase();
            var linktext = linktext.replace(String.fromCharCode(8217),"");
            var linktext = linktext.replace(String.fromCharCode(226),"a");

			//var myRegEx = new RegExp("'","g");
			//var linktext = $(this).text().replace(myRegEx, "").toLowerCase();
			
			$("body").attr("id", linktext);
			$("body").attr("class", 'navvisible');
        }
    }
});

});


sfHover = function() {
 	var sfEls = document.getElementById("mainNav").getElementsByTagName("LI");
 	for (var i=0; i<sfEls.length; i++) {
 		sfEls[i].onmouseover=function() {
	
 			this.className+=" sfhover";
 		}
 		sfEls[i].onmouseout=function() {
 			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
 		}
 	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);


