max = 255;

function CheckForm() {
         if (!VerifyText('document.form.forename', 1))
                 return false;
         if (!VerifyText('document.form.name', 0))
                 return false;
         if (!VerifyList('document.form.sex', 0))
                 return false;
         if (!VerifyList('document.form.day', 1))
                 return false;
         if (!VerifyList('document.form.month', 1))
                 return false;
         if (!VerifyList('document.form.year', 1))
                 return false;
         if (!VerifyText('document.form.birthplace', 4))
                 return false;
         if (!VerifyText('document.form.father', 5))
                 return false;
         if (!VerifyText('document.form.city', 6))
                 return false;
     if (!VerifyText('document.form.address', 7))
                 return false;
         if (!VerifyText('document.form.zip', 8, 'numbers'))
                 return false;
         if (!VerifyText('document.form.county', 9))
                 return false;
//         if (!VerifyList('document.form.country', 4))
//                 return false;
         if (!VerifyText('document.form.phone', 11))
                 return false;
         if (!VerifyEmail('document.form.email')) {
                 return false;
         }

        return true;
}
<!---------------------------------------------------------------------------
function CheckFormProfile() {
         if (!VerifyText('document.form.city', 6))
                 return false;
     if (!VerifyText('document.form.address', 7))
                 return false;
         if (!VerifyText('document.form.zip', 8, 'numbers'))
                 return false;
         if (!VerifyText('document.form.county', 9))
                 return false;
         if (!VerifyText('document.form.phone', 11))
                 return false;
         if (!VerifyText('document.form.school', 13))
                 return false;

        if (!VerifyPassword())
                return false;

        return true;
}
<!---------------------------------------------------------------------------
function GetCurrentDate()
        {var months=new Array(13);
                months[1]=  "January";
                months[2]=  "February";
                months[3]=  "March";
                months[4]=  "April";
                months[5]=  "May";
                months[6]=  "June";
                months[7]=  "July";
                months[8]=  "August";
                months[9]=  "September";
                months[10]= "Octomber";
                months[11]= "November";
                months[12]= "December";

        var time=new Date();
        var lmonth=months[time.getMonth() + 1];
        var date=time.getDate();
        var year=time.getYear();

        if (year < 2000)
                year = year + 1900;
        document.write(lmonth+" "+date + ", "+ year);
}
<!---------------------------------------------------------------------------

function VerifyText(str, j, action) {
                        var Messages = new Array(14);

                         Messages[0]  = 'Câmpul "Nume" contine caractere invalide sau nu a fost completat !!!';
                         Messages[1]  = 'Câmpul "Prenume" contine caractere invalide sau nu a fost completat !!!';
                         //Messages[2]  = 'Va rugam sa va alegeti sexul';
                         //Messages[3]  = 'Va rugam sa selectati ziua, luna si anul nasterii';
                         Messages[4]  = 'Câmpul "Locul nasterii" contine caractere invalide sau nu a fost completat !!!';
                         Messages[5]  = 'Câmpul "Initiala tatalui" contine un caracter invalid sau nu a fost completat !!!';
                         Messages[6]  = 'Câmpul "Localitate" contine caractere invalide sau nu a fost completat !!!';
                         Messages[7]  = 'Câmpul "Adresa" contine caractere invalide sau nu a fost completat !!!';
                         Messages[8]  = 'Câmpul "Cod Postal" contine caractere invalide sau nu a fost completat !!!';
                         Messages[9]  = 'Câmpul "Judet/Stat" contine caractere invalide sau nu a fost completat !!!';
                         Messages[10] = 'Tara';
                         Messages[11] = 'Câmpul "Telefon" contine caractere invalide sau nu a fost completat !!!';
                        // Messages[12] = 'Campul "Email" nu ';
                         Messages[13] = 'Câmpul "Ultima institutie de invatamant absolvita" contine caractere invalide sau nu a fost completat !!!';
                         Messages[14] = 'Câmpul "Ordin de Plata/Mandat Postal" contine caractere invalide sau nu a fost completat !!!';
                         Messages[15] = 'Câmpul "Cod numeric personal" contine caractere invalide sau nu a fost completat !!!';

                        var temp

                        if (action != 'numbers')
                                ValidChr = "0123456789ABCDEFGHIJKLMNOPRSTUVZYWXQabcdefghijklmnoprstuzywxvq-.,+ \\\""
                        else
                                ValidChr = "0123456789"

                        if (eval(str+'.value==""') || eval(str+'.value=="ex. Ion"') || eval(str+'.value=="ex. Popescu"') ||  eval(str+'.value=="ex. +40-yy-xxx.xx.xx"')) {
                                alert(Messages[j]);
                                eval(str+'.select()');
                                eval(str+'.focus()');
                                return false
                        }

                        for (var i=0;i < eval(str+'.value.length');i++){
                                temp = eval(str + '.value.substring(i,i+1)');
                                if (ValidChr.indexOf(temp) == -1){
                                        eval(str+'.select()');
                                        eval(str+'.focus()');
                                        alert(Messages[j]);
                                        return false
                                }
                        }
                        return true
                }
