//-----------------------------------------------------------------------
/*二级折叠 设置折叠数量var number=8;
onclick=javascript:ShowTree(1)  href="javascript:void(null)"
id=Tid1*/
function Tree() {
var tre;
    for (i=1;i<=number;i++) {
        tre = eval('Tid' + i);
        tre.style.display = 'none';
    }
}
 
function ShowTree(i) {
    tre = eval('Tid' + i);
    if (tre.style.display == 'none') {
        Tree();
        tre.style.display = '';
    }
    else {
        tre.style.display = 'none';
    }
}
//-----------------------------------------------------------------------
//弹出指定大小窗体
function winPop(url, width, height)
{
  window.showModelessDialog(url,"",'dialogWidth=' + width + 'px; dialogHeight=' + height + 'px; resizable=no; help=no; status=no;resizable=0; help=0; scroll=0; status=0;'); 
}
//弹出指定大小居中页面
function winWin(Url,WindowName,Width,Height)
{
  window.open(Url,WindowName,'toolbar=0,location=0,maximize=1,directories=0,status=1,menubar=0,scrollbars=0,resizable=1,top='+(screen.height-Height)/2+',left='+(screen.width-Width)/2+',width='+Width+',height='+Height);
}
//-----------------------------------------------------------------------
/*横向无缝滚动*/
function marqueex(dem,dem1,dem2)
{
var demo = document.getElementById(dem);
var demo1 = document.getElementById(dem1);
var demo2 = document.getElementById(dem2);

var speed=10;    //数值越大滚动速度越慢
demo2.innerHTML = demo1.innerHTML
Marquee();
var MyMar = setInterval(Marquee,speed);
demo.onmouseover = function(){clearInterval(MyMar)}
demo.onmouseout = function(){MyMar = setInterval(Marquee,speed)}
}
function Marquee(){
    if(demo2.offsetWidth-demo.scrollLeft<=0)
        demo.scrollLeft-=demo1.offsetWidth
    else{
        demo.scrollLeft++
    }
}
//-----------------------------------------------------------------------
/*纵向无缝滚动*/
function marqueey(dem,dem1,dem2)
{
var demodiv = document.getElementById(dem);
var demotd1 = document.getElementById(dem1);
var demotd2 = document.getElementById(dem2);
var speed1=30;    //滚动速度值，值越大速度越慢
demotd2.innerHTML = demotd1.innerHTML    //克隆demotd2为demotd1
Marquee1();
var MyMar1 = setInterval(Marquee1,speed1);        //设置定时器
demodiv.onmouseover = function(){clearInterval(MyMar1)}    //鼠标经过时清除定时器达到滚动停止的目的
demodiv.onmouseout = function(){MyMar1 = setInterval(Marquee1,speed1)}    //鼠标移开时重设定时器
function Marquee1(){
    if(demotd2.offsetTop-demodiv.scrollTop<=0)    //当滚动至demotd1与demotd2交界时
        demodiv.scrollTop-=demotd1.offsetHeight    //demo跳到最顶端
    else{
        demodiv.scrollTop++
    }
}
function end()
{
	clearInterval(MyMar1);
}
function start()
{
    clearInterval(MyMar1);
	MyMar1 = setInterval(Marquee1,speed1);
}
}
//-----------------------------------------------------------------------
/*JS插入Flash*/
function mainFlash(pic_width,pic_height,imag,link,text){
var show_text=1;
var pic_width=pic_width;
var pic_height=pic_height;
var imag=imag;
var link=link;
var text=text;
var swf_height=show_text==1?pic_height+20:pic_height;
var pics="";
var links="";
var texts="";
for(var i=1; i<imag.length; i++){
	pics=pics+("|"+imag[i]);
	links=links+("|"+link[i]);
	texts=texts+("|"+text[i]);
}
pics=pics.substring(1);
links=links.substring(1);
texts=texts.substring(1);
document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cabversion=6,0,0,0" width="'+ pic_width +'" height="'+ swf_height +'">');
document.write('<param name="movie" value="flash/focus.swf">');
document.write('<param name="quality" value="high"><param name="wmode" value="opaque">');
document.write('<param name="FlashVars" value="pics='+pics+'&links='+links+'&texts='+texts+'&pic_width='+pic_width+'&pic_height='+pic_height+'&show_text='+show_text+'&txtcolor=000000&bgcolor=dddddd&button_pos=4&stop_time=3000">');
document.write('<embed src="flash/focus.swf" FlashVars="pics='+pics+'&links='+links+'&texts='+texts+'&pic_width='+pic_width+'&pic_height='+pic_height+'&show_text='+show_text+'&txtcolor=000000&bgcolor=dddddd&button_pos=4&stop_time=3000" quality="high" width="'+ pic_width +'" height="'+ swf_height +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
document.write('</object>');		
}