
	//functions.js
	
	//Function to determine when the process_upload.php file has finished executing.
	function doneloading(theframe,thefile){
		var theloc = "showimg.php?thefile=" + thefile
		theframe.processajax ("showimg",theloc);
	}
	
	function uploadimg (theform){
		//Submit the form.
		theform.submit();
		//Then display a loading message to the user.
		setStatus ("Loading...","showimg");
	}
	
	//Function to set a loading status.
	function setStatus (theStatus, theObj){
		obj = document.getElementById(theObj);
		if (obj){
			obj.innerHTML = "<div class=\"bold\">" + theStatus + "</div>";
		}
	}
	
	function changesize (img, sml){
		//The display a loading message to the user.
		theobj = document.getElementById("showimg");
		if (theobj){
			setStatus ("Loading...","showimg");
			var loc = "thumb.php?img=" + img + "&sml=" + sml;
			processajax ("showimg",loc);
		}
	}
	////////////////to creat my createhtml codes////
	function creatmyhtml (img, sml){
		//The display a loading message to the user.
		theobj = document.getElementById("error");
		if (theobj){
			setStatus ("正在生成...","error");
			var loc = "createhtml.php?id=" + img + "&sml=" + sml+"&random="+new Date().getTime();
			processajax ("error",loc);
		}
	}
	function GetClick(id, sml){
		//The display a loading message to the user.
		theobj = document.getElementById("click");
		if (theobj){
			setStatus ("正在读取...","click");
			var loc = "../Getclick.php?id=" + id + "&sml=" + sml+"&random="+new Date().getTime();
			processajax ("click",loc);
		}
	}
	function BuyNow(id, sml)
	{
		//alert('please click me!');
		/*theobj = document.getElementById("div"+id);
		if (theobj){
			setStatus ("正在读取...","div"+id);
			var loc = "BuyNow.php?id=" + id + "&cpath=" + sml+"&random="+new Date().getTime();
			processajax ("div"+id,loc);
		}*/
		window.location.href="BuyNow.php?id=" + id + "&cpath=" + sml+"&random="+new Date().getTime();
		
		
		
		
	}
