var $j = jQuery.noConflict();

$j(document).ready(function(){
	ie = ($j.browser.msie && $j.browser.version == 6);
	
	if (ie){
		$j('>ul>li','#menu-3').hover(function(){
			$j('>div.sub',this).stop(true).show();
		},function(){
			$j('>div.sub',this).delay(100).hide();
		});
	}
	
	
	boxSelect = $j('div.box-select');
	
	
	if($j(boxSelect).length){
		if (ie){
			$j.each(boxSelect,function(){
				var decoSel = $j('div.select',this);
				var width=$j(decoSel).width();
				$j('>div.deco-t',decoSel).width(width-17);
				$j('>div.deco-b',decoSel).width(width-32);
				$j('>div>a.but-select',this).mouseover(function(){
					$j(decoSel).show().parent().css('z-index',20);
				});
				$j(this).hover(function(){
						$j(decoSel).stop(true);
					},function(){
						$j(decoSel).delay(500,function(){ $j(this).hide().parent().css('z-index',0); });
					});
			});
			boxSelectSize();
			$j(window).resize(function(){ boxSelectSize(); });
		}else{
			$j.each(boxSelect,function(){
				var decoSel = $j('div.select',this);
				$j('>div>a.but-select',this).mouseover(function(){
					$j(decoSel).show();
				});
				$j(this).hover(function(){
						$j(decoSel).stop(true);
					},function(){
						$j(decoSel).delay(500,function(){ $j(this).hide() });
					});
			});
		}
	}


/*   
    $('#tablist a').attr('href','javascript:;').click(function(){
      $('#tablist li').attr('class','noactive');
      $(this).closest('li').attr('class','active');
      $('#tabs>div').hide();
      $('#tabs>div:eq('+$('#tablist a').index(this)+')').show();
    });
*/    

    $j('ul.ul-tabs li a').attr('href','javascript:;').click(function(){
      $j('ul.ul-tabs li').attr('class','');
      $j(this).closest('li').attr('class','current');
      $j('div.box-1>div.tab-content').hide();
      $j('div.box-1>div.tab-content:eq('+$j('ul.ul-tabs li a').index(this)+')').show();
    });


//    $j('#ul-tabs>div:not(:first)').hide();
    $j('ul.ul-tabs>li:first').attr('class','current')
    $j('div.box-1>div.tab-content:not(:first)').hide();
    
//    $j('#tablist li:first').attr('class','active');
/*
    $('#col1,#col2,#col3').map(function(){
      maxhp=Math.max(maxhp,$(this).height());								
    });
    $('#col1,#col2,#col3').height(maxhp);
*/  

	
});

function boxSelectSize(){
	$j.each(boxSelect,function(){
		var deco = $j('>div',this);
		$j('>a.but-select',deco).height($j(deco).height()+5);
	});
}

