/*
	The Dominion Group scripts
	Developed by Foamcube ~ tdblanchard ~ TAW
*/

/* --- Initialize page --- */
$(document).ready(function(){


//   Browser sniffers
//~~~~~~IE

if ($.browser.msie) {
	$("html").addClass("browser-ie");
	}
//~~~~~~Firefox
if ($.browser.mozilla) {
	$("html").addClass("browser-firefox");
	}
//~~~~~~Safari
if ($.browser.safari) {
	$("html").addClass("browser-safari");
	}
// WORDPRESS

/*
$("#navigation ul li ul").css({display: "none"}); // Opera Fix
$("#navigation li").hover(function(){
		$(this).find('ul:first').css({visibility: "visible",display: "none"}).slideDown('fast');
		},function(){
		$(this).find('ul:first').slideUp().css({visibility: "hidden"});
		});
*/

$("#navigation ul li ul").css({display: "none"});

$("#navigation .menu>ul").addClass("main-nav");

$("#navigation .menu>ul > li").hover(function(){
		$(this).children("ul:hidden").slideDown(150);
		$(this).addClass("hover"); // IE6 hover support
	}, function(){
		$(this).children("ul").slideUp(90);
		$(this).removeClass("hover");
	});

//they wanted to get rid of the tooltips, so i hack
$("#navigation a").removeAttr("title");

/*$("#navigation li").hover(function(){
		$(this).find('ul:first').css({display: "block"});
		},
		function(){
			$(this).find('ul:first').css({display: "none"});
		});

*/

//end WORDPRESS
	// add active class to current nav
	$("#navigation li.current_page_item").addClass("active");
	$("#navigation .menu>ul>li").addClass("primary");
//sidenav same dealio
	$("#sidenav>ul>li:last-child, #navigation li ul li:last-child").addClass("last");


	// Stripe row colors
	$("table.data tr:nth-child(even)").not(".even").not(".odd").addClass("even");

	// Insert document icons
	$("a[href$=pdf]:not(:has(img))").append('<img class="icon" src="images/icon_pdf.gif" width="14" height="14" alt=" (PDF)">');
	$("a[href$=doc]:not(:has(img)), a[href$=docx]:not(:has(img))").append('<img class="icon" src="images/icon_word.gif" width="14" height="14" alt=" (Word Document)">');
	$("a[href$=xls]:not(:has(img)), a[href$=xlsx]:not(:has(img))").append('<img class="icon" src="images/icon_excel.gif" width="14" height="14" alt=" (Excel Spreadsheet)">');
	$("a[href$=ppt]:not(:has(img)), a[href$=pptx]:not(:has(img))").append('<img class="icon" src="images/icon_powerpoint.gif" width="14" height="14" alt=" (Powerpoint Presentation)">');

	// Column childs CSS3 fix
	$(".columns .col:last-child").addClass("last-child");
	$(".columns .col:first-child").addClass("first-child");
	$(".columns.three .col:eq(1)").addClass("middle-child");


	$(".go-wide").find("p:first").addClass("thin-p");

/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
auto-number the classnames of a list
*/
	$("ul#navigation>li").each(function(i){
		$(this).addClass("item-" + i);
	});



});


