/*
 * MAIN JS FILE GRINKENSCHMIDT.DE
 * AUTHOR D.POEPPING, LOST-UPDATE.DE
 * LASTCHANGE 2010 09 19
 */


$(document).ready(function() {
  $("#content input, #content textarea, #content select, #content button").uniform();

  //klick-vergroessern bilder galerie trigger
  $("a.galleryimg1").fancybox({
    'transitionIn'  :'elastic',
    'transitionOut'  :'none',
    'speedIn'  :600, 
    'speedOut'  :200, 
    'overlayShow'  :true,
    'overlayOpacity' : 0.5,
    'overlayColor':'#000'
  });
  
  //alle labels gleiche laenge ...
  var labelmax = 0;
      $("#content-inner label").each(function(){
        if ($(this).width() > labelmax)
            labelmax = $(this).width();   
      });
      $("label").width(labelmax);      
      //$(".errorwrap2").addClass("error");
      $(".error").css("padding","4px");      

});


function setEmoticon(text,fieldid) {
  var txtarea = document.getElementById(fieldid);
  text = ' ' + text + ' ';
  if (txtarea.createTextRange && txtarea.caretPos)
  {
    var caretPos = txtarea.caretPos;
    caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? caretPos.text + text + ' ' : caretPos.text + text;
    txtarea.focus();
  }
  else { txtarea.value += text; txtarea.focus(); }
}

function showPuzzleSolved(results) {
alert('Glückwunsch, Sie haben das Puzzle gelöst und ' + results.moves + ' Züge und '+ results.seconds + ' Sekunden benötigt.');
}

    
