/*
	Projecten Javascript
	KanWel!
	12-06-2008 i-Aspect B.V.
	door: Bart Raekers en Rutger Laurman

*/

/* projecten tabel overzicht */
   function initProjectenOverzicht(){
      if(!$('projectenoverzicht')) return;
      $$('table#projectenoverzicht tbody tr:nth-child(odd)').each(function(node){
         node.addClassName('offset');
      });

      $$('table#projectenoverzicht tbody tr').each(function(node){
         node.observe('click',function(){
            window.location=node.childElements()[0].childElements();
         })

         node.observe('mouseover',function(){
            node.addClassName('active');

         });
         node.observe('mouseout',function(){
            node.removeClassName('active');
         });
         //alert(node.tagName);
      });
   }
   //document.observe('dom:loaded', initProjectenOverzicht);
   Event.observe(window,'load',initProjectenOverzicht);

/* */

var middenNederland;

      // pas polygon in kaart
      function fitToMap(){
         var center = bounds.getCenter();
         map.setCenter(center, map.getBoundsZoomLevel(bounds));
      };


/* project info over de googlemap heen */
   function toonProjectInfo(titel,inhoud){
      $('infotitel').update('<strong>Projectgebied:</strong> '+titel);
      $('infoinhoud').update(inhoud);
      $("infoproject").show();
   }
   function verbergProjectInfo(){
      $("infoproject").hide();
   }

/* plaats youtube video */
   function bekijkVideo(doel,videocode,titel){
      // reset video holder
      document.getElementById('videoSpeler').innerHTML='<div id="video">Video wordt geladen...</div>';
      // zet titel
      document.getElementById('videoTitel').innerHTML=titel;
      var params = { allowScriptAccess: "always" };
      var atts = { id: "youtubevideospeler" };
      var colors = "&color1=0xd5f0fb&color2=0xd5f0fb";
      var border = "&border=0";
      swfobject.embedSWF("http://nl.youtube.com/v/"+videocode+"&hl=nl&enablejsapi=1&playerapiid="+doel+"&rel=0&autoplay=1"+colors+border,doel, "425", "356", "8", null, null, params, atts);
   }

   /* zet meeschalende text area */
   Event.observe(window,'load', function(){
      if($('reaction'))
         var textding = new ResizingTextArea($('reaction'));
   });

