﻿var instructeursopleidingDisplay, golfensurfenDisplay, godutchDisplay;

function switchMovie(movie) {
  document.getElementById('fade').innerHTML = '<object width="583" height="327"><param name="movie" value="http://www.youtube.com/v/' + movie + '?hl=nl&fs=1&autoplay=1&rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/' + movie + '?hl=nl&fs=1&autoplay=1&rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="583" height="327"></embed></object>';
}

function switchMovie2(movie) {
  var params = { allowScriptAccess: "always", allowFullScreen: "true" };
  var atts = { id: "fade" };
  swfobject.embedSWF("http://www.youtube.com/v/" + movie + "?enablejsapi=1&playerapiid=ytplayer&autoplay=1&rel=0&fs=1",
                         "fade", "583", "327", "8", null, null, params, atts);
}

function switchMovie3(movie) {
  switchMovie(movie);
  setFacebookUrl(movie);
}


function onYouTubePlayerReady(playerId) {
  ytplayer = document.getElementById("fade");
  if (!(document.getElementById("movies"))) {
    ytplayer.addEventListener("onStateChange", "onytplayerStateChange");
  }
}

function onytplayerStateChange(newState) {
  if (newState == 0) {
    if (document.getElementById("ctl00_fotocarousel"))
      document.getElementById("ctl00_fotocarousel").innerHTML = oldHTML;
    else
      document.getElementById("car").innerHTML = oldHTML;
    $('#fade').cycle({
      fx: 'fade',
      speed: 2000,
      timeout: 2000,
      random: 0
    });
  }
}

