// JavaScript Document

function DrawImage(ImgD,maxwidth,maxheight){ 
 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>=maxwidth/maxheight){ 
   if(image.width>maxwidth){
    ImgD.width=maxwidth; 
    ImgD.height=(image.height*maxwidth)/image.width; 
   }else{ 
    ImgD.width=image.width;
    ImgD.height=image.height; 
   } 
  } 
  else{ 
   if(image.height>maxheight){
    ImgD.height=maxheight; 
    ImgD.width=(image.width*maxheight)/image.height; 
   }else{ 
    ImgD.width=image.width;
    ImgD.height=image.height; 
   } 
  } 
 }
}
function addfavorite(){
	if (document.all){
		window.external.addFavorite('http://www.com','深圳市家春秋文化传播有限公司');
	}
	else if (window.sidebar){
		window.sidebar.addPanel('深圳市家春秋文化传播有限公司', 'http://www.com', ""); 
	}
}
function swapTop(id)
					{
var objTopImg;
						for(i=1;i<9;i++)
						{

objTopImg = document.getElementById("topimg" + i);

if (objTopImg != null)
{
  if (i==1)
  {
    objTopImg.className ="menu_text"+(id==1?"0":"1");
  }
  else
  {
     objTopImg.className ="menu_text"+(i==id?"3":"2");
   }	
}
						}
					}
					
function changedisplay(objid)
{
	var obj;
	obj = document.getElementById("bybrand_"+objid);
	if (obj==null)
	{}
	else
	{
		try{
		  if(obj.style.display=="none")
		  {
		     	obj.style.display = "inherit";
		    	}
		  else
	    	{
		    	obj.style.display = "none";
		    	}
		}
		catch(e)
		{
			obj.style.display = "block";
			}
		}
	}
