//加载FLASH(优化代码，减少页面代码量)
//elm显示DIV 的ID，url FLASH地址，w FLASH宽,h FLASH高,wm 是否FLASH透明默认为false, btnID flash按钮ID，btnActUrl 跳转URL，target 打开方式；
function insertFlash(elm,url,w,h,wm,btnID,btnActUrl,target) {
    if (!document.getElementById(elm)) return;
    var strCode = '';
    if(btnActUrl!=null || btnActUrl!=undefined){
    strCode += '<button type="button" id="'+btnID+'" style="width:'+w+';height:'+h+';background:transparent;border:0;padding:0;cursor:pointer;" ';
        if(target=="_blank"){
            strCode += 'onclick="window.open(\''+btnActUrl+'\')"/>';
        }else{
            strCode += 'onclick="window.location.href=\''+btnActUrl+'\'"/>'; 
        }
    }
    strCode += '<object width="'+ w +'" height="'+ h +'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0">';
	
    strCode += '<param name="movie" value="'+ url +'">';
    if(wm){
        var wmv="transparent";
    }else{
        var wmv="opaque";
    }
    
    strCode += '<param name="wmode" value="'+wmv+'">';

    strCode += '<param name="quality" value="autohigh">';
    strCode += '<embed width="'+ w +'" height="'+ h +'" src="'+ url +'" quality="autohigh" wmode="'+wmv+'" type="application/x-shockwave-flash" plugspace="https://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed>';
    strCode += '</object>';
    document.getElementById(elm).innerHTML = strCode;
}



function divR_LHH(div1,div2){
    var h0;
    if(isFirefox=navigator.userAgent.indexOf("Firefox")>0) h0=2;
    if(isFirefox=navigator.userAgent.indexOf("MSIE")>0) h0=0;
    $div1=document.getElementById(div1);
    $div2=document.getElementById(div2);
	
	$div2.clientHeight<$div1.clientHeight ? $div2.style.height=$div1.scrollHeight-h0+"px" : $div1.style.height=$div2.scrollHeight-h0+"px";
	
}


function fontZoom(size){
 document.getElementById('content').style.fontSize=size+'px'
}

function DrawImage(ImgD,imgWidth,imgHeight){ 
 var image=new Image(); 
 image.src=ImgD.src; 
 if(image.width>0 & image.height>0){ 
  flag=true; 
  if(image.width/image.height>= imgWidth/imgHeight){ 
   if(image.width>imgWidth){
    ImgD.width=imgWidth; 
    ImgD.height=(image.height*imgWidth)/image.width; 
   }else{ 
    ImgD.width=image.width;
    ImgD.height=image.height; 
   } 
   //ImgD.alt="More..."; 
  } 
  else{ 
   if(image.height>imgHeight){
    ImgD.height=imgHeight; 
    ImgD.width=(image.width*imgHeight)/image.height; 
   }else{ 
    ImgD.width=image.width;
    ImgD.height=image.height; 
   } 
   //ImgD.alt="More..."; 
  } 
 }
}


/*
 * 双色表特效，为了修改方便，把它写成两层结构
 * 
 */


//隔行变色
//说明：ID为标签所属ID 
//      TagName为对象的标签名　如"li"、"tr"
//      t1为颜色值1
//      t2为颜色值2
//      t3为鼠标经过的颜色值
function TbStyle(ID,TagName,t1,t2,t3){
    if(document.getElementById(ID)==null) return;
	var ii=0;
	if(TagName=="tr"){ii=1;}
	var Ptr=document.getElementById(ID).getElementsByTagName(TagName);
	
	for (i=ii;i<Ptr.length;i++) { 
		Ptr[i].style.background = (i%2==0)? t1:t2; 
	}

	for(var i=ii;i<Ptr.length;i++) {
		Ptr[i].onmouseover=function(){
			this.tmpBg=this.style.background;
			this.style.background = t3;    
		};
		Ptr[i].onmouseout=function(){
			this.style.background=this.tmpBg;
		};
	}
}


//调用直接调用这里已设置好的样式类型，这样方便修改
function TableStyle(o,TagName,type){

    switch(type)
       {
       case 1:
       //TbStyle("表格名称","奇数行背景","偶数行背景","鼠标经过背景","点击后背景");
         TbStyle(o,TagName,"#ECF5FF","#f6fbfd","#fcffe8");
         break;
       default:
         TbStyle(o,TagName,"#ECF5FF","#f6fbfd","#fcffe8");
         break;
       }
}
