/*按比例生成缩略图*/
function DrawImage(ImgD,W,H){ 
  var flag=false; 
  var image=new Image(); 
  image.src=ImgD.src; 
  if(image.width>0 && image.height>0){ 
    flag=true; 
    if(image.width/image.height>= W/H){ 
      if(image.width>W){
        ImgD.width=W; 
        ImgD.height=(image.height*H)/image.width; 
      }
	  else{ 
        ImgD.width=image.width;
        ImgD.height=image.height; 
      } 
      ImgD.alt= ""; 
    } 
    else{ 
      if(image.height>H){
        ImgD.height=H; 
        ImgD.width=(image.width*W)/image.height; 
      }
	  else{ 
        ImgD.width=image.width;
        ImgD.height=image.height; 
      } 
      ImgD.alt=""; 
    } 
  }
}


function openwin(selID) {
var obj=document.getElementById("selID");
var url=obj.options[obj.selectedIndex].value;
window.open (url);
//bj.options[obj.selectedIndex].selected=true;
}


//多个层之间切换显示
function switchTab(mode,id){
	contentArr=document.getElementsByName(mode+"_content");
	titleArr=document.getElementsByName(mode+"_title");

	for (i=1;i<=titleArr.length;i++){
		if (i==id){
			contentArr[i-1].style.display="";
			titleArr[i-1].className="on";
		}else{
			contentArr[i-1].style.display="none";
			titleArr[i-1].className="off";
		}
	}
}

function getDateTime(obj){
	G(obj).innerHTM=new Date().toLocaleString()+' 星期'+'日一二三四五六'.charAt(new Date().getDay());
	
}

function showDateTime(obj){
	setInterval(getDateTime(obj),1000);
}
