// JavaScript Document

hrefString = document.location.href ? document.location.href : document.location;
var url = document.location.href;
var root = document.location.protocol + '//' + document.location.host
var pos = url.indexOf('//');
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);
var www = url.slice(root.length);
var pos2 = www.indexOf('/');
var yyy = url.slice(0, pos + pos2 + 3);

var fileNameAnn = url.slice(pos + 1, posAnn);
//alert(path);
//alert(xxx);
//alert(yyy);

if (www.match('/_blog/News'))
{
	www = '/_blog/News';
}

$(document).ready(function(){
	$('a[href$="' + www + '"]').parents('li').addClass('selected');
	
	//$('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);
	//});
});
