﻿// JavaScript Document
function autoImg(img,w,h)
{
	if(w<=0 || h<=0) return;
	var image=new Image();
	image.src=img.src;
	//判断宽
	if(image.width>w)
	{
		newHeight=image.height/image.width*w;
		img.width=w;
		img.height=newHeight;
	}
	//判断高
	if(img.height>h)
	{
		newWidth=image.width/image.height*h;
		img.height=h;
		img.width=newWidth;
	}      
}

function click() {
alert('禁止你的左键复制！') }
function click1() {
if (event.button==2) {alert('禁止右键点击~！') }}
function CtrlKeyDown(){
if (event.ctrlKey) {alert('不当的拷贝将损害您的系统！') }}
document.onkeydown=CtrlKeyDown;
document.onselectstart=click;
document.onmousedown=click1;

