/*

*/
function setTextboxHeight() {
  txtCont = document.getElementById('lefigaro-text');
  txt = document.getElementById('lefigaro-text-content');
  bg = document.getElementById('lefigaro-text-background');
  fg = document.getElementById('lefigaro-text-background');

  textHeight = txt.offsetHeight + txt.style.paddingTop + txt.style.paddingBottom;
  txtCont.style.height = textHeight+'px';
  bg.style.height = textHeight+'px';
  
  if(fg!="") {
    fg.style.height = textHeight+'px';
  }
  
  txt.style.visibility = 'visible';

}

registerEventListener(window, "load", setTextboxHeight);


/*
 HairCut Tool
*/
function loadHairCutTool() {
  toolContainer = document.getElementById('haircut-tool-flash')
  
  if(toolContainer) {
    var so = new SWFObject("frisurenTool1.2.swf", "portalAnimation", "600", "275", "6", "");
    so.addParam("allowScriptAccess", "sameDomain");
    so.addParam("menu", "false");
    so.addParam("loop", "false");
    so.addParam("wmode", "opaque");
    
    if(typeof userPic != "undefined") {
      so.addVariable('userPic',userPic);
    }
    
    // overwrite the div "portal-animation" with the flash code
    so.write("haircut-tool-flash");
  }
}

registerEventListener(window, "load", loadHairCutTool);

/*
  HairCut Tool UI scripts
*/

function showUploader() {
  document.getElementById('lefigaro-text-content').style.display='none';
  document.getElementById('lefigaro-text-foreground').style.display='block';
}
