
/************************************************** FUNCTION: RESIZE SPECIFIC TEXT ***************************************/

function resize_text(obj_name, fontsize){
   document.getElementById(obj_name).style.fontSize = fontsize+'px';
}

/************************************************** FUNCTION: RESIZE SPECIFIC TEXT ***************************************/


/************************************************** FUNCTION: DATE, CHANGE SELECTBOX DAY *********************************/

function date_change_selectbox_day(day_id, month_id, year_id, today_day, today_month, today_year){
   // Get the date from today (today minus 1)
      today = new getToday(today_day, today_month, today_year);

   // Get the selected month
      var month_value = document.getElementById(month_id).value;

   // Get the selected year
      var year_value = document.getElementById(year_id).value;

   // Initialize the days in the selected month
      var intDaysInMonth      = date_change_selectbox_day_getDays((month_value - 1), year_value);

   // Initialize the day variables
      var day_selectedIndex   = document.getElementById(day_id).selectedIndex;
      var day_value           = document.getElementById(day_id)[day_selectedIndex].text;
      var day_selectboxLength = document.getElementById(day_id).options.length;

   // Remove the days from the selectbox
      var remove_days = day_selectboxLength - intDaysInMonth;

      for(i = (day_selectboxLength - 1); i >= 0; i--){
          document.getElementById(day_id).remove(i);
      }

   // Calculate the start and end day of the selected month
      if((today.month + 1) == month_value && today.year == year_value){
         var start_day = today.day;
         var end_day   = (intDaysInMonth - start_day) + 1;

         // Set the variable that is used to set back the selected day
            var change_day = start_day;
      } else {
         var start_day = 1;
         var end_day = intDaysInMonth;

         // Set the variable that is used to set back the selected day
            var change_day = today.day;
      }

   // Add the correct amount of days for the selected month
      for(i = 0; i < end_day; i++){
          var optn = document.createElement("OPTION");

          optn.text = start_day;
          optn.value = start_day;

          document.getElementById(day_id).options.add(optn);

          start_day ++;
      }

   // Check if the selected day is available in the selected month
      if(day_value > intDaysInMonth || (day_value < change_day && (today.month + 1) == month_value && today.year == year_value)){
         // Select the first day of the month
            document.getElementById(day_id).selectedIndex = 0;
      } else {
         // Set back the selected day
            var found_selectedIndex = "n";

         for(i=0; found_selectedIndex == "n"; i++){
             var selectbox_value = document.getElementById(day_id)[i].text;

             if(selectbox_value == day_value){
                document.getElementById(day_id).selectedIndex = i;

                found_selectedIndex = "y";
             }
         }
      }
}

function date_change_selectbox_day_getDays(month, year){
   var daysInMonth = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);

   if(month == 1){
      // Handle the month februari
         return ((0 == year % 4) && (0 != (year % 100))) || (0 == year % 400) ? 29 : 28;
   } else {
      return daysInMonth[month];
   }
}

function getToday(today_day, today_month, today_year){
   // Generate today's date
      this.day   = today_day;
      this.month = today_month;
      this.year  = today_year;
}

/************************************************** FUNCTION: DATE, CHANGE SELECTBOX DAY *********************************/


/************************************************** FUNCTION: BROWSE THROUGH THE PAGES (Browse) **************************/

function browse_pages_submit(page_number){
   obj = document.getElementById('item_page_number');
   if(obj){  obj.value = page_number; }
   document.item_browse_form.submit();
}

/************************************************** FUNCTION: BROWSE THROUGH THE PAGES (Browse) **************************/


/************************************************** FUNCTION: BROWSE THROUGH THE PAGES (Browse) **************************/

function result_pages_submit(){
   obj = document.getElementById('item_result_number');
   obj_result = document.getElementById('item_result_amount');
   if(obj && obj_result){ obj.value = obj_result.value; }
   document.item_result_form.submit()
}

/************************************************** FUNCTION: BROWSE THROUGH THE PAGES (Browse) **************************/


/************************************************** FUNCTION: INITIALIZE THE COMPANY ADRESSES ****************************/

