function ajax_request(){var request=null;if(window.XMLHttpRequest){request=new XMLHttpRequest();}else{if(window.ActiveXObject){request=new ActiveXObject("Microsoft.XMLHTTP");}}return request;}function ajax_status(){if(req.readyState==4){if(req.status==200){return true;}}return false;}var LOADING="<div id='loading_div'><span id='loading'>loading &hellip;</span></div>";var req=null;var currently_loaded="";function load_content_and_jump_to(file,anchor){if(currently_loaded==file){return ;}document.getElementById("content").innerHTML=LOADING;req=ajax_request();if(req!=undefined){req.onreadystatechange=function(){load_content_and_jump_to_done(file,anchor);};req.open("GET",file,true);req.send("");currently_loaded=file;}}function load_content_and_jump_to_done(file,anchor){try{if(ajax_status()){curr_x_pos=get_scroll_x_pos();document.getElementById("content").innerHTML=req.responseText;if(anchor==""){return ;}smooth_scroll_to(curr_x_pos,get_x_pos(anchor)-70,anchor);}else{document.getElementById("content").innerHTML="error:\n"+req.status+"\n"+req.statusText;}}catch(e){}}function get_x_pos(id){obj=document.getElementById(id);var curleft=0;if(obj.offsetParent){do{curleft+=obj.offsetLeft;}while(obj=obj.offsetParent);return curleft;}}function get_scroll_x_pos(){body=document.body;d=document.documentElement;if(body&&body.scrollLeft){return body.scrollLeft;}if(d&&d.scrollLeft){return d.scrollLeft;}if(window.pageXOffset){return window.pageXOffset;}return 0;}var STEP=250;function smooth_scroll_to(curr_x_pos,dest_x_pos,anchor){if(curr_x_pos<dest_x_pos){if((curr_x_pos+STEP)>=dest_x_pos){window.location.hash=anchor;window.scrollTo(dest_x_pos,0);return ;}curr_x_pos+=STEP;window.scrollTo(curr_x_pos,0);window.setTimeout(function(){smooth_scroll_to(curr_x_pos,dest_x_pos,anchor);},25);}}function load_content(file,container){container.innerHTML=LOADING;req=ajax_request();if(req!=undefined){req.onreadystatechange=function(){try{if(ajax_status()){container.innerHTML=req.responseText;}else{container.innerHTML="error:\n"+req.status+"\n"+req.statusText;}}catch(e){}};req.open("GET",file,true);req.send("");}}