$(document).ready(
	function() {

		// Page-Top Finder
		$("#findertoggle").hide();
		$("a.togglefinder").click(function(){
			$("#findertoggle").slideToggle();
			return false;
		});

		// Textbox Hints
		$('input.txbhint').focus(function() {
			if ($(this).val() == "" || $(this).val() == $(this).attr('title')){
				$(this).val("").removeClass("hinted");
			}
		}).blur(function() {
			if ($(this).val() == "") {
				$(this).val($(this).attr('title')).addClass("hinted");
			}
		}).filter(function() {
			if ($(this).val() == "" || $(this).val() == $(this).attr('title')){
				$(this).val($(this).attr('title')).addClass("hinted");
			}
		});
		$('select.keyword').change(function(){
			var selectedservice = $(this).children('option:selected').text();
			if (selectedservice == "Choose a Service"){
				$('#selectedservice').addClass('hinted').text(selectedservice);
			} else {
				$('#selectedservice').removeClass('hinted').text(selectedservice);
			}
		});
		$('select.company').change(function(){
			var selectedcompany = $(this).children('option:selected').text();
			if (selectedcompany == "Choose a Company"){
				$('#selectedcompany').addClass('hinted').text(selectedcompany);
			} else {
				$('#selectedcompany').removeClass('hinted').text(selectedcompany);
			}
		});
		
		// Bookend Right Sidebar list items
		$(".contentsidebar li:first").addClass('first');
		$(".contentsidebar li:last").addClass('last');
				
		// Open links with rel="external" in new window - like ye ole' target="_blank"
		$('a[rel="external"]').click(function() {window.open( $(this).attr('href') ); return false;});


		// Zebra-stripe data tables
		$("table.data tbody").each(function() {
			$(this).removeClass("odd even");
			$("tr:odd", this).addClass("odd");
			$("tr:even", this).addClass("even");
		});


		// Initialize Lightbox
		$(".lightbox a").lightbox();
	}
);

