var toggle_timeout = 4000;
var toggle_duration = 1000;
//$(document).ready(function() {
jQuery(function ($) {
	//setInterval(toggle_splash, toggle_timeout);
    $('div.soc_tabs a').click(function(){
    	var a = $(this);
    	if(!a.hasClass('active')) {
    		$('div.soc_tabs a').removeClass('active');
    		if(a.attr('class').match('facebook')) {
    			$('#vkontakte_tab').css('display', 'none');
    			$('#facebook_tab').css('display', 'block');
    			$('#hifinews_tab').css('display', 'none');
    		}
    		if(a.attr('class').match('vkontakte')) {
    			$('#facebook_tab').css('display', 'none');
    			$('#vkontakte_tab').css('display', 'block');
    			$('#hifinews_tab').css('display', 'none');
    		}
    		if(a.attr('class').match('hifinews')) {
    			$('#facebook_tab').css('display', 'none');
    			$('#vkontakte_tab').css('display', 'none');
    			$('#hifinews_tab').css('display', 'block');
    		}
    		a.addClass('active');
    	}
    });
});
function toggle_splash () {

	var splash_active = 0;
	var splash_count = 0;
	while ($('#splash_' + splash_count).length > 0) {
		if ($('#splash_' + splash_count).css('display') != 'none')
			splash_active = splash_count;
		splash_count++;
	}

	if (splash_count < 2) return;

	var splash_next = (splash_active >= splash_count - 1)? 0: splash_active + 1;
	$('#splash_' + splash_active).fadeOut(toggle_duration);
	$('#splash_' + splash_next).fadeIn(toggle_duration);

}
