It's used frequently in North Britain (Scotland and Northern England). I've seen Chris' answer above here and on Urban Dictionary, claiming it to be a shortened version of the Danish "Tak," which, I believe is incorrect.
Seeing as it's used here in Scotland, I presumed it is an abbreviated form of the Gaelic "Tapadh leat," which is the informal way of saying thanks. The formal is "Tapadh leibh," (pr: "Tapa lev") or many thanks/big thanks, "Taing mhór" or "Móran taing." This word has it's origins in Old Irish, clever, active, so Irish, Early Irish tapad, suddenness, alertness, so the Gaelic way of saying thanks is literally translated to "you are clever/alert/handy."
According to the OED (Oxford English Dictionary), the origin of "thanks" is the Old English "thancas," plural of "thank" (kindly) thought, gratitude, of Germanic origin; related to Dutch "dank" and German "Dank."
Source(s):
MacBain, A. 1982. An Etymological Dictionary of the Gaelic Language. Glasgow: Gairm Publications.
OED Online. 2014. Accessed 7 April, 2014: http://www.oxforddictionaries.com/definition/english/thanks?q=Thanks