function resizepic(thispic)
{
	if(thispic.width>510){
		Pre_ChangeImage2(thispic,510,510)
	}
}

function bbimg(o)
{
/*
  var zoom=parseInt(o.style.zoom, 10)||100;
  zoom+=event.wheelDelta/12;
  if (zoom>0) o.style.zoom=zoom+'%';
  return false;
*/
}

var currentpos,timer;
function initialize()
{
	timer=setInterval ("scrollwindow ()",30);
}
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

//更改字体大小
var status0='';
var curfontsize=10;
var curlineheight=18;
function fontZoomA(){
  if(curfontsize>8){
    document.getElementById('fontzoom').style.fontSize=(--curfontsize)+'pt';
	document.getElementById('fontzoom').style.lineHeight=(--curlineheight)+'pt';
  }
}
function fontZoomB(){
  if(curfontsize<64){
    document.getElementById('fontzoom').style.fontSize=(++curfontsize)+'pt';
	document.getElementById('fontzoom').style.lineHeight=(++curlineheight)+'pt';
  }
}


function Pre_ChangeImage(imgobj,iPreImg_w,iPreImg_h){
	var image=new Image();
	var iwidth = iPreImg_w
	var iheight = iPreImg_h
	image.src=imgobj.src;
	
	if(imgobj.readyState!="complete"){
		imgobj.width=iwidth; 
		imgobj.height=iheight;
	}else{
		image.width=imgobj.width;
		image.height=imgobj.height;
		
		if(image.width>iwidth || image.height>iheight){
			if(image.width>0 && image.height>0){
				if(image.width/image.height>= iwidth/iheight){
					if(image.width>iwidth){ 
						imgobj.width=iwidth;
						imgobj.height=(image.height*iwidth)/image.width;
					}else{
						imgobj.width=image.width; 
						imgogj.height=image.height;
					}
				}
				else{
					if(image.height>iheight){ 
						imgobj.height=iheight;
						imgobj.width=(image.width*iheight)/image.height; 
					}else{
						imgobj.width=image.width; 
						imgobj.height=image.height;
					}
				}
			}
		}else{
			imgobj.width=image.width; 
			imgobj.height=image.height;
		}		
	}
	
	if(imgobj.width<=0 || imgobj.height<=0){
		imgobj.width=iwidth; 
		imgobj.height=iheight;
	}
}

function Pre_ChangeImage2(imgobj,iPreImg_w,iPreImg_h){
	var image=new Image();
	var iwidth = iPreImg_w
	var iheight = iPreImg_h
	image.src=imgobj.src;	
	
	if(imgobj.readyState!="complete"){
		imgobj.width=iwidth; 
		imgobj.height=iheight;
	}else{
		image.width=imgobj.width;
		image.height=imgobj.height;
		
		if(image.width>iwidth || image.height>iheight){
			if(image.width>0 && image.height>0){
				if(image.width/image.height>= iwidth/iheight){
					if(image.width>iwidth){ 
						imgobj.style.width=iwidth;
						imgobj.style.height=(image.height*iwidth)/image.width;
					}else{
						imgobj.style.width=image.width; 
						imgogj.style.height=image.height;
					}
				}
				else{
					if(image.height>iheight){ 
						imgobj.style.height=iheight;
						imgobj.style.width=(image.width*iheight)/image.height; 
					}else{
						imgobj.style.width=image.width; 
						imgobj.style.height=image.height;
					}
				}
			}
		}else{
			imgobj.style.width=image.width; 
			imgobj.style.height=image.height;
		}
		
	}
	
	if(imgobj.width<=0 || imgobj.height<=0){
		imgobj.style.width=iwidth; 
		imgobj.style.height=iheight;
	}
}


function iframeAutoFit()
{
    try
    {
        if(window!=parent)
        {
            var a = parent.document.getElementsByTagName("IFRAME");
            for(var i=0; i<a.length; i++) //author:meizz
            {
                if(a[i].contentWindow==window)
                {
                    var h1=0, h2=0;
                    a[i].parentNode.style.height = a[i].offsetHeight +"px";
                    a[i].style.height = "10px";
                    if(document.documentElement&&document.documentElement.scrollHeight)
                    {
                        h1=document.documentElement.scrollHeight;
                    }
                    if(document.body) h2=document.body.scrollHeight;

                    var h=Math.max(h1, h2);
                    if(document.all) {h += 4;}
                    if(window.opera) {h += 1;}
                    a[i].style.height = a[i].parentNode.style.height = h +"px";
                }
            }
        }
    }
    catch (ex){}
}


/*
if(window.attachEvent)
{
    window.attachEvent("onload",  iframeAutoFit);
}
else if(window.addEventListener)
{
    window.addEventListener('load',  iframeAutoFit,  false);
}
*/



