Passing Settings from page.tpl to Javascript: Uncaught TypeError: Cannot read property
You need two line to add your code. Before one line to add js data settings:

$my_settings = array(
  'message' =&gt; $message,
);

drupal_add_js(array('my_settings' =&gt; $my_settings), 'setting');


and one line function to add file js

drupal_add_js(drupal_get_path('theme', 'sizin') .'/js/anim.js', 'file');


And better you don't write code in file tpl. You cand add js file, js  settings in hook_preprocess_page(). It's drupal standard and clean tpl file.