function ED_buildmenu() {    $(".menu li").each(function() {        $(this).prepend('<b class="l"></b>');        $(this).append('<b class="r"></b>')    });    $(".menu li a").each(function() {        $(this).before('<em>' + $(this).text() + '</em>')    });    $(".blue h1").each(function() {        $(this).wrapInner('<em></em>');        $(this).prepend('<span>' + $(this).text() + '</span>')    })}function ED_search() {    $('.search .string').focus(function() {        if ($(this).val() == 'Type here keyword...') $(this).val('');        $(this).addClass('active')    });    $('.search .string').blur(function() {        if ($(this).val() == '') $(this).val('Type here keyword...');        $(this).removeClass('active')    })}function ED_rounds() {    $(".block").wrapInner('<div class="hh"><div class="ww"><div class="content"></div></div></div>');    $(".block .ww").prepend('<div class="cn tl"></div><div class="cn tr"></div>');    $(".block .ww").append('<div class="cn bl"></div><div class="cn br"></div>')}function ED_main() {    var delay = '3s';    var list = '';    $('#main dt').each(function() {        list = list + '<li>' + $(this).text() + '</li>';        $(this).hide()    });    $('#main').parent().parent().before('<ul id="maintabs" class="clear">' + list + '</ul>');    $('#maintabs li:first').addClass('current');    $('#maintabs li:last').addClass('last');    $('#main dt:not(:first)').hide();    $('#main dd:not(:first)').hide();    $('.cat:not(:first)').hide();    var show = {};    show.run = function(delay) {        var curindex = $('#maintabs li.current').prevAll().length;        var preindex = 0;        var numtabs = 4;        $('body').everyTime(delay, 'slideshow',        function(i) {            if (curindex < numtabs) {                preindex = curindex;                curindex++            } else {                curindex = 0;                preindex = numtabs            }            $('#maintabs:not(.noslider) li').removeClass('current');            $('#maintabs:not(.noslider) li').eq(curindex).addClass('current');            $('#main dd').eq(preindex).css('z-index', '20');            $('#main dd').eq(curindex).show().css('z-index', '10');            $('#main dd').eq(preindex).fadeOut('slow')        })    };    show.run(delay);    $('#maintabs li').click(function() {        var current = $(this).prevAll().length;        $('#main dd').hide();        $('#main dd').eq(current).show();        $('#maintabs li').removeClass('current');        $('#maintabs li').eq(current).addClass('current');        $('body').stopTime('slideshow')    });    $('#main dd').mouseover(function() {        $('body').stopTime('slideshow')    });    $('#main dd').mouseout(function() {        show.run(delay)    });    $('.noslider').hide().removeAttr('id');    $('.noslider').clone().insertAfter('.blue').attr('id', 'maintabs').show();    $('.noslider li').click(function() {        var current = $(this).prevAll().length;        $('.cat').hide();        $('.cat').eq(current).show();        $('#maintabs li').removeClass('current');        $('#maintabs li').eq(current).addClass('current')    })}function ED_browserFixes() {    var browser = {};    browser.name = function() {        for (var key in $.browser) {            if ($.browser[key] == true) break        }        return key    };	    switch (browser.name()) {    case 'msie':        $(".fmenu li:not(:first)").prepend('|');        $(".nav li:not(:first)").prepend('|');        break;    case 'opera':	    {		if (window.navigator.userAgent.indexOf ("Version/10.5") >= 0)		{break;}		else{		$('.block .br').css('margin-top', '-5px');        $('.block .bl').css('margin-top', '-5px');        $('.document .br').css('margin-top', '-5px');        $('.document .bl').css('margin-top', '-5px');        $('.document .latest .br').css('margin-top', '-6px');        $('.document .latest .bl').css('margin-top', '-6px');        break;		}		}    default:        break    }}function ED_itemnav() {    var Shift = {        number: 3,        speed: 1500,        width: 60,        init: function() {            this.count = $(".clip ul").children().length;            this.back = 0;            if (this.count > this.number) {                this.fwd = this.count - this.number            } else {                this.fwd = 0            }            this.nav()        },        nav: function() {            if (this.back == 0) {                $(".thumbs .prev").addClass('inactive')            } else {                $(".thumbs .prev").removeClass('inactive')            };            if (this.fwd == 0 || (this.fwd < 0 && this.back != 0)) {                $(".thumbs .next").addClass('inactive')            } else {                $(".thumbs .next").removeClass('inactive')            }        },        forward: function(elem) {            if (this.fwd > 0) {                this.fwd -= this.number;                this.back += this.number;                var offset = this.back * this.width;                $(".clip ul").animate({                    left: -offset                },                this.speed, this.nav())            }        },        rewind: function(elem) {            if (this.back > 0) {                this.fwd += this.number;                this.back -= this.number;                var offset = this.back * this.width;                $(".clip ul").animate({                    left: -offset                },                this.speed, this.nav())            }        },        zoom: function(elem) {            $('#itemimage img').attr('src', $(elem).attr('href'));            return false        },        unzoom: function() {}    };    Shift.init();    $('.thumbs .next').click(function() {        Shift.forward()    });    $('.thumbs .prev').click(function() {        Shift.rewind()    });    $('.clip ul a').click(function() {        Shift.zoom(this);        return false    })}function ED_paginator() {    $('.commentslist .pages a').click(function() {        var url = $(this).attr('href');        $('.commentslist').load(location.protocol + '//' + location.host + url, {},        function() {            ED_paginator()        });        return false    })}function ED_video() {    $('.bayan li dl').hide();    $('.bayan li:first dl').show();    $('.bayan li span').click(function() {        $('.bayan li dl').hide();        $('.bayan li span').removeAttr('class');        $(this).parent().find('dl').show();        $(this).addClass('open')    })}$(document).ready(function() {    ED_buildmenu();    ED_search();    ED_rounds();    ED_main();    ED_browserFixes();    ED_itemnav();    ED_paginator();    ED_video();    $('#cse-search-results iframe').attr('width', '100%')});
