// JavaScript Document

hrefString = document.location.href ? document.location.href : document.location;
var url = document.location.href;
var pos = url.lastIndexOf('/');
var posHash = url.lastIndexOf('#'); //not used
var suffix = '.html'
var posSuffix = url.lastIndexOf(suffix);
var posAnn = url.lastIndexOf('?');
var path = url.slice(0, pos + 1);
var fileName = url.slice(pos + 1, posSuffix + suffix.length);

var fileNameAnn = url.slice(pos + 1, posAnn);

$(document).ready(function(){
	$('a[href$="/' + fileName + '"]').parents('li').addClass('active');
	
	$('ul#navigation > li').hover(function(){
		$(this).children('ul').css('display', 'block');},
		function(){
		$(this).children('ul').css('display', 'none');
	});
	
	//$('ul#navigation li').each(function(){
	//	var text = $(this).children('a').text();
	//	$(this).attr('title', text);
	//});
	
	//$('ul#navigation > ul > li').each(function(){
	//	var text = $(this).children('a').text().replace(/ /g,'');
	//	var title = text.replace(text.charAt(0), text.charAt(0).toLowerCase());
	//	$(this).attr('id', title);
	//});
	
	//$('#nav .subMenu > li').each(function(){
	//	var text = $(this).children('a').text().replace(/ /g,'');
	//	var pId = $(this).parents('li').attr('id');
	//	$(this).attr('id', pId + text);
	//});
});