function bedrijven_company_browse_result(block_name, page_number, page_total){
   if(page_total != 1){
      var content_teller = 1;

      while(content_teller <= page_total){
            if(document.getElementById(block_name+'_result_'+content_teller).style.display == "block"){
               obj_get_height = document.getElementById(block_name+'_result_'+content_teller).offsetHeight;
            }

            content_teller ++;
      }

      obj_set_height = document.getElementById(block_name+'_result_'+page_number);

      var content_teller = 1;

      while(content_teller <= page_total){
            document.getElementById(block_name+'_result_'+content_teller).style.display = "none";
            document.getElementById(block_name+'_'+content_teller).style.textDecoration = "none";

            content_teller ++;
      }

      document.getElementById(block_name+'_result_'+page_number).style.display = "block";
      document.getElementById(block_name+'_'+page_number).style.textDecoration = "underline";

      obj_block_height = document.getElementById(block_name+'_result_'+page_number);
      if(obj_block_height.offsetHeight >= obj_get_height){
         obj_get_height = obj_block_height.offsetHeight;
      }

      obj_set_height.style.height = obj_get_height+'px';
   }
}

/************************************************** FUNCTION: INITIALIZE THE COMPANY ADRESSES ****************************/


/************************************************** FUNCTION: INITIALIZE THE COMPANY QUICKLINKS **************************/

function bedrijven_company_browse_quicklinks(page_number, page_total){
   var content_teller = 1;

   while(content_teller <= page_total){
         if(content_teller == page_number){
            if(document.getElementById('bedrijven_quicklinks_page_'+content_teller)){
               document.getElementById('bedrijven_quicklinks_page_'+content_teller).style.display = "block";
            }
            if(document.getElementById('bedrijven_quicklinks_page_result_'+content_teller)){
               document.getElementById('bedrijven_quicklinks_page_result_'+content_teller).style.textDecoration = "underline";
            }
         } else {
            if(document.getElementById('bedrijven_quicklinks_page_'+content_teller)){
               document.getElementById('bedrijven_quicklinks_page_'+content_teller).style.display = "none";
            }
            if(document.getElementById('bedrijven_quicklinks_page_result_'+content_teller)){
               document.getElementById('bedrijven_quicklinks_page_result_'+content_teller).style.textDecoration = "none";
            }
         }

         content_teller ++;
   }
}

/************************************************** FUNCTION: INITIALIZE THE COMPANY QUICKLINKS **************************/


/************************************************** FUNCTION: INITIALIZE THE ARCHIVE ITEMS *******************************/

function browse_archive(page_number, page_total){
   var content_teller = 1;

   while(content_teller <= page_total){
         if(content_teller == page_number){
           document.getElementById('browse_archive_page_'+content_teller).style.display = "block";
           document.getElementById('browse_archive_page_result_'+content_teller).style.textDecoration = "underline";
         } else {
           document.getElementById('browse_archive_page_'+content_teller).style.display = "none";
           document.getElementById('browse_archive_page_result_'+content_teller).style.textDecoration = "none";
         }

         content_teller ++;
   }
}

/************************************************** FUNCTION: INITIALIZE THE ARCHIVE ITEMS *******************************/


/************************************************** FUNCTION: GO BACK TO PREVIOUS PAGE (countdown) ***********************/

function page_back_countdown(seconds_preset, seconds, milliseconds_preset, milliseconds, location){
   if(seconds <= 0){
      if(!(location == "")){
         window.location= location;
      }
   } else {
      milliseconds --;

      if(milliseconds == 0){
         seconds --;

         document.getElementById('page_back_countdown').innerHTML= seconds;

         milliseconds = milliseconds_preset
      }

      setTimeout("page_back_countdown(\'"+seconds_preset+"\', \'"+seconds+"\', \'"+milliseconds_preset+"\', \'"+milliseconds+"\', \'"+location+"\')",100)
   }
}

/************************************************** FUNCTION: GO BACK TO PREVIOUS PAGE (countdown) ***********************/


/************************************************** FUNCTION: SWITCH PICTURES (mouseover) ********************************/

function switch_pictures(p_location, p_name, p_number){
   document.getElementById("switch_pictures_large").src = p_location+p_name+p_number+"groot.jpg";
}

function switch_pictures_fullname(obj_id, p_location, p_file){
   document.getElementById(obj_id).src = p_location+p_file;
}

/************************************************** FUNCTION: SWITCH PICTURES (mouseover) ********************************/


/************************************************** FUNCTION: SWITCH PICTURES AND DESCRIPTION (mouseover) ****************/

