﻿// JScript 文件

$(document).ready(function(){
//菜单
            var li = $("#me-1 > li");
        
                $("#me-1").find("li").each(function(i){
                $(this).hover(
                    function(){
                        $(this).addClass("selLi");
                        if($(this).attr("id")=="liProducts")
                        {
                            $("ul .c2").show();
                        }
                        else
                        {                        
                            $(this).find("ul").show();
                        }
                    },
                    function(){
                        $(this).removeClass("selLi");
                        if($(this).attr("id")=="liProducts")
                        {
                            $("ul .c2").hide();
                        }
                        else
                        {                        
                            $(this).find("ul").hide();
                        }
                    }
                    );
            });    
        
            $("#me-1 .c2").find("li").each(function(i){
                $(this).hover(
                    function(){
                        $(this).addClass("selLi");
                        //$(this).find("ul").show().each(function(i){li.eq(i).hover(function(){$(this).find("ul").show();},function(){$(this).find("ul").hide(); })});
                        //$(this).find("ul .c2").show().each(function(i){li.eq(i).hover(function(){},function(){})});
                        $(this).find("ul").show();
                    },
                    function(){
                        $(this).removeClass("selLi");
                        //$(this).find("ul .c2").hide();
                        $(this).find("ul").hide();
                    }
                    );
            });
            
            $("#me-1 li ul").find("li").each(function(i){
                $(this).hover(
                    function(){
                        $(this).removeClass("selLi");
                        $(this).addClass("subLi");
                    },
                    function(){
                        $(this).removeClass("subLi");
                    }
                    );
            });
            
            //下拉框
            $('.select').jcombox({ theme: 'mytheme' , set: true ,fx: 'slide'}); 
				$("#a_selected").click(function(){
				    alert($("#slct1").jcSelected());
				});
				
		    $("#aOpenImg").click(function(){
	            $("#img2").show();
	            return false;
	        });
	        $("#aYuanTu").click(function(){
	            $("#img2").show();
	            return false;
	        });
	        $("#aCloseImg").click(function(){
	            $("#img2").hide();
	        });
	        
	       
        });
        
        function changeFriendLink(url)
        {
            window.open(url,"_blank");
        }
        
        function getfilesize(para)  
        {  
           var myfile=new ActiveXObject("scripting.filesystemobject");  
           var fi=myfile.GetFile(para);  
           return fi.size/1024/1024+"M";
        }
        
        function ChgTab(id)
        {
        if(id == "tab1")
        {
            var tab = document.getElementById('tabBg');
            tab.style.backgroundImage = "url(images/tab/tab-1_03.gif)";
            document.getElementById('pnl1').style.display = "";
            document.getElementById('pnl2').style.display = "none";
            document.getElementById('pnl3').style.display = "none";
            document.getElementById('pnl4').style.display = "none";
            document.getElementById('pnl5').style.display = "none";
        }
        else if(id == "tab2")
        {
            var tab = document.getElementById('tabBg');
            tab.style.backgroundImage = "url(images/tab/tab-2_03.gif)";
            document.getElementById('pnl1').style.display = "none";
            document.getElementById('pnl2').style.display = "";
            document.getElementById('pnl3').style.display = "none";
            document.getElementById('pnl4').style.display = "none";
            document.getElementById('pnl5').style.display = "none";
        }
        else if(id == "tab3")
        {
            var tab = document.getElementById('tabBg');
            tab.style.backgroundImage = "url(images/tab/tab-3_03.gif)";
            document.getElementById('pnl1').style.display = "none";
            document.getElementById('pnl2').style.display = "none";
            document.getElementById('pnl3').style.display = "";
            document.getElementById('pnl4').style.display = "none";
            document.getElementById('pnl5').style.display = "none";
        }
        else if(id == "tab4")
        {
            var tab = document.getElementById('tabBg');
            tab.style.backgroundImage = "url(images/tab/tab-4_03.gif)";
            document.getElementById('pnl1').style.display = "none";
            document.getElementById('pnl2').style.display = "none";
            document.getElementById('pnl3').style.display = "none";
            document.getElementById('pnl4').style.display = "";
            document.getElementById('pnl5').style.display = "none";
        }
        else
        {
            var tab = document.getElementById('tabBg');
            tab.style.backgroundImage = "url(images/tab/tab-5_03.gif)";
            document.getElementById('pnl1').style.display = "none";
            document.getElementById('pnl2').style.display = "none";
            document.getElementById('pnl3').style.display = "none";
            document.getElementById('pnl4').style.display = "none";
            document.getElementById('pnl5').style.display = "";
        }
    }
    
    function toBreakWord(id,intLen){
    var obj=id;
    
    var strContent=obj.innerText;
    var strTemp="";  
    while(strContent.length>intLen){  
    strTemp+=strContent.substr(0,intLen)+"<br>";    
    strContent=strContent.substr(intLen,strContent.length);
    }  
    strTemp+=""+strContent;
    alert(strTemp);  
    obj.innerHTML=strTemp;
    }  
    
    