function extras() {
  var extras = '' +
        '<table class="tablesorter" cellspacing="0" cellpadding="0"> ' +
        '  <thead> ' +
        '    <tr> ' +
        '      <th class="c1">Extra te boeken:</th> ' +
        '      <th class="c2"></th> ' +
        '      <th class="c3"></th> ' +
        '      <th class="c4"></th> ' +
        '      <th class="c6"></th> ' +
        '      <th class="c7"></th> ' +
        '    </tr> ' +
        '  </thead> ' +
        '  <tbody> '
  if (instructeursopleidingDisplay) {
    extras = extras +
        '    <tr onclick="location.href=\'../Zeilen-en-Windsurfen/ZeilschoolMolenhuisvakanties.aspx?Vaknr=57\'" class="tr-hover"> ' +
        '      <td><img src="/Plaatjes/0instruc_ov120.gif" alt="Instructeursopleiding " border="0" /></td> ' +
        '      <td><h3>Instructeursopleiding </h3><p>Voor iedereen die passie heeft voor zeilen en windsurfen</p></td> ' +
        '      <td class="extrastd">17 - 30</td> ' +
        '      <td class="extrastd">10</td> ' +
        '      <td class="extrastd">€ 445</td> ' +
        '      <td> ' +
        '        <div class="grades"></div> ' +
        '        <a href="../Zeilen-en-Windsurfen/ZeilschoolMolenhuisvakanties.aspx?Vaknr=57"><img src="../images/meerinformatie.gif" alt="Nu boeken" title="Meer informatie" border="0" /></a> ' +
        '      </td> ' +
        '    </tr> '
  }
  if (golfensurfenDisplay) {
    extras = extras +
        '    <tr onclick="location.href=\'../Zeilen-en-Windsurfen/ZeilschoolStevenvakanties.aspx?Vaknr=320\'" class="tr-hover"> ' +
        '       <td><img src="/Plaatjes/120x90golf7.jpg" alt="Golfen en Zeilen de Steven 7-12" border="0" /></td> ' +
        '       <td><h3>Golfen en Zeilen de Steven 7-12</h3><p>Gijpen, opkruisen en... putten</p></td> ' +
        '       <td class="extrastd">7 - 12</td> ' +
        '       <td class="extrastd">7</td> ' +
        '       <td class="extrastd">€ 545</td> ' +
        '       <td> ' +
        '         <div class="grades"></div> ' +
        '         <a href="../Zeilen-en-Windsurfen/ZeilschoolStevenvakanties.aspx?Vaknr=320"><img src="../images/meerinformatie.gif" alt="Nu boeken" title="Meer informatie" border="0" /></a> ' +
        '       </td> ' +
        '    </tr> ' +
        '    <tr onclick="location.href=\'../Zeilen-en-Windsurfen/ZeilschoolWyldeSwanvakanties.aspx?Vaknr=321\'" class="tr-hover"> ' +
        '       <td><img src="/Plaatjes/120x90gez12-16.jpg" alt="Golfen en Zeilen Wylde Swan 12-14" border="0" /></td> ' +
        '       <td><h3>Golfen en Zeilen Wylde Swan 12-14</h3><p>Laser pico, Valk of windsurfen in combinatie met Golfen</p></td> ' +
        '       <td class="extrastd">12 - 14</td> ' +
        '       <td class="extrastd">7</td> ' +
        '       <td class="extrastd">€ 545</td> ' +
        '       <td> ' +
        '         <div class="grades"></div> ' +
        '         <a href="../Zeilen-en-Windsurfen/ZeilschoolWyldeSwanvakanties.aspx?Vaknr=321"><img src="../images/meerinformatie.gif" alt="Nu boeken" title="Meer informatie" border="0" /></a> ' +
        '       </td> ' +
        '    </tr> ' +
        '    <tr onclick="location.href=\'../Zeilen-en-Windsurfen/ZeilschoolWyldeSwanvakanties.aspx?Vaknr=449\'" class="tr-hover"> ' +
        '       <td><img src="/Plaatjes/Golf-zeilen14-16thumb.jpg" alt="Golfen en Zeilen Wylde Swan 14-16" border="0" /></td> ' +
        '       <td><h3>Golfen en Zeilen Wylde Swan 14-16</h3><p>Gijpen, opkruisen en...putten</p></td> ' +
        '       <td class="extrastd">14 - 16</td> ' +
        '       <td class="extrastd">7</td> ' +
        '       <td class="extrastd">€ 545</td> ' +
        '       <td> ' +
        '         <div class="grades"></div> ' +
        '         <a href="../Zeilen-en-Windsurfen/ZeilschoolWyldeSwanvakanties.aspx?Vaknr=449"><img src="../images/meerinformatie.gif" alt="Nu boeken" title="Meer informatie" border="0" /></a> ' +
        '       </td> ' +
        '    </tr> '
  }
  if (godutchDisplay) {
    extras = extras +
        '    <tr onclick="location.href=\'../Taal-en-Vakantie/TaalNederlandvakanties.aspx?Vaknr=386\'" class="tr-hover"> ' +
        '      <td><img src="/Plaatjes/go-dutch8-19-thumb.jpg" alt="Go Dutch! 8-11" border="0" /></td> ' +
        '      <td><h3>Go Dutch! 8-11</h3><p>Leer Nederlands en zeilen op de Friese Meren</p></td> ' +
        '      <td class="extrastd">8 - 11</td> ' +
        '      <td class="extrastd">7</td> ' +
        '      <td class="extrastd">€ 545</td> ' +
        '      <td> ' +
        '        <div class="grades"></div> ' +
        '        <a href="../Taal-en-Vakantie/TaalNederlandvakanties.aspx?Vaknr=386"><img src="../images/meerinformatie.gif" alt="Nu boeken" title="Meer informatie" border="0" /></a> ' +
        '      </td> ' +
        '    </tr> ' +
        '    <tr onclick="location.href=\'../Taal-en-Vakantie/TaalNederlandvakanties.aspx?Vaknr=387\'" class="tr-hover"> ' +
        '      <td><img src="/Plaatjes/120x90wind.jpg" alt="Go Dutch! 12-14" border="0" /></td> ' +
        '      <td><h3>Go Dutch! 12-14</h3><p>Leer Nederlands en Zeilen op de Friese Meren</p></td> ' +
        '      <td class="extrastd">12 - 14</td> ' +
        '      <td class="extrastd">7</td> ' +
        '      <td class="extrastd">€ 545</td> ' +
        '      <td> ' +
        '        <div class="grades"></div> ' +
        '        <a href="../Taal-en-Vakantie/TaalNederlandvakanties.aspx?Vaknr=387"><img src="../images/meerinformatie.gif" alt="Nu boeken" title="Meer informatie" border="0" /></a> ' +
        '      </td> ' +
        '    </tr> ' +
        '    <tr onclick="location.href=\'../Taal-en-Vakantie/TaalNederlandvakanties.aspx?Vaknr=388\'" class="tr-hover"> ' +
        '      <td><img src="/Plaatjes/0swan_ov120.gif" alt="Go Dutch! 15-19" border="0" /></td> ' +
        '      <td><h3>Go Dutch! 15-19</h3><p>Ga mee naar Friesland voor een week zeilen en Nederlands</p></td> ' +
        '      <td class="extrastd">15 - 19</td> ' +
        '      <td class="extrastd">7</td> ' +
        '      <td class="extrastd">€ 545</td> ' +
        '      <td> ' +
        '        <div class="grades"></div> ' +
        '        <a href="../Taal-en-Vakantie/TaalNederlandvakanties.aspx?Vaknr=388"><img src="../images/meerinformatie.gif" alt="Nu boeken" title="Meer informatie" border="0" /></a> ' +
        '      </td> ' +
        '    </tr> '
  }
  extras = extras +
        '  </tbody> ' +
	      '</table> ';
  document.getElementById('extras').innerHTML = extras;
}

function setFacebookUrl(url) {
  document.getElementById('facebook-frame').src = 'http://www.facebook.com/plugins/like.php?href=http://www.youtube.com/watch?v=' + url + '&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;colorscheme=light&amp;height=80'
}