function switch_pictures_and_description(p_location, p_name, p_description, p_number){
   document.getElementById("switch_pictures_description").innerHTML = p_description;
   document.getElementById("switch_pictures_large").src = p_location+p_name;
}

/************************************************** FUNCTION: SWITCH PICTURES AND DESCRIPTION (mouseover) ****************/


/************************************************** FUNCTION: SWITCH SWF (mouseover) *************************************/

function switch_swf(s_location, s_name, s_number){
   var version = swfobject.getFlashPlayerVersion();
   var obj = document.getElementById('flashcontrole');
   var flashplayer = document.getElementById('flashmovie');

   if(document.getElementById && version.major > 0){
      var flashvars = {};
      var params = {};
      params.play = "true";
      params.loop = "false";
      params.wmode = "transparent";
      var attributes = {};

      swfobject.embedSWF(s_location+s_name+s_number+".swf", "flashmovie", "480", "360", "9", "", flashvars, params, attributes);
   } else {
      if(obj){ obj.style.display = "block"; }
      if(flashplayer){ flashplayer.style.display = "none"; }
      if(obj){ obj.innerHTML = "You do not have the Flash plugin installed, <a href=\"http://www.macromedia.com/go/getflashplayer\" target=\"_blank\">download</a> the flashplayer"; }
   }
}

/************************************************** FUNCTION: SWITCH SWF (mouseover) *************************************/


/************************************************** FUNCTION: JAVASCRIPT & SWF CHECK (availability) **********************/

function check_javascript_swf(path_download_flash){
   var version = swfobject.getFlashPlayerVersion();
   var obj = document.getElementById('flashcontrole');
   var flashplayer = document.getElementById('flashmovie');

   if(document.getElementById && version.major > 0){
      // document.getElementById('flashcontrole').innerHTML = "You have Flash player "+ version.major +"."+ version.minor +"."+ version.release +" installed.";
      if(obj){ obj.style.display = "none"; }
      if(flashplayer){ flashplayer.style.display = "block"; }
   } else {
      if(path_download_flash == ""){ path_download_flash = "http://www.macromedia.com/"; }
      if(obj){ obj.innerHTML = "You do not have the Flash plugin installed, <a href=\""+path_download_flash+"\" target=\"_blank\">download</a> the flashplayer"; }
   }
}

/************************************************** FUNCTION: JAVASCRIPT & SWF CHECK (availability) **********************/


/************************************************** HEADER: JAVASCRIPT & SWF CHECK (availability) ************************/

function header_check_javascript_swf(path_download_flash){
   var version = swfobject.getFlashPlayerVersion();
   var obj = document.getElementById('header_flashcontrole');
   var obj_message = document.getElementById('header_flashcontrole_message');
   var flashplayer = document.getElementById('header_flashmovie');

   if(document.getElementById && version.major > 0){
      // document.getElementById('flashcontrole').innerHTML = "You have Flash player "+ version.major +"."+ version.minor +"."+ version.release +" installed.";
      if(obj){ obj.style.display = "none"; }
      if(flashplayer){ flashplayer.style.display = "block"; }
   } else {
      if(path_download_flash == ""){ path_download_flash = "http://www.macromedia.com/"; }
      if(obj){ obj_message.innerHTML = "You do not have the Flash plugin installed, <a href=\""+path_download_flash+"\" target=\"_blank\">download</a> the flashplayer"; }
   }
}

/************************************************** HEADER: JAVASCRIPT & SWF CHECK (availability) ************************/


/************************************************** FUNCTION: RESIZE SPECIFIC TEXT ***************************************/

function set_boxrechts_adslider_image(obj_id, obj_nr){
   var shift = new Array(2);
   var x;
   var y;
   x = 0;
   y = 0;

   var elem = document.getElementById(obj_id+obj_nr);

   do{
       x += elem.offsetLeft;
       y += elem.offsetTop;

       if(elem.id == obj_id+obj_nr){ break; }

 	     elem = elem.offsetParent;
   } while(1 > 0);

   document.getElementById(obj_id).style.left = (x-357)+'px';

   document.getElementById(obj_id).style.top = y+'px';

   document.getElementById(obj_id).style.display = 'block';
}

function remove_boxrechts_adslider_image(obj_id){
   document.getElementById(obj_id).style.display = 'none';
}

/************************************************** FUNCTION: RESIZE SPECIFIC TEXT ***************************************/


/************************************************** FUNCTION: JAVASCRIPT DIV SLIDER (slide down & slide up) **************/

