$(document).ready(function(){
    $(".corner").corner();
});
$(document).ready(function(){
    // hide all of the element with 'show_hide' class
    $(".show_hide").hide();
    // toggle the .show component with next .show_hide class
    $(".show").click(function(){
        $(this).next(".show_hide").slideToggle(600);
    });
});
$(document).ready(function(){
    // for FancyBox fancy
    $('a.fancybox').fancybox({
        'hideOnContentClick': true,
        'titlePosition'     : 'inside',
        'zoomOpacity'       : true,
        'overlayShow'       : true,
        'speedIn'           : 600,
        'speedOut'          : 500
    });
    // for Fancybox plain (in gallery, use rel='anything')
    $('a.fancygal').fancybox({
        'hideOnContentClick': true,
        'titlePosition'     : 'inside',
        'titleFormat'       : function(title, currentArray, currentIndex, currentOpts) {
            return '<span id="fancybox-title-over">' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &mdash; ' + title : '') + '</span>';
        }
    });
    // for iframes
    $("a.iframe").fancybox({
        'width'     : '75%',
        'height'    : '75%',
        'autoScale' : 'none',
        'type'      : 'iframe'
    });
    // for youtube video, need to click on go button
    $("a.youtube").click(function() {
        $.fancybox({
            'padding'       : 0,
            'autoScale'     : false,
            'transitionIn'  : 'none',
            'transitionOut' : 'none',
            'title'         : this.title,
            'width'         : 680,
            'height'        : 495,
            'href'          : this.href.replace(new RegExp("watch\\?v=","i"),'v/'),
            'type'          : 'swf',
            'swf'           : {
                'wmode'         : 'transparent',
                'allowFullscreen' : 'true'
            }
        });
        return false;
    });
    // for Fancybox image map (in gallery, use rel='anything')
    $('area.fancy').fancybox({
        'hideOnContentClick': true,
        'titlePosition'     : 'inside',
        'titleFormat'       : function(title, currentArray, currentIndex, currentOpts) {
            return '<span id="fancybox-title-over">' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &mdash; ' + title : '') + '</span>';
        }
    });
});
$(document).ready(function(){
    $("a.spamno").each(function() {
        str         = $(this).attr('href');
        var re_at   = new RegExp("/q-q/");
        var re_addr = new RegExp("addr=(.+?)&");
        var re_name = new RegExp("name=(.*)");
        var addr_ar = re_addr.exec(str);
        var addr    = addr_ar[1];
        addr        = addr.replace(re_at,'@').split('').reverse().join('').replace(/\//g, '.');
        var name_ar = re_name.exec(str);
        var name    = name_ar[1];
        $(this).attr('href', 'mailto:' + addr);
        name        = name.replace("(addr)", addr);
        $(this).text(name);
    });
});


