try{
            origin = JSON.parse(text1);
        }catch(e){
            $('#primary').addClass("invalidJson");
            alert('The input is not valid JSON. Please check the checkboes.');