// opens a popup-window
function NewWindow(u,n,w,h,f,p,x,y){
  var ws=window.screen?1:0,m=Math,C='center',R='random',M='custom',sw=screen.availWidth,sh=screen.availHeight,T=(p==C&&ws)?(sh-h)/2:(p==R&&ws)?(m.floor(m.random()*(sh-h))):(p==M)?y:100,L=(p==C&&ws)?(sw-w)/2:(p==R&&ws)?(m.floor(m.random()*(sw-w))):(p==M)?x:100,s='width='+w+',height='+h+',top='+T+',left='+L;s+=(!f||f=='')?'':','+f;
  win=window.open(u,n,s);
  if(win.focus)win.focus();
}


// deletes default-values in form-fields
function clearDefault(el) {
  if (el.defaultValue==el.value) el.value = ""
}

function checkForm()
{

//====== checks field USERNAME ======
if(document.loginform.username.value=="" ||document.loginform.username.value=="Username")
{
alert ("You have not entered your username yet.");
document.loginform.username.focus();
return false;
}

if( document.loginform.username.value.length <2  )
{
alert ("Would you please enter your real username?");
document.loginform.username.focus();
return false;
}


//====== checks field PASSWORD ======
if(document.loginform.password.value=="" ||document.loginform.password.value=="Password")
{
alert ("Please enter your password.");
document.loginform.password.focus();
return false;
}

if( document.loginform.password.value.length <2  )
{
alert ("Please enter the correct password.");
document.loginform.password.focus();
return false;
}

}
