function RandCode()
{
    	var str = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
    	var length = str.length;
		var Passwd="";
    	for(i=0; i<3; i++){
		var a = Math.random() * length;
		var rndstr = Math.round(a);
        Passwd += str.substring(rndstr,rndstr+1);
		}
		var DateTime= new Date();
		Passwd += DateTime.getYear();
		Passwd += FormatTime((DateTime.getMonth() + 1));
   		Passwd += FormatTime(DateTime.getDate());
		Passwd += FormatTime(DateTime.getHours());
   		Passwd += FormatTime(DateTime.getMinutes());
   		Passwd += FormatTime(DateTime.getSeconds());
   		Passwd += FormatMs(DateTime.getMilliseconds());
		return Passwd;	
}

function FormatTime(time){
    if (time < 10) time = "0" + time;
    return time;
}

// 格式毫秒
function FormatMs(Ms){
    if (Ms < 10) Ms = "00" + Ms;
    if (Ms < 100) Ms = "0" + Ms;
    return Ms;   
}