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 u = elm.attr('href');
		if(u != null){
			$(this)
				.hover(
					function (){
						$(this).addClass('hover');
					},
					function (){
						$(this).removeClass('hover');
					}
				)
				.click(
					function(){
						if(elm.attr("class") == "blank"){
							window.open(u,'','');
							return false;
						} else if(elm.attr("class") == "thickbox") {
							return false;
						} else {
							location.href = u;
						}
				})
				.css('cursor','pointer')
			.end();
		}else{
			$(this).addClass('none');
		}
	});
	
	$('#aside a')
		.hover(
			function(){
				$(this).find('span').css('text-decoration','underline');
			},
			function(){
				$(this).find('span').css('text-decoration','none');
			}
		);
	
	/*
	$('#nav > li > a').each(function(){
		var c = $(this).attr('class');
		if(c == 'interview') {
			$(this)
				.removeAttr('href')
				.css('cursor','default')
				.click(function(){
					return false;
				});
		}
	});
	*/
	
})
.bind("contextmenu",function(e){
    return false;
 });

