var varname = location.search.match(/[\?&]varname=([^&]*)(&|$)/)[1];