var A_choice = "Ram"; var B_choice = "fret"; var C_choice = "Ex Libris / Your Name"; var D_choice = "zodiac7"; var flash_path = "flash/"; var nImgs = 5; var curr = 0; function setupFlash() { var width = "277"; var height = "214"; swfobject.embedSWF(flash_path + D_choice + ".swf", "flash_container", width, height, "9", false, false, false); } function updateA () { $('flash_container').updateFlashA(A_choice); } function updateB() { $('flash_container').updateFlashB(B_choice); } function updateC(txtObj) { var Fl_txt = txtObj.replace(/ \/ /g, "\n~"); if (txtObj == '' || txtObj == ' ') { Fl_txt = "~"; } $('flash_container').updateFlashC(Fl_txt); } function turnPage(direction) { if (direction == 'next') { if (curr < nImgs) { curr++; } else if (curr == nImgs) { curr = 1; } } if (direction == 'prev') { if (curr > 1) { curr--; } else if (curr == 1) { curr = nImgs; } } switch(curr) { case 1: document.getElementById('choiceA').value = "Scales"; document.getElementById('choiceB').value = "hatch"; document.getElementById('choiceC').value = "Ex Libris :: Your Name"; break; case 2: document.getElementById('choiceA').value = "Bull"; document.getElementById('choiceB').value = "graduated"; document.getElementById('choiceC').value = "From the Library of / Your Name"; break; case 3: document.getElementById('choiceA').value = "Twins"; document.getElementById('choiceB').value = "band"; document.getElementById('choiceC').value = "This book belongs to / Your Name | City, ST"; break; case 4: document.getElementById('choiceA').value = "Goat"; document.getElementById('choiceB').value = "hatch"; document.getElementById('choiceC').value = "Property of / Your / Name"; break; case 5: document.getElementById('choiceA').value = "Archer"; document.getElementById('choiceB').value = "band"; document.getElementById('choiceC').value = "Your Name"; break; default: document.getElementById('choiceA').value = "Ram"; document.getElementById('choiceB').value = "fret"; document.getElementById('choiceC').value = "Ex Libris / Your Name"; } A_choice = document.getElementById('choiceA').value; updateA(); B_choice = document.getElementById('choiceB').value; updateB(); updateC(document.getElementById('choiceC').value); } function checkinput(txtObj) { txtObj.value = txtObj.value.replace(/&#/g, "& #"); txtObj.value = txtObj.value.replace(/<(.)*>/g, ""); txtObj.value = txtObj.value.replace(/<|>|"|\\|~>/g, ""); var restricted_chars=new Array(); restricted_chars['<']=1; restricted_chars['>']=1; restricted_chars['"']=1; restricted_chars['/']=1; restricted_chars['~']=1; restricted_chars['\\']=1; restricted_chars['%']=1; restricted_chars['$']=1; restricted_chars['^']=1; var mychar=txtObj.value.charAt(txtObj.value.length-1); if(restricted_chars[mychar]) { txtObj.value=txtObj.value.substr(0,txtObj.value.length-1); } txtObj.value = txtObj.value.replace(/[\r\n]/g, " / "); txtObj.value = txtObj.value.replace(/( \/ ){2,}/g, " / "); txtObj.value = txtObj.value.replace(/( ){3,}(\/)+( ){3,}/g, " / "); txtObj.value = txtObj.value.replace(/(( ){3,}(\/)+( ){3,}){2,}/g, " / "); txtObj.value = txtObj.value.replace(/[ ]{3,}/g, " "); txtObj.value = txtObj.value.replace(/(.\/.)/g, " / "); } function checkCustomSettings() { var ok = 1; var C_choice = document.getElementById('choiceC').value; if(C_choice.search(/(Your Name)|(Your \/ Name)/) > -1) { alert ("Your bookplate still contains the words \'Your Name\' in the Custom Settings. Please edit the inscription with your own personalized text."); ok = 0; } return ok; } 
