﻿/*::::::::::::::::::::::::::::::::::::::::::::
		Base JS
		Design/HTML/CSS/JS by Brandon Kidd
		Copyright © 2010 McMurry
::::::::::::::::::::::::::::::::::::::::::::*/

(function($) {
	$(function() {
		// jQuery

		// Pager
		$(".pager a[disabled=disabled]").addClass("disabled");
		$(".pager .pager-command:last").addClass("pager-next");
		//show/hide job details
		$(".showlink").click(function(e){ $(this).parents(".listrow").children(".showhidepanel").slideToggle("fast"); });
		// Open Print Window
		$('#printForm').attr("target","_blank");
		
		// Header Navigation
		$('#header .navigation ul li').hoverIntent(dPanel);
		$('#header .navigation a').removeAttr('title');
		$('#header .navigation ul li .subnav').css('opacity','0.95');
		
		// Site Search
		$('#header .top-nav .search').removeAttr('href').click(function(){ if($(this).hasClass('search-expanded')){ $('#header .site-search').fadeOut('medium', function(){ $('#header .top-nav .search').removeClass('search-expanded'); }); }else{ $('#header .site-search').fadeIn('medium', function(){ $('#header .top-nav .search').addClass('search-expanded'); }); }});
		$('#header .site-search input').val('Enter keyword...').focus(function(){ $(this).filter(function(){ return $(this).val() == '' || $(this).val() == 'Enter keyword...'; }).val('').addClass('focus'); }).blur(function(){ $(this).filter(function(){ return $(this).val() == ''; }).val('Enter keyword...').removeClass('focus'); });
		$('#header .site-search a').click(function(){ if($('#header .site-search input').val() != 'Enter keyword...'){ window.location = '/SearchResults.aspx?searchterm=' + $('#header .site-search input').val(); }});
	});
})(jQuery);

// Header Navigation Hover Intent Setup
var dPanel = { interval: 100, sensitivity: 10, over: addPanel, timeout: 100, out: removePanel };
function addPanel(){ $($(this).find('div.subnav')).fadeIn('fast'); $(this).addClass('hover'); }
function removePanel(){ $($(this).find('div.subnav')).fadeOut('fast'); $(this).removeClass('hover'); }

// Font Resizer
function fontResize(size){ var litContent = document.getElementById("litContent"); switch (size) { case "normal": litContent.style.fontSize = "1em"; break; case "medium": litContent.style.fontSize = "1.2em"; break; case "large": litContent.style.fontSize = "1.4em"; break; }}
// Print
function printpage(){ document.getElementById("hdn_Title").value = document.title; document.getElementById("hdn_Content").value = document.getElementById("main_content").innerHTML; document.forms[1].submit(); }
// Bookmark
function bookmarkpage(bookmarkUrl){ var bookmarkTitle = document.title; if (window.sidebar) { window.sidebar.addPanel(bookmarkTitle, bookmarkUrl, ""); } else if(window.external){ window.external.AddFavorite(bookmarkUrl, bookmarkTitle); }else if(window.opera && window.print){ var elem = document.getElementById('menu_bookmark'); elem.setAttribute('href', bookmarkUrl); elem.setAttribute('title', bookmarkTitle); elem.setAttribute('rel', 'sidebar'); elem.click(); }}
// Textbox Char count
function CheckFieldLength(fn, rn, mc){ var len = fn.value.length; if (len > mc){ fn.value = fn.value.substring(0, mc); len = mc; } document.getElementById(rn).innerHTML = mc - len; }
