var blogNotes = ["1", "2", "3"]; // literal array function selectBlog(whichBlog, clearOrNot) { if ( !clearOrNot || clearOrNot != "no" ) { clearGeneratedSnippet(); } for ( i = 0; i < blogNotes.length; i++ ) { var blogNoteObj = document.getElementById( "BlogNote" + blogNotes[i] ); if ( whichBlog == blogNotes[i] ) { blogNoteObj.style.display = "block"; blogNoteObj.style.visibility = "visible"; } else { blogNoteObj.style.display = "none"; blogNoteObj.style.visibility = "hidden"; } } } function myTrim( str ) { return str.replace(/^\s\s*/, '').replace(/\s\s*$/, ''); } function checkForm() { var snippet = document.getElementById("snippetOrUrl"); if ( myTrim(snippet.value).length == 0 ) { alert("Please paste in the YouTube embed into the first text box before proceeding."); snippet.focus(); return false; } else if (document.getElementsByName("blogTypeId")[0].checked && !document.getElementById("wordPressAcknowledged").checked) { alert("If you select WordPress you must confirm that you have read the iframe instructions using the checkbox below the WordPress radio button."); return false; } else if (!document.getElementById("acceptTerms").checked) { alert('You have not completed Step 3. Please read the Terms of Service, then click the checkbox next to the statement "I agree to the Terms of Service."'); return false; } else { return true; } } // Clears the results out so they don't think the stuff sitting in there is valid. function clearGeneratedSnippet() { var snippetTextAreaObj = document.getElementById( "ourSnippet" ); snippetTextAreaObj.value = ""; } function closeEmbedErrorBox() { document.getElementById('embedErrorBoxWrapper').style.visibility = 'hidden'; } function clearPaste() { document.getElementById("snippetOrUrl").value = ""; }