$(document).ready(function(){
   if (window.location.pathname.match(/^\/creator/)) {
       var hash = window.location.hash.replace(/^#/, '');
       if (window.location.pathname != hash && hash.match(/^[\/]{0,1}creator\/index\/deeplink\/[0-9]{1,11}$/)) {
            window.location = hash;
       }
       else if (window.location.pathname.match(/^[\/]{0,1}creator\/index\/deeplink\/[0-9]{1,11}/) && hash == '/creator') {
           window.location = '/creator';
       }
       else if (window.location.pathname.match(/^[\/]{0,1}creator\/index\/user\/[0-9]{1,11}\/[\w]{1,255}\/[0-9]{1,16}/)) {
           var matno = window.location.pathname.replace(/^[\/]{0,1}creator\/index\/user\/[0-9]{1,11}\/[\w]{1,255}\/([0-9]{1,16})\/.+?$/, '$1');
            $.ajax({
               type: "GET",
               dataType: "json",
               url: '/creator/getinfotext/label/' + matno,
               data: '',
               success: function(data) {
                   if (typeof(data) == 'object' && typeof(data['success']) != 'undefined' && data['success']) {
                       if (!$('#creatorinfo').length) {
                           $('#mainmenu_left>ul').append('<li></li>');
                           $('#mainmenu_left>ul>li:last').attr('id', 'creatorinfo');
                           $('#mainmenu_left>ul>li:last').addClass('last');
                       }
                       $('#creatorinfo').html(data['info']);
                       if (window.location.pathname != '/creator/index/deeplink/' + data['mat_nr']) {
                           window.location = window.location.pathname + '#/creator/index/deeplink/' + data['mat_nr'];
                       }
                   }
               }
            });
           
       }
   }
   
});
