window.onload= init;
function init(){
NSHInit();
SlideShowInit();
}
/////////// Pop-up window for embedded topics (non MS browsers) //////
var win = null;
function NewWindow(mypage,myname,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings ='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable,status=no,location=no',
win = window.open(mypage,myname,settings)
}
/////////// Embedded topics (IE>4) ///////////////////////////////////
function Example(embedded){
 if    (/MSIE 6/.test(navigator.userAgent)) var client  = 'good'
 else {var client  = 'bad'}
 if(!embedded){return client}
 if(client  == 'bad'){
  document.write('<br><br><b><a href="' + embedded + '" onclick="NewWindow(this.href,\'name\',\'610\',\'476\',\'yes\');return false">Click here for example</a></b>')
 }
 else{
  document.write('<br><br><iframe frameborder="0" id="ifr" class="example" scrolling="no" src="' + embedded + '"  width="100%" onload="this.height=document.frames[this.id].document.body.scrollHeight;"></iframe>')
 }
}
/////////// Slide show ///////////////////////////////////////////////
var page=1;
//////////////////////////////////////////////////////////////////////
function n(){
 if (page < document.getElementById('SSPageCount').innerHTML){
  page +=1
  PaintAll(page)
 }
}
//////////////////////////////////////////////////////////////////////
function p(){
 if (page>1){
  page=page-1
  PaintAll(page)
 }
}
//////////////////////////////////////////////////////////////////////
function f(){ if (page!=1){page=1; PaintAll(page)}}
//////////////////////////////////////////////////////////////////////
function l(){ if (page!=document.getElementById('SSPageCount').innerHTML){
  page=document.getElementById('SSPageCount').innerHTML
  PaintAll(page)
 }
}
//////////////////////////////////////////////////////////////////////
function PaintAll(N){
//alert('PaintAll!!!!')
 if(document.getElementById('PictureHeader'))document.getElementById('PictureHeader').innerHTML=document.getElementById('PictureHeader'+N).innerHTML
	if(document.getElementById('Picture'))document.getElementById('Picture').src=document.getElementById('Picture'+N).src
	if(document.getElementById('PictureComment'))document.getElementById('PictureComment').innerHTML=document.getElementById('PictureComment'+N).innerHTML
	if(document.getElementById('StepNumber'))document.getElementById('StepNumber').innerHTML=N
	if(document.getElementById('StepsTotal'))document.getElementById('StepsTotal').innerHTML=document.getElementById('SSPageCount').innerHTML
	if(document.getElementById('SlidesWord'))document.getElementById('SlidesWord').innerHTML=document.getElementById('SSWordValue').innerHTML
	if(document.getElementById('SlidesWordOf'))document.getElementById('SlidesWordOf').innerHTML=document.getElementById('SSWordOfValue').innerHTML
}
//////////////////////////////////////////////////////////////////////
function SlideShowInit(){
 if(document.getElementById('SSContainer')){document.getElementById('SSContainer').innerHTML=''+
  '<table cellspacing=5 cellpadding=0>'+
  ' <tr>'+
  '  <td id=NavButtonsPanel>'+
  '   <table cellspacing=0 cellpadding=0>'+
  '    <tr>'+
  '     <td width=100% id=SlidesCountParent><span id=SlidesCount><span id=SlidesWord></span>&nbsp;<span id=StepNumber></span>&nbsp;<span id=SlidesWordOf></span>&nbsp;<span id=StepsTotal></span></span></td>'+
  '     <td>'+
  '      <table id=NavButtonsTable cellpadding=0 cellspacing=4>'+
  '       <tr>'+
  '        <td id=NavButtonParentF><img src=images/f.png class=NavButton onmouseover=this.src=\'images/f_mo.png\' onmouseout=this.src=\'images/f.png\' onmousedown=this.src=\'images/f_p.png\' onmouseup=this.src=\'images/f_mo.png\' ondragstart=this.src=\'images/f_mo.png\' onclick=f()></td>'+
  '        <td id=NavButtonParentP><img src=images/p.png class=NavButton onmouseover=this.src=\'images/p_mo.png\' onmouseout=this.src=\'images/p.png\' onmousedown=this.src=\'images/p_p.png\' onmouseup=this.src=\'images/p_mo.png\' ondragstart=this.src=\'images/p_mo.png\' onclick=p()></td>'+
  '        <td id=NavButtonParentN><img src=images/n.png class=NavButton onmouseover=this.src=\'images/n_mo.png\' onmouseout=this.src=\'images/n.png\' onmousedown=this.src=\'images/n_p.png\' onmouseup=this.src=\'images/n_mo.png\' ondragstart=this.src=\'images/n_mo.png\' onclick=n()></td>'+
  '        <td id=NavButtonParentL><img src=images/l.png class=NavButton onmouseover=this.src=\'images/l_mo.png\' onmouseout=this.src=\'images/l.png\' onmousedown=this.src=\'images/l_p.png\' onmouseup=this.src=\'images/l_mo.png\' ondragstart=this.src=\'images/l_mo.png\' onclick=l()></td>'+
  '       </tr>'+
  '      </table>'+
  '     </td>'+
  '    </tr>'+
  '   </table>'+
  '  </td>'+
  '  <td rowspan=3 width=100%>&nbsp;</td>'+
  ' </tr>'+
  ''+
  ' <tr><td id=PictureParent><img id=Picture src=></td></tr>'+
  ''+
  ' <tr>'+
  '  <td>'+
  '   <table width=100% cellpadding=0 cellspacing=0>'+
  '    <tr><td id=PictureCommentParent><div id=PictureComment></div></td></tr>'+
  '   </table>'+
  '  </td>'+
  ' </tr>'+
  '</table>'
  PaintAll(1)
 }
}
function NSHInit(){
TopicHeader = document.title;
 if(document.getElementById('n')){document.getElementById('n').innerHTML=''+
'<table width=100% border=0 cellspacing=1 cellpadding=0 bgcolor=#214D7A>' +
' <tr>' +
'  <td class=h>' +
'   <table width=100% border=0 cellspacing=0 cellpadding=0>' +
'    <tr>' +
'     <td class=h nowrap style=padding:0 valign=top><span class=h>' + TopicHeader + '</span></td>' +
'    </tr>' +
'   </table>' +
'  </td>' +
' </tr>' +
'</table>'
 }
}

