function $docID(id){return(typeof s=='object')?s:document.getElementById(id);}
function addEvent( obj, type, fn ) {
        if ( obj.attachEvent ) {
            obj['e'+type+fn] = fn;
            obj[type+fn] = function(){obj['e'+type+fn]( window.event );}
            obj.attachEvent( 'on'+type, obj[type+fn] );
        } else
            obj.addEventListener( type, fn, false );
    }
function removeEvent( obj, type, fn ) {
        if ( obj.detachEvent ) {
            obj.detachEvent( 'on'+type, obj[type+fn] );
            obj[type+fn] = null;
        } else
            obj.removeEventListener( type, fn, false );
}
function playFlash(iWmode){
    var fpic =$docID("flashid").getElementsByTagName("img");
	var flink =$docID("flashid").getElementsByTagName("a");
	var pic_width=466;
    var pic_height=177;
	var button_pos=fpic.length;
	var stop_time=6000;
	var show_text=1; 
	var txtcolor="fcff00";
	var bgcolor="666666";
	var imag=new Array();
	var link=new Array();
	var text=new Array();

	var flashUrl = 'images/newflash.swf';
	for(var i=0;i<fpic.length;i++){
   imag[i]=fpic[i].src;
   link[i]=flink[i].href;
   text[i]=flink[i].title;
   }  

	var swf_height=show_text==1?pic_height+0:pic_height;
	var pics="", links="", texts="";
	for(var i=0; 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);
	
	links = links.replace(/(&)/g,"^^");
	
	var flash = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="'+ pic_width +'" height="' + pic_height +'" />';
	flash = flash + '<param name="movie" value="'+ flashUrl +'" />';
	flash = flash + '<param name="quality" value="high" />';
	flash = flash + '<param name="menu" value="false" />';
	flash = flash + '<param name="FlashVars" value="pics='+pics+'&links='+links+'&texts='+texts+'&pic_width='+pic_width+'&pic_height='+pic_height+'&show_text='+show_text+'&txtcolor='+txtcolor+'&bgcolor='+bgcolor+'&button_pos='+button_pos+'&stop_time='+stop_time+'">';
    flash = flash + '<param name="wmode" value="transparent" />';
	flash = flash + '<embed src="' + flashUrl + '" FlashVars="pics='+pics+'&links='+links+'&texts='+texts+'&pic_width='+pic_width+'&pic_height='+pic_height+'&show_text='+show_text+'&txtcolor='+txtcolor+'&bgcolor='+bgcolor+'&button_pos='+button_pos+'&stop_time='+stop_time+'" quality="high" wmode="transparent" width="'+ pic_width +'" height="'+ swf_height +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
	flash = flash + '</object>';
	document.writeln(flash);
}

//Flash调用代码，兼容FF
function showFlash(iUrl,iWidth,iHeight,iWmode)
{
var flash = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="'+ iWidth +'" height="' + iHeight +'" />';
flash = flash + '<param name="movie" value="'+ iUrl +'" />';
flash = flash + '<param name="quality" value="high" />';
flash = flash + '<param name="menu" value="false" />';
if (iWmode == 1) {
   flash = flash + '<param name="wmode" value="transparent" />';      
}
flash = flash + '<embed src="' + iUrl + '" width="'+ iWidth +'" height="'+ iHeight +'" menu="false" quality="high" ';
if (iWmode == 1) {
   flash = flash + 'wmode="transparent" ';      
}
flash = flash + ' pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent"></embed>';
flash = flash + '</object>';

document.writeln(flash); 
//alert(flash);
}