/******* CSS CODE - FOR THE PAGE CONTAINING THE DIV SLIDER **************\

 div#container {
    border: 1px solid #cccccc;

    min-height: 130px;
    height: auto !important;
    height: 130px;
    width: 550px;

    float: left;

    / * ADDED BECOUSE OF JS SLIDER * /
       position: relative;
       top: 0px;
       left: 0px;
 }

 div#container_content {
    display: inline;

    font-size: 11px;
    font-weight: normal;

    / * height: auto; * /
    line-height: 15px;
    width: 372px;

    float: right;
    position: relative;

    margin: 0px 4px 0px 4px;

    overflow: hidden;
 }

 div#container_content #readmore {
    display: block;

    background-color: #ffffff;

    border: 1px solid #cccccc;

    font-size: 11px;
    font-weight: bold;

    color: #6d6527;

    height: 15px;
    line-height: 15px;
    width: 100px;

    position: absolute;
    top: 84px;
    right: 4px;

    text-align: center;
 }

\******* CSS CODE - FOR THE PAGE CONTAINING THE DIV SLIDER **************/

/******* JAVASCRIPT CODE - FOR THE PAGE CONTAINING THE DIV SLIDER *******\

 //<![CDATA[

 // Set the div slider configuration variable(s)
    var div_slider_div_height = 0;
    var div_slider_div_minheight = 105;
    var div_slider_steps = 5;
    var div_slider_timeout = 1;
    var div_slider_sliding = "";
    var div_slider_sliding_onhold = "";
    var div_slider_sliding_object = "news_advertorial_content_text";
    var div_slider_readmore_active = "y";
    var div_slider_readmore_state = "";
    var div_slider_readmore_object = "readmore";

 // Process the div slider conditions
    window.onload = function(){
       // Initialize the full height of the div
          div_slider_div_height = document.getElementById(div_slider_sliding_object).offsetHeight;

       // Set the height of the div to the minimum height
          document.getElementById(div_slider_sliding_object).style.height = div_slider_div_minheight+'px';

       // Check if the full height is larger then the minimum height
          if(div_slider_div_height > div_slider_div_minheight){
             // Set the javascript mouse events
                document.getElementById(div_slider_sliding_object).onmouseover = div_slider_slidedown;
                document.getElementById(div_slider_sliding_object).onmouseout = div_slider_slideup;

             // Set the javascript for the readmore elements (check if the readmore object exist and is activated)
                if(document.getElementById(div_slider_readmore_object) && div_slider_readmore_active == "y"){
                   // Set the javascript mouse event
                      document.getElementById(div_slider_readmore_object).onmouseout = div_slider_readmore;

                   // Show the readmore div-element
                      document.getElementById(div_slider_readmore_object).style.display = "block";
                }
          }
    };

 //]]>

\******* JAVASCRIPT CODE - FOR THE PAGE CONTAINING THE DIV SLIDER *******/

function div_slider_readmore(){
   // Set the variable that keeps track if the readmore div-element is active
      div_slider_readmore_state = "active";
}

function div_slider_slidedown(){
   // Check if there is permission to process the function
      if(div_slider_readmore_state == "" || div_slider_readmore_active == "n"){
         // Get if the slider should slide down or need to be put on hold
            if(div_slider_sliding == "" || div_slider_sliding == "slidedown"){
               /* Trigger the slider to slide down */

               // Set the sliding state
                  div_slider_sliding = "slidedown";

               // Initialize the div object
                  var div_slider_sliding_div = document.getElementById(div_slider_sliding_object);

               // Get the maximum height
                  var div_slider_stop_position = div_slider_div_height;

               // Check if the div height is lower then the maximum height
                  if(parseInt(div_slider_sliding_div.style.height) < div_slider_stop_position){
                     // Check if the readmore object exist and is activated
                        if(document.getElementById(div_slider_readmore_object) && div_slider_readmore_active == "y"){
                           // Hide the readmore div-element
                              document.getElementById(div_slider_readmore_object).style.display = "none";
                        }

                     // Increase the height of the div with the defined steps
                        div_slider_sliding_div.style.height = parseInt(div_slider_sliding_div.style.height) + div_slider_steps + 'px';

                     // Reload the function
                        setTimeout(div_slider_slidedown, div_slider_timeout);
                  } else {
                     // Reset the sliding state
                        div_slider_sliding = "";

                     // Check if there is a sliding state on hold that wants to be triggered
                        if(div_slider_sliding_onhold != "" && div_slider_sliding_onhold != "slidedown"){
                           // Trigger the sliding state that is on hold
                              setTimeout(div_slider_slideup, div_slider_timeout);

                           // Reset the on hold sliding state
                              div_slider_sliding_onhold = "";
                        } else if(div_slider_sliding_onhold == "slidedown"){
                           // Reset the on hold sliding state
                              div_slider_sliding_onhold = "";
                        }

                     // Set the height of the div on the maximum height
                        div_slider_sliding_div.style.height = div_slider_div_height+ 'px';
                  }
            } else {
               /* Put the slider on hold with sliding state "slidedown" (next sliding action) */
                  div_slider_sliding_onhold = "slidedown";
            }
      } else {
         // Reset the variable that keeps track if the readmore div-element is active
            div_slider_readmore_state = "";
      }
}

