var xmlhttp;

function loadXMLDoc(url)
{
xmlhttp=null;
if (window.XMLHttpRequest)
  {// code for IE7, Firefox, Mozilla, etc.
  xmlhttp=new XMLHttpRequest();
  }
else if (window.ActiveXObject)
  {// code for IE5, IE6
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
if (xmlhttp!=null)
  {
  xmlhttp.onreadystatechange=onResponse;
  xmlhttp.open("GET",url+"?"+Math.random(),true);
  xmlhttp.send(null);
  }
else
  {
  alert("Your browser does not support XMLHTTP.");
  }
}

function onResponse()
{
if(xmlhttp.readyState!=4) return;
if(xmlhttp.status!=200)
  {
  alert("Problem retrieving XML data");
  return;
  }

txt="";
txtB="";
txtC="";
// get section id
function gup( name )
{
  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var results = regex.exec( window.location.href );
  if( results == null )
    return "1";
  else
    return results[1];
}
var section_param = gup( 'section' );
//document.write(section_param);

if(section_param == 1){
section = '1';
hide('on1');
hide('off2');
hide('off3');
hide('off4');
show('off1');
show('on2');
show('on3');
show('on4');
}
if(section_param == 2){
section = '2';
hide('on2');
hide('off1');
hide('off3');
hide('off4');
show('off2');
show('on1');
show('on3');
show('on4');
}
if(section_param == 3){
section = '3';
hide('on3');
hide('off2');
hide('off1');
hide('off4');
show('off3');
show('on2');
show('on1');
show('on4');
}
if(section_param == 4){
section = '4';
hide('on4');
hide('off2');
hide('off1');
hide('off3');
show('off4');
show('on2');
show('on1');
show('on3');
}
//

x=xmlhttp.responseXML.documentElement.getElementsByTagName("slide");
for (i=0;i<1;i++)
  {
  if (section == 1){
  xx=x[0].getElementsByTagName("main");
  }else if(section == 2){
  xx=x[1].getElementsByTagName("main");
  }else if(section == 3){
  xx=x[2].getElementsByTagName("main");
  }else if(section == 4){
  xx=x[3].getElementsByTagName("main");
  }
    {
    try
      {
      txtB=txtB + xx[0].firstChild.nodeValue;
      }
    catch (er)
      {
     
      }
    }
   if (section == 1){
   xx=x[0].getElementsByTagName("sub");
   }else if(section == 2){
   xx=x[1].getElementsByTagName("sub");
   }else if(section == 3){
   xx=x[2].getElementsByTagName("sub");
   }else if(section == 4){
   xx=x[3].getElementsByTagName("sub");
   }
    {
    try
      {
      txtC=txtC + xx[0].firstChild.nodeValue;
      }
    catch (er)
      {
     
      }
    }
  
  }
document.getElementById('mainArea').innerHTML=txtB;

document.getElementById('addContent').innerHTML=txtC;

}

function onChange(num)
{
if(xmlhttp.readyState!=4) return;
if(xmlhttp.status!=200)
  {
  alert("Problem retrieving XML data");
  return;
  }

txt="";
txtB="";
txtC="";
x=xmlhttp.responseXML.documentElement.getElementsByTagName("slide");
for (i=0;i<1;i++)
  {
  xx=x[num].getElementsByTagName("main");
    {
    try
      {
      txtB=txtB + xx[0].firstChild.nodeValue;
      }
    catch (er)
      {
     
      }
    }
   xx=x[num].getElementsByTagName("sub");
    {
    try
      {
      txtC=txtC + xx[0].firstChild.nodeValue;
      }
    catch (er)
      {
     
      }
    }
  
  }

document.getElementById('mainArea').innerHTML=txtB;

document.getElementById('addContent').innerHTML=txtC;
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
  function MM_swapImage() { //v3.0
    var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
     if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
  }
function show(menuName) {
var el = document.getElementById(menuName);
el.style.display = 'block';
}
function hide(menuName) {
var el = document.getElementById(menuName);
el.style.display = 'none';
}

function section1(){
onChange(0);
hide('on1');
hide('off2');
hide('off3');
hide('off4');
show('off1');
show('on2');
show('on3');
show('on4');
}
function section2(){
onChange(1);
hide('on2');
hide('off1');
hide('off3');
hide('off4');
show('off2');
show('on1');
show('on3');
show('on4');
}
function section3(){
onChange(2);
hide('on3');
hide('off2');
hide('off1');
hide('off4');
show('off3');
show('on2');
show('on1');
show('on4');
}
function section4(){
onChange(3);
hide('on4');
hide('off2');
hide('off1');
hide('off3');
show('off4');
show('on2');
show('on1');
show('on3');
}