-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathverseview.js
1 lines (1 loc) · 29.9 KB
/
verseview.js
1
var bookIndex=0;var chapterIndex=0;var verseIndex=0;var bible=new Array();var content1=new Array();var content2=new Array();var numofch=new Array([0],[50,31,25,24,26,32,22,24,22,29,32,32,20,18,24,21,16,27,33,38,18,34,24,20,67,34,35,46,22,35,43,55,32,20,31,29,43,36,30,23,23,57,38,34,34,28,34,31,22,33,26],[40,22,25,22,31,23,30,25,32,35,29,10,51,22,31,27,36,16,27,25,26,36,31,33,18,40,37,21,43,46,38,18,35,23,35,35,38,29,31,43,38],[27,17,16,17,35,19,30,38,36,24,20,47,8,59,57,33,34,16,30,37,27,24,33,44,23,55,46,34],[36,54,34,51,49,31,27,89,26,23,36,35,16,33,45,41,50,13,32,22,29,35,41,30,25,18,65,23,31,40,16,54,42,56,29,34,13],[34,46,37,29,49,33,25,26,20,29,22,32,32,18,29,23,22,20,22,21,20,23,30,25,22,19,19,26,68,29,20,30,52,29,12],[24,18,24,17,24,15,27,26,35,27,43,23,24,33,15,63,10,18,28,51,9,45,34,16,33],[21,36,23,31,24,31,40,25,35,57,18,40,15,25,20,20,31,13,31,30,48,25],[4,22,23,18,22],[31,28,36,21,22,12,21,17,22,27,27,15,25,23,52,35,23,58,30,24,42,15,23,29,22,44,25,12,25,11,31,13],[24,27,32,39,12,25,23,29,18,13,19,27,31,39,33,37,23,29,33,43,26,22,51,39,25],[22,53,46,28,34,18,38,51,66,28,29,43,33,34,31,34,34,24,46,21,43,29,53],[25,18,25,27,44,27,33,20,29,37,36,21,21,25,29,38,20,41,37,37,21,26,20,37,20,30],[29,54,55,24,43,26,81,40,40,44,14,47,40,14,17,29,43,27,17,19,8,30,19,32,31,31,32,34,21,30],[36,17,18,17,22,14,42,22,18,31,19,23,16,22,15,19,14,19,34,11,37,20,12,21,27,28,23,9,27,36,27,21,33,25,33,27,23],[10,11,70,13,24,17,22,28,36,15,44],[13,11,20,32,23,19,19,73,18,38,39,36,47,31],[10,22,23,15,17,14,14,10,17,32,3],[42,22,13,26,21,27,30,21,22,35,22,20,25,28,22,35,22,16,21,29,29,34,30,17,25,6,14,23,28,25,31,40,22,33,37,16,33,24,41,30,24,34,17],[150,6,12,8,8,12,10,17,9,20,18,7,8,6,7,5,11,15,50,14,9,13,31,6,10,22,12,14,9,11,12,24,11,22,22,28,12,40,22,13,17,13,11,5,26,17,11,9,14,20,23,19,9,6,7,23,13,11,11,17,12,8,12,11,10,13,20,7,35,36,5,24,20,28,23,10,12,20,72,13,19,16,8,18,12,13,17,7,18,52,17,16,15,5,23,11,13,12,9,9,5,8,28,22,35,45,48,43,13,31,7,10,10,9,8,18,19,2,29,176,7,8,9,4,8,5,6,5,6,8,8,3,18,3,3,21,26,9,8,24,13,10,7,12,15,21,10,20,14,9,6],[31,33,22,35,27,23,35,27,36,18,32,31,28,25,35,33,33,28,24,29,30,31,29,35,34,28,28,27,28,27,33,31],[12,18,26,22,16,20,12,29,17,18,20,10,14],[8,17,17,11,16,16,13,13,14],[66,31,22,26,6,30,13,25,22,21,34,16,6,22,32,9,14,14,7,25,6,17,25,18,23,12,21,13,29,24,33,9,20,24,17,10,22,38,22,8,31,29,25,28,28,25,13,15,22,26,11,23,15,12,17,13,12,21,14,21,22,11,12,19,12,25,24],[52,19,37,25,31,31,30,34,22,26,25,23,17,27,22,21,21,27,23,15,18,14,30,40,10,38,24,22,17,32,24,40,44,26,22,19,32,21,28,18,16,18,22,13,30,5,28,7,47,39,46,64,34],[5,22,22,66,22,22],[48,28,10,27,17,17,14,27,18,11,22,25,28,23,23,8,63,24,32,14,49,32,31,49,27,17,21,36,26,21,26,18,32,33,31,15,38,28,23,29,49,26,20,27,31,25,24,23,35],[12,21,49,30,37,31,28,28,27,27,21,45,13],[14,11,23,5,19,15,11,16,14,17,15,12,14,16,9],[3,20,32,21],[9,15,16,15,13,27,14,17,14,15],[1,21],[4,17,10,10,11],[7,16,13,12,13,15,16,20],[3,15,13,19],[3,17,20,19],[3,18,15,20],[2,15,23],[14,21,13,10,14,11,15,14,23,17,12,17,14,9,21],[4,14,17,18,6],[28,25,23,17,25,48,34,29,34,38,42,30,50,58,36,39,28,27,35,30,34,46,46,39,51,46,75,66,20],[16,45,28,35,41,43,56,37,38,50,52,33,44,37,72,47,20],[24,80,52,38,44,39,49,50,56,62,42,54,59,35,35,32,31,37,43,48,47,38,71,56,53],[21,51,25,36,54,47,71,53,59,41,42,57,50,38,31,27,33,26,40,42,31,25],[28,26,47,26,37,42,15,60,40,43,48,30,25,52,28,41,40,34,28,41,38,40,30,35,27,27,32,44,31],[16,32,29,31,25,21,23,25,39,33,21,36,21,14,23,33,27],[16,31,16,23,21,13,20,40,13,27,33,34,31,13,40,58,24],[13,24,17,18,18,21,18,16,24,15,18,33,21,14],[6,24,21,29,31,26,18],[6,23,22,21,32,33,24],[4,30,30,21,23],[4,29,23,25,18],[5,10,20,13,18,28],[3,12,17,18],[6,20,15,16,16,25,21],[4,18,26,17,22],[3,16,15,15],[1,25],[13,14,18,19,16,14,20,28,13,28,39,40,29,25],[5,27,26,18,17,20],[5,25,25,22,19,14],[3,21,22,18],[5,10,29,24,21,21],[1,13],[1,14],[1,25],[22,20,29,22,11,14,17,17,13,21,11,19,17,18,20,8,21,18,24,21,15,27,21]);colorChart=["FFFFFF","800000","A52A2A","DC143C","FF0000","FF6347","FF7F50","CD5C5C","FA8072","FFA07A","FF4500","FF8C00","FFD700","B8860B","DAA520","BDB76B","F0E68C","808000","FFFF00","9ACD32","7CFC00","ADFF2F","006400","228B22","00FF00","32CD32","98FB98","8FBC8F","00FA9A","00FF7F","2E8B57","3CB371","20B2AA","2F4F4F","008080","00FFFF","E0FFFF","AFEEEE","B0E0E6","5F9EA0","6495ED","00BFFF","1E90FF","000080","0000FF","4169E1","8A2BE2","4B0082","483D8B","7B68EE","8B008B","9400D3","BA55D3","D8BFD8","DDA0DD","EE82EE","FF00FF","C71585","DB7093","FF1493","FFC0CB","FAEBD7","FFE4C4","F5DEB3","8B4513","A0522D","D2691E","CD853F","F4A460","DEB887","FFE4B5","FFF0F5","F5FFFA","778899","B0C4DE","F0F8FF","000000","696969","A9A9A9","D3D3D3","FFFFFF","26FF2A"];var themeState=false;var enterPressed=false;var searchFocus=false;var verseFocus=false;var systemFontList=new Array("Impact","Tahoma","Helvetica","Garamond","Montserrat","Futura","Gill Sans","Rockwell","Palatino","Verdana","Cabin","Patua One","Rancho","Roboto Slab","Alegreya Sans","Bitter","Calibri","Myriad Pro","Optima","Baloo Tammudu","Baloo Thambi","Baloo Chettan","Chilanka Malayalam","Gayathri Malayalam","Manjari Malayalam","MeeraInimai Tamil","NotoSans Hindi","Ramabhadra Telugu","Suranna Telugu","AnjaliOldLipi","Aruna","Jomhuria Arabic","Lalezra Arabic","Kambar","Lohit Malayalam","Meera Malayalam","Tenali Telugu");var specialFontList=new Array("JC_Malayalam","JC_Hindi","Malayalam","ML-TTKarthika","Thiruvachanam","Kerala","ML-TTRevathi","Tamil Bible","ML-Keraleeyam1","","Shusha","kambar","tamil","Kerala");var tabViewN=null;var searchObj=null;var notesObj=null;var notesManageObj=null;var scheduleObj=null;var webServerObj=null;var vvchatQObj=null;var webEngineObj=null;var bibleRefObj=null;var songEditObj=null;var songManagerObj=null;var songNumberObj=null;var chordsNavObj=null;var chordsEditObj=null;var chordsKeyboard=null;var chordsManagerObj=null;var chordsDatabaseObj=null;var chordsImportExportObj=null;var songNavObj=null;var helpObj=null;var audioObj=null;var vvMonitor=null;var bibleVersionSelObj=null;var remoteVV_UI_Obj=null;var setup_present_UI_Obj=null;var updateVV_UI_Obj=null;var editVerse_UI_Obj=null;var newUpdateObj=null;var varID="";var notesUI="";var songEditUI="";var helpContent="";var cpObj=null;var firstTimeFlag=false;var enterForSearchActive=true;var enterForBibleRef=false;var vvMenu=null;var vvConfigObj=null;var previousSelVerse=0;var presentationContent="";var highlightColor="#BAD0EF";var oAC=null;var tabView;var scroll_to_view=false;var songDBVersion;var bibleDBVersion;var systemOS="";var airVersion=3;var dataSizeOK=false;var navWindowHeight=1000;var navWindowWidth=1000;var learner=null;var wordbrain=null;var testTAB=false;function getBookValue(){return(document.getElementById("bookList").selectedIndex)}function getChapterValue(){return(document.getElementById("chapterList").selectedIndex)}function getVerseValue(){return(document.getElementById("verseList").selectedIndex)}function launch(g){var j;var c=document.getElementById("multipleVerseID").checked;var e=1;if(c){e=2}var b=new Array();var a=new Array();p_last_index=content1.length-1;var h=0;h=p_last_index+1;j=p_last_index;b=content1;a=content2;if(e==2){var l=h%2;if(l==0){j=(parseInt(h/2))-1;for(var f=0;f<=j;f++){b[f]=content1[f*2]+"<BR>"+content1[(f*2)+1];a[f]=content2[f*2]+"<BR>"+content2[(f*2)+1]}}else{j=(parseInt(h/2));for(var f=0;f<j;f++){b[f]=content1[f*2]+"<BR>"+content1[(f*2)+1];a[f]=content2[f*2]+"<BR>"+content2[(f*2)+1]}b[f]=content1[f*2];a[f]=content2[f*2]}}var k=parseInt(g/e);if(vvConfigObj.get_singleVersion()){var d=a.length;for(f=0;f<d;f++){a[f]=""}}p_text1_arr=b;p_text2_arr=a;p_text1_font=bibleVersionArray[vvConfigObj.get_version1()][6];p_text2_font=bibleVersionArray[vvConfigObj.get_version2()][6];p_title=p_title;p_footnote=p_footer;p_current_index=k;p_last_index=j;p_bkgnd_filename=graphicsObj.getBkgndFilename();p_bkgnd_motion=graphicsObj.getMotionFlag();p_bkgnd_color="blue";p_font_color=vvConfigObj.get_p_textColor();p_font_color2=vvConfigObj.get_p_textColor2();p_ver1ScaleFactor=1;p_ver2ScaleFactor=1;if(vvConfigObj.get_singleVersion()){p_text_orientation=2}else{p_text_orientation=vvConfigObj.get_p_text_orientation()}presentation()}function loadBookNames(a){setPrimaryBooknames()}function getSingleVerse(j,f,k,e){var l;var g=(j*1)+1;var a=(f*1)+1;var h=(k*1)+1;var d=getVerseFromArray(g,a,h);if(e==1){l=(bibledbObj[1].getSingleVerseFromBuffer(d-1))}else{l=(bibledbObj[2].getSingleVerseFromBuffer(d-1))}return(l)}function present(){bookIndex=document.getElementById("bookList").selectedIndex;chapterIndex=document.getElementById("chapterList").selectedIndex;verseIndex=document.getElementById("verseList").selectedIndex;recent.addSelection(bookIndex,chapterIndex,verseIndex);air.trace("Called in present()");getdata();p_footer=getFooter();p_title=booknames[bookIndex]+" "+(chapterIndex+1);launch(verseIndex);themeState=false;disableNavButtons(false)}function present_external(a,h,e){var g=bookIndex;var f=chapterIndex;var d=verseIndex;bookIndex=a;chapterIndex=h;verseIndex=e;getdataONLY();p_footer=getFooter();p_title=booknames[bookIndex]+" "+((chapterIndex*1)+1);launch(verseIndex);themeState=false;bookIndex=g;chapterIndex=f;verseIndex=d;getdataONLY();disableNavButtons(false)}function getFooter(){var b;var a=bibleVersionArray[vvConfigObj.get_version1()][3];var c=bibleVersionArray[vvConfigObj.get_version2()][3];b=a+" / "+c;if(a=="public"){a="Public Domain"}if(c=="public"){c="Public Domain"}if((a=="Public Domain")&&(c=="Public Domain")){b=""}if(((a=="Public Domain")||(a==""))&&(c!="Public Domain")){b=c}if((a!="Public Domain")&&((c=="Public Domain")||(c==""))){b=a}if(a==c){b=a}if(parseInt(p_text_orientation)==2){if(a=="Public Domain"){b=""}else{b=a}}return(b)}function presentTheme(){if(themeState){present()}else{themeState=true;p_title="";p_footnote="";p_last_index=0;content1[0]="";content2[0]="";p_current_index=0;p_bkgnd_filename=graphicsObj.getBkgndFilename();p_bkgnd_motion=graphicsObj.getMotionFlag();p_bkgnd_color="black";p_font_color="white";p_font_color2="white";presentation()}}function setFontForList(){var a=bibleVersionArray[vvConfigObj.get_version1()][6];$("#bookList").css("font-family",a);$("#chapterList").css("font-family",a);$("#verseList").css("font-family",a);$("#recentSel").css("font-family",a)}function putbook(){clearSelectList("bookList");var a=vvConfigObj.get_listinenglish();var b=booknames.length;for(i=0;i<b;i++){if(a){document.getElementById("bookList").options[i]=new Option(default_booknames[i],i)}else{document.getElementById("bookList").options[i]=new Option(booknames[i],i)}}document.getElementById("bookList").selectedIndex=0;setFontForList()}function putch(b,a){clearSelectList("chapterList");val=document.getElementById("bookList").selectedIndex+1;for(i=0;i<numofch[val][0];i++){document.getElementById("chapterList").options[i]=new Option(i+1,i)}if(b==null){document.getElementById("chapterList").selectedIndex=0}else{document.getElementById("chapterList").selectedIndex=b}if(!a){putver()}}function putver(a){bookval=document.getElementById("bookList").selectedIndex+1;chval=document.getElementById("chapterList").selectedIndex+1;clearSelectList("verseList");for(i=0;i<numofch[bookval][chval];i++){document.getElementById("verseList").options[i]=new Option(i+1,i+1)}if(a==null){document.getElementById("verseList").selectedIndex=0}else{document.getElementById("verseList").selectedIndex=a}scroll_to_view=true;updateVerseContainer()}function verseChange(){var a=getVerseValue();scroll_to_view=true;highlightVerse(a);updateRefMenu()}function updateRefMenu(){var a=document.getElementById("bookList").selectedIndex;var f=document.getElementById("chapterList").selectedIndex;var d=document.getElementById("verseList").selectedIndex;var e=booknames[a]+" "+(f+1);$("#book_name").text(e)}function highlightVerse(a){var b="TC_"+previousSelVerse;document.getElementById(b).style.backgroundColor="edf5ff";var b="TC_"+a;document.getElementById(b).style.backgroundColor=highlightColor;previousSelVerse=a;var c="TC_"+(a);if(scroll_to_view){document.getElementById(c).scrollIntoView();scroll_to_view=false}window.scroll(0,0)}function updateVerseContainer(){previousSelVerse=0;priFontName=bibleVersionArray[vvConfigObj.get_version1()][6];secFontName=bibleVersionArray[vvConfigObj.get_version2()][6];var a=document.getElementById("navDualLanguageID").checked;vvConfigObj.set_navDualLanguage(a);bookIndex=document.getElementById("bookList").selectedIndex;chapterIndex=document.getElementById("chapterList").selectedIndex;verseIndex=document.getElementById("verseList").selectedIndex;getdata()}function updateVerseContainer_continue(){var p=content1.length;var n="";n=n+"<table border=1>";if(vvConfigObj.get_navDualLanguage()){n=n+'<tr><td width="4%"></td><td width="48%"></td><td width="48%"></td></tr>'}else{n=n+'<tr><td width="4%"></td><td width="96%"></td></tr>'}for(i=0;i<p;i++){var a="TC_"+i;if(vvConfigObj.get_navDualLanguage()){n=n+'<tr class="vcClass" id="'+a+'"><td width="4%">';var h="NC_"+i;n=n+'<div class="vcClassIcon" id="'+h+'"><img class="vcClassIcon" src="graphics/icon/notes_s.png"></div>';n=n+'</td><td class="navtd" width="48%">';var h="VC1_"+i;n=n+'<div class="vcClass" id="'+h+'">a</div>';n=n+'</td><td class="navtd" width="48%">';var h="VC2_"+i;n=n+'<div class="vcClass" id="'+h+'">b</div>';n=n+"</td></tr>"}else{n=n+'<tr class="vcClass" id="'+a+'"><td width="4%">';var h="NC_"+i;n=n+'<div class="vcClassIcon" id="'+h+'"><img class="vcClassIcon" src="graphics/icon/notes_s.png"></div>';n=n+'</td><td class="navtd" width="96%">';var h="VC1_"+i;n=n+'<div class="vcClass" id="'+h+'">x</div>';n=n+"</td></tr>"}}n=n+"</table>";document.getElementById("verseTab").innerHTML=n;var o=new Array();var c=new Array();var b=new Array();for(i=0;i<p;i++){var m="VC1_"+i;var g="VC2_"+i;var e="NC_"+i;o[i]=new postit();o[i].init(e,(bookIndex+1),(chapterIndex+1),(i+1));c[i]=new verseClass;var l=content1[i];var k=bibleVersionArray[vvConfigObj.get_version1()][6];c[i].init(m,l,(bookIndex+1),(chapterIndex+1),(i+1),k);if(vvConfigObj.get_navDualLanguage()){b[i]=new verseClass;var l=content2[i];var k=bibleVersionArray[vvConfigObj.get_version2()][6];b[i].init(g,l,(bookIndex+1),(chapterIndex+1),(i+1),k)}}if(notesObj!=null){var j=document.getElementById("nm_note_type1");if(j.checked){notesObj.getNotes(bookval,chval,0)}}var d=getVerseValue();highlightVerse(d)}function vvinit(){splash(true);setAIRversion();var a=firstTimeCheck();if(!a){vvDialog("VerseVIEW","Error loading database. Please contact verseview@yahoo.com")}tabFrame();tabFrameVerse();vvConfigObj=new vvConfigClass();vvConfigObj.load();learner=new wordlearner();wordbrain=new vvbrain();wordbrain.init()}function vvinit_continue(){vvDialogSetup();vvConfirmSetup();vvPanelSetup();setTimeout(function(){var b=(vvConfigObj.get_chordsDBVersion())*1;if(b==1&&!firstTimeFlag){var c=copyFile("chords/chords.db","song/chords.db");if(c){vvDialog("Chords","Updated Chords database");vvConfigObj.set_chordsDBVersion(2)}}var a=(vvConfigObj.get_bibleDBVersion())*1;if(a==1&&!firstTimeFlag){var c=copyFile("xml/version.xml","xml/version.xml");if(c){c=copyFile("bible","bible");if(c){vvConfigObj.set_version1(1);vvConfigObj.set_version2(2);vvConfigObj.set_bibleDBVersion(2);vvDialog("VerseVIEW","Bible Database update process completed.")}else{vvDialog("VerseVIEW","Bible Database update failed. Please contact verseview@yahoo.com")}}else{vvDialog("VerseVIEW","Bible Database update failed. Please contact verseview@yahoo.com")}}loadBibleVersion();loadSQLBible(vvConfigObj.get_version1(),1);loadSQLBible(vvConfigObj.get_version2(),2);nativeWindow.maximize();generateTabContent();splash(false);air.trace(" AIR Runtime Version: "+air.NativeApplication.nativeApplication.runtimeVersion);nativeWindow.visible=true;nativeWindow.activate();setupNavWindow();loadBookNames(vvConfigObj.get_version1());putbook();vvMenu=air.ui.Menu.createFromXML("menu/menu.xml");air.ui.Menu.setAsMenu(vvMenu);nativeWindow.addEventListener("resize",setupNavWindow);nativeWindow.addEventListener("close",processExit);newUpdateObj=new checkForNewVersion();newUpdateObj.init()},500);setTimeout(function(){window.scroll(0,0)},3000)}function setupNavWindow(){var c=280;var d=window.nativeWindow.bounds.height;var k=window.nativeWindow.bounds.width;if((navWindowHeight!=d)||(navWindowWidth!=k)){document.body.style.overflow="hidden";var j=window.nativeWindow.bounds.width-16;var f=window.innerHeight;var b=parseInt(j*3/100);var a=parseInt(f*4/100);tabHeight=f-120;var g=250;var e=200;document.getElementById("wrapper").style.height=tabHeight;$("#container").height(tabHeight);$("#navTab").height(tabHeight);$("#songNavTab").height(tabHeight);$("#bookList").height(tabHeight-c);$("#chapterList").height(tabHeight-c);$("#verseList").height(tabHeight-c);var l=j-g-e-(3*b);document.getElementById("container2").style.height=tabHeight;document.getElementById("bibleverseTab").style.height=tabHeight;document.getElementById("lyricsTab").style.height=tabHeight;document.getElementById("notesTab").style.height=tabHeight;document.getElementById("scheduleTab").style.height=tabHeight;document.getElementById("searchTab").style.height=tabHeight;document.getElementById("graphicsTab").style.height=tabHeight;document.getElementById("screenTab").style.height=tabHeight;document.getElementById("still_bkgnd_grid").style.height=f-450;graphicsObj.setNumOfPicsInRow(l);songNavObj.setFormats();navWindowHeight=d;navWindowWidth=k}}function setupTheme(){var a=document.getElementById("themeList").value;switch(a){case"1":document.body.style.backgroundImage="url(graphics/background2.png)";break;case"2":document.body.style.backgroundImage="url(graphics/background3.png)";break;default:}}function generateTabContent(){promptInit();readContentFile2Var("./content/setup_biblesel.txt");bibleVersionSelObj=new bibleVersionSelClass();bibleVersionSelObj.init(varID);readContentFile2Var("./content/setup_remote.html");remoteVV_UI_Obj=new remoteVV_UI_Class();remoteVV_UI_Obj.init(varID);readTabContentFile("./content/bible_verses.txt","bibleverseTab");readTabContentFile("./content/screens.html","screenTab");readContentFile2Var("./content/setup_update.txt");updateVV_UI_Obj=new updateVV_UI_Class();updateVV_UI_Obj.init(varID);readTabContentFile("./content/config.txt","configTab");readTabContentFile("./content/nav.html","navTab");readTabContentFile("./content/search.txt","searchField");readTabContentFile("./content/notesmanage.txt","notesTab");readTabContentFile("./content/schedule.txt","scheduleTab");readTabContentFile("./content/song_nav.html","songNavTab");readContentFile2Var("./content/help.txt");helpContent=varID;readContentFile2Var("./content/song_edit.html");songEditUI=varID;readTabContentFile("./content/song_lyrics.html","lyricsTab");if(testTAB){readTabContentFile("./content/test.html","testTab")}readContentFile2Var("./content/notesui.txt");notesUI=varID;notesManageObj=new manageNotes();notesObj=new notes();notesObj.setNotesContainerID("notesPanelID");notesManageObj.init(firstTimeFlag);var a="./bible/"+getVersion1Filename();searchObj=new vvsearch(a);searchObj.init();webServerObj=new vvWebServer();webEngineObj=new vvWebEngine();vvchatQObj=new chatQ();if(testTAB){}bibleRefObj=new BibleReference();songNumberObj=new songNumber();songManagerObj=new songManagerClass();songManagerObj.init(true,true);songEditObj=new songEditClass();songEditObj.init(songEditUI);songNavObj=new songNavClass();songNavObj.init();helpObj=new vvhelpClass();helpObj.init(helpContent);readContentFile2Var("./content/graphics.html");graphicsObj=new graphicsClass();graphicsObj.init(varID);readContentFile2Var("./content/chords.html");chordsNavObj=new chordsNavClass();chordsNavObj.init(varID);readContentFile2Var("./content/chords_edit.html");chordsEditObj=new chordsEditClass();chordsEditObj.init(varID);readContentFile2Var("./content/chords_keyboard.html");chordsKeyboard=new chordsVirtualKeyboard();chordsKeyboard.init(varID);if(!isUpToDate()&&(task2Status()==false)){air.trace("About to copy webroot files...");var b=backupWebroot();if(b){copyFile("network/webroot","network/webroot");task2Complete()}checkVerUpdateFlags()}}function readContentFile2Var(a){var b;b=new XMLHttpRequest();b.onreadystatechange=function(){if(b.readyState<4){}if(b.readyState==4){varID=b.responseText}};b.open("GET",a,false);b.send(null)}function readTabContentFile(a,b){var c;c=new XMLHttpRequest();c.onreadystatechange=function(){if(c.readyState<4){}if(c.readyState==4){if(b!="configTab"){document.getElementById(b).innerHTML=c.responseText}fillTabs(b)}};c.open("GET",a,false);c.send(null)}function fillTabs(a){if(a=="navTab"){fillNav()}if(a=="configTab"){versionFill(true);configInit()}if(a=="scheduleTab"){scheduleObj=new schedule()}if(a=="graphicsTab"){}if(a=="testTab"){initTestEvents()}if(a=="searchField"){roundSearchBox(document.getElementById("adSearch"))}if(a=="monitorTab"){}if(a=="screenTab"){document.getElementById("thirdview_opacity").value=vvConfigObj.get_svOpacity();document.getElementById("thirdview_height").value=vvConfigObj.get_svHeight();document.getElementById("thirdview_fcolor").value=vvConfigObj.get_svFcolor();document.getElementById("thirdview_position").value=vvConfigObj.get_svPosition();document.getElementById("thirdview_maxFontSize").value=vvConfigObj.get_svMaxFontSize();document.getElementById("thirdview_bcolor").value=vvConfigObj.get_svBcolor();$("#thirdview_primary").prop("checked",((vvConfigObj.get_svShowPrimary())=="true"?true:false));$("#thirdview_secondary").prop("checked",((vvConfigObj.get_svShowSecondary())=="true"?true:false));$("#stageviewWindow").prop("checked",((vvConfigObj.get_svWindow())=="true"?true:false));$("#stageviewGreenWindow").prop("checked",((vvConfigObj.get_svGreenWindow())=="true"?true:false));$("#thirdview_outline").prop("checked",((vvConfigObj.get_svTextOutline())=="true"?true:false));$("#thirdview_shadow").prop("checked",((vvConfigObj.get_svTextShadow())=="true"?true:false));$("#stageSettingShowTime").prop("checked",((vvConfigObj.get_svShowDate())=="true"?true:false));$("#thirdview_opacity_range").range({min:0,max:10,start:(vvConfigObj.get_svOpacity()*10),onChange:function(b){$("#thirdview_opacity").val(b/10);svParameterSaveEvent()}});$("#thirdview_opacity").prop("disabled",true);$("#thirdview_height_range").range({min:0,max:100,start:vvConfigObj.get_svHeight(),onChange:function(b){$("#thirdview_height").val(b);svParameterSaveEvent()}});$("#thirdview_height").prop("disabled",true);$("#thirdview_position_range").range({min:0,max:100,start:vvConfigObj.get_svPosition(),onChange:function(b){$("#thirdview_position").val(b);svParameterSaveEvent()}});$("#thirdview_position").prop("disabled",true);$("#thirdview_maxFontSize_range").range({min:10,max:100,start:vvConfigObj.get_svMaxFontSize(),onChange:function(b){$("#thirdview_maxFontSize").val(b);svParameterSaveEvent()}});$("#thirdview_maxFontSize").prop("disabled",true);$("#thirdview_fcolor_range").range({min:0,max:80,start:vvConfigObj.get_svFcolor(),onChange:function(b){$("#thirdview_fcolor").val(b);svParameterSaveEvent();var c="#"+colorChart[$("#thirdview_fcolor").val()];$("#thirdview_fcolor").css({"background-color":c})}});$("#thirdview_fcolor").prop("disabled",true);$("#thirdview_bcolor_range").range({min:0,max:81,start:vvConfigObj.get_svBcolor(),onChange:function(b){$("#thirdview_bcolor").val(b);svParameterSaveEvent();var c="#"+colorChart[$("#thirdview_bcolor").val()];$("#thirdview_bcolor").css({"background-color":c})}});$("#thirdview_bcolor").prop("disabled",true)}}function updateBookNameVar(){var a;a=new XMLHttpRequest();a.onreadystatechange=function(){if(a.readyState<4){air.trace("BOOK NAME: Loading...")}if(a.readyState==4){var c=a.responseXML.documentElement;b(c)}};a.open("GET","./xml/booknames.xml",false);a.send(null);function b(e){air.trace("********Processing bookname");var d=e.getElementsByTagName("b").length;for(var c=0;c<d;c++){booknames[c]=e.getElementsByTagName("b")[c].textContent}}}function fillNav(){putbook();putch();document.getElementById("bookList").addEventListener("change",putch,false);document.getElementById("chapterList").addEventListener("change",putver,false);document.getElementById("verseList").addEventListener("change",verseChange,false);var b=new icon("searchButtonID"," SEARCH ","graphics/icon/search_32.png","graphics/icon/search_32.png","");document.getElementById("nav_bibleRef_presentID").addEventListener("click",processNavBibleRef,false);document.getElementById("nav_bibleRef_findID").addEventListener("click",processNavBibleRefFind,false);var c=new icon("nav_bibleRef_presentID"," QUICK PRESENT ","graphics/icon/qpresent_24.png","graphics/icon/qpresent_24.png","");var a=new icon("nav_bibleRef_findID"," FIND ","graphics/icon/search_s.png","graphics/icon/search_s.png","");document.getElementById("nav_bibleRefID").addEventListener("blur",bibleRefBlur,false);document.getElementById("nav_bibleRefID").addEventListener("focus",bibleRefFocus,false);$("#bibleAddScheduleButton").click(function(){nav_addVerse2Schedule()});$("#icon_present").click(function(){var d=getActiveTabLabel();if(d=="Songs"){songNavObj.sn_presentSong()}else{present()}});$("#icon_blank").click(function(){blankSlide()});$("#icon_theme").click(function(){if(newWindow!=null){newWindow.window.showThemeProcess()}});$("#icon_logo").click(function(){showLogoSlide()});$("#icon_close").click(function(){closePresentWindowMain()});$("#icon_prev").click(function(){call_prevSlide()});$("#icon_next").click(function(){call_nextSlide()});disableNavButtons(true);enterForSearchActive=true;recent.init()}function tabFrame(){tabView=new YAHOO.widget.TabView({orientation:"top"});tabView.addTab(new YAHOO.widget.Tab({label:" Bible ",content:'<div id="navTab">Bible</div>',active:true}));tabView.addTab(new YAHOO.widget.Tab({label:" Songs ",content:'<div id="songNavTab">Songs</div>'}));tabView.appendTo("container");tabView.addListener("activeTabChange",a);function a(){var b=tabView.get("activeTab");var c=b.get("label");if(c==" Bible "){tabViewN.selectTab(0)}if(c==" Songs "){tabViewN.selectTab(1)}}}function tabFrameVerse(){var b=new YAHOO.widget.TabView({orientation:"top"});b.addTab(new YAHOO.widget.Tab({label:" Verses ",content:'<div id="bibleverseTab" class="tabSubContainer" >Loading Bible Database ... </div>',active:true}));b.addTab(new YAHOO.widget.Tab({label:" Lyrics ",content:'<div id="lyricsTab" class="tabSubContainer" >Lyrics</div>'}));b.addTab(new YAHOO.widget.Tab({label:" Notes",content:'<div id="notesTab" class="notesTabSubContainer">Notes</div>'}));b.addTab(new YAHOO.widget.Tab({label:" Search",content:'<div id="searchTab"><div id="searchField" class="searchFieldContainer">Search Field</div></div>'}));b.addTab(new YAHOO.widget.Tab({label:" Schedule ",content:'<div id="scheduleTab">Schedule</div>'}));b.addTab(new YAHOO.widget.Tab({label:" Graphics ",content:'<div id="graphicsTab">Graphics</div>'}));b.addTab(new YAHOO.widget.Tab({label:" Screens ",content:'<div id="screenTab">Screens</div>'}));b.addTab(new YAHOO.widget.Tab({label:" Test ",content:'<div id="testTab"></div>'}));b.appendTo("container2");a();b.addListener("activeTabChange",a);function a(){var c=b.get("activeTab");var d=c.get("label");$("#verses_menu").hide();$("#lyrics_menu").hide();if(d==" Verses "){$("#verses_menu").show()}if(d==" Lyrics "){$("#lyrics_menu").show()}}if(!testTAB){b.removeTab(b.getTab(7))}tabViewN=b}var splashWindow;function splash(g){if(g){var a=air.Screen.mainScreen;var d=a.visibleBounds;var f=500;var e=195;var c=new air.Rectangle((d.left+d.right-f)/2,(d.top+d.bottom-e)/2,f,e);var b=new air.NativeWindowInitOptions();b.maximizable=false;b.minimizable=false;b.resizable=false;b.systemChrome="none";b.transparent="true";splashWindow=air.HTMLLoader.createRootWindow(true,b,false,c);splashWindow.window.nativeWindow.alwaysInFront=true;splashWindow.load(new air.URLRequest("splash.htm"))}else{if(splashWindow!=null){splashWindow.window.nativeWindow.close();splashWindow=null}}}function processExit(){if(presentWindowOpen){newWindow.window.nativeWindow.removeEventListener(air.Event.CLOSE,presentWindowClosed);newWindow.window.nativeWindow.close();if(stageView&&(newStageWindow!=null)){newStageWindow.window.nativeWindow.removeEventListener(air.Event.CLOSE,presentWindowClosed);newStageWindow.window.nativeWindow.close()}}}function firstTimeCheck(){var b=true;var a=fileExist("xml/version.xml",1);if(!a){b=setupVVersion()}var d=fileExist("xml/backgroundlist.xml",1);if(!d){b=setupVBkgnd()}var c=fileExist("xml/config.xml",1);if(!c){b=setupVConfig()}if(!a&&!d&&!c){firstTimeFlag=true}air.trace("First time check: "+b);return(b)}function setupVVersion(){createFolder("xml");createFolder("bible");createFolder("notes");createFolder("song");createFolder("network");var a=copyFile("xml/version.xml","xml/version.xml");if(!a){return(a)}var a=copyFile("bible","bible");if(!a){return(a)}var a=copyFile("network/webroot","network/webroot");if(!a){return(a)}var a=copyFile("song/default.db","song/default.db");if(!a){return(a)}var a=copyFile("song/words.db","song/words.db");if(!a){return(a)}var a=copyFile("chords/chords.db","song/chords.db");if(!a){return(a)}return(a)}function setupVBkgnd(){var a=copyFile("xml/backgroundlist.xml","xml/backgroundlist.xml");if(!a){return(a)}var a=copyFile("background","background");if(!a){return(a)}return(a)}function mainWindowKey(a){key=a.keyCode;var b=$(":focus").attr("id");switch(key){case 13:if(enterForSearchActive){searchObj.searchKeywordInit()}if(enterForBibleRef){processNavBibleRef()}if(songNavObj.isSongSearchEditActive()){songNavObj.sn_searchSong()}break;case 27:closePresentWindowMain();break;case 33:call_prevSlide();break;case 34:call_nextSlide();break;default:break;case 39:case 40:if(b==null){call_nextSlide()}break;case 37:case 38:if(b==null){call_prevSlide()}break;case 84:if(b==null){call_showTheme()}break;case 119:if(!apple){pluckapple()}}}function setupVConfig(){var a=copyFile("xml/config.xml","xml/config.xml");if(!a){return(a)}return(a)}function searchFocusChange(){searchKeyword()}function processFontSizeChange(){updateVerseContainer();searchObj.setFontSize(vvConfigObj.get_navFontSize());scheduleObj.changeFontsizeScheduleTab()}function setAIRversion(){var a=air.NativeApplication.nativeApplication.runtimeVersion;a=a.split(".");airVersion=a[0];if(airVersion<4){dataSizeOK=true}}function getActiveTabLabel(){var a=tabView.get("activeTab");var b=a.get("label");var c="";if(b==" Bible "){c="Bible"}if(b==" Songs "){c="Songs"}return(c)}function printStatus(a,b){}function roll_over(b,a){document.getElementById(b).src=a}function msg(){alert("clicked...")}function test(){function b(){alert("m1")}function a(){alert("m2")}};