function div_slider_slideup(){
   // Check if there is permission to process the function
      if(div_slider_readmore_state == "" || div_slider_readmore_active == "n"){
         // Get if the slider should slide up or need to be put on hold
            if(div_slider_sliding == "" || div_slider_sliding == "slideup"){
               /* Trigger the slider to slide up */

               // Set the sliding state
                  div_slider_sliding = "slideup";

               // Initialize the div object
                  var div_slider_sliding_div = document.getElementById(div_slider_sliding_object);

               // Get the minimum height
                  var div_slider_stop_position = div_slider_div_minheight;

               // Check if the div height is larger then the minimum height
                  if(parseInt(div_slider_sliding_div.style.height) > div_slider_stop_position){
                     // Decrease the height of the div with the defined steps
                        div_slider_sliding_div.style.height = parseInt(div_slider_sliding_div.style.height) - div_slider_steps + 'px';

                     // Reload the function
                        setTimeout(div_slider_slideup, div_slider_timeout);
                  } else {
                     // Reset the sliding state
                        div_slider_sliding = "";

                     // Check if there is a sliding state on hold that wants to be triggered
                        if(div_slider_sliding_onhold != "" && div_slider_sliding_onhold != "slideup"){
                           // Trigger the sliding state that is on hold
                              setTimeout(div_slider_slidedown, div_slider_timeout);

                           // Reset the on hold sliding state
                              div_slider_sliding_onhold = "";
                        } else if(div_slider_sliding_onhold == "slideup"){
                           // Reset the on hold sliding state
                              div_slider_sliding_onhold = "";
                        }

                     // Set the height of the div on the minimum height
                        div_slider_sliding_div.style.height = div_slider_div_minheight+'px';

                     // Check if the readmore object exist and is activated
                        if(document.getElementById(div_slider_readmore_object) && div_slider_readmore_active == "y"){
                           // Show the readmore div-element
                              document.getElementById(div_slider_readmore_object).style.display = "block";
                        }
                  }
            } else {
              /* Put the slider on hold with sliding state "slideup" (next sliding action) */
                  div_slider_sliding_onhold = "slideup";
            }
      }
}

/************************************************** FUNCTION: JAVASCRIPT DIV SLIDER (slide down & slide up) **************/


/************************************************** FUNCTION: ABONNEMENTEN (form field actions) **************************/

function abonnement_object_display(obj_id, display_value){
   var obj = document.getElementById(obj_id);

   if(obj && display_value != ""){
      obj.style.display = display_value;
   } else if(obj && obj.style.display == "none"){
      obj.style.display = "block";
   } else if(obj){
      obj.style.display = "none";
   }
}

function abonnement_object_radiobutton(obj_id){
   if(document.getElementById(obj_id)){
      document.getElementById(obj_id).checked = true;
   }
}

function abonnement_submit(submit, obj_id, radio_id, anchor){
   if(document.getElementById(obj_id)){
      document.getElementById(obj_id).value = "refresh";
   }

   if(document.getElementById(radio_id)){
      document.getElementById(radio_id).checked = true;
   }

   if(anchor != "" && document.getElementById('abonnement')){
      document.getElementById('abonnement').action = document.getElementById('abonnement').action+'#'+anchor;
   }

   if(submit == "y"){
      document.abonnement.submit();
   }
}

/************************************************** FUNCTION: ABONNEMENTEN (form field actions) **************************/

