﻿function GoLearn(strLearID,strBaseID) 
{
    var selectObj1 = document.getElementById(strLearID);
    var selectObj2 = document.getElementById(strBaseID);
    if(selectObj1==null||selectObj2==null) return;
    window.location = "/knowledge/learn-"+selectObj1.value+"-"+selectObj2.value+".htm";
}
function GoSearch(strTextID) 
{
    var textObj= document.getElementById(strTextID);
    if(textObj==null) return;
    window.location = "/knowledge/search.htm?Query="+encodeURIComponent(textObj.value);
}
function setImgSize(img,maxWidth,maxHeight)   
{   
    if(maxWidth < 1)   
    {   
     if(img.height > maxHeight)   
     {   
         img.height = maxHeight;   
     }   
     return true;   
    }   
    if(maxHeight < 1)   
    {   
     if(img.width > maxWidth)   
     {   
         img.width = maxWidth;   
     }   
     return true;   
    }   
    if(img.height > maxHeight || img.width > maxWidth)   
    {   
     if((img.height / maxHeight) > (img.width / maxWidth))   
     {   
         img.height = maxHeight;   
     }   
     else   
     {   
         img.width = maxWidth;   
     }   
     return true;   
    }   
}   