﻿function DrawImage(MyPic,W,H){
  var flag=false;
  var image=new Image();
  image.src=MyPic.src;
  if(image.width>0 && image.height>0){
    flag=true;
    if(image.width/image.height>= W/H){
      if(image.width>W){
        MyPic.width=W;
        MyPic.height=(image.height*W)/image.width;
      }
	  else{
        MyPic.width=image.width;
        MyPic.height=image.height;
      }
    }
    else{
      if(image.height>H){
        MyPic.height=H;
        MyPic.width=(image.width*H)/image.height;
      }
	  else{
        MyPic.width=image.width;
        MyPic.height=image.height;
      }
    }
  }
}


function getObject(objectId) {
if(document.getElementById && document.getElementById(objectId)) {
return document.getElementById(objectId);
} else if (document.all && document.all(objectId)) {
return document.all(objectId);
} else if (document.layers && document.layers[objectId]) {
return document.layers[objectId];
} else {
return false;
}
}
function focusTab2(n){
/****************************/
for(var j=1;j<=3;j++){
    getObject('focusTab2_'+j).style.color="#717171";
}
var bg1="url(images/new_bt1.gif)";
var bg2="url(images/new_bt2.gif)";
for(var i=1;i<=3;i++){
if (i==n){
getObject('focusTab2_'+i).style.background=bg1;
getObject('focusTable2_'+i).style.display='';
getObject('focusTab2_'+i).style.color="#000000";
}

else {
getObject('focusTab2_'+i).style.background=bg2;
getObject('focusTable2_'+i).style.display='none';

}
}
}
