/*-----------------------------------------------------------------

	index.js
	
-----------------------------------------------------------------*/


ddaccordion.init({
	headerclass: "expandable", 
	contentclass: "categoryitems", 
	revealtype: "click", 
	mouseoverdelay: 200, 
	collapseprev: true,  
	defaultexpanded: [0], 
	onemustopen: false, 
	animatedefault: false, 
	persiststate: true, 
	toggleclass: ["", "openheader"], //Two CSS classes to be applied to the header when it's collapsed and expanded, respectively ["class1", "class2"]
	togglehtml: ["prefix", "", ""], //Additional HTML added to the header when it's collapsed and expanded, respectively  ["position", "html1", "html2"] (see docs)
	animatespeed: "slow", 
	oninit:function(headers, expandedindices){ 
		//do nothing
	},
	onopenclose:function(header, index, state, isuseractivated){ 
		//do nothing
	}
})



//** アコーディオンメニュー js ↑　-----------------------------------------------------------------




/*** 
    Simple jQuery Slideshow Script
    Released by Jon Raasch (jonraasch.com) under FreeBSD license: free to use or modify, not responsible for anything, etc.  Please link out to me if you like it :)
***/

function slideSwitch() {
    var $active = $('#slideshow div.active');

    if ( $active.length == 0 ) $active = $('#slideshow div:last');

    // use this to pull the divs in the order they appear in the markup
    var $next =  $active.next().length ? $active.next()
        : $('#slideshow div:first');

    // uncomment below to pull the divs randomly
    // var $sibs  = $active.siblings();
    // var rndNum = Math.floor(Math.random() * $sibs.length );
    // var $next  = $( $sibs[ rndNum ] );


    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}

$(function() {
    setInterval( "slideSwitch()", 6000 );
});




//** ヘッダー画像きりかえ js ↑　-----------------------------------------------------------------





   $(function () {
                        var tabContainers = $('div.tabs div');
                        tabContainers.hide().filter(':first').show();
                        $('div.tabs ul.tabNavigation a').click(function () {
                                tabContainers.hide();
                                tabContainers.filter(this.hash).show();
 　                              $('div.tabs ul.tabNavigation a').removeClass('selected');
                                $(this).addClass('selected');
                                return false;
                        }).filter(':first').click();
                });




//** ranking tabmenu ↑　-----------------------------------------------------------------



function bookMark() 
{

if(navigator.userAgent.indexOf("MSIE") > -1){
document.write(' onclick="window.external.AddFavorite(\'http://store.spiral.co.jp/ \',\'スパイラルオンラインストア\')"');
}


//Firefox
else if(navigator.userAgent.indexOf("Firefox") > -1){
document.write(' onclick="window.sidebar.addPanel(\'スパイラルオンラインストア\',\'http://store.spiral.co.jp/ \',\'\');"');
}
//Netscape
else if(navigator.userAgent.indexOf("Netscape") > -1){
document.write(' onclick="window.sidebar.addPanel(\'スパイラルオンラインストア\',\'http://store.spiral.co.jp/ \',\'\');"');
}
//Opera
else if(navigator.userAgent.indexOf("Opera") > -1){
document.write(' onclick="window.sidebar.addPanel(\'スパイラルオンラインストア\',\'http://store.spiral.co.jp/ \',\'\');"');
}


}


//** お気に入りに追加↑　-----------------------------------------------------------------






