// Удаление пробелов слева и справа
function trim(s) { 	return rtrim(ltrim(s)); }
// удаление пробелов слева
function ltrim(s) { return s.replace(/^\s+/, ''); }
// удаление пробелов справа
function rtrim(s) { return s.replace(/\s+$/, ''); }

$(function() {
	$('#b1').bind('click', function(event) {
		$('#sb1').fadeIn('2');
	}).bind('mouseout', function() {
		var t = setTimeout(function() {
			$('#sb1').fadeOut('2');
		}, 50);
		$('#sb1, .a, #b1').bind('mouseover', function() {
			clearTimeout(t);
		});
	});
	
	$('#add_lang').bind('click', function(event) {
	$('#add_lang_form').fadeIn('2');
	});
	
	
	
	$('#b2').bind('click', function(event) {
		$('#sb2').fadeIn('2');
	}).bind('mouseout', function() {
		var t = setTimeout(function() {
			$('#sb2').fadeOut('2');
		}, 50);
		$('#sb2, .a, #b2').bind('mouseover', function() {
			clearTimeout(t);
		});
	});
	
	$('#b4').bind('click', function(event) {
		$('#sb4').fadeIn('2');
	}).bind('mouseout', function() {
		var t = setTimeout(function() {
			$('#sb4').fadeOut('2');
		}, 50);
		$('#sb4, .a, #b4').bind('mouseover', function() {
			clearTimeout(t);
		});
	});
	
	$('#b5').bind('click', function(event) {
		$('#sb5').fadeIn('2');
	}).bind('mouseout', function() {
		var t = setTimeout(function() {
			$('#sb5').fadeOut('2');
		}, 50);
		$('#sb5, .a, #b5').bind('mouseover', function() {
			clearTimeout(t);
		});
	});
	
	$('#b3').bind('click', function(event) {
		$('#sb3').fadeIn('2');
	}).bind('mouseout', function() {
		var t = setTimeout(function() {
			$('#sb3').fadeOut('2');
		}, 50);
		$('#sb3, .a, #b3').bind('mouseover', function() {
			clearTimeout(t);
		});
	});
});

function go(path) {
	location.href=path;
}

function win(l) {
    window.open(l, 'player', 'height=165,width=400,toolbar=no,left=300,top=100,resizeable=no,center=yes');
}

function win_video(l, w, h) {
    window.open(l, 'player', 'height='+h+',width='+w+',toolbar=no,left=300,top=100,resizeable=no,center=yes');
}

function win_button(l, w, h) {
    window.open(l, 'player', 'height='+h+',width='+w+',toolbar=no,left=300,top=100,resizeable=no,center=yes');
}














