if (jQuery) {
	
	//plugin for inputTextDefValue
	$.fn.inputTextDefValue = function() {
		return this.each( function() {
			if ($(this).is("input[type=text]")) {
				var defVal = this.value;
				
				var onBlur = function() {
					if (this.value == "") {
						this.value = defVal;
					}
				}
				
				var onFocus = function() {
					if (this.value == defVal) {
						this.value = "";
						//this.select();
					}
				}
				
				$(this).bind("blur", onBlur);
				$(this).bind("focus", onFocus);
			}
		});
	}
	
	//fix png
	$.fn.fixPng = function() {
		return this.each( function() {
			if (/\.png$/ig.test(this.src)) {
				s = 'display: block; float: left';
				s += ';margin-left:'+($(this).css("margin-left") ? parseInt($(this).css("margin-left")) : 0)+'px';
				s += ';margin-top:'+($(this).css("margin-top") ? parseInt($(this).css("margin-top")) : 0)+'px';
				s += ';width:'+ ((this.width) ? this.width : $(this).width)+'px';
				s += ';height:'+ ((this.height) ? this.height : $(this).height)+'px';
				
				o = $('<span style="'+s+'; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, src=\''+this.src+'\',sizingMethod=\'scale\')"></span>');
				$(this).css("display","none").parent().append(o);
				return;
			}
		});
	}
	
//	$(document).ready(function() {
// Changed to window.load DMC 4/24/08 to fix IE6 load bug
	$(window).load(function() {
		//initialize searchbox tab navigation
		//alert ("initializing serarchbox");
		$("#searchbox>ul>li>span.a>span>a").each(function() {
			$(this).click(function() {
				if ($(this).parent().parent().parent().is("li.active")) {
					return false;
				}
				
				$("#searchbox").find("li.active").removeClass("active");
				$(this).parent().parent().parent().addClass("active");
				return false;
			});
		});
		
		//initialize inputTextDefValue plugin
		$("input.inputTextDefValue").inputTextDefValue();
		
		//
		if ($.fn.visualCheckbox) {
			if ($("#counselorBox").length > 0) {
				$("#counselorBox")
				$("input[type='checkbox']","#counselorBox").visualCheckbox();
			}
		}
		
		if (jQuery.browser.msie && jQuery.browser.version < 7) {
			$("img.fixpng").fixPng();
		}
	});
}