window.onload = function () {
	// Fix PNG for Ie 6
	if ( (/MSIE 6\.0/).test(navigator.userAgent) && !(/MSIE 7\.0/).test(navigator.userAgent) && !(/MSIE 8\.0/).test(navigator.userAgent) ) {	
		DD_belatedPNG.fix(".FixPng");
	}
}

$(document).ready(function(){
	hideLabel("userID","User Name");
	hideLabel("password","Password");

	//equalHeight(".Object");
	//sameHeight(".SameHeight");
	$("#nav ul > li").each(function(i) {
		var _li = $(this);
		_li.bind("mouseover",function() {
			if(!$(this).hasClass("Hover")) {
				$(this).addClass("Hover");
			}
		});
		_li.bind("mouseout",function() {
			$(this).removeClass("Hover");
		});		
	});
});

//Auto hide label
function hideLabel(obj,text) {
	$("#" + obj).focus(function() {
		if($(this).val() == text) {
			$(this).val("");
		}
	});
	$("#" + obj).blur(function() {
		if($(this).val() == "") {
			$(this).val(text);
		}
	});
}

function sameHeight(obj) {
	if($(obj).length > 0) {
		var maxHCell = 0;
		$(obj).each(function() {
			var thisObj = $(this);
			var thisH = thisObj.height();
			if(maxHCell < thisH) {
				maxHCell = thisH;
			}
		});
		$(obj).height(maxHCell);
	}
}

function equalHeight(obj) {
	if($(obj).length > 0) {
		$(obj).each(function() {
			var thisObj = $(this);
			var maxHCell = 0;
			$(thisObj).children().each(function() {
				var thisCell = $(this);
				var thisH = thisCell.height();
				if(maxHCell < thisH) {
					maxHCell = thisH;
				}
			});
			$(thisObj).children().height(maxHCell);
		});
	}
}
