var PNG_BLANK_IMAGE = 'http://img.tokai-tv.com/common/image/space.gif';


$(function () {
	
	$('a[href*=#]').click(function() {
		if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
			var target = $(this.hash);
			target = target.length && target;
			if (target.length) {
				var targetOffset = $('html').offset().top;
				$('html,body')
					.animate({scrollTop: targetOffset}, {duration: 1000, easing: "easeOutExpo"});
				return false;
			}
		}
	});
	
	$('a.blank')
		.click(function(){
			window.open(this.href,"","");
			return false;
		});
		
	if($.browser.msie && $.browser.version<7){
    	
    	/*  IEで透過PNGを表示  */
    	$('img[src$=.png]').each(function(){
            $(this)
                .data('src',$(this).attr('src'))
                .attr('src',PNG_BLANK_IMAGE)
                .css('filter','progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+$(this).data('src')+'",sizingMethod="scale")');
        });
        
    }
		
	$('#news dl,#blog dl').each(function (){
		var elm = $(this).find('a');
		var eHref = elm.attr('href');
		if(eHref != null){
			$(this)
				.hover(
					function (){
						$(this).addClass('hover');
					},
					function (){
						$(this).removeClass('hover');
					}
				)
				.click(
					function(){
						if(elm.attr("class") == "blank"){
							window.open(eHref,'','');
							return false;
						} else if(elm.attr("class") == "thickbox") {
							return false;
						} else {
							location.href = eHref;
						}
				})
				.css('cursor','pointer')
			.end();
		}else{
			$(this).addClass('none');
		}
	});
	
    $('#read div.mainContents > dl:first').addClass('first');
    	
    $('div.group:last-child').css('margin-bottom',0);
	
	$('div.section:last-child').css('border','none');
	
});
