// JavaScript Document

// open ajax message compose box
function cValidateFile(){

    var supportedImage = ['jpg', 'jpeg', 'gif', 'png']
    var showError      = false;

    fileName = jQuery('#file-upload').val();
    arrFile  = fileName.split(".");
    
    if(jQuery('#file-upload').val().length == 0){
       showError = true;
    } else if(jQuery.inArray(arrFile[1], supportedImage) < 0){       
       showError = true;
    }
    
    if(showError){
	    var ajaxCall = 'jax.call("community", "profile,ajaxErrorFileUpload", "")';
	    cWindowShow(ajaxCall, 'Empty file or invalid file type!', 400, 180);
		return false;
    }//end if
}
