jQuery(document).ready(function() {
  
  // be an ass, detect ie 6 and kick them out
  if (jQuery.browser.msie 
      && /MSIE 6.0/.test(navigator.userAgent)) {
    if ($.cookie('socialuxe-ie6') != null) {
      if ($.cookie('socialuxe-ie6') == 'stripped') {
        $('#primaryStylesheet').attr('disabled', 'disabled'); // stripped!
      }
    } else {
      window.location.href = 'http://socialuxe.com/?ie6';
    }
  }
  
  // resize all embedded video clips to the proper size, not 400
  $('#etc .video embed, #etc .video object').each(function() {
    $(this).attr('width', '274');
    $(this).attr('height', '274');
  });
  
  // set up permalink
  $('.post').hover(
    function() {
      $(this).find('.permalink').fadeIn(400);
    },
    function() {
      $(this).find('.permalink').fadeOut(100);
    }
  );
  
  // trigger fancybox
  $("#etc .photo a.lightbox").fancybox(); 
  
  // fire sifr
  sIFR.replace(chaletParis, {
                  selector: '#etc .link h3.sifr',
                  wmode: 'transparent',
                  css: ['.sIFR-root { color: #00aeef; }',
                        '.sIFR-root a { color: #00aeef; text-decoration: none; }',
                        '.sIFR-root a:hover { color: #f1f1f1; text-decoration: none; }',
                        '.sIFR-root a:visited { color: #f1f1f1; text-decoration: none; }']
              });
              
  sIFR.replace(chaletParis, {
                  selector: '#etc .quote blockquote p',
                  wmode: 'transparent',
                  css: ['.sIFR-root { color: #f1f1f1; }',
                        '.sIFR-root a { color: #00aeef; text-decoration: none; }',
                        '.sIFR-root a:hover { color: #f1f1f1; text-decoration: none; }',
                        '.sIFR-root a:visited { color: #f1f1f1; text-decoration: none; }']
              });
  
});