﻿//选项卡
function selectTag(showContent,selfObj){
	// 操作标签
	var tag = document.getElementById("tags").getElementsByTagName("li");
	var taglength = tag.length;
	for(i=0; i<taglength; i++){
		tag[i].className = "";
	}
	selfObj.parentNode.className = "selectTag";
	// 操作内容
	for(i=0; j=document.getElementById("tagContent"+i); i++){
		j.style.display = "none";
	}
	document.getElementById(showContent).style.display = "block";
} 

//字体大小
function $(xixi) {
return document.getElementById(xixi);
}
//转换字号
function doZoom(size){
	if(size==12){
		$("contentText").style.fontSize = size + "px";
		$("fs12").style.display = "";
		$("fs14").style.display = "none";
		$("fs16").style.display = "none";
	}
	if(size==14){
		$("contentText").style.fontSize = size + "px";
		$("fs12").style.display = "none";
		$("fs14").style.display = "";
		$("fs16").style.display = "none";
	}
	if(size==16){
		$("contentText").style.fontSize = size + "px";
		$("fs12").style.display = "none";
		$("fs14").style.display = "none";
		$("fs16").style.display = "";
	}
}

//图片缩放
function DrawImage(ImgD,FitWidth,FitHeight){
     var image=new Image();
     image.src=ImgD.src;
     if(image.width>0 && image.height>0){
         if(image.width/image.height>= FitWidth/FitHeight){
             if(image.width>FitWidth){
                 ImgD.width=FitWidth;
                 ImgD.height=(image.height*FitWidth)/image.width;
             }else{
                 ImgD.width=image.width; 
                ImgD.height=image.height;
             }
         } else{
             if(image.height>FitHeight){
                 ImgD.height=FitHeight;
                 ImgD.width=(image.width*FitHeight)/image.height;
             }else{
                 ImgD.width=image.width; 
                ImgD.height=image.height;
             } 
        }
     }
 }
 
 function Open_w(t0,t1,t2,t3,t4)
{
	var t5=showModalDialog(t0,t3,'dialogWidth:'+t1+'pt;dialogHeight:'+t2+'pt;status:no;help:no;;');
	if (t5!=null) t4.value=t5;
}
