
function checkInput() {
    groupName = $("groupName").value;
    songTitle = $("songTitle").value;
    artistName = $("artistName").value;
    artistEmail = $("artistEmail").value;
    confirmEmail = $("confirm_email").value
    mobilePhone = $("mobilePhone").value;
    biography = $("biography").value;
    //dob = $('dob').value;
    genre = $('genre').value;
    //addr1 = $('addressLine1').value;
    //addr2 = $('addressLine2').value;
    //suburb = $('suburb').value;
    //state = $('state').value;
    //country = $('country').value;
    //postcode = $('postcode').value;
    //district = $('district').value;
    
    
    if(isEmpty(groupName)) {
        alert("Artist/Band name can not be empty!");
        return false;
    }
    if(isEmpty(artistName)) {
        alert("Your name can not be empty!");
        return false;
    }
    /*
    if ($('under15').checked) {
        if (isEmpty($('parentName').value) || isEmpty($('parentPhone').value)) {
            alert("You must provide your parent's name and contact number.");
            return false;
        }            
    }
    if(isEmpty(addr1)&&isEmpty(addr2)) {
        alert("Street address can not be emypty!");
        return false;
    }
    if(isEmpty(suburb)) {
        alert("Suburb can not be emypty!");
        return false;
    }
    if(isEmpty(postcode)) {
        alert("Postcode can not be emypty!");
        return false;
    }
    if(country=="AU"){
        if(isEmpty(state)) {
            alert("Please select a state!");
            return false;
        }
    } */
//    else {
//        if(isEmpty(district)) {
//            alert("Please enter the district!");
//            return false;
//        }
//    }
    
//    if (!isDate(dob)) {
//        //alert("Please provide a valid date of birth!");
//        return false;
//    }
    
//    if(isEmpty(mobilePhone)) {
//        alert("Contact number can not be empty!");
//        return false;
//    }
    if(isEmpty(artistEmail)) {
        alert("Email can not be empty!");
        return false;
    }
    
    if ($('school_yes').checked) {
        if (isEmpty($('schoolName').value)) {
            alert("You must enter the shcool name.");
            return false;
        }
        if (isEmpty($('schoolMusicDeptHead').value)) {
            alert("You must enter name of head of school music department .");
            return false;
        }
        if (isEmpty($('schoolMusicDeptNumber').value)) {
            alert("You must enter contact number of head of school music department .");
            return false;
        }
    }
    
    if(artistEmail!=confirmEmail) {
        alert("Confirm Email does not match! Please check!");
        return false;
    }    
    if(isEmpty(songTitle)) {
        alert("Track title can not be empty!");
        return false;
    }
    if ($('orig_no').checked) {
        if (isEmpty($('origWriter').value) || isEmpty($('origArtist').value)) {
            alert("You must provide original song writer's name and who made the song famous.");
            return false;
        }
    }
    if ($('sample_yes').checked) {
        if (isEmpty($('sampleDetails').value)) {
            alert("You must provide details of the samples you used in your submitted track.");
            return false;
        }
    }
    if(biography.length>1000) {
        alert("The Biography field must contain between 0 and 1000 characters. Currently the field contains  "+biography.length+" characters");
        return false;
    }
    if(genre=="") {
        alert("You must select a genre!");
        return false;
    }
    
    termsCondition = document.getElementById("TermsConditions");
    if(termsCondition.checked==false) {
        alert("Please agree to the terms & conditions!");
        return false;
    }
    
    //termsCondition = document.getElementById("TermsConditions2");
    //if(termsCondition.checked==false) {
    //    alert("???????!");
    //    return false;
    //}
    
    validateCode = document.getElementById("validateCode").value;
    if(isEmpty(validateCode)) {
        alert("Validation code can not be empty!");
        return false;
    }        
    
    // marked how many are other members
    //document.getElementById("otherMemberNumber").value = i;
    return true;
}

//validate other member
function checkOtherMember() {
    
    return true;
}

//validate for idCard
function checkIdcard(idcard){
    
    return true;
}
function isIdcard(idcard) {
    
    return true;
}

function toggle_parent(che, div) {
    if (che.checked) div.show();
    else div.hide();
}


function checkInput3() {
    //alert("checking input");
    accepted_m = "wma,mp3,avi,flv,wmv,mpg,mpeg,mov,m4a";
    accepted_p = "jpg,jpeg,png,bmp,gif";
    musicFile = document.getElementById("musicFile").value;
    if (isEmpty(musicFile)) {
        alert("You must provide media file for your track.");
        return false;
    }
    pos = musicFile.lastIndexOf(".")
    suffix = musicFile.substring(pos + 1).toLowerCase();
    if (accepted_m.indexOf(suffix)<0)
    {
        alert("The music/video file you are about to upload is in an unaccepted format. We only accept the following format: " + accepted_m);
        return false;
    }   

    imgFile = document.getElementById("imgFile").value;
    if (isEmpty(imgFile)) {
        alert("You must provide a profile image file.");
        return false;
    }
     
    pos = imgFile.lastIndexOf(".")
    suffix = imgFile.substring(pos + 1).toLowerCase();    
    if (accepted_p.indexOf(suffix)<0) {
        alert("The picture you are about to upload is in an unaccepted format. We only accept the following format: " + accepted_p);
        return false;
    }  
        fb.loadAnchor("uploadProcessing.do", "width:600 height:450 scrolling:no", "");
        //alert("end of check input");
        return true;
}
