' || w == '<') {
$(this).val('');}});
$('body').append('▲');
$.fn.scrollToTop = function() {
$(this).hide().removeAttr("href");
if ($(window).scrollTop() >= "250") $(this).fadeIn("slow")
var scrollDiv = $(this);
$(window).scroll(function() {
if ($(window).scrollTop() <= "250") $(scrollDiv).fadeOut("slow")
else $(scrollDiv).fadeIn("slow")});
$(this).click(function() {
$("html, body").animate({scrollTop: 0}, "slow")})}
$("#go-top").scrollToTop();
$('form').submit(function(event) {
if ($(this).attr('id') == 'no_ajax') {
return;
}
else
{
var text = '';
var subm = $('button[type=submit]');
if($(this).attr('data-loading') == 'true')
{
text = subm.html();
subm.attr('disabled','');
subm.html('
обработка...');}
var json;
event.preventDefault();
$.ajax({
type: $(this).attr('method'),
url: "",
data: new FormData(this),
contentType: false,
cache: false,
processData: false,
success: function(result) {
json = jQuery.parseJSON(result);
if (json.url) {
window.location.href = '/' + json.url;} else {
alert(json.status + ' - ' + json.message);
if($(this).attr('data-loading') == 'true')
{
subm.removeAttr('disabled');
subm.html(text);}
if(json.location)
{
if(json.location == "1")
{
location.reload();}
else
{
window.location.href = json.location;}}}},
});
if($(this).attr('name') == "comm_form") $('textarea#comments').val('');
return;}}
);
});
function open_search_form(event) {
var e = $(event);
var icon = e.children('span');
if(icon.hasClass("glyphicon-search")){
icon.removeClass('glyphicon-search').addClass('glyphicon-remove');
$('.search-wrap').slideDown();}
else
{
icon.removeClass('glyphicon-remove').addClass('glyphicon-search');
$('.search-wrap').slideUp();}
$('#navbarColor03').removeClass('show');
return;}
var switchScreens={intervals:{},run:function(s,f,e,b,d,a){clearInterval(this.intervals[f]);var prog = $(d);if(a){var c=0;this.intervals[f]=setInterval(function(){c++;if(c>e){c=1;}var ig = (c*(e == 5 ? 20 : 10));prog.siblings(".hd-video,.views,.duration").addClass('d-none');prog.siblings(".progress-video-line").html('
');d.setAttribute("src",b.replace("%i",c))},500);}else{d.setAttribute("src",b.replace("%i",s));prog.siblings(".progress-video-line").html('');prog.siblings(".hd-video,.views,.duration").removeClass('d-none');}}};
function drop_list_menu(item) {var e = $('.dropdown-list-'+item);if(e.is(':hidden')) {e.show();}else{e.hide();}}