refcatored code to reduce duplication
Merge branch 'master' of https://github.com/cth3403/sweepstake

Conflicts:
	js/admin.js