// JavaScript Document
accordion.init({
	headerclass: "expandable", //Shared CSS class name of headers group that are expandable
	contentclass: "categoryitems", //Shared CSS class name of contents group
    revealtype: "click", //Reveal content when user clicks or onmouseover the header? Valid value: "click", "clickgo", or "mouseover"
	mouseoverdelay: 0, //if revealtype="mouseover", set delay in milliseconds before header expands onMouseover
	collapseprev: false, //Collapse previous content (so only one open at any time)? true/false
	expandedAll:true,//expand  all class
	defaultexpanded: [0,1,2,3,4,5,6,7,8,9,10], //index of content(s) open by default [index1, index2, etc] [] denotes no content
	onemustopen: false, //Specify whether at least one header should be open always (so never all headers closed)
	animatedefault: true, //Should contents open by default be animated into view?
	persiststate: true, //persist state of opened contents within browser session?
	toggleclass: ["", "",""], //Three CSS classes to be applied to the header when it's collapsed , expanded,selected, respectively ["class1", "class2","class3"]
	togglehtml: ["", "", ""], //Additional HTML added to the header when it's collapsed and expanded, respectively  ["position", "html1", "html2"] (see docs)
	animatespeed: "fast", //speed of animation: integer in milliseconds (ie: 200), or keywords "fast", "normal", or "slow"
	oninit:function(headers, expandedindices){ //custom code to run when headers have initalized
		//do nothing
	},
	onopenclose:function(header, index, state, isuseractivated){ //custom code to run whenever a header is opened or closed
		//alert(state)
	}
})
jQuery(document).ready(function($){
	 //goodstype style
	 $(".class").find("li").bind("mouseover", function(){
	   $(this).css("font-weight","bold");
	   $(this).css("color","#123731");
	 })
	 $(".class").find("li").bind("mouseout", function(){
	   $(this).css("font-weight","normal");
	    $(this).css("color","#ffffff");
	 })
	 
})
function setIndex(int){
	var text=$("#tabs li").eq(int).text();
	$("#tabs li").eq(int).addClass("selected")
	$("#tabs li").eq(int).html("<span>"+text+"</span>")
}
function gotoType(id){
	 window.navigate("product.asp?key="+id);
}
function gotoSearch(){
	window.navigate("search.asp?keyword="+$("#searchInput").val());
}
function gotoProduct(id){
	window.navigate("productInfo.asp?id="+id);
}
function slideSwitch() {
    var $active = $('#slideshow IMG.active');

    if ( $active.length == 0 ) $active = $('#slideshow IMG:last');

    // use this to pull the images in the order they appear in the markup
    var $next =  $active.next().length ? $active.next()
        : $('#slideshow IMG:first');

    // uncomment the 3 lines below to pull the images in random order
    
    // 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()", 5000 );
});
function gotoURL(url){
	window.location.href=url;
}
function setNavi(text){
	$(".navi").each(function(i){
	   if($.trim($(this).text())==$.trim(text)){
	     $(this).css("background-color", "#9e2e33");
		 $(this).css("color", "#fff");
	   }
   });
}
 var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-16716670-1']);
  _gaq.push(['_trackPageview']);
  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

