//页面打印代码
function doPrint() { 
//bdhtml=window.document.body.innerHTML; 
//sprnstr="<!--startprint-->"; 
//eprnstr="<!--endprint-->"; 
//prnhtml=bdhtml.substr(bdhtml.indexOf(sprnstr)+17); 
//prnhtml=prnhtml.substring(0,prnhtml.indexOf(eprnstr)); 
//window.document.body.innerHTML=prnhtml; 
window.print(); 
//setTimeout("Load_room();",60000);
//window.location.reload();   
}

//png图片透明效果
function correctPNG() 
{
for(var i=0; i<document.images.length; i++)
{
var img = document.images[i]
var imgName = img.src.toUpperCase()
if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
{
var imgID = (img.id) ? "id='" + img.id + "' " : ""
var imgClass = (img.className) ? "class='" + img.className + "' " : ""
var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
var imgStyle = "display:inline-block;" + img.style.cssText 
if (img.align == "left") imgStyle = "float:left;" + imgStyle
if (img.align == "right") imgStyle = "float:right;" + imgStyle
if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle 
var strNewHTML = "<span " + imgID + imgClass + imgTitle
+ " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
+ "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
+ "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
img.outerHTML = strNewHTML
i = i-1
}
}
}
window.attachEvent("onload", correctPNG);

//选择产品js
//全部选中
function selectAll(){
	var obj=document.all.idno;
	if(obj.length){
		for(i=0;i<obj.length;i++){
			obj[i].checked=true;
		}
	}
	else{
		obj.checked = true;
	}
}
//全部清除
function clearAll(){
	var obj=document.all.idno;
	if(obj.length){
		for(i=0;i<obj.length;i++){
			obj[i].checked=false;
		}
	}
	else{
		obj.checked = false;
	}
}
//resize images By ChenReal 2007-9-5
function chkimgsize(SourceImage,limitWidth,limitHeight)
{
 tempImage=new Image()
 tempImage.src=SourceImage.src
 if(tempImage.width!=0&&tempImage.height!=0)
 {
  if(tempImage.width/tempImage.height>= limitWidth/limitHeight)
  { 
   if(tempImage.width>limitWidth)
   {
    SourceImage.width=limitWidth; 
    SourceImage.height=(tempImage.height*limitWidth)/tempImage.width; 
   }
   else
   { 
    SourceImage.width=tempImage.width;
    SourceImage.height=tempImage.height; 
   } 
  } 
  else
  { 
   if(tempImage.height>limitHeight)
   {
    SourceImage.height=limitHeight; 
    SourceImage.width=(tempImage.width*limitHeight)/tempImage.height; 
   }
   else
   { 
    SourceImage.width=tempImage.width;
    SourceImage.height=tempImage.height; 
   } 
  }
  SourceImage.style.marginLeft = (limitWidth - SourceImage.width) / 2;
  SourceImage.style.marginTop = (limitHeight - SourceImage.height) / 2;
 }
}