 function validation_register(forma)
 {

 if (trim(document.forma.user.value) == '')
	 {
	 alert('Please enter the username !');
	 document.forma.user.focus();
	 return false;
	 }
  
 if (trim(document.forma.user.value).length < 4)
	 {
	 alert('Please enter minimum 4 characters for the username !');
	 document.forma.user.focus();
	 return false;
	 } 	

 if (document.forma.parola.value == '')
	 {
	 alert('Please enter the password !');
	 document.forma.parola.focus();
	 return false;
	 }

 if (document.forma.parola.value.length < 4)
	 {
	 alert('Please enter minimum 4 characters for the password !');
	 document.forma.parola.focus();
	 return false;
	 }


 if (document.forma.parola.value != document.forma.repeta_parola.value)
    {
    alert('Passwords are not identical !');
	return false;
    }

  if (trim(document.forma.name_display.value) == '')
	 {
	 alert('Please enter the name that will be displayed at Contact details !');
	 document.forma.name_display.focus();
	 return false;
	 }

 }

 function validation_modify_profile(forma)
 {

   if (trim(document.forma.name_display.value) == '')
	 {
	 alert('Please enter the name that will be displayed at Contact details!');
	 document.forma.name_display.focus();
	 return false;
	 }

 }

 function validation_pass()
 {

  if (document.forma.parola.value == '')
	 {
	 alert('Please enter the password !');
	 document.forma.parola.focus();
	 return false;
	 }

 if (document.forma.parola.value.length < 4)
	 {
	 alert('Please enter minimum 4 characters for the password !');
	 document.forma.parola.focus();
	 return false;
	 }


 if (document.forma.parola.value != document.forma.repeta_parola.value)
    {
    alert('Passwords are not identical !');
	return false;
    }
 
 }

function openwindow_book(id)
{
var URL = 'book.php?id='+id;
var options = "toolbar=1,status=0,menubar=0,scrollbars=1," + "resizable=0,width=400,height=200, left=350,top=100";
//alert(URL);
window.open(URL, "", options);
}

function openwindow_user(id)
{
var URL = 'user.php?id='+id;
var options = "toolbar=1,status=0,menubar=0,scrollbars=1," + "resizable=0,width=350,height=200, left=500,top=100";
//alert(URL);
window.open(URL, "", options);
}

function openwindow_helpsearch()
{
var URL = 'help_search.html';
var options = "toolbar=1,status=0,menubar=0,scrollbars=1," + "resizable=0,width=400,height=500, left=600,top=100";
//alert(URL);
window.open(URL, "", options);
}

function openwindow_terms()
{
var URL = 'html/terms.html';
var options = "toolbar=0,status=0,menubar=0,scrollbars=0," + "resizable=1";
//alert(URL);
window.open(URL, "", options);
}

function openwindow_contact()
{
var URL = 'contact.php';
var options = "toolbar=0,status=0,menubar=0,scrollbars=0," + "resizable=0, width=300,height=100, left=900,top=700";
//alert(URL);
window.open(URL, "", options);
}

/**********************************************************************
Name: trim
Description: Removes leading and trailing spaces
**********************************************************************/
function trim(str) {
	return (str.replace(/^\s*|\s*$/gi,''))
} 

/***********************************************************************
Name: confirmDelete
Description:
************************************************************************/

function confirmDelete(confirm_message) {
	return window.confirm(confirm_message);
}

function remember()
  {
    var URL = 'html/rem.html';
    var options = "toolbar=0,status=0,menubar=0,scrollbars=1," + "resizable=0,width=300,height=100, left=700,top=200";
    //alert(URL);
    window.open(URL, "", options);
  }



