function checkboxselect(itemname,checkstatus)
{
	if(!itemname) return;
	if(!itemname.length) 
	{
		itemname.checked=checkstatus;
	} 
	else 
	{
		for(var i=0;i<itemname.length;i++) 
		{
			itemname[i].checked=checkstatus;
		}
	}
}

 function query()
 {
	 if(document.type.value =="0")
	 {
		 alert("ÇëÑ¡ÔñÀà±ð£¡")
		 document.all.type.focus()
		 return false;
	  } 	
 }
function fImageAuto(nID,nMaxWidth,nMaxHeight)
{
  var imageArr=document.getElementById(nID);
  var imageWidthRate,imgHeightRate;
  imageWidthRate=imageArr.offsetWidth/nMaxWidth;
  imageHeightRate=imageArr.offsetHeight/nMaxHeight;
  if(imageWidthRate >=imageHeightRate)
  {
  imageArr.style.width=nMaxWidth+"px";
  imageArr.style.height=imageArr.offsetHeight+"px";
  imageArr.style.marginTop=(nMaxHeight-imageArr.offsetHeight)/2+"px";
  }else if(imageWidthRate <imageHeightRate){
  imageArr.style.height=nMaxHeight+"px";
  imageArr.style.width =imageArr.offsetWidth+"px";
  imageArr.style.marginLeft=(nMaxWidth-imageArr.offsetWidth)/2+"px";
  }
  return true;
}
