// JavaScript Document

function changeItem(id,item_name,count){
    for(i=1;i<=count;i++){
	    _item_id="#"+item_name+i;
		_item="#"+item_name+"_"+i;
		if(id == i){
			$(_item_id).attr("class","change_yes");
			$(_item).show();
		}else{
			$(_item_id).attr("class","change_no");
			$(_item).hide();
		}
	}
}



function correctPNG() // correctly handle PNG transparency in Win IE 5.5 & 6. 
{ 
    var arVersion = navigator.appVersion.split("MSIE") 
    var version = parseFloat(arVersion[1]) 
    if ((version >= 5.5) && (document.body.filters)) 
    { 
       for(var j=0; j<document.images.length; j++) 
       { 
          var img = document.images[j] 
          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 
             j = j-1 
          } 
       } 
    }     
} 
function EnterCheck(evt)
{
	if(evt.keyCode==13){
	  return true;} 
	  return false;
}


function DrawImage(ImgD,_width,_height){ 
     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>= _width/_height){ 
       if(image.width>_width){
        ImgD.width=_width; 
        ImgD.height=(image.height*_width)/image.width; 
       }else{ 
        ImgD.width=image.width;
        ImgD.height=image.height; 
       } 
      // ImgD.alt="点击查看详细信息..."; 
      } 
      else{ 
       if(image.height>_height){
        ImgD.height=_height; 
        ImgD.width=(image.width*_height)/image.height; 
       }else{ 
        ImgD.width=image.width;
        ImgD.height=image.height; 
       } 
      // ImgD.alt="点击查看详细信息..."; 
      } 
     }
    }

$(document).ready(function(){
    $("#bottomcounter").load("/Ajax/Counter.ashx");
});
