﻿// JavaScript Document
function banner(filepath,w,h,str) {
if(filepath.substring(filepath.length-3,filepath.length)=="swf"){
    document.write('<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="'+w+'" height="'+h+'"> ');
    document.write('<param name="movie" value="' + filepath + '">');
    document.write('<param name="quality" value="high"> ');
    document.write('<param name="wmode" value="transparent"> ');
    document.write('<param name="menu" value="false"> ');
    document.write('<embed src="' + filepath + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+w+'" height="'+h+'"></embed> ');
    document.write('</object> ');
}else{
	document.write('<img src="'+filepath+'" width="'+w+'" height="'+h+'" alt="'+str+'" border="0" />');
}
}

var flag=false; 
function DrawImage(ImgD,w,t){ 
 var image=new Image(); 
 image.src=ImgD.src; 
 if(image.width>0 && image.height>0){ 
  flag=true; 
  if(image.width/image.height>= w/w){ 
   if(image.width>w){
    ImgD.width=w; 
    ImgD.height=(image.height*w)/image.width; 
   }else{ 
    ImgD.width=image.width;
    ImgD.height=image.height; 
   } 
   ImgD.alt=t; 
  } 
  else{ 
   if(image.height>w){
    ImgD.height=w; 
    ImgD.width=(image.width*w)/image.height; 
   }else{ 
    ImgD.width=image.width;
    ImgD.height=image.height; 
   } 
   ImgD.alt=t; 
  } 
 }
}


/*财经栏目播放*/
var scrollEcCt=1;
var EcpauseTime=5*1000;
var timerEc;
function hideAllEcClips() {
	for (i=1; i<7; i++){
		var allEcBoxs="ecBox"+i;
		var ecNavNum="ecNav"+i;
		document.getElementById(allEcBoxs).style.display="none";
		document.getElementById(ecNavNum).className="dhli";
		}
	}
	
function ecNavOn(n) {
	var curEcBox="ecBox"+n;
	var curEcNavNum="ecNav"+n;
	hideAllEcClips();
	document.getElementById(curEcBox).style.display="block";
	document.getElementById(curEcNavNum).className="dhlia";
	scrollEcCt=n;
	}
	
function fecScroll() {
	stopEcScroll();
	ecNavOn(scrollEcCt);
	scrollEcCt+=1;
	if (scrollEcCt==7) {
		scrollEcCt=1;
		}
		timerEc=setTimeout("fecScroll()",EcpauseTime);
	}
	
function stopEcScroll() {
	clearTimeout(timerEc);
	}
