Версия 23:05, 2 сентября 2011 | | Версия 23:10, 2 сентября 2011 |
Строка 41: | | Строка 41: |
| | | | |
| var tacticCounter = 1; | | | var tacticCounter = 1; |
? | var tacticPages = 4; | | + | var mapImages = new Array(); |
? | var mapPrefix = 'karel54_'; | | + | |
| | | | |
| function tacticNext() { | | | function tacticNext() { |
? | document.getElementById('step' + tacticCounter).style.display = 'none'; | | |
? | document.getElementById(mapPrefix + tacticCounter).style.display = 'none'; | | |
? | | | |
? | if (tacticCounter < tacticPages) { | | |
? | tacticCounter++ ; | | |
? | if (tacticCounter == tacticPages) document.getElementById('nextsteplink').innerHTML = 'В начало'; | | |
? | } else { | | |
? | tacticCounter = 1; | | |
? | document.getElementById('nextsteplink').innerHTML = 'Продолжить »'; | | |
? | } | | |
? | | | |
? | document.getElementById('step' + tacticCounter).style.display = 'block'; | | |
? | document.getElementById(mapPrefix + tacticCounter).style.display = 'block'; | | |
? | return false; | | |
? | } | | |
? | | | |
? | function tacticSlideShow() { | | |
? | try { | | |
? | var nextDiv = document.getElementById('nextstep'); | | |
? | if (nextDiv == null) { | | |
? | return; | | |
? | } | | |
? | var aNode = document.createElement( 'a' ); | | |
? | aNode.setAttribute( 'id', 'nextsteplink' ); | | |
? | aNode.setAttribute( 'href', '#' ); | | |
? | aNode.setAttribute( 'onClick', 'return tacticNext();' ); | | |
? | aNode.appendChild(document.createTextNode('Продолжить »')); | | |
? | nextDiv.appendChild( aNode ); | | |
? | } catch(e) { | | |
? | return; | | |
? | } | | |
? | } | | |
? | | | |
? | addOnloadHook(tacticSlideShow); | | |
? | | | |
? | var mapImages = new Array(); | | |
? | | | |
? | function tacticNext2() { | | |
| document.getElementById('step' + tacticCounter).style.display = 'none'; | | | document.getElementById('step' + tacticCounter).style.display = 'none'; |
| | | | |
Строка 98: | | Строка 59: |
| } | | | } |
| | | | |
? | function tacticSlideShow2() { | | + | function tacticSlideShow() { |
| try { | | | try { |
| var mapDiv = document.getElementById('tacticmap'); | | | var mapDiv = document.getElementById('tacticmap'); |
Строка 115: | | Строка 76: |
| aNode.setAttribute( 'id', 'nextsteplink' ); | | | aNode.setAttribute( 'id', 'nextsteplink' ); |
| aNode.setAttribute( 'href', '#' ); | | | aNode.setAttribute( 'href', '#' ); |
? | aNode.setAttribute( 'onClick', 'return tacticNext2();' ); | | + | aNode.setAttribute( 'onClick', 'return tacticNext();' ); |
| aNode.appendChild(document.createTextNode('Продолжить »')); | | | aNode.appendChild(document.createTextNode('Продолжить »')); |
? | document.getElementById('nextstep2').appendChild(aNode); | | + | document.getElementById('nextstep').appendChild(aNode); |
| } catch(e) { | | | } catch(e) { |
| return; | | | return; |
Строка 123: | | Строка 84: |
| } | | | } |
| | | | |
? | addOnloadHook(tacticSlideShow2); | | + | addOnloadHook(tacticSlideShow); |