<!---------------------------------------------------------------------------
function VerifyPassword() {


        if (document.form.password.value!='') {
                if (document.form.password.value != document.form.cf_password.value) {
                        alert('Câmpurile "Parolâ" si "Confirma parolâ" trebuie sâ continâ aceeasi valoare !');
                        return false;
                }

        if (document.form.password.value.length < 6) {
                alert('Parola trebuie sa aibă între 6 si 10 caractere !');
                return false;
        }
        }
        return true;

}
<!---------------------------------------------------------------------------
function VerifyEmail(str) {

 str1 = eval(str + '.value');

        if(!str1.match(/^[\w]{1}[\w\.\-_]*@[\w]{1}[\w\-_\.]*\.[\w]{2,6}$/i)) {
                        eval(str + '.focus()');
                        eval(str + '.select()');
                        alert('Adresă de email invalidă !');
                        return false;
        } else
                        return true;

        }
<!---------------------------------------------------------------------------
function VerifyList(Common, j) {
          var Messages = new Array(5);
          Messages[0]  = 'Trebuie să faci o alegere în câmpul "Sex" !';
          Messages[1]  = 'Va rugăm să selectati ziua, luna si anul nasterii !';
          Messages[2]  = 'luna ?';
          Messages[3]  = 'anul ?';
          Messages[4]  = 'tara ?';

        if (eval(Common+'.selectedIndex == 0'))        {
                alert(Messages[j]);
                eval(Common+'.focus()');
                return false;
                }
        else
                return true;

        }
<!-----------------------------------------------------------------------------
function CheckDiplomaForm() {
         if (!VerifyText('document.form.op', 14))
                 return false;
        if (!VerifyList('document.form.Day', 1))
                 return false;
         if (!VerifyList('document.form.Month', 1))
                 return false;
         if (!VerifyList('document.form.Year', 1))
                 return false;
         if (!VerifyText('document.form.CNP', 15, 'numbers'))
                 return false;

         return true;

        }
