$(document).ready(function() {
						  
	var button = $('.accordionButton'); // accordion
	var content = $('.accordionContent');
	
    button.click(function() {  
    button.removeClass("on");  
        content.slideUp("normal");
    if($(this).next().is(':hidden') == true) {
        $(this).addClass('on');            
        $(this).next().slideDown('normal');    
        }     
    });
    button.mouseover(function() {
        $(this).addClass("over");
        }).mouseout(function() {
        $(this).removeClass("over");                                        
    });
    content.hide();
    $("#open").trigger("click");
    

    var tabContents = $(".tab_content").hide(), // Product tab script
    tabs = $("ul.tabs li, ul.whatistabs li");

    tabs.first().addClass("active").show();
    tabContents.first().show();

    tabs.click(function() {
    var $this = $(this),
        activeTab = $this.find('a').attr('href');
    
    if(!$this.hasClass('active')){
        $this.addClass('active').siblings().removeClass('active');
        tabContents.hide().filter(activeTab).show();
    }
    return false;
	});

		
	$('.boxgrid.caption').hover(function(){ //sports menu rollover
	$(".cover", this).stop().animate({top:'20px'},{queue:false,duration:200});
		}, function() {
		$(".cover", this).stop().animate({top:'87px'},{queue:false,duration:300});
	});
			

	$(".img, .imgborder, .thumb").hover(function(){ //img fade on rollover
		$(this).fadeTo("slow", 0.5); 
	},function(){
		$(this).fadeTo("slow", 1.0); 
	});
	

	$('.searchbutton').click(function(){ // panel slider
		$("#searchpanel").slideToggle('normal');
		$(this).toggleClass('active');
       return false;
	});
	
	$('[placeholder]').placeHoldize();//form watermark
  

	$('#vidslide').click(function(){ // vid comment	  
		$('#vidview').slideToggle('fast'); 
	});
	
	$("#slider1").bxSlider({ // product slider
    	displaySlideQty: 3,
    	moveSlideQty: 3,
		infiniteLoop: false,
    	hideControlOnEnd: true
	});	 
	
    $('#slideshow').before('<div id="nav" class="nav">').cycle({ // ad slider
        fx:     'fade',
        speed:  '2000',
        timeout: 5000,
        pager:  '#nav',
		pause:  'true',
        before: function() { if (window.console) console.log(this.src); },
		pagerAnchorBuilder: function(index, el) { return '<a href="#">&nbsp;</a>'; }
    });
		 
	$('.bgpictoggle').click(function() { 
	$('div#categoryarea, div#newsarea, .main_view, div#sports, .shoparea, div#phonearea, div#recomendblock, .tvpics, #footer, #video').toggle(); 
	$(this).toggleClass('bgpic');
	return false;
	}); 
		  	
});


