// Javascript functions

function randomStuCode(length)
{
	chars = "ABCDEF123456789";
	pass = "SS";
	for(x=0;x<length;x++)
	{
		i = Math.floor(Math.random() * 62);
		pass += chars.charAt(Math.floor(Math.random()*chars.length))
	}
	return pass;
}

function randomAuthCode(length)
{
	chars = "1234567890";
	pass = "A";
	for(x=0;x<length;x++)
	{
		i = Math.floor(Math.random() * 62);
		pass += chars.charAt(Math.floor(Math.random()*chars.length))
	}
	return pass;
}

function confirmAction()
{
	if(confirm('This action is irreversible. \n Do you really want to delete ?')==1)
	{
		return true;	
	}
	else
	{
		return false;	
	}
}

// JavaScript Document

var win = null;
function NewWindow(mypage,myname,w,h,scroll){
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	settings =
	'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
	win = window.open(mypage,myname,settings)
}
