//图片按比例缩放
var flag=false;
function DrawImage(ImgD,iwidth,iheight){
    //参数(图片,允许的宽度,允许的高度)
    var image=new Image();
    image.src=ImgD.src;
    if(image.width>0 && image.height>0){
    flag=true;
    if(image.width/image.height>= iwidth/iheight){
        if(image.width>iwidth){  
        ImgD.width=iwidth;
        ImgD.height=(image.height*iwidth)/image.width;
        }else{
        ImgD.width=image.width;  
        ImgD.height=image.height;
        }
        ImgD.alt=image.width+"×"+image.height;
        }
    else{
        if(image.height>iheight){  
        ImgD.height=iheight;
        ImgD.width=(image.width*iheight)/image.height;        
        }else{
        ImgD.width=image.width;  
        ImgD.height=image.height;
        }
        ImgD.alt=image.width+"×"+image.height;
        }
    }
} 


function secBoard(n)
{
 var hs=mainTable.getElementsByTagName("li");//内容的li的id
/*    for(i=0;i<2;i++){
        idName=document.getElementById(i);
        if(i!=n)
            idName.className="sec1";
        else
            idName.className="sec2";
    }*/
//控制下面显示内容的样式

	for(i=0;i<hs.length;i++){
        if(i!=n)
            hs[i].style.display="none";
        else
            hs[n].style.display="block";
    }
}

function showsubmenu(sid)
{
whichEl = eval("submenu" + sid);
//imgmenu = eval("imgmenu" + sid);
if (whichEl.style.display == "none")
{
eval("submenu" + sid + ".style.display=\"\";");
//imgmenu.background="images/menuup.gif";
}
else
{
eval("submenu" + sid + ".style.display=\"none\";");
//imgmenu.background="images/menudown.gif";
}
}