function newtab(){
 var uls=$docID("news").getElementsByTagName("ul");
 var gg=$docID("news").getElementsByTagName("span")[0];
 var dq=$docID("news").getElementsByTagName("span")[1];
 addEvent(gg,"mouseover",onOver);
 addEvent(dq,"mouseover",onOver1);
 function onOver(){
	 uls[0].style.display="block";
	 uls[1].style.display="none";
	 dq.style.background="none";
	 dq.style.color="#fff";
	 dq.style.border="none";
	 gg.style.background="#fff";
	 gg.style.color="#F60";
	 }
 function onOver1(){
	 uls[1].style.display="block";
	 uls[0].style.display="none";
	 gg.style.background="none";
	 gg.style.color="#fff";
	 gg.style.border="none";
	 dq.style.background="#fff";
	 dq.style.color="#F60"
	 }
}
function rolldiv(){
var roll_te =$docID("roll_te");
var roll_te1 =$docID("roll_te1");
var roll_te2 =$docID("roll_te2");
var speedTE = 30; //数值越大滚动速度越慢
roll_te2.innerHTML = roll_te1.innerHTML;
//向上
                function MarqueeTE_IE() {

                    if (roll_te2.offsetTop - roll_te.scrollTop <= 0) {

                        roll_te.scrollTop -= roll_te1.offsetHeight;
                    }
                    else {
                        roll_te.scrollTop++;
                    }

                }
				function MarqueeTE_FF() {

                    if (roll_te2.offsetTop - roll_te.offsetTop - roll_te.scrollTop <= 0) {

                        roll_te.scrollTop -= roll_te1.offsetHeight;
                    }
                    else {

                        roll_te.scrollTop++;
                    }

                }
                if (document.all) {
                    var MyMarTE = setInterval(MarqueeTE_IE, speedTE);
                    roll_te.onmouseover = function() { clearInterval(MyMarTE) };
                    roll_te.onmouseout = function() { MyMarTE = setInterval(MarqueeTE_IE, speedTE) };

                }
                else {
                    var MyMarTE = setInterval(MarqueeTE_FF, speedTE);
                    roll_te.onmouseover = function() { clearInterval(MyMarTE) };
                    roll_te.onmouseout = function() { MyMarTE = setInterval(MarqueeTE_FF, speedTE) };
                }
}
var tips; 
var theTop =100;
var old = theTop;
function moveTips() {
    var tt = 0;
    if (window.innerHeight) {
        pos = window.pageYOffset
    } else if (document.documentElement && document.documentElement.scrollTop) {
        pos = document.documentElement.scrollTop
    } else if (document.body) {
        pos = document.body.scrollTop;
    }
	pos = pos - tips.offsetTop + theTop;
    pos=tips.offsetTop+pos/10;
    if (pos < theTop) pos = theTop;
    if (pos != old) {
        tips.style.top = pos+"px";
        tt = 0;
    }
    old = pos;
    setTimeout(moveTips,tt);
} 
function addMask(_id){
  var newMask = document.createElement("div");   
  newMask.id =_id;   
  newMask.style.position = "absolute";   
  newMask.style.zIndex = "1";   
  newMask.style.width = document.body.scrollWidth + "px";   
  newMask.style.height = document.body.scrollHeight + "px";   
  newMask.style.top = "0px";   
  newMask.style.left = "0px";   
  newMask.style.background = "#333";   
  newMask.style.filter = "alpha(opacity=40)";   
  newMask.style.opacity = "0.40";   
  document.body.appendChild(newMask);  
}
function addNewDiv(_id,w,h,txt) {  
  var newDiv = document.createElement("div");   
  newDiv.id = _id;   
  newDiv.style.position = "absolute";   
  newDiv.style.zIndex = "9999";   
  newDiv.style.width = w+"px";   
  newDiv.style.height = h+"px";   
  newDiv.style.left = parseInt(document.body.clientWidth) / 2 + "px";
  newDiv.style.marginLeft=-w/2+"px";
  newDiv.style.background = "#fff";   
  newDiv.style.border = "7px solid #666";
  newDiv.style.fontSize=12+"px";
  newDiv.style.padding = "5px";
  document.body.appendChild(newDiv);

  // 关闭mask和新图层

  NewGold_havePrzie(txt);

}
function showDivss(_id,w,h,txt){
		addMask('mask');
		addNewDiv(_id,w,h,txt)
		tips = $docID(_id);
		moveTips();

}
function remove_div() {
    document.body.removeChild($docID("box1"));
    document.body.removeChild($docID("mask"));
    return false;
}
function dom_dd(a){
	var dds=$docID("list_dl").getElementsByTagName("dd");
	var aas=$docID("list_dl").getElementsByTagName("a");
		dds[a].style.background="url(../images/main_43.gif) 15px center no-repeat #ffffff";
		dds[a].style.border="1px solid #a2cbff";
		dds[a].style.borderRight="none";
		aas[a].style.color="#f60";
		var l_div=document.createElement("div"); 
		dds[a].appendChild(l_div);
		l_div.style.position="absolute";
		l_div.style.width="6px";
		l_div.style.height="30px";
		l_div.style.right="-3px";
		l_div.style.top="0px";
		l_div.style.background="#fff";		
	}