Cufon.replace('h1', {
  color: '-linear-gradient(#fecc00, #fecc00, #ed7506, #e96e00)',
  textShadow: '2px 2px black'
});
Cufon.replace('#mainnav li span');
Cufon.replace('#slogan', {
  textShadow: '2px 2px black'
});
Cufon.replace('#mainnav li.active span', {
  color: '-linear-gradient(#fecc00, #fecc00, #ed7706)',
  textShadow: '1px 1px black'
});
Cufon.replace('#sidecoltitle', {
  color: '-linear-gradient(#fecc00, #fecc00, #ed7506, #e96e00)',
  textShadow: '2px 2px black'
});
Cufon.replace('#carousel h4, #detailrow h3, #thumblist h2 a');

Cufon.replace('.home #main-col h2, .home #main-col h3', {
  color: '-linear-gradient(#fecc00, #fecc00, #ed7506, #e96e00)',
  textShadow: '2px 2px black'
});

$(document).ready(function() {
  if ($('#photogallery').length != 0) {
    $('#photogallery li a').lightBox();
  }
});

$('#carousel .image').cycle({ 
                      fx:     'scrollHorz', 
                      timeout: 5000,
                      speed: 500,
                      before:  onBefore,
                      after:   onAfter,
                      pager:'#pager', 
                      next:   '#browse-next', 
                      prev:   '#browse-prev'
                   });
 
function onBefore() { 
    //$('#text').html("Scrolling image:<br>" + this.src);
  //alert(this.id);
    $('.info').fadeOut(200);
    $('#carousel .sticker').fadeOut(100);
}

function onAfter() { 
    //$('#text').html('<h1>' + this.alt + '</h1>') 
    //    .append('<p>' + this.id + '</p>');
  //alert(this.id);
    $('.'+this.id).fadeIn(200);
    $('.'+this.id+' .sticker').fadeIn(100);
}
function extractParamFromUri(uri, paramName) {
  if (!uri) {
    return;
  }
  var uri = uri.split('#')[0];  // Remove anchor.
  var parts = uri.split('?');  // Check for query params.
  if (parts.length == 1) {
    return;
  }
  var query = decodeURI(parts[1]);

  // Find url param.
  paramName += '=';
  var params = query.split('&');
  for (var i = 0, param; param = params[i]; ++i) {
    if (param.indexOf(paramName) === 0) {
      return unescape(param.split('=')[1]);
    }
  }
}
$('#carousel .pageimage').cycle({ 
                      fx:     'scrollHorz', 
                      timeout: 5000,
                      speed: 500,
                      next:   '#browse-next', 
                      prev:   '#browse-prev'
                   });

function bindXVote() {
  $('.star, .nostar').live('mouseover', function(e) {
        $('.star, .nostar').removeClass('star-on');
        $(this).parent('.rating').addClass('dovote');
        $(this).addClass('star-on');
        prevs = $(this).parent('.rating').find('.star, .nostar');
        element = $(this);
        prevs.each(function (index) {
            if (index < prevs.index(element)) {
                $(this).addClass('star-on');
            }
        });
        action = element.closest('.vote').find('.action');
        action.show();
        action.html('Geef '+(prevs.index(element)+1)+' sterren');
    });
    $('.star, .nostar, .share a').live('mouseout', function(e) {
        $('.star, .nostar').removeClass('star-on');
        $('.rating').removeClass('dovote');
        $('.action').hide();
        $('.action').html('Stem op deze foto');
    });
    $('.share a').live('mouseover', function(e) {
        action = $(this).closest('.social').find('.action');
        action.show();
        action.html($(this).html());
    }); 
    $('.star, .nostar').live('click', function(e) {
      vc = $(this).parent('.rating').find('.star, .nostar').index(element) + 1;
      vid = $(this).parent('.rating').attr('id').replace(/[^\d\.]/g, '');
      $.ajax({url: '/pcvote/vote?v='+vc+'&i='+vid, contentType: 'JSON', success: function(data) { if (data.error && data.error != 'undefined') {alert(data.error);} else {alert('Bedankt voor uw stem!');} }});
    })
}