<!-----------------------------------------------------------------------------
function CheckMessageForm() {
        if (!CheckIfEmpty('document.subj.Subject', 'Câmpul "Subiect" nu poate fi gol !'))
                return false;
        if (!CheckIfEmpty('document.subj.Message', 'Câmpul "Mesaj" nu poate fi gol !'))
                return false;
return true;
}
<!-----------------------------------------------------------------------------
function CheckProposalInstit() {
		if (!CheckIfEmpty('document.Propunere.Titlu', 'Câmpul "Titlul cursului" nu poate fi gol !'))
			return false;
		if (!CheckIfEmpty('document.Propunere.Descriere', 'Câmpul "Descriere" nu poate fi gol !'))
			return false;
		if (!CheckIfEmpty('document.Propunere.Data', 'Câmpul "Data la care va fi livrat cursul" nu poate fi gol !'))
			return false;
		if (!CheckIfEmpty('document.Propunere.Institutie', 'Câmpul "Nume Institutie" nu poate fi gol !'))
			return false;
		if (!CheckIfEmpty('document.Propunere.PersoanaContact', 'Câmpul "Persoana de contact" nu poate fi gol !'))
			return false;
		if (!CheckIfEmpty('document.Propunere.Functie', 'Câmpul "Functie" nu poate fi gol !'))
			return false;
		if (!CheckIfEmpty('document.Propunere.Telefon', 'Câmpul "Telefon" nu poate fi gol !'))
			return false;
		if (!VerifyEmail('document.Propunere.Email')) 
            return false;

return true;
}
<!-----------------------------------------------------------------------------
function CheckProposalPF() {
		if (!CheckIfEmpty('document.Propunere.Titlu', 'Câmpul "Titlul cursului" nu poate fi gol !'))
			return false;
		if (!CheckIfEmpty('document.Propunere.Descriere', 'Câmpul "Descriere" nu poate fi gol !'))
			return false;
		if (!CheckIfEmpty('document.Propunere.Data', 'Câmpul "Data la care va fi livrat cursul" nu poate fi gol !'))
			return false;
		if (!CheckIfEmpty('document.Propunere.PersoanaContact', 'Câmpul "Nume" nu poate fi gol !'))
			return false;
		if (!CheckIfEmpty('document.Propunere.Telefon', 'Câmpul "Telefon" nu poate fi gol !'))
			return false;
		if (!VerifyEmail('document.Propunere.Email')) 
            return false;
		if (!CheckIfEmpty('document.Propunere.Calificari', 'Câmpul "Calificari" nu poate fi gol !'))
			return false;

return true;
}
<!-----------------------------------------------------------------------------
function ConfirmTopicDelete(Message) {
        return confirm(Message);

}
<!-----------------------------------------------------------------------------
function CheckIfEmpty(Str, Message) {

        if (eval(Str + '.value==""')) {
                eval(Str+'.focus()');
                eval(Str+'.select()');
                alert(Message);
                return false;
        } else {
                return true;
        }

}
<!-----------------------------------------------------------------------------
function customWindow (location, name, width, height, options)
{
    var op_str;

    width  =  width  == 0 ? 500 : width  ;
    height =  height == 0 ? 300 : height ;

    op_str = 'width=' + width + ',height=' + height;

    if ( options & 01 ) op_str += ",location=yes"  ;
    if ( options & 02 ) op_str += ",menubar=yes"   ;
    if ( options & 04 ) op_str += ",resizable=yes" ;
    if ( options & 08 ) op_str += ",scrollbars=yes";
    if ( options & 16 ) op_str += ",status=yes"    ;
    if ( options & 32 ) op_str += ",toolbar=yes"   ;

    return window.open(location , name, op_str);
}
<!-----------------------------------------------------
function DisplayTopics(Base, Idc, Idl, Page, Ses, Choose) {

if (Choose==0)
        location.href = Base + "index.php/Cont/Seminar/Subiecte/" + Idc + "/" + Idl + "/" + Page + "/" + document.seminar.selection.value  + "?PHPSESSID=" + Ses;
else
        location.href = Base + "index.php/Tutor/Seminarii/Subiecte/" + Idc + "/" + Idl + "/" + Page + "/" + document.seminar.selection.value  + "?PHPSESSID=" + Ses;
}
<!-----------------------------------------------------
function StudentDisplayTopics(Base, Idc, Idl, Page, Ses, UserType) {
    location.href = Base + "index.php/Cont/Seminar/Subiecte/" + Idc + "/" + Idl + "/" + Page + "/" + document.seminar.selection.value  + "?PHPSESSID=" + Ses;
}
<!-----------------------------------------------------
function Reset(str) {
        eval (str+'.value=""');
}
<!-----------------------------------------------------
function changeCase(frmObj) {
	var index;
	var tmpStr;
	var tmpChar;
	var preString;
	var postString;
	var strlen;
        tmpStr = frmObj.value.toLowerCase();
        strLen = tmpStr.length;
        if (strLen > 0)  {
                for (index = 0; index < strLen; index++)  {
                        if (index == 0)  {
                                tmpChar = tmpStr.substring(0,1).toUpperCase();
                                postString = tmpStr.substring(1,strLen);
                                tmpStr = tmpChar + postString;
                        }
                        else {
                                tmpChar = tmpStr.substring(index, index+1);
                                if ((tmpChar == " " || tmpChar == "-")&& index < (strLen-1))  {
                                        tmpChar = tmpStr.substring(index+1, index+2).toUpperCase();
                                        preString = tmpStr.substring(0, index+1);
                                        postString = tmpStr.substring(index+2,strLen);
                                        tmpStr = preString + tmpChar + postString;
                                 }
                        }
                }
        }
frmObj.value = tmpStr;

}
<!-----------------------------------------------------
function CountChars() {
        if(document.subj.Message.value.length > max) {
                document.subj.Message.blur();
                Buffer = document.subj.Message.value;
                document.subj.Message.value=Buffer.substr(0, max);
                alert("Numărul maxim de caractere permis este 255 !");
        }
}
<!-----------------------------------------------------
function countDown(tick) {
    if (tick == 0) {
        window.status = "Testarea online a luat sfârsit";
                document.form.submit();
        return;
        }
    var time = "Timp ramas: ";
    var minute = Math.floor(tick / 60);
    if (minute < 10) {
        time += "0";
        }
    time += minute + " minute ";
    var second = tick % 60;
    if (second < 10) {
        time += "0";
        }
    time += second + " secunde";
    window.status = time;
    --tick;
    var command = "countDown(" + tick + ")";
    window.setTimeout(command,1000);
    }
<!-----------------------------------------------------
function DisableRightClick() {
        document.oncontextmenu = function(){return false}
        if(document.layers) {
                window.captureEvents(Event.MOUSEDOWN);
                window.onmousedown = function(e){
                        if(e.target==document)return false;
                }
        } else {
                document.onmousedown = function()
                        {return false}

}
}
<!-----------------------------------------------------
function ShowBanner()  {
        document.all.BannerSpace.style.display = "";
}
<!-----------------------------------------------------
function HideBanner()   {
        document.all.BannerSpace.style.display = "none";
}
<!-----------------------------------------------------
function PrintLesson() {
        HideBanner();
        window.print();
        ShowBanner();
}
<!-----------------------------------------------------
function ShowEmoticon(text) {
        text = ' ' + text + ' ';
        if (document.subj.Message.createTextRange && document.subj.Message.caretPos) {
                var caretPos = document.subj.Message.caretPos;
                caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? text + ' ' : text;
                document.subj.Message.focus();
        } else {
        document.subj.Message.value  += text;
        document.subj.Message.focus();
        }
}
<!-----------------------------------------------------
function storeCaret(textEl) {
        if (textEl.createTextRange) textEl.caretPos = document.selection.createRange().duplicate();
}
