var originImage=new Image();
var successSrc=new Array();

function SetPicSize(obj, width, height) 
{ 
	myImage = new Image(); 
	myImage.src = obj.src; 
	if (myImage.width>0 && myImage.height>0) 
	{ 
		var rate = 1; 
		if (myImage.width>width || myImage.height>height) 
		{ 
			if (width/myImage.width<height/myImage.height) 
			{ 
				rate = width/myImage.width; 
			} 
			else 
			{ 
				rate = height/myImage.height; 
			} 
		} 
		if (window.navigator.appName == "Microsoft Internet Explorer") 
		{ 
			obj.style.zoom = rate; 
		} 
		else 
		{ 
			obj.width = myImage.width*rate; 
			obj.height = myImage.height*rate; 
		} 
	} 
} 


function GetImageWidth(src)
{
  if(originImage.src!=src)originImage.src=src;
  return originImage.width;
}

function GetImageHeight(src)
{
  if(originImage.src!=src)originImage.src=src;
  return originImage.height;
}

function LoadImage(DomElement,befaultUrl,id) 
{ 
	var url= befaultUrl + id +"&stamptime="+new Date().getTime(); 
	//var url=befaultUrl + id;
	var xhrObject = new ActiveXObject("MSXML2.XMLHTTP"); 
	xhrObject.onreadystatechange=function event() 
	{ 
		if(xhrObject.readystate==4) 
		{ 
			if(xhrObject.status==200) 
			{ 
				DomElement.src=url;
			} 
		} 
	 } 
	 xhrObject.open("get",url); 
	 xhrObject.send(null); 
} 

function LoadImageWithArr(DomElement,befaultUrl,id,index) 
{ 
	if (successSrc[index]==""||successSrc[index]==null||successSrc[index].length==0)
	{
		var url= befaultUrl + id +"&stamptime="+new Date().getTime(); 
		//var url=befaultUrl + id;
		var xhrObject = new ActiveXObject("MSXML2.XMLHTTP"); 
		xhrObject.onreadystatechange=function event() 
		{ 
			if(xhrObject.readystate==4) 
			{ 
				if(xhrObject.status==200) 
				{ 
					DomElement.src=url;
					successSrc[index]=url;
				} 
			} 
		 } 
		 xhrObject.open("get",url); 
		 xhrObject.send(null); 
	}
	else
	{
		DomElement.src=successSrc[index];
	}
}
