jQuery(function(){
//$(window).load(function(){
	/***** shared *****/
	// only enable tipTip plugin if it's not IE6, objectAll is false in IE7/8
	//if (jQuery.support.boxModel || !jQuery.support.objectAll) {
		//alert(jQuery.browser.msie);
		//alert(parseInt(jQuery.browser.version));
	if (!jQuery.browser.msie && parseInt(jQuery.browser.version) != 6) {
		$("*[title]")
			.not("#miniImgNav *")
			.not("#header *")
			.tipTip();
		$("#header *[title]").tipTip({delay:1});
		$("#miniImgNav *[title]").tipTip({delay:3000});
	}
	/*
	
//		.not("#miniImgNav *")
//		.tipTip();
*/
	
	$("#btnLogin").click(function(){
		
		$("#cLogin").slideToggle(300);
		
		$(".popup[id!='" + $(this).attr('id') + "']").hide();
		return false;
	});
	
	$("#btnCancelLogin").click(function(){
		$("#cLogin").slideUp(300);
	});
	
	
	$("#btnContact").click(function() {
		
		$("#cContact").slideToggle(300);
		
		$(".popup[id!='" + $(this).attr('id') + "']").hide();
		return false;
	});

	$("#btnCancelContact").click(function(){
		$("#cContact").slideUp(300);
	});

	//$("#addObj").bind("click", addObj);
	// $("div").live("click", addObj);
	
	
	$("#frmContact").submit(function(){
		if (jQuery.trim($('#contact_name').val())
			&& jQuery.trim($('#contact_message').val())
			) {
				// Pass
		} else {
			alert("Please enter your name and a message!  Thank you!");
			return false;
		}
		//return false;
	});


	
	/***** main page *****/
	
	$("#miniImgNav a").hover(
		function(){
			$("img", this).animate({opacity: 0.5}, 400);
		},
		function() {
			$("img", this).animate({opacity: 1}, 200);
		}
	);
	
	/*
	$('#miniImgNav a').hover(
		function () {
			var strImg = strWebRoot + "/imgs/icn_" + $(this).attr("icn") + "_2.gif";
			$("img", this).attr("src", strImg);
		},
		function() {
			var strImg = strWebRoot + "/imgs/icn_" + $(this).attr("icn") + ".gif";
			$("img", this).attr("src", strImg);
		}
		);
	*/
});