/*
	NEP scripts (utilizing jQuery 1.2.6)
	Developed by Saforian
*/


/* --- Initialize page --- */
$(document).ready(function(){

	// 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 (IE6 selector fix)
	$(".columns .col:last-child").addClass("last-child");
	$(".three .col:first-child").addClass("first-child");

	// Add wrappers to boxes
	$(".box").wrapInner("<div class='wrapper'><div class='wrapper'></div></div>");


	// IE6 PNG fix
	iepng();
});




// IE 5.5 - 6.0 PNG support
function iepng() {
	var i, src, div;

	var isIE = (document.all && navigator.appName == "Microsoft Internet Explorer" &&
	(navigator.userAgent.indexOf("MSIE 5.5") >= 0 || navigator.userAgent.indexOf("MSIE 6.") >= 0));

	if (!isIE) return;

	// Inline image PNG transparency for IE (derived from youngpup.net)
	for (i = document.images.length - 1, img = null; (img = document.images[i]); i--)
		if (img.src.match(/\.png$/i) != null) {
			src = img.src;

			div = document.createElement("div");
			div.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "', sizing='scale')";
			div.style.width = img.width + "px";
			div.style.height = img.height + "px";
			div.id = img.id;
			div.className = img.className;
			img.replaceNode(div);
		}
}
