public function onTemplateRedirect()
 {
     if (!is_array(self::$PUBLIC_PAGE_IDS)) {
         self::$PUBLIC_PAGE_IDS = array($this->publicPages[WPAM_Plugin::PAGE_NAME_HOME]->getPageId(), $this->publicPages[WPAM_Plugin::PAGE_NAME_REGISTER]->getPageId());
     }
     //get the current page
     $page_id = NULL;
     $page = get_page($page_id);
     //register front-end scripts
     if (isset($page->ID) && in_array($page->ID, self::$PUBLIC_PAGE_IDS)) {
         //add jquery dialog + some style
         $this->enqueueDialog();
         wp_register_style('wpam_jquery_ui_theme', WPAM_URL . '/style/jquery-ui/smoothness/jquery-ui.css');
         wp_enqueue_style('wpam_jquery_ui_theme');
         wp_register_style('wpam_style', WPAM_URL . "/style/style.css");
         wp_enqueue_style('wpam_style');
         //#45 add a datepicker
         wp_enqueue_script('jquery-ui-datepicker');
         wp_register_script('wpam_contact_info', WPAM_URL . '/js/contact_info.js', array('jquery-ui-dialog'));
         wp_register_script('wpam_tnc', WPAM_URL . '/js/tnc.js', array('jquery-ui-dialog'));
         wp_register_script('wpam_payment_method', WPAM_URL . '/js/payment_method.js');
     }
 }