var moopop={width:0,height:0,captureByRel:function(attrVal,parent){this.capture((parent||document).getElements('a[rel*='
+(attrVal||'popup')+']'));},capture:function(el,width,height){if($defined(width)&&$defined(height)){this.width=width;this.height=height;}
switch($type(el)){case'string':el=$$(el);case'element':case'array':$splat(el).each(this.add_pop_to,this);}
this.width=null;this.height=null;},add_pop_to:function(el){el.addEvent('click',function(e){e.stop();this.popup(el);}.bind(this));var size=el.get('rel').match(/\[(\d+),\s*(\d+)/)||['',this.width,this.height];var resizable=el.get('rel').match(/,(r)/)||[];if(size[1])
el.store('popupprops','width='+size[1]+', height='+size[2]
+(resizable[1]?', scrollbars=yes, resizable=yes':''));},popup:function(el){window.open(el.get('href'),el.get('name')||'',el.retrieve('popupprops')||'');}}

window.addEvent('domready', function() {
  $$('.item:last-child').addClass('last');
  $$('.panel:not(:first-child)').setStyle('display', 'none');
  
}); 

window.addEvent('load', function() {
  $chk($('site_flash')) && $('site_flash').inject('content', 'top').wink(6000);
  
  FB_RequireFeatures(["XFBML"], function() {
    FB.Facebook.init("610470299d0623483a9b0e505f621578", "xd_receiver.htm");

    FB.XFBML.Host.autoParseDomTree = false;
    // Add XFBML elements through JavaScript codes
    if ($('fb_fan_box')) {
      FB.XFBML.Host.addElement(new FB.XFBML.Fan($("fb_fan_box")));  
    }
  });
  
  moopop.captureByRel('popup');
});
