function popup(url, name, width, height) {
settings="toolbar=no,location=no,directories=no,"+"status=no,menubar=no,scrollbars=yes,"+"resizable=yes,width="+width+",height="+height;
NewWindow=window.open(url,name,settings);
NewWindow.focus();
}

function validateMyForm(form) {
        if (form.contact.value.length < 3) {
                alert('Please enter a CONTACT NAME');
                form.contact.focus();
                form.contact.select();
                return false;
        }
        if (form.phone.value.length < 3) {
                alert('Please enter a CONTACT PHONE NUMBER');
                form.phone.focus();
                form.phone.select();
                return false;
        }

        var radio_choice = false;

        for (counter = 0; counter < form.mattype.length; counter++)
        {
                if (form.mattype[counter].checked)
                radio_choice = true;
        }

        if (!radio_choice)
        {
                alert('Please select a TYPE OF MATERIAL');
                return false;
        }

        if (form.file.value.length < 3) {
                alert('Please enter a FILENAME');
                form.file.focus();
                form.file.select();
                return false;
        }
        x = form.file.value.substr(form.file.value.length - 4, 4);
        if (x != ".sit" &&
            x != ".SIT" &&
            x != ".eps" &&
            x != ".EPS" &&
            x != ".hqx" &&
            x != ".HQX" &&
            x != ".pdf" &&
            x != ".PDF" &&
            x != ".jpg" &&
            x != ".JPG" &&
            x != ".sea" &&
            x != ".SEA" &&
            x != ".zip" &&
            x != ".ZIP" &&
            x != ".tif" &&
            x != ".TIF" &&
            x != ".tiff" &&
            x != ".TIFF") {
                alert('Only files of type .sit, .sea, .pdf, .eps, .hqx, .jpg, .zip, .tif, or .tiff are allowed');
                form.file.focus();
                form.file.select();
                return false;
        }
        return true;
}

function validateContactForm(form) {
        if (form.name.value.length < 3) {
                alert('Please enter your name to continue.');
                form.name.focus();
                form.name.select();
                return false;
        }
        var numericExpression = /^[0-9]{3}\-[0-9]{3}\-[0-9]{4}$/;
        if(!form.number.value.match(numericExpression)){
                alert('Please enter a valid 10 digit phone number including area code. Example 902-225-2525');
                form.number.focus();
                form.number.select();
                return false;
        }
        var emailExp = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;
        if(!form.email.value.match(emailExp)){
                alert('Please enter a valid email address to continue.');
                form.email.focus();
                form.email.select();
                return false;
        }
        if (form.comment.value.length < 3) {
                alert('Please enter your comment to continue.');
                form.comment.focus();
                form.comment.select();
                return false;
        }
        return true;
}


