
$(document).ready(function() {

    //change recent work title on hover
    $('.recentwork-image').mouseenter(function() {
        $(this).parent().find('.recentwork-title').addClass('recentwork-title-hover');
    }).mouseleave(function() {
        $(this).parent().find('.recentwork-title').removeClass('recentwork-title-hover');
  });
  
  //show/hide custom layout builder
  $('#buildcustomlayout').click(function() {
      $('.recentworkscheckbox').toggle();
      if($('.recentworkscheckbox').is(":visible")) {
        $(this).text('hide custom view');
      }
      else
      {
        $(this).text('build custom view');
      }
    });

    //build custom layout builder view
    $('input[type=checkbox]').click(function() {
        $recentWorksIds = '';
        $('input[type=checkbox]').each(function () {
               if (this.checked) {
                   if($recentWorksIds != '') $recentWorksIds = $recentWorksIds + ':';
                   $recentWorksIds = $recentWorksIds + this.name;
        }});

        if($recentWorksIds == '') {
            $('#customviewlink').text('');
        }
        else {
            $('#customviewlink').text('Custom View Link (click to test)');
        }


        $('#customviewlink').attr('href', '/?rwv=' + $recentWorksIds);

    });
});

function launchVideoPlayer(videoType, videoId)
{
    newwindow = window.open('player.php?type=' + videoType + '&video=' + videoId,'player','width=684,height=555,scrollbars=no');
    if (window.focus) {newwindow.focus()}
    return false;
}

function launchNewWindow(url)
{
    newwindow = window.open(url,'newwindow','width=650,height=600,scrollbars=yes');
    if (window.focus) {newwindow.focus()}
    return false;
}




