\n {title}\n <\/strong>\n {msg}<\/p>\n {html}\n {created}<\/small>\n <\/div>\n <\/div>\n <\/a>\n {icon}<\/div>\n
\n <\/i>\n <\/button>\n<\/div>"
var requiredUserNotificationTemplateFields = ["href","onclick","status","element_class","element_id","type","image","icon","title","msg","html","id","created"]
var _adWasPlayed = 0;
$(document).ready(function () {
YPTHidenavbar();
});
$(document).ready(function() {
searchInList('#search_6484181b9c3b7-search', '.search_6484181b9c3b7 .form-check');
$('#search_6484181b9c3b7-panel .form-check-input').on('change', function() {
var checked = $(this).prop('checked');
var value = $(this).val();
$('.searchHTMLsearchFieldsNames input[type="checkbox"], .searchHTMLsearchFieldsNames input[type="radio"]').each(function() {
if ($(this).val() === value) {
$(this).prop('checked', checked);
}
});
const checkedValues = $('#search_6484181b9c3b7-panel .form-check-input').filter(':checked').map(function() {
return this.value;
}).get();
console.log('#search_6484181b9c3b7-panel .form-check-input', checkedValues, JSON.stringify(checkedValues));
Cookies.set('searchFieldsNames[]', JSON.stringify(checkedValues), {
expires: 365,
path: '/'
});
setSearchFilterIcon();
});
var savedCookies = Cookies.get('searchFieldsNames[]');
if (savedCookies) {
var checkedValues = JSON.parse(savedCookies);
$('#search_6484181b9c3b7-panel .form-check-input').each(function() {
this.checked = checkedValues.includes(this.value);
});
}
setSearchFilterIcon();
});
$(document).ready(function() {
searchInList('#search_6484181b9cfd4-search', '.search_6484181b9cfd4 .form-check');
$('#search_6484181b9cfd4-panel .form-check-input').on('change', function() {
var checked = $(this).prop('checked');
var value = $(this).val();
$('.searchHTMLcatName input[type="checkbox"], .searchHTMLcatName input[type="radio"]').each(function() {
if ($(this).val() === value) {
$(this).prop('checked', checked);
}
});
const checkedValues = $('#search_6484181b9cfd4-panel .form-check-input').filter(':checked').map(function() {
return this.value;
}).get();
console.log('#search_6484181b9cfd4-panel .form-check-input', checkedValues, JSON.stringify(checkedValues));
Cookies.set('catName', JSON.stringify(checkedValues), {
expires: 365,
path: '/'
});
setSearchFilterIcon();
});
var savedCookies = Cookies.get('catName');
if (savedCookies) {
var checkedValues = JSON.parse(savedCookies);
$('#search_6484181b9cfd4-panel .form-check-input').each(function() {
this.checked = checkedValues.includes(this.value);
});
}
setSearchFilterIcon();
});
$(document).ready(function() {
searchInList('#search_6484181b9cfe8-search', '.search_6484181b9cfe8 .form-check');
$('#search_6484181b9cfe8-panel .form-check-input').on('change', function() {
var checked = $(this).prop('checked');
var value = $(this).val();
$('.searchHTMLtags_id input[type="checkbox"], .searchHTMLtags_id input[type="radio"]').each(function() {
if ($(this).val() === value) {
$(this).prop('checked', checked);
}
});
const checkedValues = $('#search_6484181b9cfe8-panel .form-check-input').filter(':checked').map(function() {
return this.value;
}).get();
console.log('#search_6484181b9cfe8-panel .form-check-input', checkedValues, JSON.stringify(checkedValues));
Cookies.set('tags_id', JSON.stringify(checkedValues), {
expires: 365,
path: '/'
});
setSearchFilterIcon();
});
var savedCookies = Cookies.get('tags_id');
if (savedCookies) {
var checkedValues = JSON.parse(savedCookies);
$('#search_6484181b9cfe8-panel .form-check-input').each(function() {
this.checked = checkedValues.includes(this.value);
});
}
setSearchFilterIcon();
});
$(document).ready(function() {
searchInList('#search_6484181b9d00a-search', '.search_6484181b9d00a .form-check');
$('#search_6484181b9d00a-panel .form-check-input').on('change', function() {
var checked = $(this).prop('checked');
var value = $(this).val();
$('.searchHTMLcreated input[type="checkbox"], .searchHTMLcreated input[type="radio"]').each(function() {
if ($(this).val() === value) {
$(this).prop('checked', checked);
}
});
const checkedValues = $('#search_6484181b9d00a-panel .form-check-input').filter(':checked').map(function() {
return this.value;
}).get();
console.log('#search_6484181b9d00a-panel .form-check-input', checkedValues, JSON.stringify(checkedValues));
Cookies.set('created', JSON.stringify(checkedValues), {
expires: 365,
path: '/'
});
setSearchFilterIcon();
});
var savedCookies = Cookies.get('created');
if (savedCookies) {
var checkedValues = JSON.parse(savedCookies);
$('#search_6484181b9d00a-panel .form-check-input').each(function() {
this.checked = checkedValues.includes(this.value);
});
}
setSearchFilterIcon();
});
$(document).ready(function() {
searchInList('#search_6484181b9d3ba-search', '.search_6484181b9d3ba .form-check');
$('#search_6484181b9d3ba-panel .form-check-input').on('change', function() {
var checked = $(this).prop('checked');
var value = $(this).val();
$('.searchHTMLminViews input[type="checkbox"], .searchHTMLminViews input[type="radio"]').each(function() {
if ($(this).val() === value) {
$(this).prop('checked', checked);
}
});
const checkedValues = $('#search_6484181b9d3ba-panel .form-check-input').filter(':checked').map(function() {
return this.value;
}).get();
console.log('#search_6484181b9d3ba-panel .form-check-input', checkedValues, JSON.stringify(checkedValues));
Cookies.set('minViews', JSON.stringify(checkedValues), {
expires: 365,
path: '/'
});
setSearchFilterIcon();
});
var savedCookies = Cookies.get('minViews');
if (savedCookies) {
var checkedValues = JSON.parse(savedCookies);
$('#search_6484181b9d3ba-panel .form-check-input').each(function() {
this.checked = checkedValues.includes(this.value);
});
}
setSearchFilterIcon();
});
var searchTotalSelectedSearchIn = 0;
var searchSelectedCategoryVal = '';
var searchSelectedTagVal = '';
var searchSelectedCategory = '';
var searchSelectedTag = '';
function updateSearchSelectedValues() {
searchTotalSelectedSearchIn = $('#search-tab .form-check-input:checked').length;
searchSelectedCategoryVal = $('#filter-tab .form-check-input:checked').val();
searchSelectedTagVal = $('#filter-tags-tab .form-check-input:checked').val();
searchSelectedCategory = $('#filter-tab .form-check-input:checked').parent().find('.form-check-label').html();
searchSelectedTag = $('#filter-tags-tab .form-check-input:checked').parent().find('.form-check-label').html();
}
$(document).ready(function () {
$('#filterButton').click(function () {
$('#filterDropdown').toggleClass('show');
});
setSearchFilterIcon();
});
function setSearchFilterIcon() {
updateSearchSelectedValues();
$('#searchFieldsNamesBelowNavbar-dropdown .badge').text(searchTotalSelectedSearchIn);
$('#catNameBelowNavbar-dropdown').html(searchSelectedCategory);
$('#tagNameBelowNavbar-dropdown').html(searchSelectedTag);
// check if no filter checkboxes are checked and search_category0 is checked and search_tag0 is checked
if (searchTotalSelectedSearchIn === 0 && empty(searchSelectedCategoryVal) && empty(searchSelectedTagVal)) {
// add the text-muted icon to the filterButton
$('#filterButton').removeClass('active');
} else {
// remove the text-muted icon from the filterButton
$('#filterButton').addClass('active');
}
}
$(function () {
$("#navBarFlag").change(function () {
var selfURI = "https://tutorials.avideo.com/view/";
window.location.href = addGetParam(selfURI, 'lang', $(this).val());
});
});
$(document).ready(function () {
loadPL('78','6484181ba6bf0');
});
$(document).ready(function () {
loadPL('10','6484181bb8d17');
});
$(document).ready(function () {
loadPL('27','6484181bbd849');
});
$(document).ready(function () {
loadPL('78','6484181bc1196');
});
$(document).ready(function () {
loadPL('72','6484181bc40aa');
});
$(document).ready(function () {
loadPL('25','6484181bc8d15');
});
$(document).ready(function () {
loadPL('79','6484181bcd615');
});
$(document).ready(function () {
loadPL('84','6484181bd176d');
});
$(document).ready(function () {
loadPL('9','6484181bd64a7');
});
$(document).ready(function () {
loadPL('22','6484181bdaeef');
});
$(document).ready(function () {
loadPL('52','6484181bde9e3');
});
$(document).ready(function () {
loadPL('8','6484181be3025');
});
$(document).ready(function () {
loadPL('57','6484181be65c5');
});
$(document).ready(function () {
loadPL('111','6484181bf36ee');
});
$(document).ready(function () {
loadPL('110','6484181c03918');
});
$(document).ready(function () {
loadPL('109','6484181c07ddf');
});
$(document).ready(function () {
loadPL('104','6484181c0c9a8');
});
$(document).ready(function () {
loadPL('103','6484181c118f7');
});
$(document).ready(function () {
loadPL('86','6484181c16087');
});
$(document).ready(function () {
loadPL('84','6484181c1910c');
});
$(document).ready(function () {
loadPL('82','6484181c1c5f1');
});
$(document).ready(function () {
loadPL('81','6484181c21f4d');
});
$(document).ready(function () {
loadPL('80','6484181c27232');
});
$(document).ready(function () {
loadPL('79','6484181c29ae4');
});
$(document).ready(function () {
loadPL('78','6484181c2ad38');
});
$(document).ready(function () {
loadPL('10','6484181c33db1');
});
$(document).ready(function () {
loadPL('27','6484181c351c0');
});
$(document).ready(function () {
loadPL('78','6484181c36384');
});
$(document).ready(function () {
loadPL('9','6484181c375a3');
});
$(document).ready(function () {
loadPL('20','6484181c39ea9');
});
$(document).ready(function () {
loadPL('6','6484181c3e10a');
});
$(document).ready(function () {
loadPL('25','6484181c41224');
});
$(document).ready(function () {
loadPL('17','6484181c43b8b');
});
$(document).ready(function () {
loadPL('18','6484181c48031');
});
$(document).ready(function () {
loadPL('7','6484181c4caf0');
});
$(document).ready(function () {
loadPL('16','6484181c509fd');
});
$(document).ready(function () {
loadPL('24','6484181c5495c');
});
$(function () {
/** showAlertMessage **/
/** showAlertMessage !requestComesFromSafePlace [] **/ });
$(document).ready(function () {
});
function startRecorderCallback(json){
setIsRecording(json.key);
}
function stopRecorderCallback(json){
setIsNotRecording(json.key);
}
function setIsRecording(key) {
$('.isRecordingIcon'+key).addClass('isRecording');
}
function setIsNotRecording(key) {
$('.isRecordingIcon'+key).removeClass('isRecording');
}
function getBeatJSSelector(key, live_servers_id){
live_servers_id = parseInt(live_servers_id);
if(isNaN(live_servers_id)){
live_servers_id = 0;
}
var selector = '.liveUsersViews_' + key +
', .liveUsersViews_' + key +
'_' + live_servers_id +
', .views_on_total_on_live_' + key +
'_' + live_servers_id;
console.log('getBeatJSSelector', selector);
return selector;
}
function updateViewsLiveUsersBeat(key, live_servers_id, total) {
console.log('updateViewsLiveUsersBeat', key, live_servers_id, total);
$(getBeatJSSelector(key, live_servers_id)).text(total);
}
function socketLiveUsersBeat(json) {
console.log('socketLiveUsersBeat', json.users);
var total = json.total;
if (!total && json.views) {
total = json.views;
}else if (!total && json.users && json.users.views) {
total = json.users.views;
}
var key = json.transmition_key;
if (!key && json.users && json.users.key) {
key = json.users.key;
}else if (!key && json.key) {
key = json.key;
}
var live_servers_id = json.live_servers_id;
if (!live_servers_id && json.users && json.users.live_servers_id) {
live_servers_id = json.users.live_servers_id;
}
updateViewsLiveUsersBeat(key, live_servers_id, total);
}
var liveLinkAppsCalled = {};
function liveLinkApps($liveLi, className, live_starts) {
if (new Date(live_starts).getTime() < new Date().getTime()) {
return false;
}
if (typeof liveLinkAppsCalled[className] !== 'undefined') { // do not call it twice
//return false;
}
//console.log('liveLinkApps', $liveLi, className, live_starts, $liveLi.find('.liveNow'));
liveLinkAppsCalled[className] = live_starts;
$liveLi.find('.liveNow').html("Starts in " + live_starts + "");
$liveLi.find('.liveNow').attr("class", 'label label-primary liveFuture');
//console.log('liveLinkApps', '.'+className+' '+live_starts);
startTimerToDate(live_starts, '.Timer_' + className, false);
return $liveLi;
}
$(document).ready(function () {
$("#searchForm").attr("onsubmit", "return false;"); // tu="off"
$("#searchForm input[name=search]").click(function () {
if ($("#searchForm input[name=search]").val() != "") {
$("#liveSearchResult").show();
} else {
$("#liveSearchResult").hide();
}
});
$("#searchForm input[name=search]").focus(function () {
if ($("#searchForm input[name=search]").val() != "") {
$("#liveSearchResult").show();
} else {
$("#liveSearchResult").hide();
}
});
$(document).mouseup(function (e) {
var container = $("#liveSearchResult");
if (!container.is(e.target) && container.has(e.target).length === 0) {
container.hide();
}
});
//$("#searchForm").append("");
$("#searchForm input[name=search]").on("input", function () {
if ($("#searchForm input[name=search]").val() == "") {
$("#liveSearchResult").hide();
}
});
});
var linksToFullscreenAutocompleteTimeout;
var livesearchAutocompleteSelected = false;
var livesearchAutocompleteCliked = false;
$(function () {
if($("#searchForm input[name=search]").length){
$("#searchForm input[name=search]").autocomplete({
minLength: 0,
source: function (req, res) {
const searchFieldsNames = $('#searchForm input[name="searchFieldsNames[]"]:checked').map(function() {
return $(this).val();
}).get();
//console.log(searchFieldsNames);
const catName = $('#searchForm input[name="catName"]:checked').val();
console.log('autocomplete',req, res);
$.ajax({
url: webSiteRootURL + 'plugin/Livesearch/myVideos.json.php',
type: "GET",
data: {
searchPhrase: req.term,
searchFieldsNames: searchFieldsNames,
catName: catName,
},
success: function (data) {
console.log("autocomplete data received");
res(data.response.rows);
if (typeof linksToFullscreen == 'function') {
clearTimeout(linksToFullscreenAutocompleteTimeout);
linksToFullscreenAutocompleteTimeout = setTimeout(function () {
console.log('autocomplete linksToFullscreen .ui-autocomplete a');
}, 50);
}
}
});
},
focus: function (event, ui) {
//$("#searchForm input[name=search]").val(ui.item.title);
return false;
},
select: function (event, ui) {
console.log("autocomplete select");
if (livesearchAutocompleteCliked) {
console.log("autocomplete select already clicked");
return true;
}
livesearchAutocompleteSelected = true;
clearTimeout(linksToFullscreenAutocompleteTimeout);
linksToFullscreenAutocompleteTimeout = setTimeout(function () {
console.log("autocomplete trigger click");
livesearchAutocompleteCliked = true;
if (!$('#livesearch_autocomplete_' + ui.item.id).hasClass('linksToFullscreen')) {
document.location = $('#livesearch_autocomplete_' + ui.item.id).attr('href');
} else {
$('#livesearch_autocomplete_' + ui.item.id).trigger('click');
}
setTimeout(function () {
livesearchAutocompleteCliked = false;
}, 1000);
}, 50);
return false;
},
search: function (event, ui) {
//$("#liveSearchResult").empty();
console.log("autocomplete search");
}
}).autocomplete("instance")._renderItem = function (ul, item) {
var sr = $("#searchRow").clone();
sr.css("display", "block");
var html = sr.html();
html = html.replace(new RegExp("{id}", 'g'), item.id);
html = html.replace(new RegExp("{href}", 'g'), item.link);
html = html.replace(new RegExp("{embed}", 'g'), item.embedUrl);
html = html.replace(new RegExp("{filename}", 'g'), item.filename);
html = html.replace(new RegExp("{imgURL}", 'g'), ' ');
html = html.replace(new RegExp("{clean_category}", 'g'), item.clean_category);
html = html.replace(new RegExp("{category}", 'g'), item.category);
html = html.replace(new RegExp("{title}", 'g'), item.title);
html = html.replace(new RegExp("{description}", 'g'), item.description);
//$("#liveSearchResult").show();
var append = $("").append(html).appendTo(ul);
return append;
};
$("#searchForm input[name=search]").keydown(function (event) {
if (event.keyCode == 13) {
if (livesearchAutocompleteSelected) {
console.log("autocomplete keydown already selected");
livesearchAutocompleteSelected = false;
return false;
}
if ($("#searchForm input[name=search]").val().length == 0) {
event.preventDefault();
return false;
} else {
clearTimeout(linksToFullscreenAutocompleteTimeout);
linksToFullscreenAutocompleteTimeout = setTimeout(function () {
console.log("autocomplete trigger keydown");
$("#searchForm").submit();
}, 1000);
}
}
});
}
});
var playListsAdding = false;
var playList = [];
async function reloadPlayLists() {
if (!isOnline()) {
return false;
}
//console.log('reloadPlayLists');
$.ajax({
url: webSiteRootURL + 'objects/playlists.json.php',
success: function (response) {
playList = response;
reloadPlayListButtons();
}
});
}
function reloadPlayListButtons() {
//console.log('reloadPlayListButtons');
$('.watchLaterBtnAdded').hide();
$('.favoriteBtnAdded').hide();
$('.watchLaterBtn').show();
$('.favoriteBtn').show();
for (var i in playList) {
if (!playList[i].id || (playList[i].status !== 'watch_later' && playList[i].status !== 'favorite')) {
continue;
}
for (var x in playList[i].videos) {
if (typeof (playList[i].videos[x]) === 'object') {
if (playList[i].status === 'watch_later') {
$('.watchLaterBtn' + playList[i].videos[x].videos_id).hide();
$('.watchLaterBtnAdded' + playList[i].videos[x].videos_id).show();
} else if (playList[i].status === 'favorite') {
$('.favoriteBtn' + playList[i].videos[x].videos_id).hide();
$('.favoriteBtnAdded' + playList[i].videos[x].videos_id).show();
}
}
}
}
}
loadPlayListsResponseObject = {timestamp: 0, response: false};
async function loadPlayLists(videos_id, crc) {
//console.log('loadPlayLists');
if (loadPlayListsResponseObject.timestamp + 5000 < Date.now()) {
loadPlayListsResponseObject.timestamp = Date.now();
loadPlayListsResponseObject.response = [];
setTimeout(function () {
$.ajax({
url: webSiteRootURL+'objects/playlists.json.php',
cache: true,
success: function (response) {
loadPlayListsResponseObject.response = response;
loadPlayListsResponse(loadPlayListsResponseObject.response, videos_id, crc);
}
});
;
}, 500);
} else {
if (loadPlayListsResponseObject.response) {
loadPlayListsResponse(loadPlayListsResponseObject.response, videos_id, crc);
} else {
setTimeout(function () {
loadPlayLists(videos_id, crc);
}, 1500);
}
}
}
var listGroupItemTemplate = "\n \n <\/i> \n <\/button>\n \n <\/i> \n <\/button>\n \n <\/i> \n {name_translated}<\/span>\n <\/span>\n \n \n <\/label>\n <\/div>\n<\/a>";
async function loadPlayListsResponse(response, videos_id, crc) {
//console.log('loadPlayListsResponse');
//console.log(response, videos_id, crc);
$('.searchlist' + videos_id + crc).html('');
for (var i in response) {
if (!response[i].id) {
continue;
}
var icon = "fa fa-lock"
if (response[i].status == "public") {
icon = "fa fa-globe"
} else if (response[i].status == "watch_later") {
icon = "fas fa-clock"
} else if (response[i].status == "favorite") {
icon = "fas fa-heart"
}
var checked = "";
for (var x in response[i].videos) {
if (typeof (response[i].videos[x]) === 'object' && response[i].videos[x].videos_id == videos_id) {
checked = "checked";
}
}
var randId = (("_" + response[i].id) + videos_id) + Math.random();
var itemsArray = {};
itemsArray.icon = icon;
itemsArray.id = response[i].id;
itemsArray.name_translated = response[i].name_translated;
itemsArray.response_id = response[i].id + '' + videos_id;
itemsArray.checked = checked;
itemsArray.videos_id = videos_id;
itemsArray.randId = randId;
$(".searchlist" + videos_id + crc).append(arrayToTemplate(itemsArray, listGroupItemTemplate));
}
$('.searchlist' + videos_id + crc).btsListFilter('#searchinput' + videos_id + crc, {itemChild: '.nameSearch', initial:false});
$('.playListsVideosIds' + videos_id).change(function () {
if (playListsAdding) {
return false;
}
playListsAdding = true;
addVideoToPlayList(videos_id, $(this).is(":checked"), $(this).val());
return false;
});
}
function addVideoToPlayList(videos_id, isChecked, playlists_id) {
//console.log('addVideoToPlayList');
modal.showPleaseWait();
$.ajax({
url: webSiteRootURL + 'objects/playListAddVideo.json.php',
method: 'POST',
data: {
'videos_id': videos_id,
'add': isChecked,
'playlists_id': playlists_id
},
success: function (response) {
reloadPlayLists();
//console.log(".playListsIds_" + playlists_id + '_videos_id_' + videos_id);
$(".playListsIds_" + playlists_id + '_videos_id_' + videos_id).prop("checked", isChecked);
modal.hidePleaseWait();
setTimeout(function () {
playListsAdding = false
}, 500);
}
});
}
$(document).ready(function () {
reloadPlayLists();
});
var webSocketSelfURI = 'https://tutorials.avideo.com/view/';
var webSocketVideos_id = '0';
var webSocketLiveKey = 'false';
var webSocketServerVersion = '4.2';
var webSocketToken = '';
var webSocketURL = '';
var webSocketTypes = {"OPEN_CONNECTION":"OPEN_CONNECTION","NEW_CONNECTION":"NEW_CONNECTION","NEW_DISCONNECTION":"NEW_DISCONNECTION","DEFAULT_MESSAGE":"DEFAULT_MESSAGE","ON_VIDEO_MSG":"ON_VIDEO_MSG","ON_LIVE_MSG":"ON_LIVE_MSG","TESTING":"TESTING"};
function onUserSocketConnect(response) {
try {
for (const key in response.users_id_online) {
if (Object.hasOwnProperty.call(response.users_id_online, key)) {
const element = response.users_id_online[key];
$('#caller'+element.users_id).show();
$('.users_id_'+element.users_id).addClass('online');
}
}
for (const key in response.users_id_online) {
if (Object.hasOwnProperty.call(response.users_id_online, key)) {
const element = response.users_id_online[key];
if (room_users_id == element.room_users_id) {
appentChatUser(element.users_id, element.identification, element.chat_is_banned);
}
}
}
callerNewConnection(response);socketNewConnection(response); } catch (e) {
console.log('onUserSocketConnect:error', e.message);
}
}
function onUserSocketDisconnect(response) {
try {
$('#caller'+response.msg.users_id).hide();
$('.users_id_'+response.msg.users_id).removeClass('online');if(typeof changeChat2UserStatus === 'function'){
changeChat2UserStatus(response.msg.users_id, 'f', false);
}callerDisconnection(response);socketDisconnection(response); } catch (e) {
console.log('onUserSocketConnect:error', e.message);
}
}
$(document).ready(function () {
});
$(function () {setTimeout(function(){if(typeof $("#mainNavBar").autoHidingNavbar == "function"){$("#mainNavBar").autoHidingNavbar();}},5000);});
$(function () {
$("#mainNavBar").on("show.autoHidingNavbar", function () {
if ($(window).scrollTop() < 10) {
$("body").removeClass("nopadding");
}
});
$("#mainNavBar").on("hide.autoHidingNavbar", function () {
if ($(window).scrollTop() < 10) {
$("body").addClass("nopadding");
}
});
});
iframeAllowAttributes = 'allow="fullscreen;autoplay;camera *;microphone *;" allowfullscreen="allowfullscreen" mozallowfullscreen="mozallowfullscreen" msallowfullscreen="msallowfullscreen" oallowfullscreen="oallowfullscreen" webkitallowfullscreen="webkitallowfullscreen"';
var offlineVideoDbName = 'videos_offlineDb_0';
var videoOfflineExpiration = 168;
var checkFooterTimout;
$(function () {
checkFooter();
$(window).scroll(function () {
clearTimeout(checkFooterTimout);
checkFooterTimout = setTimeout(function () {
checkFooter();
}, 100);
});
$(window).resize(function () {
clearTimeout(checkFooterTimout);
checkFooterTimout = setTimeout(function () {
checkFooter();
}, 100);
});
$(window).mouseup(function () {
clearTimeout(checkFooterTimout);
checkFooterTimout = setTimeout(function () {
checkFooter();
}, 100);
});
});
function checkFooter() {
$("#mainFooter").fadeIn();
var height = $("#mainFooter").height();
if (height < 150 && getPageHeight() <= $(window).height()) {
clearTimeout(checkFooterTimout);
checkFooterTimout = setTimeout(function () {
checkFooter();
}, 1000);
$("#mainFooter").css("position", "fixed");
$('body').css('padding-bottom', height+'px');
} else {
$("#mainFooter").css("position", "relative");
$('body').css('padding-bottom', '');
}
}
function getPageHeight() {
var mainNavBarH = 0;
if ($('#mainNavBar').length) {
mainNavBarH = $('#mainNavBar').height();
}
var mainFooterH = 0;
if ($('#mainFooter').length) {
mainFooterH = $('#mainFooter').height();
}
var containerH = getLargerContainerHeight();
return mainNavBarH + mainFooterH + containerH;
}
function getLargerContainerHeight() {
var conteiners = $('body > .container,body > .container-fluid');
var height = 0;
for (var item in conteiners) {
if (isNaN(item)) {
continue;
}
var h = $(conteiners[item]).height();
if (h > height) {
height = h;
}
}
return height;
}
$(document).ready(function () {
$('#TrailerModal').on('hidden.bs.modal', function () {
$('#TrailerModal iframe').attr('src', '');
});
$('#bigVideoCarousel').bind('slide.bs.carousel', function (e) {
setTimeout(function(){
lazyImage();
},500);
});
});