var domain = "clubfeet.net";
function do_email (domain, name, enquiry, style, title) {

    document.write ("<a ");
    if (style != "") {
        document.write (" class=\"" + style + "\" ");
    }
    
    if(title != "") {
        document.write ("title=\"" + title + "\" ");    
    }
    document.write (" href=\"mailto:")
    document.write (name + "@" + domain);
    if (enquiry != "") {
        document.write ("?subject="+enquiry)
    }
    document.write ("\">")
    document.write (name + "@" + domain);
    document.write ("</a>")
}

function updateTxtCount(oSrc, maxLen, strFieldName){

    if(oSrc.value.length > maxLen){
        alert("Please limit your "+strFieldName+" to "+maxLen+" characters or less");
    }
    oSrc.value = oSrc.value.substring(0, maxLen);
    intCharLeft = maxLen - oSrc.value.length
    document.getElementById("spanCounter").innerHTML = intCharLeft+" characters left";
}

function validateUploadImage(){
    var strImage, strImgDesc, strTerms, strMissingFields;
    strMissingFields = "";
    strImage    = document.getElementById('frmImgFile').value;
    strImgDesc  = document.getElementById('frmImageDesc').value;
    strTerms    = document.getElementById('termsAgree').checked;
    
    if(strImage == ""){
        strMissingFields += "Please select an image to upload\n";
    }
    
    if(strImgDesc == ""){
        strMissingFields += "Please enter a small description of this image\n";
    }
    if(strTerms == false){
        strMissingFields += "Please accept the terms and conditions\n";
    }
    if(strMissingFields != ""){
        alert("Please correct the following\n"+strMissingFields);
        return false;
    }else{
        return true;
    }
    
    
    
}
