// JavaScript Document
	var started = 0;

    function email_checker(zx) {

        var z=1;
        var email=zx;
        var zplus=0;
        var dot=0;
        for (var I=0; I<email.length; I++) {
            em=email.charAt(I);
            em1=email.charAt(I+1);

            if (em=='*' | em=='%' | em=='!' | em=='$' | em=='&' | em=='(' | em==')' | em==' ' | em=='#' | em=='/' | em==',' | em=='?' | em=='+' | em=='=' | em=='[' | em==']' | em=='}' | em=='{') {
                z=0;
            }
            if ((em=='@' & em1=='.') | (em=='.' & em1=='@')) {
                z=0;
            }
            if (em=='@') {
                zplus++;
            }
            if (zplus>0) {
                if (em=='.') {
                    dot++;
                }
            }
        }

            em2=email.charAt(email.length-1);
            em3=email.charAt(0);
            if (em2=='_' | em3=='_' | em2=='.' | em3=='.' | em3=='@') {z=0;}
            if (zplus!=1 | dot==0) {z=0;}

            return z;
    }


    function form_processor() {

        var allright = 1;

        started = 1;

        the_form = document.form1;

        if (the_form.name.value == "") {
            allright = 0;
            document.getElementById("name_id").style.bgcolor="#000000";
        }

        if (the_form.email.value == "" || email_checker(the_form.email.value)==0) {
            allright = 0;
        }

        if (the_form.message.value == "") {
            allright = 0;
        }


        if (allright!="0") {
            document.form1.submit();
			document.getElementById("sent").style.visibility="visible";
        }
        else {
            document.getElementById("error_sign").style.visibility="visible";
        }

    }


    function form_checker() {

        if (started == 1)

        {

            var allright = 1;

            the_form = document.form1;

            if (the_form.name.value == "") {
                allright = 0;
            }

            if (the_form.email.value == "" || email_checker(the_form.email.value)==0) {
                allright = 0;
            }

            if (the_form.message.value == "") {
                allright = 0;
            }

            if (allright!="0") {
                document.getElementById("error_sign").style.visibility="hidden";
            }
            else {
                document.getElementById("error_sign").style.visibility="visible";
            }


        }

    }

