function DrawImage(MyPic,W,H){
  var flag=false;
  var image=new Image();
  image.src=MyPic.src;
  if(image.width>0 && image.height>0){
    flag=true;
    if(image.width/image.height>= W/H){
      if(image.width>W){
        MyPic.width=W;
        MyPic.height=(image.height*W)/image.width;
      }
	  else{
        MyPic.width=image.width;
        MyPic.height=image.height;
      }
    }
    else{
      if(image.height>H){
        MyPic.height=H;
        MyPic.width=(image.width*H)/image.height;
      }
	  else{
        MyPic.width=image.width;
        MyPic.height=image.height;
      }
    }
  }
}

function processKS(num){
 var tabs=document.getElementById("navcontainerKS");
 if(tabs==null) return;
 tabs=tabs.getElementsByTagName("LI");
 for(i=0;i<tabs.length;i++){
   	 if(num==i){
		tabs[i].id="active";
		document.getElementById("ks"+i).className="sw";
	 }else{
		tabs[i].id="";
		document.getElementById("ks"+i).className="hd";
	 }
 }
}

  function   newsScroll()   {   
  if(scrollimg.parentNode.scrollLeft!=(scrollimg.clientWidth/2))   
  scrollimg.parentNode.scrollLeft++;   
  else   
  scrollimg.parentNode.scrollLeft=0   
  }   
  window.onload=function()   {   
  simg1.innerHTML=simg.innerHTML   
  tm=setInterval('newsScroll()',20)     
  }   
  function   stop()   
  {   
  clearInterval(tm)   
  }   
    
  function   start()   
  {   
  tm=setInterval('newsScroll()',20)     
  }   
  
 function regetImage(obj) {
    var today = new Date();
	var today_ms = ""
		+ today.getFullYear() + (today.getMonth() + 1) + today.getDate()
		+ today.getMinutes() + today.getSeconds() + today.getMilliseconds();
    obj.src = 'include/auth/getimg.php?' + today_ms;
}

