added set cookie function
used document ready listener