//YiTu soft script
//author:ice yu
//time:2011-9-19
$(document).ready(function(){
	$(document).pngFix();//PNG透明					   
	//导航
/*	$(".cf li").hover(function(){
		$(this).siblings().removeClass("navclick");
			if(!$(this).hasClass("navclick")){
				$(this).addClass("navclick");
			}
	})*/
	
	//二级导航
 $(".lank").hover(
 	function (){
		var child=$(this).attr('child');
		$('#links_'+child).show();
		$('#links_'+child).siblings().hide();
		$('#links-btm').hide();
  	}
); 
 //快速导航
  $(".blank").hover(
 	function (){
		$('#links-btm').show();
  	},
	function () {
		$('#links-btm').hide();
  }

); 
 //快速导航-b
  $("#links-btm").hover(
 	function (){
		$('#links-btm').show();
  	},
	function () {
		$('#links-btm').hide();
  }

);   
  
  
  
  
//tab box-1
   //Get all the LI from the #tabMenu UL
  $('#tabMenua li').click(function(){
    
    //perform the actions when it's not selected
    if (!$(this).hasClass('selected')) {    
           
	    //remove the selected class from all LI    
	    $('#tabMenua li').removeClass('selected');
	    
	    //Reassign the LI
	    $(this).addClass('selected');
	    
	    //Hide all the DIV in .boxBody
	    $('.boxBodya div.parent').slideUp('1500');
	    
	    //Look for the right DIV in boxBody according to the Navigation UL index, therefore, the arrangement is very important.
	    $('.boxBodya div.parent:eq(' + $('#tabMenua > li').index(this) + ')').slideDown('1500');
	    
	 }
    
  }).mouseover(function() {

    //Add and remove class, Personally I dont think this is the right way to do it, anyone please suggest    
    $(this).addClass('mouseover');
    $(this).removeClass('mouseout');   
    
  }).mouseout(function() {
    
    //Add and remove class
    $(this).addClass('mouseout');
    $(this).removeClass('mouseover');    
    
  });

	//Mouseover with animate Effect for Category menu list
  $('.boxBodya #category li').click(function(){

    //Get the Anchor tag href under the LI
    window.location = $(this).children().attr('href');
  }).mouseover(function() {

    //Change background color and animate the padding
    $(this).css('backgroundColor','#888');
    $(this).children().animate({paddingLeft:"20px"}, {queue:false, duration:300});
  }).mouseout(function() {
    
    //Change background color and animate the padding
    $(this).css('backgroundColor','');
    $(this).children().animate({paddingLeft:"0"}, {queue:false, duration:300});
  });  
	
	//Mouseover effect for Posts, Comments, Famous Posts and Random Posts menu list.
  $('#.boxBodya li').click(function(){
    window.location = $(this).children().attr('href');
  }).mouseover(function() {
    $(this).css('backgroundColor','#E5E5E5');
  }).mouseout(function() {
    $(this).css('backgroundColor','');
  });  	 
  
  
  //tab box-2
   //Get all the LI from the #tabMenu UL
  $('#tabMenub li').click(function(){
    
    //perform the actions when it's not selected
    if (!$(this).hasClass('selected')) {    
           
	    //remove the selected class from all LI    
	    $('#tabMenub li').removeClass('selected');
	    
	    //Reassign the LI
	    $(this).addClass('selected');
	    
	    //Hide all the DIV in .boxBody
	    $('.boxBodyb div.parent').slideUp('1500');
	    
	    //Look for the right DIV in boxBody according to the Navigation UL index, therefore, the arrangement is very important.
	    $('.boxBodyb div.parent:eq(' + $('#tabMenub > li').index(this) + ')').slideDown('1500');
	    
	 }
    
  }).mouseover(function() {

    //Add and remove class, Personally I dont think this is the right way to do it, anyone please suggest    
    $(this).addClass('mouseover');
    $(this).removeClass('mouseout');   
    
  }).mouseout(function() {
    
    //Add and remove class
    $(this).addClass('mouseout');
    $(this).removeClass('mouseover');    
    
  });

	//Mouseover with animate Effect for Category menu list
  $('.boxBodyb #category li').click(function(){

    //Get the Anchor tag href under the LI
    window.location = $(this).children().attr('href');
  }).mouseover(function() {

    //Change background color and animate the padding
    $(this).css('backgroundColor','#888');
    $(this).children().animate({paddingLeft:"20px"}, {queue:false, duration:300});
  }).mouseout(function() {
    
    //Change background color and animate the padding
    $(this).css('backgroundColor','');
    $(this).children().animate({paddingLeft:"0"}, {queue:false, duration:300});
  });  
	
	//Mouseover effect for Posts, Comments, Famous Posts and Random Posts menu list.
  $('#.boxBodyb li').click(function(){
    window.location = $(this).children().attr('href');
  }).mouseover(function() {
    $(this).css('backgroundColor','#E5E5E5');
  }).mouseout(function() {
    $(this).css('backgroundColor','');
  }); 
  
  
  
 //tab box-3
   //Get all the LI from the #tabMenu UL
  $('#tabMenuc li').click(function(){
    
    //perform the actions when it's not selected
    if (!$(this).hasClass('selected')) {    
           
	    //remove the selected class from all LI    
	    $('#tabMenuc li').removeClass('selected');
	    
	    //Reassign the LI
	    $(this).addClass('selected');
	    
	    //Hide all the DIV in .boxBody
	    $('.boxBodyc div.parent').slideUp('1500');
	    
	    //Look for the right DIV in boxBody according to the Navigation UL index, therefore, the arrangement is very important.
	    $('.boxBodyc div.parent:eq(' + $('#tabMenuc > li').index(this) + ')').slideDown('1500');
	    
	 }
    
  }).mouseover(function() {

    //Add and remove class, Personally I dont think this is the right way to do it, anyone please suggest    
    $(this).addClass('mouseover');
    $(this).removeClass('mouseout');   
    
  }).mouseout(function() {
    
    //Add and remove class
    $(this).addClass('mouseout');
    $(this).removeClass('mouseover');    
    
  });

	//Mouseover with animate Effect for Category menu list
  $('.boxBodyc #category li').click(function(){

    //Get the Anchor tag href under the LI
    window.location = $(this).children().attr('href');
  }).mouseover(function() {

    //Change background color and animate the padding
    $(this).css('backgroundColor','#888');
    $(this).children().animate({paddingLeft:"20px"}, {queue:false, duration:300});
  }).mouseout(function() {
    
    //Change background color and animate the padding
    $(this).css('backgroundColor','');
    $(this).children().animate({paddingLeft:"0"}, {queue:false, duration:300});
  });  
	
	//Mouseover effect for Posts, Comments, Famous Posts and Random Posts menu list.
  $('#.boxBodyc li').click(function(){
    window.location = $(this).children().attr('href');
  }).mouseover(function() {
    $(this).css('backgroundColor','#045cc4');
  }).mouseout(function() {
    $(this).css('backgroundColor','');
  });  	
  
  //客服
/*    $("#tel-clos").click(function(){
	 	$("#tel").css("left","-175px");
  });
  */
  $("#tel-top").toggle(
	function (){
		$("#tel").css("left","-175px");
		},
	function (){
		$("#tel").css("left","-175px");
		}
	);
    $("#tel-show").toggle(
	function (){
		$("#tel").css("left","0");
		},
	function (){
		$("#tel").css("left","0");
		}
	);
  
  //下载中心
  	$("#download-left div").click(function(){
		var id=$(this).attr('child');
		$(this).siblings().removeClass("download-item-click");
			if(!$(this).hasClass("download-item-click")){
				$(this).addClass("download-item-click");
			}
		 $.ajax({
		 	url:"index.php?m=download&a=ajaxcate&id="+id,
			 success:function(res)
		 	{
				 $('#download-right').html(res);
		 	}
	 	})
	});
	
	//下载列表滑动
	 $(".downlist").live('click',function(){
		var id=$(this).attr('child');
   		$("#c"+id).toggle();
		$("#c"+id).css("height","auto");
	})

	//经销商查询
	$("#agentbtn").click(function(){
		var name=$("#agenttxt").val();
		$.ajax({
			url:"index.php?m=agent&a=search&name="+name,
			success:function(data){
				$("#innerbox").html(data);
				}
			   })
	})

})

