﻿function $(id) {
    return document.getElementById(id);
}
function brandnavigationover(obj) {
    obj.style.backgroundImage = 'url(images/brand_navigation_over.gif)';
    obj.style.width = '86px';
    obj.style.height = '26px';
    obj.firstChild.style.textDecoration = 'none';
    obj.firstChild.style.color = '#fffefe';
    obj.style.fontWeight = 'bold';
}
function brandnavigationout(obj) {
    obj.style.backgroundImage = 'url(images/brand_navigation_out.gif)';
    obj.style.width = '86px';
    obj.style.height = '26px';
    obj.firstChild.style.textDecoration = 'none';
    obj.firstChild.style.color = '#505050';
    obj.style.fontWeight = 'normal';
}

function brandindexmenuover(menuname, mid, mlength, classname) {
    for (var i = 1; i <= mlength; i++) {
        if (i == mid) {
            $(menuname + "_title" + i).className = classname + 1;
            $(menuname + "_content" + i).style.display = "block";
        }
        else {
            $(menuname + "_title" + i).className = classname + 2;
            $(menuname + "_content" + i).style.display = "none";
        }
    }
}

function brandcenternavigationover(obj) {
    obj.style.backgroundImage = 'url(images/category_over.gif)';
    obj.style.width = '88px';
    obj.style.height = '31px';
    obj.firstChild.style.textDecoration = 'none';
    obj.firstChild.style.color = '#be3333';
    obj.style.fontWeight = 'bold';
}
function brandcenternavigationout(obj) {
    obj.style.backgroundImage = 'url(images/category_off.gif)';
    obj.style.width = '83px';
    obj.style.height = '31px';
    obj.firstChild.style.textDecoration = 'none';
    obj.firstChild.style.color = '#6a6a6a';
    obj.style.fontWeight = 'normal';
}
function mrnewsover(obj) {

    obj.firstChild.style.color = '#a2a2a3';
}
function mrnewsout(obj) {

    obj.firstChild.style.color = '#386e97';
}


/*
点击小图出现大图
*/

function MM_preloadImages() { //v3.0
 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
 var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
 if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
 d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
 if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
 for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
 if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImgRestore() { //v3.0
 var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_swapImage() { //v3.0
    var i, j = 0, x, a = MM_swapImage.arguments;
    document.MM_sr = new Array; 
    for(i=0;i<(a.length-2);i+=3)
     if ((x = MM_findObj(a[i])) != null) {
     document.MM_sr[j++] = x; if (!x.oSrc) x.oSrc = x.src; x.src = a[i + 2];
 }
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
function SearchDown()
{
	form1.content.value = "";
}

/*
左右切换图片效果
*/ 
var Speed = 1; //速度(毫秒)
var Space = 3; //每次移动(px)
var PageWidth = 253; //翻页宽度
var fill = 0; //整体移位
var MoveLock = false;
var MoveTimeObj;
var Comp = 0;
var AutoPlayObj = null;
GetObj("List2").innerHTML = GetObj("List1").innerHTML;
GetObj('ISL_Cont').scrollLeft = fill;
GetObj("ISL_Cont").onmouseover = function(){clearInterval(AutoPlayObj);}
GetObj("ISL_Cont").onmouseout = function(){AutoPlay();}
AutoPlay();
function GetObj(objName){if(document.getElementById){return eval('document.getElementById("'+objName+'")')}else{return eval('document.all.'+objName)}}
function AutoPlay(){ //自动滚动
 clearInterval(AutoPlayObj);
 AutoPlayObj = setInterval('ISL_GoDown();ISL_StopDown();',3000); //间隔时间
}
function ISL_GoUp(){ //上翻开始
 if(MoveLock) return;
 clearInterval(AutoPlayObj);
 MoveLock = true;
 MoveTimeObj = setInterval('ISL_ScrUp();',Speed);
}
function ISL_StopUp(){ //上翻停止
 clearInterval(MoveTimeObj);
 if(GetObj('ISL_Cont').scrollLeft % PageWidth - fill != 0){
  Comp = fill - (GetObj('ISL_Cont').scrollLeft % PageWidth);
  CompScr();
 }else{
  MoveLock = false;
 }
}
function ISL_ScrUp(){ //上翻动作
 if(GetObj('ISL_Cont').scrollLeft <= 0){GetObj('ISL_Cont').scrollLeft = GetObj('ISL_Cont').scrollLeft + GetObj('List1').offsetWidth}
 GetObj('ISL_Cont').scrollLeft -= Space ;
}
function ISL_GoDown(){ //下翻
 clearInterval(MoveTimeObj);
 if(MoveLock) return;
 clearInterval(AutoPlayObj);
 MoveLock = true;
 ISL_ScrDown();
 MoveTimeObj = setInterval('ISL_ScrDown()',Speed);
}
function ISL_StopDown(){ //下翻停止
 clearInterval(MoveTimeObj);
 if(GetObj('ISL_Cont').scrollLeft % PageWidth - fill != 0 ){
  Comp = PageWidth - GetObj('ISL_Cont').scrollLeft % PageWidth + fill;
  CompScr();
 }else{
  MoveLock = false;
 }
}
function ISL_ScrDown(){ //下翻动作
 if(GetObj('ISL_Cont').scrollLeft >= GetObj('List1').scrollWidth){GetObj('ISL_Cont').scrollLeft = GetObj('ISL_Cont').scrollLeft - GetObj('List1').scrollWidth;}
 GetObj('ISL_Cont').scrollLeft += Space ;
}
function CompScr(){
 var num;
 if(Comp == 0){MoveLock = false;return;}
 if(Comp < 0){ //上翻
  if(Comp < -Space){
   Comp += Space;
   num = Space;
  }else{
   num = -Comp;
   Comp = 0;
  }
  GetObj('ISL_Cont').scrollLeft -= num;
  setTimeout('CompScr()',Speed);
 }else{ //下翻
  if(Comp > Space){
   Comp -= Space;
   num = Space;
  }else{
   num = Comp;
   Comp = 0;
  }
  GetObj('ISL_Cont').scrollLeft += num;
  setTimeout('CompScr()',Speed);
 }
}













