
function show() {
    $('body').css({'visibility': 'visible'});
}

function init() {

    if ($.browser.msie) {
      $('#accessibility a').mouseenter(function (){
          //alert('ieeeeeeee')
        $(this).find('.sub-menu').remove();
      });
    }
    
    
  // sidebar functions
    $('#sidebar').removeClass('menu-topp-meny-container').find('li').addClass('menupoint'); //main class
    $('#menu_heading').insertBefore('#sidebar_menu'); //top bar
    $('.menupoint').find('ul').addClass('side_m_sub'); //sub class
    $('.side_m_sub').find('li').addClass('menup_sub').removeClass('menupoint'); //sub li
    $('.menup_sub').find('ul').addClass('fly_out').removeClass('side_m_sub'); //sub_sub class
    $('.fly_out').find('li').addClass('menup_sub_li').removeClass('menup_sub'); //sub_sub li
    
    $('#articleview').find('li').addClass('menu_button').css({
        'cursor': 'pointer'
    });
    $('#articleview').find('li:last').css('margin-right', '0');
    
    //menu bottom icon switch
    var iconswitch = $('#menu-kategori').find('a');
    iconswitch.each(function () {
        if ($(this).text() === 'Organisasjon') {
            $(this).text('').append('<img src="http://prest.mu.modula.no/wp-content/themes/prest/images/button_organisasjon.png" />').addClass('icon');
        } else if ($(this).text() === 'Lov & Rett') {
            $(this).text('').append('<img src="http://prest.mu.modula.no/wp-content/themes/prest/images/button_lovogrett.png" />').addClass('icon');
        } else if ($(this).text() === 'Lønn & tariff') {
            $(this).text('').append('<img src="http://prest.mu.modula.no/wp-content/themes/prest/images/button_lonnogtariff.png" />').addClass('icon');
        } else if ($(this).text() === 'Videreutdanning') {
            $(this).text('').append('<img src="http://prest.mu.modula.no/wp-content/themes/prest/images/button_videreutdanning.png" />').addClass('icon');
        } 
        if ($('body').hasClass('chrome') || $('body').hasClass('safari')) {
            $(this).find('img').css('margin-top', '-18px');    
        }
        $(iconswitch).hover(function () {
            $(this).find('img').css('margin-left', '-195px');
            if ($('body').hasClass('chrome') || $('body').hasClass('safari')) {
                $(this).find('img').css('margin-top', '0px');    
            }
        });
        $(iconswitch).mouseout(function () {
            $(this).find('img').css('margin-left', '0');
            if ($('body').hasClass('chrome') || $('body').hasClass('safari')) {
                $(this).find('img').css('margin-top', '-18px');    
            }
        });
    });
  
      // color & image switch themes
    var entry_div = $('.entry').find('div');
    var wrapper750div = $('.wrapper750').find('div:first');
    
    if ($(entry_div).hasClass('category-organisasjon') || $(wrapper750div).hasClass('category-organisasjon')) {
        $('#topheader').css('background', 'url(http://prest.mu.modula.no/wp-content/themes/prest/images/organisasjon_topheader.png) repeat-x');
        $('#bottomheader').css('background', 'url(http://prest.mu.modula.no/wp-content/themes/prest/images/organisasjon_bottomheader.png) repeat-x');
        $('#topfooter').css('background', 'url(http://prest.mu.modula.no/wp-content/themes/prest/images/organisasjon_topfooter.png) repeat-x');
        $('#bottomfooter').css('background', 'url(http://prest.mu.modula.no/wp-content/themes/prest/images/organisasjon_bottomfooter.png) repeat-x');
        $('#name').css({'background': 'url(http://prest.mu.modula.no/wp-content/themes/prest/images/organisasjon.png) no-repeat', 'width': '450px'});
        $('#logoheader').css('background', 'url(http://prest.mu.modula.no/wp-content/themes/prest/images/photo_head_org.png) no-repeat');
        $('#login, #login_box, #articlebg').css('background', '#e3dac6');
        $('.menup_sub').css('color', '#e3dac6'); // cat org
    } else if ($(entry_div).hasClass('category-videreutdanning') || $(wrapper750div).hasClass('category-videreutdanning')) {
        $('#topheader').css('background', 'url(http://prest.mu.modula.no/wp-content/themes/prest/images/header_top_videreutdanning.png) repeat-x');
        $('#bottomheader').css('background', 'url(http://prest.mu.modula.no/wp-content/themes/prest/images/videreutdanning_bottomheader.png) repeat-x');
        $('#topfooter').css('background', 'url(http://prest.mu.modula.no/wp-content/themes/prest/images/videreutdanning_topfooter.png) repeat-x');
        $('#bottomfooter').css('background', 'url(http://prest.mu.modula.no/wp-content/themes/prest/images/videreutdanning_bottomfooter.png) repeat-x');
        $('#name').css({'background': 'url(http://prest.mu.modula.no/wp-content/themes/prest/images/headline_videreutdanning.png) no-repeat', 'width': '450px'/* , 'margin-top': '48px' */});
        $('#logoheader').css('background', 'url(http://prest.mu.modula.no/wp-content/themes/prest/images/photo_head_utdann.png) no-repeat');
        $('#login, #login_box, #articlebg').css('background', '#D5CBCE');
        $('.menup_sub').css('color', '#D5CBCE');
        $('#menu_heading').css('background', 'url(http://prest.mu.modula.no/wp-content/themes/prest/images/videreutdanning_menuheading.png) repeat-x'); // cat utd
    } else if ($(entry_div).hasClass('category-lnn-og-tariff') || $(wrapper750div).hasClass('category-lnn-og-tariff')) {
        $('#topheader').css('background', 'url(http://prest.mu.modula.no/wp-content/themes/prest/images/lonntariff_topheader.png) repeat-x');
        $('#bottomheader').css('background', 'url(http://prest.mu.modula.no/wp-content/themes/prest/images/lonntariff_bottomheader.png) repeat-x');
        $('#topfooter').css('background', 'url(http://prest.mu.modula.no/wp-content/themes/prest/images/lonntariff_topfooter.png) repeat-x');
        $('#bottomfooter').css('background', 'url(http://prest.mu.modula.no/wp-content/themes/prest/images/lonntariff_bottomfooter.png) repeat-x');
        $('#name').css({'background': 'url(http://prest.mu.modula.no/wp-content/themes/prest/images/headline_lonnogtariff.png) no-repeat', 'width': '425px'});
        $('#logoheader').css('background', 'url(http://prest.mu.modula.no/wp-content/themes/prest/images/photo_head_lonn.png) no-repeat');
        $('#login, #login_box, #articlebg').css('background', '#C2CFC8');
        $('.menup_sub').css('color', '#C2CFC8');
        $('#menu_heading').css('background', 'url(http://prest.mu.modula.no/wp-content/themes/prest/images/lonntariff_menuheading.png) repeat-x'); // cat lonn
    } else if ($(entry_div).hasClass('category-lov-rett') || $(wrapper750div).hasClass('category-lov-rett')) {
        $('#topheader').css('background', 'url(http://prest.mu.modula.no/wp-content/themes/prest/images/lovrett_topheader.png) repeat-x');
        $('#bottomheader').css('background', 'url(http://prest.mu.modula.no/wp-content/themes/prest/images/lovrett_bottomheader.png) repeat-x');
        $('#topfooter').css('background', 'url(http://prest.mu.modula.no/wp-content/themes/prest/images/lovrett_topfooter.png) repeat-x');
        $('#bottomfooter').css('background', 'url(http://prest.mu.modula.no/wp-content/themes/prest/images/lovrett_bottomfooter.png) repeat-x');
        $('#name').css({'background': 'url(http://prest.mu.modula.no/wp-content/themes/prest/images/headline_lovogrett.png) no-repeat', 'width': '335px'});
        $('#logoheader').css('background', 'url(http://prest.mu.modula.no/wp-content/themes/prest/images/photo_head_lov.png) no-repeat');
        $('#login, #login_box, #articlebg').css('background', '#BFC7D7');
        $('.menup_sub').css('color', '#BFC7D7');
        $('#menu_heading').css('background', 'url(http://prest.mu.modula.no/wp-content/themes/prest/images/lovrett_menuheading.png) repeat-x'); //cat lov
    } else {
        $('#sidebar').hide(); //main theme
    }
  
//sidebar functions
  // remove links not in category
    $('#sidebar_menu li').each(function(){
      if (($(entry_div).hasClass('category-lnn-og-tariff') && $(this).find('a').attr('title') !== ('Lønn & tariff')) || ($(wrapper750div).hasClass('category-lnn-og-tariff') && $(this).find('a').attr('title') !== ('Lønn & tariff'))) {
       if ($(this).find('a').attr('title') !== ('Lønn & tariff')) {
          $(this).addClass('hidden');
          //$(this).remove();
        }
      }
      if (($(entry_div).hasClass('category-lov-rett') && $(this).find('a').attr('title') !== ('Lov & rett')) || ($(wrapper750div).hasClass('category-lov-rett') && $(this).find('a').attr('title') !== ('Lov & rett'))) {
       if ($(this).find('a').attr('title') !== ('Lov & rett')) {
          $(this).addClass('hidden');
          //$(this).remove();
        }
      }
      if (($(entry_div).hasClass('category-videreutdanning')/*  && $(this).find('a').attr('title') !== ('Utdanning') */) || ($(wrapper750div).hasClass('category-videreutdanning') && $(this).find('a').attr('title') !== ('Utdanning'))) {
       if ($(this).find('a').attr('title') !== ('Utdanning')) {
          $(this).addClass('hidden');
          //$(this).remove();
        } else {
          $(this).removeClass('hidden');
        }
      }
      if (($(entry_div).hasClass('category-organisasjon') && $(this).find('a').attr('title') !== ('Organisasjon')) || ($(wrapper750div).hasClass('category-organisasjon') && $(this).find('a').attr('title') !== ('Organisasjon'))) {
       if ($(this).find('a').attr('title') !== ('Organisasjon')) {
          $(this).addClass('hidden');
          //$(this).remove();
        }
      }
      
    // find active link
    var pathname = window.location.href;
    if($(this).find('a').attr('href') === pathname ) {
      $(this).addClass('open');
    } else {
      $(this).addClass('closed');
    }
    
    // indicate children
    if ($('.menupoint').find('.side_m_sub')) {
    $('.side_m_sub').closest('.menupoint.closed').css({'background': 'url(http://prest.mu.modula.no/wp-content/themes/prest/images/indicator_closed.png) no-repeat 185px 8px'});
    $('.side_m_sub').closest('.menupoint.open').css({'background': 'url(http://prest.mu.modula.no/wp-content/themes/prest/images/indicator_open.png) no-repeat 185px 8px'});
    }
    
  //////////////////////////////////////////////////////////////////
    // menu point active style
    if ($('.open').closest('ul').hasClass('side_m_sub') ){
      $('.side_m_sub').each(function(){
        $(this).css({'display':'block'});
        if ($(this).closest('.menupoint').hasClass('inactive')) {
          $(this).css('display', 'none');
          $(this).closest('.menupoint').hover(function(){
            $(this).find('.side_m_sub').css({'display':'block'});
          });
          $(this).closest('.menupoint').mouseout(function(){
            $(this).find('.side_m_sub').css({'display':'none'});
          });
           $(this).closest('.menupoint').hover(function(){
              $(this).find('.menup_sub').removeClass('hidden');
            });
            $(this).closest('.menupoint').mouseout(function(){
              $(this).find('.menup_sub').addClass('hidden');
            });
        }
      });
     $('.menup_sub').each(function(){
      if($(this).hasClass('closed')) {
        $(this).closest('.side_m_sub').hide();
      }
      if($(this).hasClass('open')) {
        $(this).closest('.menupoint').removeClass('closed').addClass('active_parent');
        if ($(this).closest('.menupoint').hasClass('active_parent') && $(this).closest('.menupoint').find('.menup_sub.closed')) {
          $(this).closest('.menupoint').find('.menup_sub.closed').show().removeClass('closed');
        }
      }
      /*
  $(this).closest('.menupoint').each(function(){
        if ($(this).hasClass('closed')) {
          $(this).mouseover(function(){
            $(this).find('.side_m_sub').show();
          });
          $(this).mouseout(function(){
            $(this).find('.side_m_sub').hide();
          });
        }
      });
  */
     });
    }
    
    if ($('.open').closest('ul').hasClass('fly_out')) {
      $('.fly_out').each(function(){
        $(this).css({'display':'block'});
        $(this).addClass('trans');
        $(this).closest('.side_m_sub').css('display', 'block');
        
        $(this).closest('.menup_sub').each(function(){
          if ($(this).hasClass('closed')) {
            $(this).mouseover(function(){
              $(this).closest('.fly_out').show();
            });
            $(this).mouseout(function(){
              $(this).closest('.fly_out').hide();
            });
          }   
        });
      });
      $('.fly_out').find('li').each(function(){
        
        if ($(this).hasClass('open')) {
          $(this).show();
          $(this).removeClass('closed');
        } else if ($(this).hasClass('closed')){
          $(this).addClass('hidden'); 
        }
      });
    } 
    $('.menup_sub_li').each(function(){
      if ($(this).hasClass('open')) {
        $(this).closest('.menup_sub').addClass('open_fly');
        $(this).closest('.menupoint').addClass('open_fly');
        $(this).closest('.fly_out').addClass('open');
        $(this).find('.fly_out.open').show();
      } else {
        $(this).closest('.menup_sub').addClass('closed');
        $(this).closest('.menup_sub_li').addClass('closed');
        $(this).closest('.fly_out').addClass('closed');
        $(this).closest('.menupoint').addClass('closed');
      }
      if ($(this).closest('.menup_sub').hasClass('closed') && $(this).closest('.menup_sub_li').hasClass('closed')) {
        $(this).closest('.menupoint').hover(function(){
          $(this).find('.fly_out.closed').hide();
          $(this).find('.fly_out.open').show();
        });
        $(this).closest('.menup_sub.closed').mouseover(function(){
          $(this).find('.fly_out.closed').show();
          $(this).find('.fly_out.open').show();
        });
        $(this).closest('.menup_sub.closed').mouseout(function(){
          $(this).find('.fly_out.closed').hide();
          $(this).find('.fly_out.open').show();
        }); 
      }
      if ($(this).hasClass('closed') && $(this).closest('.fly_out').hasClass('open')) {
        $(this).removeClass('hidden');
      }
    });
  });
  
  show();
  //////////////////////////////////////////////////////////////////
  }
  
  
  var active_color = '#000'; // Colour of user provided text
  var inactive_color = '#ccc'; // Colour of default text
  var i = 0; 
  var max_size = 120;
  var h;
  var w;
  
  $/* (window).load */(function(){
  
  if( $('.article').find('.wp-caption').css('border', 'solid red 1px') ) {
    $('.article').find('.wp-caption').contents().insertBefore($('.article').find('.wp-caption'));
    $('.article').find('.wp-caption').remove();
  }
  
  $('body').css('visibility', 'hidden');
  if ($('.wrapper950').find('#sticky')) {
    $('#sticky').insertAfter('#news');
  }
  
  $('table').attr({'cellspacing':'0', 'cellpadding':'0'}).css('width', '100%');
  $('table tr').find('td:first').each(function(){
    $(this).css({'min-width': parseInt($(this).closest('table').width()/4)});
  });
  
  $('.people tr').find('td:last').closest('tr').each(function(){
    $(this).css({'border-bottom': 'solid 1px gray'});
  });
  
  // ie class image
  if ($('body').hasClass('ie')) {
    $('.entry').find('img').css({
      'margin-top': '-40px'
    });
  }
  
  // newsletter styling attributes
  $('.newsletter').find('input').each(function(){
   if( $(this).attr('type') === 'text') {
     $(this).addClass('letter');
     $(this).val($(this).closest('tr').find('td:first').text());
     $(this).closest('tr').find('td:first').remove();
   }
   if( $(this).attr('type') === 'submit') {
    $(this).closest('td').addClass('submit_it');
   }
  });
  
  $('.newsletter').find('.letter').css('color', inactive_color);
    var default_values = new Array();
   // var value = $('.newsletter').find('.letter').val();
    $('.newsletter').find('.letter').focus(function() {
    //alert($(this).val())
      if (!default_values[this.id]) {
        default_values[this.id] = this.value;
      } 
      if (this.value === default_values[this.id]) {
        this.value = '';
        this.style.color = active_color;
      }
      $(this).blur(function() {
        if (this.value === '') {
          this.style.color = inactive_color;
          this.value = default_values[this.id];
        }
      });
    });
    
  // menu top adjustments
  $('.wrapper950').find('#searchform').remove().appendTo('#menu-topp-meny').wrap('<li></li>');
  $('#searchform').find('label').remove();
  $('#searchsubmit').val('Søk');
  
  // navigation style
  if ($('.navigation').find('strong')) {
    $('.navigation').find('a').css('font-weight', 'bold');
  }
  
  // navigation text
  $('.navigation').find('a').each(function(){
    if ($(this).text() === '« Older Entries') {
      $(this).addClass('prev');
      $(this).text('>>');
      $(this).css('float', 'right');
    }
    if ($(this).text() === 'Newer Entries »') {
      $(this).addClass('next');
      $(this).text('<<');
      $(this).css('float', 'left');
    }
  });
  
  // add class to .page (styling)
  if ($('#news').hasClass('lov-rett')) {
    $('.wrapper750').find('.page').addClass('category-lov-rett');
  } else if ($('#news').hasClass('lonn-tariff')) {
    $('.wrapper750').find('.page').addClass('category-lnn-og-tariff');
  } else if ($('#news').hasClass('organisasjon')) {
    $('.wrapper750').find('.page').addClass('category-organisasjon');
  } else if ($('#news').hasClass('utdanning')) {
    $('.wrapper750').find('.page').addClass('category-videreutdanning');
  }
  
  // image size in archive & single + linkage through img
  var archive_element = $('#news').find('.article');
  if ($('#news').hasClass('archive')) {
  max_size = 120;
  $(archive_element).find('img').each(function(i) {
    if ($(this).height() > $(this).width()) {
      h = max_size;
      w = Math.ceil($(this).width() / $(this).height() * max_size);
    } else {
      w = max_size;
      h = Math.ceil($(this).height() / $(this).width() * max_size);
    }
    $(this).css({ height: h, width: w });
    $(this).wrap('<a class="to_entry_img"></a>').addClass('article_thumb');
    $(archive_element).find('.to_entry_img').each(function(){
      $(this).attr('href', $(this).closest('div').find('.to_entry').attr('href'));
    });
    //$(archive_element).find('p strong').css('font-weight', 'normal');
    $(archive_element).find('a').closest('strong').css('font-weight', 'normal');
    $(archive_element).find('h1.article_text a').css('font-weight', 'bold');
    $(archive_element).find('h5:first').hide();
  });
  } else if ($('#news').hasClass('article_view')) {
    $(archive_element).find('img').addClass('article_image');
    $(archive_element).find('.article_image').css({'margin-top': '0', 'width': '240px', 'height': 'auto'});
    $(archive_element).find('h1.article_text').css('margin-left', '0');
    $(archive_element).find('h6.article_text').css('margin', '0');
    //$(archive_element).find('p strong').wrap('<span class="ingress_txt"></span>');
    //$(archive_element).find('.ingress_txt').css({'width': '200px', 'display':'inline-block'});
    $(archive_element).css('width', '450px');
    $(archive_element).closest('.wrapper750').css('border', 'none');
    $(archive_element).find('h1.article_text a').css('font-weight', 'bold');
    $('#news').css('width', '508px');
  }
  
  // archive styling when viewing archive list in content
  if ($('#news').hasClass('all_arch')) {
    $('.article, #load_content, #news').css({
      'width': '460px',
      'padding-right': '25px',
      'margin-bottom': '20px'
      });
  }
  
  // archive styling when viewing archive list in footer
  var footerarchive = $('#articlebg').find('.article_footer');
  //var footerarticle = $('#articlebg').find('.article_view');
  if($('#articlebg').hasClass('.footerarchive')) { 
    $(footerarchive).find('p strong').css('font-weight', 'normal');
    $(footerarchive).css('width', '710px');
    $(footerarchive).find('a').closest('strong').css('font-weight', 'normal');
    $(footerarchive).find('h1.article_text').css('margin-left', '135px');
    $(footerarchive).find('h1.article_text a').css('font-weight', 'bold');
    $(footerarchive).find('h6.article_text').css('margin', '0 0 0 135px');
    //$(footerarchive).find('.ingress_txt').css({'width': '100%', 'display':'inline' });
    max_size = 120;
    $(footerarchive).find('img').each(function(i) {
      if ($(this).height() > $(this).width()) {
        h = max_size;
        w = Math.ceil($(this).width() / $(this).height() * max_size);
      } else {
        w = max_size;
        h = Math.ceil($(this).height() / $(this).width() * max_size);
      }
      $(this).css({ height: h, width: w });
      $(this).css('margin-top', '-35px');
      $(this).wrap('<a class="to_entry_img"></a>').addClass('article_thumb');
      $(footerarchive).find('.to_entry_img').each(function(){
        $(this).attr('href', $(this).closest('div').find('.to_entry').attr('href'));
      });
    });
    $(footerarchive).find('.article_thumb').css('margin-top', '-35px').removeClass('article_image');
  }
  
  // page view layout main category
  if ($('.article').hasClass('the_page') && $('.the_page').find('.with_img')) {
      $('.to_entry_img').find('img').insertBefore('.to_entry_img').addClass('page_img');
      $('.to_entry_img').remove();
      $('.page_img').css('margin-top', '-30px');
  }
  
  // without image
  $('.entry').each(function(){
    if($(this).find('p:has(img)')) {
      $(this).find('p:has(img)').addClass('with_img');
    } 
    $('.entry').find('p').addClass('without_img');
    if ($(this).find('p').hasClass('with_img')) {
      $(this).find('p').removeClass('without_img');
      $(this).find('h1').css({'width': '430px'});
    }
    if ($(this).find('p').hasClass('without_img')) {
      $(this).find('h1, h6').css('margin-left', '0');
    }
  });
  
  $('body.search').find('.article').each(function(){
    if($(this).find('p:has(img)')) {
      $(this).find('p:has(img)').addClass('with_img');
    } 
    $('body.search').find('.article').find('p').addClass('without_img');
    if ($(this).find('p').hasClass('with_img')) {
      $(this).find('p').removeClass('without_img');
    }
    if ($(this).find('p').hasClass('without_img')) {
      $(this).find('h1, h6').css('margin-left', '0');
    }
  });
  
  //*********
    
   
    // link color active/hover
  $('#sidebar_menu a').each(function() {
  if ($(this).attr('title') === 'Organisasjon' && $(this).closest('li').hasClass('open')) {
      $(this).css('color', '#e3dac6');
      $(this).hover(function(){
        $(this).css('color', '#e3dac6');
      });
      $(this).mouseout(function(){
        $(this).css('color', '#e3dac6');
      });
    } else if ($(this).attr('title') === 'Utdanning' && $(this).closest('li').hasClass('open')) {
      $(this).css('color', '#D5CBCE');
      $(this).hover(function(){
        $(this).css('color', '#D5CBCE');
      });
      $(this).mouseout(function(){
        $(this).css('color', '#D5CBCE');
      });
    } else if ($(this).attr('title') === 'Lønn & tariff' && $(this).closest('li').hasClass('open')) {
      $(this).css('color', '#C2CFC8');
      $(this).hover(function(){
        $(this).css('color', '#C2CFC8');
      });
      $(this).mouseout(function(){
        $(this).css('color', '#C2CFC8');
      });
    } else if ($(this).attr('title') === 'Lov & rett' && $(this).closest('li').hasClass('open')) {
      $(this).css('color', '#BFC7D7');
      $(this).hover(function(){
        $(this).css('color', '#BFC7D7');
      });
      $(this).mouseout(function(){
        $(this).css('color', '#BFC7D7');
      });
    } else {
      if ($(this).attr('title') === 'Organisasjon') {
        $(this).hover(function(){
          $(this).css('color', '#e3dac6');
        });
      } else if ($(this).attr('title') === 'Utdanning') {
        $(this).hover(function(){
          $(this).css('color', '#D5CBCE');
        });
      } else if ($(this).attr('title') === 'Lønn & tariff') {
        $(this).hover(function(){
          $(this).css('color', '#C2CFC8');
        });
      } else if ($(this).attr('title') === 'Lov & rett') {
        $(this).hover(function(){
          $(this).css('color', '#BFC7D7');
        });
      }
      $(this).mouseout(function(){
        $(this).css('color', 'gray');
      });
    }
  });
  
  // login box actions
  $('#login').click(function(){
    $('#login_box').css('display', 'inline-block');
    $(this).css('display', 'none');
    $('#name').css('margin-right', '-40px');
    $('#login_box').find('form#out_action').each(function(){
      $(this).closest('#login_box').css({
        'width': '130px',
        'height': '50px',
        'border-bottom': '1px solid #BFBFBF',
        'padding': '15px 5px 0 25px'
      });
      $('#name').css('margin-right', '30px');
    });
  });
  $('.cancel, .admin_button').click(function(){
    $('#login_box').css('display', 'none');
    $('#login').css('display', 'block');
    $('#name').css('margin-right', '80px');
  });
  
  // go home
  
    $('#homebutton').bind('click', function (ev) {
      window.location.href = "/";
    });
  /* show(); */
  });
  
  window.onload = init;
   
