/**
 * This function is convenient when encoding a string to be used in a query part
 * of a URL, as a convenient way to pass variables to the next page.
 * @param string str
 * @return string
 */
function urlencode (str)
{
    str = (str+'').toString();
    return encodeURIComponent(str).replace(/!/g, '%21').replace(/'/g, '%27').replace(/\(/g, '%28').replace(/\)/g, '%29').replace(/\*/g, '%2A').replace(/%20/g, '+');
}

jQuery(document).ready(function(){
	// Initiate the follow icons for Twitter and Facebook
	jQuery('#footerTwitter').click(function(){
		jQuery(this).attr('href', 'http://www.twitter.com/home?status=' + urlencode('Eddy Merckx: http://www.eddymerckx.be'));
	});
	jQuery('#footerFacebook').click(function(){
		jQuery(this).attr('href', 'http://www.facebook.com/sharer.php?u=' + urlencode('http://www.eddymerckx.be') + '&t=' + urlencode('Eddy Merckx'));
	});

        jQuery('#logo').click(function() {
            window.location = '/home';
        });
});
