/**
 * Javascript - jQuery enabled
 * 
 * @package WPFramework
 * @subpackage Media
 */

function prepareStartScreen()
{
  
  jQuery("#start-screen").show();
  
  /* show start screen; */
  var img = new Image();
  jQuery(img)
    .load(function() {
      var img = jQuery(this);
      jQuery(this).hide();
      jQuery("#start-screen").append(this);
      jQuery(this).fadeIn(600);
      jQuery(this).css({'left': (jQuery(window).width() - img.width()) / 2 + "px",
                        'top': (jQuery(window).height() - img.height()) / 2 + "px"});

      window.setTimeout('jQuery("#start-screen").fadeOut(500);', 2600);
    })
    .attr("id", "start-screen-image")
    .attr("src", "wp-content/themes/hsg/library/media/images/startpic.jpg");

  document.cookie = "hsg-start-shown=1";
  
}

/**
 * Javascript - jQuery enabled
 * 
 * @package WPFramework
 * @subpackage Media
 */



jQuery(document).ready(function($) {
  
  /* check if show-start cookie is set */
  var c = document.cookie;
  if (c.search('hsg-start-shown') == -1) {
    prepareStartScreen();
  }
  
  /* remove gallery links */
  /*jQuery(".ngg-gallery-thumbnail").each(function(i, val) {
    var img = jQuery(this).find("img");
    var a = jQuery(this).find("a");
    jQuery(this).append(img);
    a.remove();
    });*/

  /* fix annoying Wordpress auto added double-<br/>'s */
  jQuery(".content-box br + br").each(function(x, val) {
    jQuery(this).remove();
  });    

  
});

function prepareStartScreen()
{
  
  jQuery("#start-screen").show();
  
  /* show start screen; */
  var img = new Image();
  jQuery(img)
    .load(function() {
      var img = jQuery(this);
      jQuery(this).hide();
      jQuery("#start-screen").append(this);
      jQuery(this).fadeIn(600);
      jQuery(this).css({'left': (jQuery(window).width() - img.width()) / 2 + "px",
                        'top': (jQuery(window).height() - img.height()) / 2 + "px"});

      window.setTimeout('jQuery("#start-screen").fadeOut(500);', 2600);
    })
    .attr("id", "start-screen-image")
    .attr("src", "wp-content/themes/hsg/library/media/images/startpic.jpg");

  document.cookie = "hsg-start-shown=1";
  
}

