﻿//	HomePage zhanjia365.com
function displayItem(tag1, tag2, nIndex, nCount, defaultStyle, newStyle){
            for (nI =1; nI <= nCount; nI ++)
            {
                if (nI == nIndex)
                {
                    document.getElementById(tag1 + nI).className = newStyle;
                    document.getElementById(tag2 + nI).style.display = "block";
                }
                else
                {
                    document.getElementById(tag1 + nI).className = defaultStyle;
                    document.getElementById(tag2 + nI).style.display = "none";
                }
            }
        }

function autoDisplay1(){
            window.setTimeout("displaySelect1('newNavM', 'newNavC', 5, '', 'changepic1')", 5000);
        }

function displaySelect1(tag1, tag2,  nCount, defaultStyle, newStyle){
              if (stopAutoDisplay1 == 0)
              {
				 selectIndex1 += 1;
                 if (selectIndex1 > nCount || selectIndex1 < 1 )
                 {
                    selectIndex1 = 1;
                 }
				displayItem(tag1, tag2, selectIndex1, nCount, defaultStyle, newStyle)
              }
               window.setTimeout('autoDisplay1();', 0);
              
       }

function autoDisplay1State(isStop){
            stopAutoDisplay1 = isStop;
        }
        
function autoDisplay2(){
            window.setTimeout("displaySelect2('newBuyM', 'newBuyC', 4, '', 'changepic1')", 5000);
        }
		
        function displaySelect2(tag1, tag2,  nCount, defaultStyle, newStyle){
              if (stopAutoDisplay2 == 0)
              {
				 selectIndex2 += 1;
                 if (selectIndex2 > nCount || selectIndex2 < 1 )
                 {
                    selectIndex2 = 1;
                 }
				displayItem(tag1, tag2, selectIndex2, nCount, defaultStyle, newStyle)
              }
              window.setTimeout('autoDisplay2();', 0);
              
       }

        function autoDisplay2State(isStop){
            stopAutoDisplay2 = isStop;
        }
        var selectIndex2 = 1;
        var stopAutoDisplay2 = 0;

        var selectIndex1 = 1;
        var stopAutoDisplay1 = 0;

function showArea(key){
	    document.getElementById('titleBuy').className = 'zhuanqu_7_2';
        document.getElementById('titleSell').className = 'zhuanqu_7_2';
        
        document.getElementById('areaBuy').style.display = 'none';
        document.getElementById('areaSell').style.display  = 'none';

        document.getElementById('title' + key).className = 'zhuanqu_7_1';
        document.getElementById('area' + key).style.display = 'block';
   
}