var helptimer;
function getSiteRelativePath()
{
    sSiteRelativePath="/NetWriterGui";
    
    if(location.href.toLowerCase().indexOf("rijksbreed")!=-1)
    {
     sSiteRelativePath="/Rijksbreed";
    }
    if(location.href.toLowerCase().indexOf("netwritersite")!=-1)
    {
     sSiteRelativePath="/NetWriterSite";
    }
     if(location.href.toLowerCase().indexOf("regionaalkompas")!=-1)
    {
     sSiteRelativePath="/RegionaalKompas";
    }
   return sSiteRelativePath;
}
function IncludeJavaScript(jsFile)
{
  document.write('<script type="text/javascript" src="' + getSiteRelativePath() + '/javascript/'+ jsFile + '"></script>'); 
}
function IncludeJavaScriptEditor(jsFile)
{
  document.write('<script type="text/javascript" src="/NetWriterGui/content/xml/'+ jsFile + '"></script>'); 
}
//function IncludeJavaScriptJQuery(jsFile)
//{
//   document.write('<script type="text/javascript" src="' + getSiteRelativePath() + '/javascript/jquery.ui-1.72/'+ jsFile + '"></script>'); 
//}
document.write('<script type="text/javascript" src="' + getSiteRelativePath() + '/content/xml/util_xml.js"></script>'); 
IncludeJavaScript("jquery-ui-1.8.4.custom/js/jquery-1.4.2.min.js");
IncludeJavaScript("jquery-ui-1.8.4.custom/js/jquery-ui-1.8.4.custom.min.js");
//IncludeJavaScriptJQuery('jquery-latest.pack.js');
//IncludeJavaScriptJQuery('jquery.dimensions.js');
//IncludeJavaScriptJQuery('ui.core.js');
//IncludeJavaScriptJQuery('ui.mouse.js');
//IncludeJavaScriptJQuery('ui.resizable.js');
//IncludeJavaScriptJQuery('ui.accordion.js');
//IncludeJavaScriptJQuery('ui.draggable.js');
//IncludeJavaScriptJQuery('ui.tabs.js');
//IncludeJavaScriptJQuery('ui.draggable.ext.js');
IncludeJavaScript('jquery.ui-1.0/jquery.contextMenu.js');
IncludeJavaScript('jquery.ui-1.0/easytooltip.js');
IncludeJavaScript('jquery.ui-1.0/fg.menu.js');

IncludeJavaScript('jquery.ui-1.0/officebar/js/jquery.officebar.js');
IncludeJavaScript('sitestat.js');
IncludeJavaScript('jquery.ui-1.0/link.iframe.nw.js');
IncludeJavaScript('dhtml.js');
IncludeJavaScript('menu.js');
IncludeJavaScript('popup.js');
IncludeJavaScript('nw_link_target.js');
IncludeJavaScript('event.js');
IncludeJavaScript('getMenuDeclarations.aspx');
IncludeJavaScript('netwriter.js');

languageId=1;
//PopupWidth="250px'" ;
AtlasMapPopup=650;
PopupHeight=150;
popupposition=-1;
function getResource(strID){return getResourceNW(strID);}
imgName="";
function showHelp(txt, img)
{
showHelpCmsApp(txt, img);
}

/* Uitklap headers zoaks Bronnen en literatuur */
rememberHeight=0;
$(document).ready(function(){
    /* Geen gebruik maken van de .hide() methode als je ook nog wilt kunnen afdrukken */
    /* Initieel verbergen van Referentie lijsten */
//    $(".nw_foldable_header").siblings().addClass('hideRefList');

    /* Click event hide/show */
//    $(".nw_foldable_header").click(function(){ 
//        $(this).toggleClass("nw_foldable_header_on");
//        $(this).siblings().toggleClass('hideRefList');
//    });
    
        /* aandoeningen tree */
        /* $(".box ul, .box h3").hide();*/
        $(".nw_foldable_header").siblings().addClass('hideRefList');
        
        $(".box h2").each(function(i, obj) {
            var text = $(obj).text();
           /* var button = $("<button id='button" + i + "' class='nw_foldable_headerXXXXXX'><img src='ZuidLimburg_bestanden/transparant.gif' alt='toon " + text + "'/></button>").toggle(function(e) { */
            var button = $("<button id='button" + i + "' class='nw_foldable_header' title='toon " + text + "' > </button>").toggle(function(e) {
                    $(this)
                       // .addClass("nw_foldable_header_on")
//                        .text("verberg " + text)
                        .attr("title","verberg " + text)
                        .parent().toggleClass("nw_foldable_header_on")
                        .nextAll("*")
                        .toggleClass('hideRefList');
                }, function(e) {
                    $(this)
                        //.removeClass("nw_foldable_header_on")
                        .attr("title","toon " + text)
                        .parent().toggleClass("nw_foldable_header_on")
                        .nextAll("*")
                        .toggleClass('hideRefList');
                });
            $(obj).wrapInner("<label for='button" + i + "'></label>").prepend(button);

        }); 
});
