function Object(id){
	return document.getElementById(id);
}
function pageWidth(width){
	Object('page').style.width=width+'px';
}

var flag=false;
function DrawImage(ImgD,w,h){
	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*w)/image.width;
			/*}else{
			ImgD.width=image.width;
			ImgD.height=image.height;
			}*/
			/*ImgD.alt="bigpic" */
		}
		else{
		/* if(image.height>h){*/
		ImgD.height=h;
		ImgD.width=(image.width*h)/image.height;
		/* }else{
		ImgD.width=image.width;
		ImgD.height=image.height;
		}*/
		/*ImgD.alt="bigpic" */
		}
	}  	
}
function DrawImage2(ImgD,w,h){
	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*w)/image.width;
			}else{
				ImgD.width=image.width;
				ImgD.height=image.height;
			}
		/*ImgD.alt="bigpic" */
		}
		else{
			if(image.height>h){
				ImgD.height=h;
				ImgD.width=(image.width*h)/image.height;
			}else{
				ImgD.width=image.width;
				ImgD.height=image.height;
			}
		/*ImgD.alt="bigpic" */
		}
	}  	
}
function showMsg(id){
	Object(id).style.display="inline";
}
function hiddenMsg(id){
	Object(id).style.display="none";
}
function showDiv(targetid){
	Object(targetid).style.display="block";
}
function closeDiv(targetid){
	Object(targetid).style.display="none";
}
function change(targetid1,targetid2){
	hiddenMsg(targetid1);
	showMsg(targetid2);
}

var Digital=new Date();
function clock(id)
{
	if (id==null) return;
	var curtime=document.getElementById(id);

	Digital.setTime(new Date().getTime() + timedelay);
	var years=Digital.getYear();
	var months=Digital.getMonth()+1;
	var days=Digital.getDate();
	var hours=Digital.getHours();
	var minutes=Digital.getMinutes();
	var seconds=Digital.getSeconds();
	if(minutes<=9)
		minutes="0"+minutes;
	if(seconds<=9)
		seconds="0"+seconds;
	myclock=months+"月"+days+"日"+hours+":"+minutes+":"+seconds;
	//alert(myclock);
	curtime.innerHTML=myclock;
	setTimeout("clock('"+id+"')",1000);
}
