

/* ON PAGE LOAD */
$(document).ready(function() {
    // PNG FIX
    $(document).pngFix();

    init_choose_game();
	
});

/* HELPER FUNCITONS : BEGIN */

$.strPad = function(i,l,s) {
	var o = i.toString();
	if (!s) { s = '0'; }
	while (o.length < l) {
		o = s + o;
	}
	return o;
};

function generateGuid() {
  var result, i, j;
  result = '';
  for(j=0; j<32; j++) {
    if( j == 8 || j == 12|| j == 16|| j == 20) 
      result = result + '-';
    i = Math.floor(Math.random()*16).toString(16).toUpperCase();
    result = result + i;
  }
  return result;
}

/* HELPER FUNCITONS : BEGIN */


/* NAV BAR FUNC */
function init_choose_game() {
  var navTimer;

  $("#choose-game-trigger").click(function () {
    if ($("div#links").is(":hidden")) $("div#links").slideDown("fast");
    else $("div#links").slideUp("fast");
    clearTimeout(navTimer);
  });

  $("div#choose-game").hover(
      function() {
        if (!$("div#links").is(":hidden")) clearTimeout(navTimer);
      },
      function() {
        if (!$("div#links").is(":hidden")) {
          navTimer = setTimeout('$("div#links").slideUp("fast")', 1000);
        } // end if
      }
   );
}






