/* <documentation about="ABOUT js/brandweer.js" type="GENERAL">
	<summary>This file is specific javascript file for brandweer.nl site.

		Structure of this file:
		1.
		2.
		3.
		4.
	</summary>
	<namespace>TUE</namespace>
</documentation> */
BW = {};

/* <documentation about="BW.init" type="init function">
	<summary>This function containes all calls made to functions used within brandweer website.
		It is initialized on page load (Lib.addEvent(window, "load", BW.init);).
	</summary>
	<namespace>BW</namespace>
</documentation> */
BW.init = function() {
	try {
        Lib.textSize();
        Lib.inputAutoClear();
        Lib.setPageIsStyled();
        Lib.styleDropdowns();
		    initNavigation();
        externalLinks();
        //CheckStylesheets();
        Lib.printPage();
    }
	catch (ex){ Lib.errHandler(ex); }

}

/* <documentation about="Lib.addEvent" type="FUNCTION CALL">
	<summary>Calling Lib.addEvent: Add TUE.mainNav as eventhandler on window onresize event</summary>
</documentation>*/
Lib.addEvent(window, "load", BW.init);
Lib.eventCache.add(window, "load", BW.init, false);

/* load stylesheet when javascript is enabled */
var compatible = (document.getElementsByTagName && document.createElement);
// document.write('<link rel="stylesheet" href="'+view_folder+'css/js-enabled.css" />'); }

if (compatible) {
  var head = document.getElementsByTagName("head")[0];
  var stylesheet = document.createElement("link");
  stylesheet.setAttribute("type","text/css");
  stylesheet.setAttribute("rel","stylesheet");
  stylesheet.setAttribute("media","screen");
  stylesheet.setAttribute("href",view_folder+"css/js-enabled.css");
  head.appendChild(stylesheet);
}

function CheckStylesheets(){
   for (var sC = 0; sC<document.styleSheets.length; sC++) {
      if (document.styleSheets[sC].href && document.styleSheets[sC].href != "") {
        // serverside_generated_sheet
        // scheme_sheet
        // colors_sheet
        if (!document.styleSheets[sC].rules || document.styleSheets[sC].rules.length == 0) {
          var unique = new Date();
          document.styleSheets[sC].href = document.styleSheets[sC].href + "&retry="+unique.getTime();         
        }       
      }
    }
  }



