var calc_pounds = function(){}

jQuery(function($){
	
	function trim(str) {
		return str.replace(/^\s+|\s+$/g,"");
	}

    var start_text = $("#counter-date").html();
	start_text = trim(start_text);
	var start = start_text.split('\.');
    var start_date = new Date(parseInt(start[2]), parseInt(start[0]) - 1, parseInt(start[1]));
		
    calc_pounds = function () {
	    var now = new Date();
        var ms_diff = now.getTime() - start_date.getTime();
        var diff = Math.floor(ms_diff / 1000);
        var pounds = "" + (diff * 63); //2B / 31,556,926 (secs/year)
        pounds = pounds.replace(/\B(?=(?:\d{3})+(?!\d))/g, ",");
		$("#counter-num").html(pounds);
        setTimeout("calc_pounds()", 1000);
    }
	
	 
	
    calc_pounds();
});



