	var t;
	var timeout = 1;//sec
	
    var timedCount = function (){
    	
    	t = setTimeout("timedCount();", (timeout*1000));
    	var time_on_site = parseInt($.cookie("hearburn_time_on_site"));
    	if(!time_on_site){
    		time_on_site = 0;
    	}
    	//$('#searchword').val( time_on_site );
    	
    	if( time_on_site >= config_time_out ){
    		if($.cookie("hearburn_time_on_site_is_showed")=="one"){
    			say_bye();
    			$.cookie("hearburn_time_on_site_is_showed", "two", { expires: 1 });
    		}
    	}
    	$.cookie("hearburn_time_on_site", (time_on_site + timeout), { expires: 1 });
    }
    
$(document).ready(function(){

    //shadow
    //$('body').append('<div class="shadow"></div>');

    //news
    //$('#aside ol li:last').addClass('last');

    //tabs
    var banners = $('#banners').length;
    if (banners > 0){
        $('#banners').cycle({
            fx:     'fade',
            speed:   4000,
            timeout: 15000,
            pause:   1,
            pager:  '#tabs',
            pagerAnchorBuilder: function(idx, slide){
                return '#tabs li:eq(' + idx + ') a';
            }
        });
    }
    
    timedCount();
    if($.cookie("hearburn_time_on_site_is_showed")!="two"){
    	$.cookie("hearburn_time_on_site_is_showed", "one", { expires: 1 });
    }
    

    //services
    /*var services = $('#services').length;
    if (services > 0){
        $('#services li:last').addClass('last');
        var total = $('#services li').length;
        if (total > 3){
            var nav = '<div class="nav"><span class="prev">&lt;</span><span class="next">&gt;</span></div>';
            $('#services').append(nav);
            $('#services ul').css({
                left: '0',
                position: 'absolute',
                top: '0',
                width: total * 246 - 1
            });
            var listPos = parseInt($('#services ul').css('left'));
            var startPos = 0;
            var endPos = (total * 246 - 1) - 737;

            $('#services .nav .prev').addClass('prev-disabled');
            $('#services .nav .next').bind('click', function(){
                if (listPos < endPos) {
                    listPos += 246;
                    $('#services ul').animate({ left: -listPos}, 'slow')
                        .queue(function(){
                            if (listPos == endPos) { $('#services .nav .next').addClass('next-disabled'); }
                            else $('#services .nav .prev').removeClass('prev-disabled');
                            $(this).dequeue();
                        });
                }
            });
            $('#services .nav .prev').bind('click', function(){
                if (listPos > startPos) {
                    listPos -= 246;
                    $('#services ul').animate({ left: -listPos}, 'slow')
                        .queue(function(){
                            if (listPos == startPos) { $('#services .nav .prev').addClass('prev-disabled'); }
                            else $('#services .nav .next').removeClass('next-disabled');
                            $(this).dequeue();
                        });
                }
            });
        }
    }
*/
    //news
    /*if ($('#news').length > 0){
        newsList();
        $('#aside ol li').each(function(e){
            var isSelected = $(this).attr('class').indexOf('selected');
            if (isSelected >= 0){ newsEntries(e); }
        });
    }
*/
    //forms
   /* $('input[type="submit"]').hover(
        function(){ $(this).addClass('hover'); },
        function(){ $(this).removeClass('hover'); }
    );*/

    //external links
    //$('a[rel="external"]').attr('target','_blank');

});

/*function newsList(i){
    $('#aside ol li').each(function(e){
        var element = $(this);
        if (e == i){ element.addClass('selected').siblings().removeClass('selected'); }
        element.find('a').click(function(){
            var isSelected = element.attr('class').indexOf('selected');
            if (isSelected < 0){
                element.addClass('selected').siblings().removeClass('selected');
                newsEntries(e);
            }
            return false;
        });
    });
}
function newsEntries(i){
    $('#news .entry').each(function(e){
        var element = $(this);
        var isExpanded = element.attr('class').indexOf('expanded');
        if (e != i){ element.removeClass('expanded').find('.content, .footer').slideUp('slow'); }
        else element.addClass('expanded').find('.content, .footer').slideDown('slow');
        element.find('.header h3').click(function(){
            if (isExpanded < 0){
                element.siblings().removeClass('expanded').find('.content, .footer').slideUp('slow');
                element.addClass('expanded').find('.content, .footer').slideDown('slow');
                newsList(e);
            }
        });
    });
}*/
