function trim(str) {
	var	str = str.replace(/^\s\s*/, ''),
		ws = /\s/,
		i = str.length;
	while (ws.test(str.charAt(--i)));
	return str.slice(0, i + 1);
}

function bnSetText() {
	//console.log(document.getElementById("cntbn_text").innerHTML);
	document.getElementById("bn_text").innerHTML = document.getElementById("cntbn_text").innerHTML;
}

jQuery(function() {
	for (var k = 1; k < 20; k++) {
		if ($("a#fb_1") != "undefined") {
			$("a#fb_"+k).fancybox({
				'zoomOpacity'	: true,
				'overlayShow'	: true,
				'zoomSpeedIn'	: 500,
				'zoomSpeedOut'	: 500
			});
		}
	}

	$('#wrap_images').jScrollPane({showArrows:true});
	$('#wrap_images_extra').jScrollPane({showArrows:true});
	
	$('#wrap_images').parent().css("display","none")
	
	$("#first").click(function(){$(this).addClass("active");$("#second").removeClass("active");$('#wrap_images').parent().css("display","block");$('#wrap_images_extra').parent().css("display","none");return false})

	$("#second").click(function(){$(this).addClass("active");$("#first").removeClass("active");$('#wrap_images').parent().css("display","none");$('#wrap_images_extra').parent().css("display","block");return false})
	
	$(".popup_error_close").click(function(){$(".shadows").css("display","none");$(".popup_error").css("display","none");return false})
	$(".close").click(function(){$(".shadows").css("display","none");$(".popup").css("display","none");return false})
	$(".button_rk").click(function(){$(".shadows").css("display","block");$(".popup").css("display","block");return false})
});