﻿var scrollfCt=1;
var pauseTime=4000;
var timer1;
//焦点新闻大图片SRC地址
ImgName = new BMArray(5);
ImgName[1] = "/images/jsimg/ls_ac_cn.jpg";
ImgName[2] = "/images/jsimg/lp_ac_cn.jpg";
ImgName[3] = "/images/jsimg/focus_ads_1.jpg";
ImgName[4] ="/images/jsimg/focus_ads_4.jpg";
ImgName[5] = "/images/jsimg/focus_ads_5.jpg";

//图片所指向的URL地址
ImgUrl = new BMArray(5);
ImgUrl[1] = "http://www.nippo-sh.com/product/detail.asp?pid=1211";
ImgUrl[2] = "http://www.nippo-sh.com/product/detail.asp?pid=1023";
ImgUrl[3] = "http://www.nippo-sh.com";
ImgUrl[4] ="http://www.nippo-sh.com";
ImgUrl[5] ="http://www.nippo-sh.com";

ImgText = new BMArray(5);
ImgText[1] = "龙骰，日邦生产销售，最高级骰子机台";
ImgText[2] = "黄金轮盘三代，上海日邦代理销";
ImgText[3] = "售品种齐全，货源充足，上海日邦信息技术有限公司";
ImgText[4] ="日本最新原装机种，炒场最强兵器!";
ImgText[5] = "中国游戏机交易信息网参展AOU Amusement EXPO 2009!";

function BMArray(len)
{
    this.length=len;
}    

function hideallf()
{
    for(i=1;i<6; i++)
    {
        var clip="f"+i;
        var bigimg="bigimg";
        document.getElementById(clip).className="ot";
        if (window.navigator.userAgent.indexOf("MSIE")>=1) 
        { 
            document.getElementById(bigimg).filters.revealTrans.Transition=23;
            document.getElementById(bigimg).filters.revealTrans.apply()
        }
    }
}
function curf(n)
{
    hideallf();
    var clips="f"+n;
    var bigimg="bigimg";
    var f_text="f_text";
    var f_url="f_url";
    document.getElementById(clips).className="cur";
    document.getElementById(bigimg).src=ImgName[n];
    document.getElementById(f_text).innerHTML=ImgText[n];
    document.getElementById(f_url).href=ImgUrl[n];
    if (window.navigator.userAgent.indexOf("MSIE")>=1) 
    { 
        document.getElementById(bigimg).filters.revealTrans.play();
    }	
    scrollfCt=n;
}
//从左至右	
function fwdScroll()
{
    document.getElementById("bigimg").src=ImgName[1];
    stopScroll();
    curf(scrollfCt);
    scrollfCt+=1;
    if (scrollfCt>5) {
	    scrollfCt=1;
	    }
	    timer1=setTimeout("fwdScroll()",pauseTime);
}
	
function stopScroll()
{
    clearTimeout(timer1);
}


function slideLine(ul, delay, speed, lh) {
var slideBox = (typeof ul == 'string')?document.getElementById(ul):ul;
var delay = delay||1000, speed=speed||20, lh = lh||20;
var tid = null, pause = false;
var start = function() {
tid=setInterval(slide, speed);
}
var slide = function() {
if (pause) return;
slideBox.scrollTop += 10;
if (slideBox.scrollTop % lh == 0) {
clearInterval(tid);
slideBox.appendChild(slideBox.getElementsByTagName('li')[0]);
slideBox.scrollTop = 0;
setTimeout(start, delay);
}
}
slideBox.onmouseover=function(){pause=true;}
slideBox.onmouseout=function(){pause=false;}
setTimeout(start, delay);
}


//最新商品&推荐商品
function hideNewTuijian()
{
    for(i=1;i<3; i++)
    {
        var clip="newpro"+i;
        var pl="pl_"+i;
        var ot="ot_"+i;
        document.getElementById(clip).className="pro_o";
        document.getElementById(pl).style.display="none";
        document.getElementById(ot).style.display="none";
    }
}
function curNewTuijian(n)
{
    hideNewTuijian();
    var clips="newpro"+n;
    var pl="pl_"+n;
    var ot="ot_"+n;
    document.getElementById(clips).className="pro_f";
    document.getElementById(pl).style.display="block";
    document.getElementById(ot).style.display="block";
}


//供应&求购&合作
function hideGYQG()
{
    for(i=1;i<4; i++)
    {
        var clip="gq_"+i;   
        document.getElementById(clip).className="pub_o";        
    }
}
function curGYQG(n)
{
    hideGYQG();
    var clips="gq_"+n;
    document.getElementById(clips).className="pub_f";
}

//供应&求购&合作
function hideGYQG2()
{
    for(i=1;i<4; i++)
    {
        var clip="gq_"+i;
        var club="gyqgClub_"+i;        
        document.getElementById(clip).className="pub_o";
        document.getElementById(club).style.display="none";        
    }
}
function curGYQG2(n)
{
    hideGYQG();
    var clips="gq_"+n;
    var club="gyqgClub_"+n;   
    document.getElementById(clips).className="pub_f";
    document.getElementById(club).style.display="block";
}





//排行榜
function hideAllHot()
{
    for(i=1;i<3; i++)
    {
        var clip="HotTitle_"+i;
        var club="HotList_"+i;        
        document.getElementById(clip).className="ph_o";
        document.getElementById(club).style.display="none";
        
    }
}
function curHot(n)
{
    hideAllHot();
    if(n==1)
    {
        curPH(1);
    }
    else if(n==2)
    {
        curPH(10);
    }
    
    var clip="HotTitle_"+n;
    var club="HotList_"+n;     
    document.getElementById(clip).className="ph_f";
    document.getElementById(club).style.display="block";
}

//排行榜效果
function hideAllPH()
{
    for(i=1;i<19; i++)
    {
        var clip="ph"+i;
        document.getElementById(clip).className="phcon_o";
    }
}
function curPH(n)
{
    hideAllPH();
    var clip="ph"+n;
    document.getElementById(clip).className="phcon_f";
}

