/*
 * randomPassword()
 *
 * Generates a random password and returns it.
 *
 * @param	int		length		The length of the password
 */
function randomPassword(length)
{
	chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890~!@#$%^&*()-_=+[{]}\\|<>/?";
	pass = "";
	
	while(true)
	{
		var pass = "";
	
		for(var x=0; x < length; x++)
		{
			i = Math.floor(Math.random() * 88);
			pass += chars.charAt(i);
		}
		
		if(!/[A-Z]/.test(pass))	
			continue;
			
		if(!/[0-9]/.test(pass))	
			continue;
			
		if(!/[~!@#$%^&*()_=+\[{\]}\\|<>/?-]/.test(pass))	
			continue;
		
		break;
	}
  
	return pass;
}