if(window.addEventListener)window.addEventListener('load',initPage,false);
else if(window.attachEvent)window.attachEvent('onload',initPage);

var xmlhttp;

function initPage(){
   var menuDiv = document.getElementById("menu");
   var menuLinks = menuDiv.getElementsByTagName("a");
   for(var i=0;i<menuLinks.length;i++){
      menuLinks[i].setAttribute("href","#");
   }

   pageResized();
}


function clickLink(pageName){
   var id = pageName.getAttribute("id");
   getPage(id+".html");
}
function getPage(pName){
   document.getElementById('contentFrame').src = pName;

   document.getElementById('contentBox').style.display="block";
   document.getElementById('behindContentBox1').style.display="block";
   document.getElementById('behindContentBox2').style.display="block";
   document.getElementById('behindContentBox3').style.display="block";

}
/*
function getPage(pName){
   if (window.XMLHttpRequest)    xmlhttp=new XMLHttpRequest();
   else if (window.ActiveXObject)xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
   else return;
   if (xmlhttp!=null){
      xmlhttp.onreadystatechange=state_Change;
      xmlhttp.open("GET",pName,true);
      xmlhttp.send(null);
   }
}
*/
/*
function state_Change(){
   if (xmlhttp.readyState==4){// 4 = "loaded"
      if (xmlhttp.status==200){// 200 = "OK"
         try{
            document.getElementById('contentBox').innerHTML =
               xmlhttp.responseText ;
         }catch(e){
            var txt = xmlhttp.responseText;
            var el = document.createElement("div");
            el.innerHTML = txt;
            document.getElementById("contentBox").firstChild = el;

         }

         document.getElementById('contentBox').style.display="block";
         document.getElementById('behindContentBox1').style.display="block";
         document.getElementById('behindContentBox2').style.display="block";
         document.getElementById('behindContentBox3').style.display="block";
      }
   }
}
*/





function pageResized(){
   var ua = window.navigator.userAgent;
   var msie = ua.indexOf ( "MSIE " );
   if (msie>0) {
      var msVer = parseInt(ua.substring (msie+5, ua.indexOf (".", msie )) );
      if (msVer<7) {
         var winW = document.body.offsetWidth+"px";
         var winH = document.body.offsetHeight+"px";
         document.getElementById('bgImg').style.width = winW;
         document.getElementById('bgImg').style.height = winH;
      }
   }
   
}
