/*
 * main.js
 * Hiroki Takeuchi
 */
$(function(){

// ie6 flg
var IE6;

// IE6
if(!jQuery.support.opacity && !jQuery.support.style && typeof document.documentElement.style.maxHeight == "undefined") {
// ie6 flg
IE6 = true;
// set pngFix class
$('.pngfix').fixPng();
}

// jump to 20th special blog
/*
$("#promotionRImgArea")
.css('cursor', 'pointer')
.click(function(){
window.open('/blog/20th_special/', '20th_blog');
});
}*/


    // top image carousel
$("#Mainslides").carouFredSel({
items: 1,
    auto : {pauseDuration: 10000, pauseOnHover: true},
pagination: "#pageNation"
});

// set tooltip on global navi
$('.tooltip').tooltip();

// station image cross-fade
$('#promotionRImgArea').crossFade({interval: 10000, ie6flg: IE6});

// radiko open player
$('.radiko_player').click(function(e) {
radiko_id = $(this).attr("href").split('#')[1];
window.open(
"http://radiko.jp/player/player.html#" + radiko_id,
"radiko_player",
"width=248,height=679,menubar=no,toolbar=no,scrollbars=no,resizable=no"
);
e.preventDefault();
});
// what's new carousel
$("#whatsNewSlides").carouFredSel({
items: 1,
    auto : {pauseDuration: 10000, pauseOnHover: true},
    prev : "#whatisnew_prev",
        next : "#whatisnew_next"
});

// Topics
$("#topicsSlides").carouFredSel({
items: 5,
scroll: {
items: 1,
duration: 1500
},
    auto : {pauseDuration: 5000, pauseOnHover: true},
prev: "#topicsPrev",
next: "#topicsNext"
});

// Topics Navi
$("#topicsCont").hover(
function(){
$("#topicsPrev, #topicsNext")
.stop(true, false)
.css({opacity: 0.8, width: 30})
.hide()
.fadeIn(600);
},
function(){
$("#topicsPrev, #topicsNext")
.stop(true, false)
.fadeOut(600);
}
);

// Twitter
getUserTL('fmkyoto', '#twiCont');


});
