﻿// ie6 png24
if (jQuery.browser.msie && jQuery.browser.version < 7) {
	function setPng24(obj) {
		obj.width=obj.height=1;
		obj.className=obj.className.replace(/\bpng24\b/i,'');
		obj.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+obj.src+"',sizingMethod='image');";
		obj.src='';
		return ''; 
	}
}
(function($){
	$(function(){
		// ie6 background hover fliker bug
		if ($.browser.msie && $.browser.version < 7) {
			try {
				document.execCommand("BackgroundImageCache", false, true);
			} catch(e) {}
		}
		// ie6 png24
		if (jQuery.browser.msie && jQuery.browser.version < 7) {
			function setPng24(obj) {
				obj.width=obj.height=1;
				obj.className=obj.className.replace(/\bpng24\b/i,'');
				obj.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+obj.src+"',sizingMethod='image');";
				obj.src='';
				return ''; 
			}
		}
		// quick search
		$('#quickSearch .txt-keyword').focus(function(){
			$(this).css('background', '#fff');
			return false;
		});
		// family site
		$('#footer #familySite').click(function(){
			var _bull = $('#footer #familySite .btn-ctrl');
			var _list = $('#footer #familySite .list');
			if(_bull.hasClass('down')){
				_bull.removeClass('down');
				_list.slideDown('fast');
				return false;
			}else {
				_bull.addClass('down');
				_list.slideUp('fast');
				return false;
			}
		});
		$('#footer #familySite ul.list').mouseleave(function(){
			$('#footer #familySite .btn-ctrl').addClass('down');
			$(this).slideUp();
		});
		$('#footer #familySite ul.list li a').click(function(){
			var _url = $(this).attr('href');
				_name = $(this).text();
			window.open(_url, _name,'width=1000,height=700, menubar=yes, toolbar=yes, location=yes, status=yes, directories=yes, resizable=yes, scrollbars=yes');
			return false;
		});
		
		// new comment layer
		$('a#showNewCmmt').click(function(){
			var _hash = this.hash;
			$(_hash).show();
			$('#aside').css('z-index', 3);
			return false;
		});
		
		$('a#hideNewCmmt').click(function(){
			var _hash = this.hash;
			$(_hash).hide();
			$('#aside').css('z-index', 0);
			return false;
		});
	});

	$('.blind').hide();
})(jQuery);



