var flag=false;
function DrawImage(ImgD,FitWidth,FitHeight){
var image=new Image();
image.src=ImgD.src;


	if(image.width>0 && image.height>0){
	flag=true;
		if(image.width/image.height>= FitWidth/FitHeight){
			if(image.width>FitWidth){
			ImgD.width=FitWidth;
			ImgD.height=(image.height*FitWidth)/image.width;
			}else{
			ImgD.width=image.width;
			ImgD.height=image.height;
			}
		}
		else{
			if(image.height>FitHeight){
			ImgD.height=FitHeight;
			ImgD.width=(image.width*FitHeight)/image.height;
			}else{
			ImgD.width=image.width;
			ImgD.height=image.height;
			}
		}
	}
}
function DrawImage2(ImgD,FitWidth,FitHeight){
var image=new Image();
image.src=ImgD.src;


	if(image.width>0 && image.height>0){
	flag=true;
		if(image.width/image.height>= FitWidth/FitHeight){
			if(image.width>FitWidth){
			ImgD.width=FitWidth;
			ImgD.height=(image.height*FitWidth)/image.width;
			}else{
			ImgD.width=image.width;
			ImgD.height=image.height;
			}
		}
		else{
			if(image.height>FitHeight){
			ImgD.height=FitHeight;
			ImgD.width=(image.width*FitHeight)/image.height;
			}else{
			ImgD.width=image.width;
			ImgD.height=image.height;
			}
		}
	}
	
	ImgD.style.marginTop=(174-ImgD.height)/2
	
}

function click() {
return false;}
function click1(){if (event.button==2) {return false; }}
function CtrlKeyDown(){
 if (event.keyCode==67&&event.ctrlKey)
 {
  clipboardData.setData('text','');
  return false; 
 }
}
document.onkeydown=CtrlKeyDown;
document.onselectstart=click;
document.onmousedown=click1;

<!-- 
if (window.Event) 
document.captureEvents(Event.MOUSEUP); 
function nocontextmenu(){ 
 event.cancelBubble = true 
 event.returnValue = false; 
 return false; 
} 
function norightclick(e){ 
if (window.Event){
 if (e.which == 2 || e.which == 3)
 return false;
} 
else if (event.button == 2 || event.button == 3)
{
 event.cancelBubble = true;
 event.returnValue = false;return false;} 
} 
document.oncontextmenu = nocontextmenu; // for IE5+ 
document.onmousedown = norightclick; // for all others 
