// JavaScript Document
function set_Fontsize(CtrlType){
	if(CtrlType=="plus"){fontinfo.style.fontSize=eval(parseInt(fontinfo.style.fontSize)+2)+"px"} 
	else{ 
		if(parseInt(fontinfo.style.fontSize)>=8){fontinfo.style.fontSize=eval(parseInt(fontinfo.style.fontSize)-2)+"px";}
		else{fontinfo.style.fontSize="6px";}
	} 
} 

function set_Fontlineheight(CtrlType){
	if(CtrlType=="plus"){fontinfo.style.lineHeight=eval(parseInt(fontinfo.style.lineHeight)+4)+"px";} 
	else{
		if(parseInt(fontinfo.style.lineHeight)>14){fontinfo.style.lineHeight=eval(parseInt(fontinfo.style.lineHeight)-4)+"px";}
		else{fontinfo.style.lineHeight="14px";}
	}
}

//滚屏
var currentpos,timer;	
function initialize(){timer=setInterval("scrollwindow()",50);}
function sc(){clearInterval(timer);}
function scrollwindow(){
	currentpos=document.body.scrollTop;
	window.scroll(0,++currentpos);
	if(currentpos != document.body.scrollTop){sc();}
}
document.onmousedown=sc;
document.ondblclick=initialize;



//ie png
function correctPNG() 
     {
     for(var i=0; i<document.images.length; i++)
        {
     var img = document.images[i]
     var imgName = img.src.toUpperCase()
     if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
        {
     var imgID = (img.id) ? "id='" + img.id + "' " : ""
     var imgClass = (img.className) ? "class='" + img.className + "' " : ""
     var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
     var imgStyle = "display:inline-block;" + img.style.cssText 
     if (img.align == "left") imgStyle = "float:left;" + imgStyle
     if (img.align == "right") imgStyle = "float:right;" + imgStyle
     if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle  
     var strNewHTML = "<span " + imgID + imgClass + imgTitle
     + " style=\"" + "width:" + img.width + "px; margin:1px; height:" + img.height + "px;" + imgStyle + ";"
        + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
     + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
     img.outerHTML = strNewHTML
     i = i-1
        }
        }
     }
window.attachEvent("onload", correctPNG);


function showimg(theimg,size){  //保持缩略图比例
  imgobj=new Image();
  imgobj.src=theimg.src;
  if(imgobj.width>imgobj.height&&imgobj.width>size) theimg.width=size;
  else if(imgobj.width<imgobj.height&&imgobj.height>size) theimg.height=size;
}


function F_S(furl){
	if(furl==""){return false;}
	else{window.open(furl);return false;}	
}


function Show(num){
var href=new Array();
href[1]="/Article_List.asp?Classid=1";
href[2]="/Article_List.asp?Classid=87";
	for(var i=1;i<3;i++){
		if(i==num){
			document.getElementById("S_i_"+i).src="Images/it_"+i+"_1.gif";
			document.getElementById("tr_"+i).style.display="";
		}
		else{
			document.getElementById("S_i_"+i).src="Images/it_"+i+"_2.gif";
			document.getElementById("tr_"+i).style.display="none";
		}
		document.getElementById("S_more").href=href[num];
	}
}

//自适应高度
function SetCwinHeight(obj){
  var cwin=obj;
  if (document.getElementById){
    if (cwin && !window.opera){
      if (cwin.contentDocument && cwin.contentDocument.body.offsetHeight)
        cwin.height = cwin.contentDocument.body.offsetHeight; 
      else if(cwin.Document && cwin.Document.body.scrollHeight)
        cwin.height = cwin.Document.body.scrollHeight;
    }
  }
}
