( function () {
  try {

    window.profile = window.profile || {};
    window.profile.privateCabinetWindow = null;

    window.onbeforeunload = function () { try { window.profile.privateCabinetWindow.close(); } catch(e) {} };

    window.profile.openPrivateCabinet = function () {
      try{this.privateCabinetWindow.close();}catch(e){}
      try{this.privateCabinetWindow=window.open('/personal/profile/','privateCabinetWindow','left=150,top=150,height=570,width=807,menubar=no,toolbar=no,location=no,status=no,resizable=no,scrollbars=no,dependent=yes,minimizable=no,fullscreen=no');}catch(e){}
      try{var sw=parent.window.document.getElementById('hoverWindow');sw.parentNode.removeChild(sw);}catch(e){}
    };

    if ( RegExp( /Action=CustomerLostPassword/ ).test( document.location.search ) ) {
 
      window.profile.showLostPasswordFrame = function () { 
        document.write( "<div id='hoverWindow' style='position: absolute; left: 200px; top: 100px; width: auto; height: auto; overflow: hidden; display: block; border: 1px outset #000000;'>" );
        document.write( "<iframe name='profileFrame' id='profileFrame' src='/personal/profile/"+document.location.search+"' width='807px' height='557px' frameborder='0' hspace='0' vspace='0' scrolling='no' align='left'>" );
        document.write( "Ваш браузер не поддерживает плавающие фреймы!" );
        document.write( "</iframe>" );
        document.write( "</div>" );
     };

     window.profile.showLostPasswordFrame();
    }
  }
  catch(e){}
} )();

