﻿// JScript 文件

function OnSearchClick(str_BoxValue)
{
	location.href='search.aspx?word='+escape(str_BoxValue);
}
function En_OnSearchClick(str_BoxValue)
{
	location.href='esearch.aspx?word='+escape(str_BoxValue);
}

function sAlert(strTitle,strContent){ 
    var msgw,msgh,bordercolor; 
    //备注：如果不设置msgw的参数，窗口上方的关闭条长度 会根据你要显示内容的宽度而拉长或缩小
    msgw=900;//提示窗口的宽度   
    msgh=450;//提示窗口的高度 
    titleheight=25 //提示窗口标题高度 
    bordercolor="#336699";//提示窗口的边框颜色 
    titlecolor="#99CCFF";//提示窗口的标题颜色
    
    
    //这里表示阴影部分//
    var sWidth,sHeight; 
    sWidth=document.body.offsetWidth;
    //alert((sWidth-sWidth)/2);
    sHeight=document.body.clientHeight;//获得页面文档的高度(包括滚动条)
    var bgObj=document.createElement("div"); 
    bgObj.setAttribute('id','bgDiv'); 
    bgObj.style.position="absolute"; 
    bgObj.style.top="0"; 
    bgObj.style.background="#777"; 
    bgObj.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=3,opacity=25,finishOpacity=75"; 
    bgObj.style.opacity="0.6"; 
    bgObj.style.left="0"; 
    bgObj.style.width=sWidth + "px"; 
    bgObj.style.height=sHeight + "px"; 
    bgObj.style.zIndex = "10000"; 
    document.body.appendChild(bgObj);
    //以上这些 表示阴影部分//
    
    
    
    //div1.style.top=document.documentElement.scrollTop+oridivheight+"px";
    
    //以下这些 表示提示框中的内容宽度和高度//
    var msgObj=document.createElement("div") 
    msgObj.setAttribute("id","msgDiv"); 
    msgObj.setAttribute("align","center"); 
    msgObj.style.background="white"; 
    msgObj.style.border="1px solid "+bordercolor;
    msgObj.style.position="absolute"; 
    var oridivheight=(document.documentElement.clientHeight-msgObj.offsetHeight)/2;
    //alert(document.documentElement.scrollTop);
    msgObj.style.left=(sWidth-msgw)/2;
    msgObj.style.top=document.documentElement.scrollTop+"px";
    //alert(document.documentElement.scrollTop+oridivheight+"px");
    msgObj.style.font="12px/1.6em Verdana, Geneva, Arial, Helvetica, sans-serif"; 
    msgObj.style.marginLeft="30px";
    msgObj.style.marginTop=(document.documentElement.clientHeight-msgh)/2+"px";

    //alert(document.documentElement.scrollTop);
    msgObj.style.width =msgw+"px";
    //msgObj.style.height =msgh + "px"; 
    msgObj.style.textAlign = "center"; 
    msgObj.style.lineHeight ="25px"; 
    msgObj.style.zIndex = "10001";
    //以上这些 表示提示框中的内容宽度和高度//




    var title=document.createElement("h4"); 
    title.setAttribute("id","msgTitle"); 
    title.setAttribute("align","right"); 
    title.style.margin="0"; 
    
    //title.style.padding="3px";
    //title.style.width=sWidth + "px";
    title.style.background=bordercolor;
    title.style.filter="progid:DXImageTransform.Microsoft.Alpha(startX=20, startY=20, finishX=100, finishY=100,style=1,opacity=75,finishOpacity=100);"; 
    title.style.opacity="0.75"; 
    title.style.border="1px solid " + bordercolor; 
    title.style.height="25px"; 
    title.style.font="12px Verdana, Geneva, Arial, Helvetica, sans-serif"; 
    title.style.color="white";
    title.style.cursor="pointer"; 
    title.title = "点击关闭 Close"; 
    title.innerHTML="<table border='0′width='900'><tr><td align='left'><b>"+ strTitle +"</b></td><td>关闭 Close</td></tr></table></div>"; 
    title.onclick=function(){ 
    document.body.removeChild(bgObj); 
    document.getElementById("msgDiv").removeChild(title); 
    document.body.removeChild(msgObj); 
    } 
    document.body.appendChild(msgObj); 
    document.getElementById("msgDiv").appendChild(title); 
    var txt=document.createElement("p"); 
    txt.style.margin="0em 0";
    txt.setAttribute("id","msgTxt"); 
    txt.innerHTML="<img src='products/big/"+strContent+"' />";
    document.getElementById("msgDiv").appendChild(txt); 
} 








// 属性设置 
            var E_strIFaderTransType = 'reveal'; // 'reveal' | 'blend' 
            var Filter_number = 23; // 滤镜种数 
            var change_time = 3.000; // 滤镜转换过程为3.0秒延迟 
            var wait_time = 5000; // 两种滤镜之间为5秒延迟

            var obj_Timer; 
            var count_temp = 0; //记录当前是第几幅图片 
            var Img_arry = new Array(); //图片数组 
            var E_ie4 = document.all?true:false; 
            var E_nn4 = document.layers?true:false;

            function Filt_set() //设置滤镜 
            { 
               if(!E_ie4 && !E_nn4) return;
               if(E_ie4) { 
                 var theImg = document.all['idImgFading']; 
                 if(theImg == null) return; 
                 with(document.all['idImgFading']) { 
                   style.filter = (E_strIFaderTransType == 'reveal')?'revealTrans':'blendTrans'; 
                   style.filter.duration = change_time; 
                   style.filter.transition = Filter_number; 
                 } 
               } 
               use_Filter();
               obj_Timer = window.setInterval('use_Filter()',wait_time); 
            }

            function use_Filter() //滤镜的启动 
            { 
               if(E_ie4) { 
                 with(document.all['idImgFading']) { 
                   if(E_strIFaderTransType == 'reveal') { 
                     filters(0).transition = Filter_number; 
                   } 
                   if(count_temp == (Img_arry.length - 1)) { 
                     count_temp = -1; 
                   } 
                   count_temp++; 
                   title = Img_arry[count_temp].sAlt; 
                   parentElement.href = Img_arry[count_temp].command;
                document.all['idImgLink'].innerText=title;
                document.all['idImgLink'].href= Img_arry[count_temp].command;
                
                   filters(0).apply(); 
                   src = Img_arry[count_temp].sImgUrl; 
                   filters(0).play();
                 } 
               } 
               else if(E_nn4) { 
                 if(count_temp == (Img_arry.length - 1)) { 
                   count_temp = -1; 
                 } 
                 count_temp++; 
                 document.images['idImgFading'].src = Img_arry[count_temp].sImgUrl; 
               } 
            }

            function obj_ClearTime() { 
               window.clearInterval(obj_Timer); 
            } 
            window.onunload = obj_ClearTime;//取消计时器，释放系统资源

            function Img_obj(sImgUrl,command,sAlt,sTarget) 
            { 
               this.sImgUrl = (sImgUrl == null)?'':sImgUrl; 
               this.command = (command == null || command == '')?'/':command; 
               this.sAlt = (sAlt == null)?'':sAlt; 
               this.sTarget = (sTarget == null || sTarget == '')?'_self':sTarget; 
            } 
            Img_arry[0] = new Img_obj('images/01.jpg','','','_self'); 
            Img_arry[1] = new Img_obj('images/02.jpg','','','_self'); 
            Img_arry[2] = new Img_obj('images/03.jpg','','','_self');
            
