function validater()
{
        if(window.document.form1.type.value=="")
        {
                alert("Please Select Type");
                window.document.form1.type.focus();
                return(false);
        }

        if(window.document.form1.title.value=="")
        {

                        alert("Please enter title");
                        window.document.form1.title.focus();
                        return(false);

        }
        if(window.document.form1.url.value=="")
        {

                        alert("Please enter url");
                        window.document.form1.url.focus();
                        return(false);

        }


        if(window.document.form1.category.value=="0")
        {

                        alert("Please select a category");
                        window.document.form1.category.focus();
                        return(false);

        }

        if(window.document.form1.description.value=="")
        {

                        alert("Please enter description");
                        window.document.form1.description.focus();
                        return(false);

        }


        function doSubmit()
        {

          return;
        }

}
function regvalidater()
{
        if(window.document.regi.firstname.value=="")
        {
                alert("Please enter first name");
                window.document.regi.firstname.focus();
                return(false);
        }
        if(window.document.regi.lastname.value=="")
        {
                alert("Please enter last name");
                window.document.regi.lastname.focus();
                return(false);
        }

        if(window.document.regi.address1.value=="")
        {

                        alert("Please enter address");
                        window.document.regi.address1.focus();
                        return(false);

        }
        if(window.document.regi.city.value=="")
        {

                        alert("Please enter city");
                        window.document.regi.city.focus();
                        return(false);

        }

        if(window.document.regi.zipcode.value=="")
        {

                        alert("Please select a zipcode");
                        window.document.regi.zipcode.focus();
                        return(false);

        }

        if(window.document.regi.country.value=="")
        {

                        alert("Please enter country");
                        window.document.regi.country.focus();
                        return(false);

        }
        if(window.document.regi.phone.value=="")
        {

                        alert("Please select a phone");
                        window.document.regi.phone.focus();
                        return(false);

        }


        if(window.document.regi.email.value=="")
        {

                        alert("Please enter email");
                        window.document.regi.email.focus();
                        return(false);

        }

        if(window.document.regi.email.value!="")
        {
        var a=document.regi.email.value
        var e=/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/
        if (!e.test(a)){
        alert("Invalid E-mail Address! Please re-enter.")
        window.document.regi.email.focus();
        return(false);
        }

        }

        if(window.document.regi.username.value=="")
        {

                        alert("Please enter username");
                        window.document.regi.username.focus();
                        return(false);

        }
        if(window.document.regi.password.value=="")
        {

                        alert("Please select a password");
                        window.document.regi.password.focus();
                        return(false);

        }


        function doSubmit()
        {

          return;
        }

}

function del_listings_id(ID, PAGE) {
this.id=ID
this.page=PAGE
alert(this.page);
var confirmmessage = "Are you sure you want to delete Listings ID #"+this.id+" ?";
var goifokay = "deleteads.php?del_id="+this.id+"&a=deleted&page="+this.page;

if (confirm(confirmmessage)) {
//window.location = goifokay;
deleteads(goifokay, this.page);
} else {
}
}