$(document).ready(function() {
  if ($('.photocompetition').length) {
      $('.photocompetition .image a').lightBox({
          htmlImage: 'XHR:/pcentry/vote?img=foto'
      });
      bindXVote();
  };
  
  
    $('.hoverable').hover(function() {
      $(this).addClass('onhover');
      if ($(this).hasClass('mainnav-a')) {
        Cufon.replace('#mainnav li.onhover span', {
            color: '-linear-gradient(#fecc00, #fecc00, #ed7706)',
            textShadow: '1px 1px black'
        });
      }
    }, function() {
      $(this).removeClass('onhover');
      if ($(this).hasClass('mainnav-a')) {
        Cufon.replace('#mainnav li span');
        Cufon.replace('#mainnav li.active span', {
          color: '-linear-gradient(#fecc00, #fecc00, #ed7706)',
          textShadow: '1px 1px black'
        });
      }
    });
    
    $('#navigation').hover(function() {
      $(this).addClass('onhover');
      $(this).animate({height: '486px'}, 300);
    }, function() {
        $(this).animate({height: '136px'}, 300, function() {$(this).removeClass('onhover');} );
    });


// Facebook Social Analytics
    window.fbAsyncInit = function() {
        FB.init({appId: '274837105863500', status: true, cookie: true,
                 xfbml: true});
        FB.Event.subscribe('edge.create', function(targetUrl) {
            _gaq.push(['_trackSocial', 'facebook', 'like', targetUrl]);
        });    
        FB.Event.subscribe('edge.remove', function(targetUrl) {
            _gaq.push(['_trackSocial', 'facebook', 'unlike', targetUrl]);
        });
        FB.Event.subscribe('message.send', function(targetUrl) {
            _gaq.push(['_trackSocial', 'facebook', 'send', targetUrl]);
        });
     };
  (function() {
    var e = document.createElement('script'); e.async = true;
    e.src = document.location.protocol +
      '//connect.facebook.net/nl_NL/all.js';
    document.getElementById('fb-root').appendChild(e);
  }());

// Twitter Social Analytics
    twttr.events.bind('tweet', function(event) {
             if (event) {
                 var targetUrl;
                 if (event.target && event.target.nodeName == 'IFRAME') {
                     targetUrl = extractParamFromUri(event.target.src, 'url');
                 }
                 _gaq.push(['_trackSocial', 'twitter', 'tweet', targetUrl]);
             }
         });

  $('#search .field').focus(function() { $(this).val(''); });
  $('#search .button').click(function(e) { $('#frm-search').submit(); e.preventDefault(); });
  $('#subscribe .field').focus(function() { $(this).val(''); });
  $('#subscribe .button').click(function(e) { $('#frm-subscribe').submit(); e.preventDefault(); });
});

<!-- Copyright 2006,2007 Bontrager Connection, LLC
// http://bontragerconnection.com/ and http://willmaster.com/
// Version: July 28, 2007
var cX = 0; var cY = 0; var rX = 0; var rY = 0;
function UpdateCursorPosition(e){ cX = e.pageX; cY = e.pageY;}
function UpdateCursorPositionDocAll(e){ cX = event.clientX; cY = event.clientY;}
if(document.all) { document.onmousemove = UpdateCursorPositionDocAll; }
else { document.onmousemove = UpdateCursorPosition; }
function AssignPosition(d) {
if(self.pageYOffset) {
  rX = self.pageXOffset;
  rY = self.pageYOffset;
  }
else if(document.documentElement && document.documentElement.scrollTop) {
  rX = document.documentElement.scrollLeft;
  rY = document.documentElement.scrollTop;
  }
else if(document.body) {
  rX = document.body.scrollLeft;
  rY = document.body.scrollTop;
  }
if(document.all) {
  cX += rX; 
  cY += rY;
  }
d.style.left = (cX+10) + "px";
d.style.top = (cY+10) + "px";
}
function HideContent(d) {
if(d.length < 1) { return; }
document.getElementById(d).style.display = "none";
}
function ShowContent(d) {
if(d.length < 1) { return; }
var dd = document.getElementById(d);
AssignPosition(dd);
dd.style.display = "block";
}
function ReverseContentDisplay(d) {
if(d.length < 1) { return; }
var dd = document.getElementById(d);
AssignPosition(dd);
if(dd.style.display == "none") { dd.style.display = "block"; }
else { dd.style.display = "none"; }
}
//-->

