﻿    function DrawImage(ImgD,iwidth,iheight){
    var image=new Image();
    image.src=ImgD.src;
    if(image.width>0 && image.height>0 && (image.width>iwidth | image.height>iheight))
    {
    if(image.width/image.height>= iwidth/iheight){
        	ImgD.width=iwidth;
        	ImgD.height=(image.height*iwidth)/image.width;
        }
    else{
        	ImgD.height=iheight;
        	ImgD.width=(image.width*iheight)/image.height;
        }
    }
}
function searchKey_onclick() {
    if(document.getElementById("searchKey").value!="")
    {
        window.location.href="search.aspx?q="+document.getElementById("searchKey").value;
        return true;
    }
    else
    {
        return false;
    }
}

function clickButton(e, buttonid){ 
      var bt = document.getElementById(buttonid); 
      if (typeof bt == 'object'){ 
            if(navigator.appName.indexOf("Netscape")>(-1)){ 
                  if (e.keyCode == 13){ 
                        searchKey_onclick(); 
                        return false;
                  } 
            } 
            if (navigator.appName.indexOf("Microsoft Internet Explorer")>(-1)){ 
                  if (event.keyCode == 13){ 
                        searchKey_onclick(); 
                        return false;
                  } 
            } 
      } 
}

