/* font size changer */
function doZoom(obj_target,size){
document.getElementById(obj_target).style.fontSize=size+"px";
}


/* rollpic */
var scrollNewsCt=0;
var pauseTime=15*1000;
var timer1;

function hideAllClips() {
	for (i=1; i<5; i++){
		var allClips="img_"+i;
		document.getElementById(allClips).style.display="none";
		}
	}
	
function clip_Switch(n) {
	var curClip="img_"+n;
		hideAllClips();
	document.getElementById(curClip).style.display="block";
	scrollNewsCt=n; 
	}
	
function fwdScroll() {
	stopScroll();
	scrollNewsCt+=1;
	if (scrollNewsCt==5) {
		scrollNewsCt=1;
		}
	clip_Switch(scrollNewsCt);
		timer1=setTimeout("fwdScroll()",pauseTime);
	}
	
function stopScroll() {
	clearTimeout(timer1);
	}

function bwdScroll() {
	stopScroll();
	scrollNewsCt-=1;
	if (scrollNewsCt==0) {
		scrollNewsCt=4;
		}
	clip_Switch(scrollNewsCt);
		timer1=setTimeout("bwdScroll()",pauseTime);
	}


/* onload functions*/
function onload_function(){
	picSizeFixer();	
	fwdScroll();
}


/* detail pic fixer */

function picSizeFixer(){
  var doc=document.getElementById("chan_newsDetail").getElementsByTagName("img");
  for (i=0;i<doc.length;i++){
      var imgLink=doc[i].src;
      if (navigator.appName=="Microsoft Internet Explorer"){
        doc[i].setAttribute("title","Click to view large picture");
        doc[i].onclick=function(){window.open('/zh_cn/etc/endpage/showPic.html?'+this.src);}
        doc[i].onmouseover=function(){this.style.cursor="hand";}
        }
      else {
        doc[i].setAttribute("title","Click to view large picture");
        doc[i].setAttribute("onclick",'window.open("/zh_cn/etc/endpage/showPic.html?'+imgLink+'","")');
        }
    if (doc[i].width>540){
      doc[i].width=540;
      }
    }
  }
  

/*  the original code------------------
function picSizeFixer(){
  var doc=document.getElementById("chan_newsDetail").getElementsByTagName("img");
  for (i=0;i<doc.length;i++){
    if (doc[i].width>500){
      doc[i].width=500;
      var imgLink=doc[i].src;
      if (navigator.appName=="Microsoft Internet Explorer"){
        doc[i].setAttribute("alt","Click to view large picture");
        doc[i].onclick=function(){window.open(this.src);}
        doc[i].onmouseover=function(){this.style.cursor="hand";}
        }
      else {
        doc[i].setAttribute("onclick",'window.open("'+imgLink+'","")');
        }
      }
    }
  }

*/