﻿//普通产品目录
var aaa = document.getElementsByTagName('div');
	var j =0;
	for(i=0;i<aaa.length;i++)
	{
		if(aaa[i].id.indexOf('submenu_')>-1 && j ==0 )		
		{
			aaa[i].style.display = '';
			break;
		}
	}	
function showsubmenu(sid)
{
	var aaa = document.getElementsByTagName('div');
	var j =0;
	for(i=0;i<aaa.length;i++)
	{
		if(aaa[i].id.indexOf('submenu_')>-1)			
			aaa[i].style.display = 'none';
	}	
	var bbb = document.getElementById("submenu_" + sid );
	bbb.style.display= '';
}

//普通产品滚动

 var speed=25//速度数值越大速度越慢
  demo2.innerHTML=demo1.innerHTML
  function Marquee()
  {
  if(demo2.offsetWidth-demo.scrollLeft<=0)
  demo.scrollLeft-=demo1.offsetWidth
  else
  {
  demo.scrollLeft++
  }
  }
  var MyMar=setInterval(Marquee,speed)
  demo.onmouseover=function() 
  {
  clearInterval(MyMar)
  }
  demo.onmouseout=function() 
  {
  MyMar=setInterval(Marquee,speed)
  }









      $('.tab_btn a').mouseover(function(){
    // alert(cur);
     var cur=$(this).index();
     $(this).addClass('hover').siblings().removeClass('hover');
    $(this).parent().siblings('.tab_content').find('ul').eq(cur).show().siblings().hide();
  })

  
 function dropMenu(obj){
  $(obj).each(function(){
    var theSpan = $(this);
    var theMenu = theSpan.find(".submenu");
    var tarHeight = theMenu.height();
    theMenu.css({height:0,opacity:0});
    theSpan.hover(
      function(){
        $(this).addClass("selected");
        theMenu.stop().show().animate({height:tarHeight,opacity:1},400);
      },
      function(){
        $(this).removeClass("selected");
        theMenu.stop().animate({height:0,opacity:0},400,function(){
          $(this).css({display:"none"});
        });
      }
    );
  });
}


  
  dropMenu(".drop-menu-effect");
  
  function AddFavorite(sURL, sTitle) {
 
            sURL = encodeURI(sURL); 
        try{   
 
            window.external.addFavorite(sURL, sTitle);   
 
        }catch(e) {   
 
            try{   
 
                window.sidebar.addPanel(sTitle, sURL, "");   
 
            }catch (e) {   
 
                alert("加入收藏失败，请使用Ctrl+D进行添加,或手动在浏览器里进行设置.");
 
            }   
 
        }
 
    }

	$('#close_im').bind('click',function(){
		$('#main-im').css("height","0");
		$('#im_main').hide();
		$('#open_im').show();
	});
	
		$('#main-im').css("height","272");
		$('#im_main').show();
		$(this).hide();
	
	$('.go-top').bind('click',function(){
		$('html,body').animate({'scrollTop':0},600);
	});
	$(".weixing-container").bind('mouseenter',function(){
		$('.weixing-show').show();
	})
	$(".weixing-container").bind('mouseleave',function(){        
		$('.weixing-show').hide();
	});
	
	