<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">$(document).ready(function () {
    //Top nav line widget:begin    
    topNavPanel.init();
    //Top nav line widget:end
    //Popular video widget
    popularVideoPanel.init();
    //All widgets::begin
    //Init Scroll for All widgets 
    if ($('#fmeFriendStatusWrp').length != 0) {
       // $('#fmeFriendStatusWrp').mCustomScrollbar();
        $('#VideoWDGContentWrp').mCustomScrollbar();
        $('#ClassifiedWDGContentWrp').mCustomScrollbar();
        $('#NetworksWDGContentWrp').mCustomScrollbar();
        $('#MembersWDGContentWrp').mCustomScrollbar();
        $('#ImageWDGContentWrp').mCustomScrollbar();
        $('#ProductsWDGContentWrp').mCustomScrollbar();
        $('#BlogsWDGContentWrp').mCustomScrollbar();
    }
    //All widgets::end
    topWidgetsManager.init();
    //put white bg after control panel
    leftColumnBg.setHeightOfColumn();
    leftColumnBg.setHeightOfMembersWidget();
    //columnEqualizer.init();
	
    ControlPanel.init();

		//searchByTagManager.showHideSearchInput_Header($('#SitsIconInTheHeader'));
    //learn more link in the header
    searchByTagManager.openLearnMoreHeaderPage();


    //menu links
    linkAndEventManager.init();

    //lazy load for status widget
    lazyLoadStatusIcon.init();

    
    //init sign in / log in popup 
   //SignInPopup.init();

    //init Top cities dropdown
    ShopCenterCategory.init();
  ShopCenterCategory1.init();
    ShopCenterCategory2.init();
 ShopCenterCategory3.init();
  ShopCenterCategory4.init();
   ShopCenterCategory5.init();
   ShopCenterCategory6.init();
		 TopSearchCategory.init();
		BizCategory.init();
    //init control for admin widget
    AdminPanelObj.init();
});

var AdminPanelObj = {
    isShown: false,
    isLoaded: false,
    OpenModeStyle: 'width:185px;padding-bottom:0px; position: absolute',
    wrpClass: '.js-admin-panel-wrp',
    $wrpClass: '',
    thirdColumnWrp: '#ThirdColumnContent',
    $thirdColumnWrp: '',
    showBtn: '.js-adpanel-show-btn',
    $showBtn: '',
    showLabel: 'Show Admin Side Widget',
    hideLabel: 'Hide Admin Side Widget',
    widgetUrl: '/dashboard/admin_widget_ajax.asp',
    siteRoot: 'https://www.storeboard.com/',
    defaultHtml: '&lt;div class="js-admin-panel-wrp"&gt;&lt;div style="position:relative"&gt;&lt;div style="padding-right:10px;margin-left:9px;margin-right:12px;"id="AdminWidget"&gt;' +
        '&lt;div style="display:inline-block;background:#0FACEB;overflow:hidden;width:100%;"&gt;' +
        '&lt;table border="0" cellpadding="0" cellspacing="0" width="145" style="width:100%;"&gt;' +
          '&lt;tbody&gt;&lt;tr style="height:30px"&gt;' +
            '&lt;td class="widget-hdr fb" style="font-size:14px;color:#FFFFFF" align="center"&gt;Admin Tools &lt;span class="close-admin-widget-btn" onclick="AdminPanelObj.showHideEvent()"&gt;&lt;/span&gt;&lt;/td&gt;' +
          '&lt;/tr&gt;' +
          '&lt;tr&gt;&lt;td style="width:100%;text-align:center;padding:30px 0px 720px;background:#fff;"&gt;&lt;div class="load-gif_img" style="width: 100%;"&gt;&lt;img src="/images/schemes/lblu/trans_ajax_loader.gif" alt="Loading..."&gt;&lt;/div&gt;' +
                '&lt;div class="load-gif_txt f5"&gt;&amp;nbsp;Loading...&lt;/div&gt;&lt;/td&gt;' +
          '&lt;/tr&gt;' +
        '&lt;/tbody&gt;&lt;/table&gt;' +
        '&lt;/div&gt;' +
        '&lt;/div&gt;' +
        '&lt;/div&gt;&lt;/div&gt;',
    init: function () {
        AdminPanelObj.$wrpClass = $(AdminPanelObj.wrpClass);
        if (AdminPanelObj.$wrpClass.length != 0) {
            AdminPanelObj.$showBtn = $(AdminPanelObj.showBtn);
            AdminPanelObj.$showBtn.fadeIn(0);
        }
    },
    createUrl: function () {
        AdminPanelObj.widgetUrl += '?cp_LocalPageID=' + AdminPanelObj.$wrpClass.attr('data-cp_LocalPageID');
        AdminPanelObj.widgetUrl += '&amp;nLocalPageAdmin=' + AdminPanelObj.$wrpClass.attr('data-nLocalPageAdmin');
        AdminPanelObj.widgetUrl += '&amp;PageURL=' + AdminPanelObj.$wrpClass.attr('data-PageURL');
        AdminPanelObj.widgetUrl += '&amp;altTitle=' + AdminPanelObj.$wrpClass.attr('data-altTitle');
        AdminPanelObj.widgetUrl += '&amp;cp_PrCity=' + AdminPanelObj.$wrpClass.attr('data-cp_PrCity');
        AdminPanelObj.widgetUrl += '&amp;cp_PrStateID=' + AdminPanelObj.$wrpClass.attr('data-cp_PrStateID');
        AdminPanelObj.widgetUrl += '&amp;cp_PrCountryID=' + AdminPanelObj.$wrpClass.attr('data-cp_PrCountryID');
        AdminPanelObj.widgetUrl += '&amp;CountryCity=' + AdminPanelObj.$wrpClass.attr('data-CountryCity');
        AdminPanelObj.widgetUrl += '&amp;StatePage=' + AdminPanelObj.$wrpClass.attr('data-StatePage');
        AdminPanelObj.widgetUrl += '&amp;cp_Neighborhood=' + AdminPanelObj.$wrpClass.attr('data-cp_Neighborhood');
    },
    showHideEvent: function () {
        if (!AdminPanelObj.isShown) {
            AdminPanelObj.$thirdColumnWrp = $(AdminPanelObj.thirdColumnWrp);
            AdminPanelObj.isShown = true;
            if (!AdminPanelObj.isLoaded) {
                profilePopup.close();
                AdminPanelObj.$thirdColumnWrp.attr('style', 'width:568px');
                AdminPanelObj.isLoaded = true;
                AdminPanelObj.$wrpClass.html(AdminPanelObj.defaultHtml);
                AdminPanelObj.createUrl();

                $.get(AdminPanelObj.widgetUrl, function (data, status) {
                    AdminPanelObj.$wrpClass.html(data);
                    AdminPanelObj.$thirdColumnWrp.attr('style', 'width:568px');
                    AdminPanelObj.isLoaded = true;
                    AdminPanelObj.$wrpClass.fadeIn(0);
                    AdminPanelObj.$showBtn.find('span').first().html(AdminPanelObj.hideLabel);
                });
            }
            else {
                AdminPanelObj.$thirdColumnWrp.attr('style', 'width:568px');
                AdminPanelObj.$wrpClass.fadeIn(0);
                AdminPanelObj.$showBtn.find('span').first().html(AdminPanelObj.hideLabel);
            }
        }
        else {
            AdminPanelObj.isShown = false;
            AdminPanelObj.$thirdColumnWrp.attr('style', '');
            AdminPanelObj.$wrpClass.fadeOut(0);
            AdminPanelObj.$showBtn.find('span').first().html(AdminPanelObj.showLabel);
        }

    }

}
//top links widget Networks,Channels, Locations
var TopLinksFrame = {
    cssMark: 'js-showed',
    $ddlLabel: '',
    openCloseDdl: function ($this) {
        if (TopLinksFrame.$ddlLabel == '') {
            TopLinksFrame.$ddlLabel = $this;
        }
        if (TopLinksFrame.$ddlLabel.hasClass(TopLinksFrame.cssMark)) {
            TopLinksFrame.$ddlLabel.removeClass(TopLinksFrame.cssMark);
            TopLinksFrame.$ddlLabel.next().slideUp();
        }
        else {
            TopLinksFrame.$ddlLabel.addClass(TopLinksFrame.cssMark)

            TopLinksFrame.$ddlLabel.next().slideDown();
            //close humburger menu
            navPopupPanel.closeEvent();
        }
    },
    closeEvent: function () {//close Top Links ddl
        if (TopLinksFrame.$ddlLabel == '') {
            TopLinksFrame.$ddlLabel = $('#TopLinkDdlLabel');
        }
        TopLinksFrame.$ddlLabel.removeClass(TopLinksFrame.cssMark);
        TopLinksFrame.$ddlLabel.next().slideUp(0);
    }
}

var ShopCenterCategory = {
    mallLabel: '',
    productLabel: '',
	TopsearchproductLabel: '',
    init: function () {
        ShopCenterCategory.mallLabel = $('.js-sh-center_ddl  div.js-mallCategories &gt; span');
		 TopSearchCategory.TopsearchproductLabel = $('.js-sh1-center_ddl div.js-TopSearchCategories &gt; span');
        ShopCenterCategory.productLabel = $('.js-sh-center_ddl div.js-productCategories &gt; span');

        if ($('.js-sh-center_ddl').length != 0) {
            $('.js-sh-center_ddl &gt; div').each(function () {
                customDDL.init($(this));
                if ($(this).find('ul').length != 0) {
                    $(this).find('ul').mCustomScrollbar();
                }
                $(this).find('ul li&gt; span').each(function () {
                    $(this).on('click', function () {
                        var isMallCategoryDdl = $(this).parents('.js-mallCategories').length != 0;
                        if (isMallCategoryDdl) {
                            ShopCenterCategory.mallLabel.text($(this).attr('data-name'));
                            ShopCenterCategory.productLabel.text('Product Categories');
                        }
                        else {
                            ShopCenterCategory.productLabel.text($(this).attr('data-MediaType'));
							ShopCenterCategory.mallLabel.text('Mall Categories');
                        }
                        customDDL.closeEvent($(this).parent().parent().parent().parent('ul'));
                    });
                });
            });
        }
    }
}

var ShopCenterCategory1 = {
    mallLabel: '',
    productLabel: '',
	TopsearchproductLabel: '',
    init: function () {
        ShopCenterCategory1.mallLabel = $('.js-sh-center_ddl1  div.js-mallCategories &gt; span');
		 TopSearchCategory.TopsearchproductLabel = $('.js-sh1-center_ddl1 div.js-TopSearchCategories &gt; span');
        ShopCenterCategory1.productLabel = $('.js-sh-center_ddl1 div.js-productCategories &gt; span');

        if ($('.js-sh-center_ddl1').length != 0) {
            $('.js-sh-center_ddl1 &gt; div').each(function () {
                customDDL.init($(this));
                if ($(this).find('ul').length != 0) {
                    $(this).find('ul').mCustomScrollbar();
                }
                $(this).find('ul li&gt; span').each(function () {
                    $(this).on('click', function () {
                        var isMallCategoryDdl = $(this).parents('.js-mallCategories').length != 0;
                        if (isMallCategoryDdl) {
                            ShopCenterCategory1.mallLabel.text($(this).attr('data-name'));
                            ShopCenterCategory1.productLabel.text('Product Categories');
                        }
                        else {
                            ShopCenterCategory1.productLabel.text($(this).attr('data-MediaType'));
							ShopCenterCategory1.mallLabel.text('Mall Categories');
                        }
                        customDDL.closeEvent($(this).parent().parent().parent().parent('ul'));
                    });
                });
            });
        }
    }
}

var ShopCenterCategory2 = {
    mallLabel: '',
    productLabel: '',
	TopsearchproductLabel: '',
    init: function () {
        ShopCenterCategory2.mallLabel = $('.js-sh-center_ddl2  div.js-mallCategories &gt; span');
		 TopSearchCategory.TopsearchproductLabel = $('.js-sh1-center_ddl2 div.js-TopSearchCategories &gt; span');
        ShopCenterCategory2.productLabel = $('.js-sh-center_ddl2 div.js-productCategories &gt; span');

        if ($('.js-sh-center_ddl2').length != 0) {
            $('.js-sh-center_ddl2 &gt; div').each(function () {
                customDDL.init($(this));
                if ($(this).find('ul').length != 0) {
                    $(this).find('ul').mCustomScrollbar();
                }
                $(this).find('ul li&gt; span').each(function () {
                    $(this).on('click', function () {
                        var isMallCategoryDdl = $(this).parents('.js-mallCategories').length != 0;
                        if (isMallCategoryDdl) {
                            ShopCenterCategory2.mallLabel.text($(this).attr('data-name'));
                            ShopCenterCategory2.productLabel.text('Product Categories');
                        }
                        else {
                            ShopCenterCategory2.productLabel.text($(this).attr('data-MediaType'));
							ShopCenterCategory2.mallLabel.text('Mall Categories');
                        }
                        customDDL.closeEvent($(this).parent().parent().parent().parent('ul'));
                    });
                });
            });
        }
    }
}

var ShopCenterCategory3 = {
    mallLabel: '',
    productLabel: '',
	TopsearchproductLabel: '',
    init: function () {
        ShopCenterCategory3.mallLabel = $('.js-sh-center_ddl3  div.js-mallCategories &gt; span');
		 TopSearchCategory.TopsearchproductLabel = $('.js-sh1-center_ddl3 div.js-TopSearchCategories &gt; span');
        ShopCenterCategory3.productLabel = $('.js-sh-center_ddl3 div.js-productCategories &gt; span');

        if ($('.js-sh-center_ddl3').length != 0) {
            $('.js-sh-center_ddl3 &gt; div').each(function () {
                customDDL.init($(this));
                if ($(this).find('ul').length != 0) {
                    $(this).find('ul').mCustomScrollbar();
                }
                $(this).find('ul li&gt; span').each(function () {
                    $(this).on('click', function () {
                        var isMallCategoryDdl = $(this).parents('.js-mallCategories').length != 0;
                        if (isMallCategoryDdl) {
                            ShopCenterCategory3.mallLabel.text($(this).attr('data-name'));
                            ShopCenterCategory3.productLabel.text('Product Categories');
                        }
                        else {
                            ShopCenterCategory3.productLabel.text($(this).attr('data-MediaType'));
							ShopCenterCategory3.mallLabel.text('Mall Categories');
                        }
                        customDDL.closeEvent($(this).parent().parent().parent().parent('ul'));
                    });
                });
            });
        }
    }
}

var ShopCenterCategory4 = {
    mallLabel: '',
    productLabel: '',
	TopsearchproductLabel: '',
    init: function () {
        ShopCenterCategory4.mallLabel = $('.js-sh-center_ddl4  div.js-mallCategories &gt; span');
		 TopSearchCategory.TopsearchproductLabel = $('.js-sh1-center_ddl4 div.js-TopSearchCategories &gt; span');
        ShopCenterCategory4.productLabel = $('.js-sh-center_ddl4 div.js-productCategories &gt; span');

        if ($('.js-sh-center_ddl4').length != 0) {
            $('.js-sh-center_ddl4 &gt; div').each(function () {
                customDDL.init($(this));
                if ($(this).find('ul').length != 0) {
                    $(this).find('ul').mCustomScrollbar();
                }
                $(this).find('ul li&gt; span').each(function () {
                    $(this).on('click', function () {
                        var isMallCategoryDdl = $(this).parents('.js-mallCategories').length != 0;
                        if (isMallCategoryDdl) {
                            ShopCenterCategory4.mallLabel.text($(this).attr('data-name'));
                            ShopCenterCategory4.productLabel.text('Product Categories');
                        }
                        else {
                            ShopCenterCategory4.productLabel.text($(this).attr('data-MediaType'));
							ShopCenterCategory4.mallLabel.text('Mall Categories');
                        }
                        customDDL.closeEvent($(this).parent().parent().parent().parent('ul'));
                    });
                });
            });
        }
    }
}

var ShopCenterCategory5 = {
    mallLabel: '',
    productLabel: '',
	TopsearchproductLabel: '',
    init: function () {
        ShopCenterCategory5.mallLabel = $('.js-sh-center_ddl5  div.js-mallCategories &gt; span');
		 TopSearchCategory.TopsearchproductLabel = $('.js-sh1-center_ddl5 div.js-TopSearchCategories &gt; span');
        ShopCenterCategory5.productLabel = $('.js-sh-center_ddl5 div.js-productCategories &gt; span');

        if ($('.js-sh-center_ddl5').length != 0) {
            $('.js-sh-center_ddl5 &gt; div').each(function () {
                customDDL.init($(this));
                if ($(this).find('ul').length != 0) {
                    $(this).find('ul').mCustomScrollbar();
                }
                $(this).find('ul li&gt; span').each(function () {
                    $(this).on('click', function () {
                        var isMallCategoryDdl = $(this).parents('.js-mallCategories').length != 0;
                        if (isMallCategoryDdl) {
                            ShopCenterCategory5.mallLabel.text($(this).attr('data-name'));
                            ShopCenterCategory5.productLabel.text('Product Categories');
                        }
                        else {
                            ShopCenterCategory5.productLabel.text($(this).attr('data-MediaType'));
							ShopCenterCategory5.mallLabel.text('Mall Categories');
                        }
                        customDDL.closeEvent($(this).parent().parent().parent().parent('ul'));
                    });
                });
            });
        }
    }
}

var ShopCenterCategory6 = {
    mallLabel: '',
    productLabel: '',
	TopsearchproductLabel: '',
    init: function () {
        ShopCenterCategory6.mallLabel = $('.js-sh-center_ddl6  div.js-mallCategories &gt; span');
		 TopSearchCategory.TopsearchproductLabel = $('.js-sh1-center_ddl6 div.js-TopSearchCategories &gt; span');
        ShopCenterCategory6.productLabel = $('.js-sh-center_ddl6 div.js-productCategories &gt; span');

        if ($('.js-sh-center_ddl6').length != 0) {
            $('.js-sh-center_ddl6 &gt; div').each(function () {
                customDDL.init($(this));
                if ($(this).find('ul').length != 0) {
                    $(this).find('ul').mCustomScrollbar();
                }
                $(this).find('ul li&gt; span').each(function () {
                    $(this).on('click', function () {
                        var isMallCategoryDdl = $(this).parents('.js-mallCategories').length != 0;
                        if (isMallCategoryDdl) {
                            ShopCenterCategory6.mallLabel.text($(this).attr('data-name'));
                            ShopCenterCategory6.productLabel.text('Product Categories');
                        }
                        else {
                            ShopCenterCategory6.productLabel.text($(this).attr('data-MediaType'));
							ShopCenterCategory6.mallLabel.text('Mall Categories');
                        }
                        customDDL.closeEvent($(this).parent().parent().parent().parent('ul'));
                    });
                });
            });
        }
    }
}
var TopSearchCategory = {
    mallLabel: '',
    TopsearchproductLabel: '',
	productLabel: '',
    init: function () {
        TopSearchCategory.TopsearchproductLabel = $('.js-sh1-center_ddl div.js-TopSearchCategories &gt; span');
	//	ShopCenterCategory.productLabel = $('.js-sh-center_ddl div.js-productCategories &gt; span');
        if ($('.js-sh1-center_ddl').length != 0) {
            $('.js-sh1-center_ddl &gt; div').each(function () {
                customDDL.init($(this));
                if ($(this).find('ul').length != 0) {
                    $(this).find('ul').mCustomScrollbar();
                }
                $(this).find('ul li&gt; span').each(function () {
                    $(this).on('click', function () {
					TopSearchCategory.TopsearchproductLabel.text($(this).attr('data-MediaType'));
					document.frmMainSearch.KeySearchURL.value=$(this).attr('data-keysearchurl');
					document.frmMainSearch.NoSearchURL.value=$(this).attr('data-nosearchurl');
                     document.frmMainSearch.action=document.frmMainSearch.KeySearchURL.value
					
					 customDDL.closeEvent($(this).parent().parent().parent().parent('ul'));
                    });
                });
            });
        }
    }
}
var BizCategory = {
    Label: '',
    init: function () {
        BizCategory.Label = $('.js-biz-ddl div.js-bizCategories &gt; span');
			
        if ($('.js-biz-ddl').length != 0) {
            $('.js-biz-ddl &gt; div').each(function () {
                customDDL.init($(this));
                if ($(this).find('ul').length != 0) {
                    $(this).find('ul').mCustomScrollbar();
                }
                $(this).find('ul li&gt; span').each(function () {
                    $(this).on('click', function () {
                       
						BizCategory.Label.text($(this).attr('data-name'));
												
                        customDDL.closeEvent($(this).parent().parent().parent().parent('ul'));
                    });
                });
            });
        }
    }
}


var VideoDeleteManager = {
    isInited: false,
    $dltBtn: '',
    url: '/profile/Video_delete_popup.asp?iframe=1&amp;Action=DeleteAllSelected',
    init: function () {
       /* if (!VideoDeleteManager.isInited) {
            VideoDeleteManager.$dltBtn = $('#DeleteCheckedBtn');
            VideoDeleteManager.isInited = true;
        }*/
    },
    changeUrl: function ($chbs) {
        var ids = '';
        $chbs.each(function () {
            if ($(this).is(':checked')) {
                ids += $(this).val() + ',';
            }
        });
        VideoDeleteManager.$dltBtn.attr('href', VideoDeleteManager.url + '&amp;ids=' + ids + '&amp;containerId=' + pageSettings.contentId);
    },
		deleteSelected: function () {
      	var ids = '';
				var $chbs = $('#' + pageSettings.contentId).find('.js-delete-video-chb');
        $chbs.each(function () {
            if ($(this).is(':checked')) {
                ids += $(this).val() + ',';
            }
        });
				var deleteurl="/ajax/Video_delete.asp?Action=DeleteAllSelected" + "&amp;ids=" + ids 
				$.get(deleteurl, function(data, status){
					refreshList();
				});
    },
		deleteSingle: function (membervideoid) {
      	
				var deleteurl="/ajax/Video_delete.asp?Action=Submitted" + "&amp;MemberVideoID=" + membervideoid 
				$.get(deleteurl, function(data, status){
					refreshList();
				});
    },
    checkSingle: function () {
       // VideoDeleteManager.init();

       // var $chbs = $('#' + pageSettings.contentId).find('.js-delete-video-chb');
       // VideoDeleteManager.changeUrl($chbs);
    },
    checkAll: function () {
       // VideoDeleteManager.init();

        var $chbs = $('#' + pageSettings.contentId).find('.js-delete-video-chb');
        $chbs.each(function () {
            $(this).prop('checked', true);
        });

      //  VideoDeleteManager.changeUrl($chbs);
    },
    uncheckAll: function () {
       // VideoDeleteManager.init();

        var $chbs = $('#' + pageSettings.contentId).find('.js-delete-video-chb');
        $chbs.each(function () {
            $(this).prop('checked', false);
        });
    }
}

var MemberDeleteManager = {
    isInited: false,
    $dltBtn: '',
    url: '/profile/profile_delete_popup.asp?iframe=1&amp;Action=DeleteAllSelected',
    init: function () {
        if (!MemberDeleteManager.isInited) {
            MemberDeleteManager.$dltBtn = $('#DeleteCheckedBtn');
            MemberDeleteManager.isInited = true;
        }
    },
    changeUrl: function ($chbs) {
        var ids = '';
        $chbs.each(function () {
            if ($(this).is(':checked')) {
                ids += $(this).val() + ',';
            }
        });
        MemberDeleteManager.$dltBtn.attr('href', MemberDeleteManager.url + '&amp;ids=' + ids + '&amp;containerId=' + pageSettings.contentId);
    },
    checkSingle: function () {
        MemberDeleteManager.init();

        var $chbs = $('#' + pageSettings.contentId).find('.js-delete-member-chb');
        MemberDeleteManager.changeUrl($chbs);
    },
    checkAll: function () {
        MemberDeleteManager.init();

        var $chbs = $('#' + pageSettings.contentId).find('.js-delete-member-chb');
        $chbs.each(function () {
            $(this).prop('checked', true);
        });

        MemberDeleteManager.changeUrl($chbs);
    },
    uncheckAll: function () {
        MemberDeleteManager.init();

        var $chbs = $('#' + pageSettings.contentId).find('.js-delete-member-chb');
        $chbs.each(function () {
            $(this).prop('checked', false);
        });
    }
}

var SignInPopup = {
    isLoaded: false,
	 closeClick  : true,
    $infoLabel: '',
    init: function () {
     //  console.log($('#SigninPopupOpanBtn, #LogOut_CP').length+"VJ123")
       if ($('#SigninPopupOpanBtn, #LogOut_CP').length &gt; 0) {
			//  logInPopupPanel.OnEnterSubmitHandler($('.js-login-opened &gt; .js-signin-popup').first());
           
         if (!SignInPopup.isLoaded) {
                SignInPopup.isLoaded = true;

             /*   $.ajax({
                    url: "/ajax/SignInPopup.asp", success: function (result) {
                        $("body").append(result);
                        logInPopupPanel.OnEnterSubmitHandler($('.js-login-opened &gt; .js-signin-popup').first());
                     
                    }
                });
				*/
                
            }
        }
    },
    updateLoginReasonMessage: function ($this) {
		
        if (SignInPopup.$infoLabel == "" || SignInPopup.$infoLabel.length == 0) {
            SignInPopup.$infoLabel = $('#LogInPopup_Info')
        }
		
        SignInPopup.$infoLabel.html('&lt;p&gt;You must sign in to ' + $this.html() + '&lt;/p&gt;')
    },
     updateLoginPackage: function () {
        if (SignInPopup.$infoLabel == "" || SignInPopup.$infoLabel.length == 0) {
            SignInPopup.$infoLabel = $('#LogInPopup_Info')
        }
        SignInPopup.$infoLabel.html('&lt;p&gt;You must sign in to select package&lt;/p&gt;')
    }
    
}

var linkAndEventManager = {
    init: function () {
        if ($("#AddEditLinksBtn").length != 0) {
            $("#AddEditLinksBtn").fancybox({
                'frameWidth': 450,
                'frameHeight': 179,
                'padding': 0,
                'showCloseButton': false,
                'hideOnContentClick': false,
                'callbackOnClose': linkAndEventManager.loadProfileLinksView
            });

            $("#AddEditEventsBtn").fancybox({
                'frameWidth': 450,
                'frameHeight': 200,
                'showCloseButton': false,
                'padding': 0,
                'hideOnContentClick': true
            });
        }
    },
    loadProfileLinksView: function () {
        location.href = '/profile/profile_addedit.asp?view=links';
    }
}

var lazyLoadStatusIcon = {
    init: function () {
        $('body').append('&lt;img style="display:none" src="/css/whiteLayout/images/fb-active-pink.png"/&gt;');
        $('body').append('&lt;img style="display:none" src="/css/whiteLayout/images/fb-not-active-gray.png"/&gt;');
        $('body').append('&lt;img style="display:none" src="/css/whiteLayout/images/in-active-pink.png"/&gt;');
        $('body').append('&lt;img style="display:none" src="/css/whiteLayout/images/li-not-active-gray.png"/&gt;');
        $('body').append('&lt;img style="display:none" src="/css/whiteLayout/images/tw-active-pink.png"/&gt;');
        $('body').append('&lt;img style="display:none" src="/css/whiteLayout/images/tw-not-active-gray.png"/&gt;');
    }
}

var BoardPreferencePopup = {
    init: function () {
        /*DashboardPrefPopUp:begin*/
        $("#DashboardPrefPopUp").fancybox({
            'frameWidth': 460,
            'frameHeight': 430,
            'showCloseButton': false,
            'padding': 0,
            'hideOnContentClick': true,
            'fitToView': true
        });
        /*DashboardPrefPopUp:end*/
    }
}
var ControlPanel = {
    init: function () {
        if ($('#ControlPanel').length != 0) {
            ControlPanel.bindPopupToMenu();

            $('#ControlPanel').find('.js-menu-item').each(function () {
                $(this).bind('mouseover', function () {
                    $(this).children('div.js-sub-menu').fadeIn(0);
                });
                $(this).bind('mouseout', function () {
                    $(this).children('div.js-sub-menu').fadeOut(0);
                });


            });
			
			
        }
        else if ($('#GearMenuBtn').length != 0) {
            ControlPanel.bindPopupToAccountMenu();
        }
	
		 if ($('#ControlPanel1').length != 0) {
			 
             $('#ControlPanel1').find('.js-menu-item').each(function () {
                $(this).bind('mouseover', function () {
                    $(this).children('div.js-sub-menu').fadeIn(0);
                });
                $(this).bind('mouseout', function () {
                    $(this).children('div.js-sub-menu').fadeOut(0);
                });


            });
        }
		 if ($('#ControlPanel2').length != 0) {
			 
             $('#ControlPanel2').find('.js-menu-item').each(function () {
                $(this).bind('mouseover', function () {
                    $(this).children('div.js-sub-menu').fadeIn(0);
                });
                $(this).bind('mouseout', function () {
                    $(this).children('div.js-sub-menu').fadeOut(0);
                });


            });
        }
		if ($('#ProductControlPanel').length != 0) {
			 
             $('#ProductControlPanel').find('.js-menu-item').each(function () {
                $(this).bind('mouseover', function () {
                    $(this).children('div.js-sub-menu').fadeIn(0);
                });
                $(this).bind('mouseout', function () {
                    $(this).children('div.js-sub-menu').fadeOut(0);
                });


            });
        }
    },
    bindPopupToMenu: function () {
        /*Premium:begin*/
        $("#PanelPremium_ManageHeadline").fancybox({
            'frameWidth': 450,
            'frameHeight': 219,
            'showCloseButton': false,
            'padding': 0,
            'hideOnContentClick': true
        });
        $("#PanelPremium_ManageDisplayName").fancybox({
            'frameWidth': 450,
            'frameHeight': 242,
            'showCloseButton': false,
            'padding': 0,
            'hideOnContentClick': true
        });
        /*Premium:end*/
        /*Account:begin*/
        ControlPanel.bindPopupToAccountMenu();
        /*Account:end*/
        /*Product:begin*/
        $("#PanelProducts_AddProduct,#Products_AddProduct").fancybox({
            'frameWidth': 550,
            'frameHeight': 430,
            'showCloseButton': false,
            'title': false,
            'padding': 0,
            'hideOnContentClick': false
        });
	 $(".PanelProducts_AddProduct").fancybox({
            'frameWidth': 550,
            'frameHeight': 430,
            'showCloseButton': false,
            'title': false,
            'padding': 0,
            'hideOnContentClick': false
        });
	
        /*Product:end*/
        /*Share:begin*/
        $("#PanelShare_ShareYourMedia").fancybox({
            'frameWidth': 450,
            'frameHeight': 280,
            'showCloseButton': false,
            'padding': 0,
            'hideOnContentClick': true
        });
		$(".PanelShare_ShareMedia").fancybox({
            'frameWidth': 450,
            'frameHeight': 280,
            'showCloseButton': false,
            'padding': 0,
            'hideOnContentClick': true
        });
        $("#PanelShare_MobileSite").fancybox({
            'frameWidth': 450,
            'frameHeight': 242,
            'showCloseButton': false,
            'padding': 0,
            'hideOnContentClick': true
        });
        $("#PanelShare_ShareEvent").fancybox({
            'frameWidth': 450,
            'frameHeight': 200,
            'showCloseButton': false,
            'padding': 0,
            'hideOnContentClick': true
        });
        $("#PanelShare_ManagePowerShare").fancybox({
            'frameWidth': 450,
            'frameHeight': 219,
            'showCloseButton': false,
            'padding': 0,
            'hideOnContentClick': true
        });
        /*Share:end*/

        /*Deals:begin*/
        $("#PanelDeals_ManageYourDeals").fancybox({
            'frameWidth': 711,
            'frameHeight': 400,
            'padding': 0,
            'showCloseButton': false,
            'hideOnContentClick': false
        });
        $("#PanelDeals_AddDeal").fancybox({
            'frameWidth': 711,
            'frameHeight': 400,
            'padding': 0,
            'showCloseButton': false,
            'hideOnContentClick': false
        });
		  $(".Deals_ManageYourDeals").fancybox({
            'frameWidth': 711,
            'frameHeight': 400,
            'padding': 0,
            'showCloseButton': false,
            'hideOnContentClick': false
        });
        $(".Deals_AddDeal").fancybox({
            'frameWidth': 711,
            'frameHeight': 400,
            'padding': 0,
            'showCloseButton': false,
            'hideOnContentClick': false
        });
        /*Deals:end*/
        /*Networks:begin*/
        $("#PanelNetworks_ManageNetwork").fancybox({
            'frameWidth': 450,
            'frameHeight': 242,
            'showCloseButton': false,
            'padding': 0,
            'hideOnContentClick': true
        });

        /*Networks:end*/

        /*audios:begin*/
        $("#PanelAudios_ManageAudios,#PanelAudios_AddAudios").fancybox({
            'frameWidth': 650,
            'showCloseButton': false,
            'padding': 0,
            'frameHeight': 330
        });
        /*audios:end*/

        /*Images:begin*/
        $("#PanelImages_ManageImages,#PanelImages_AddImages").fancybox({
            'frameWidth': 712,
            'frameHeight': 475,
            'showCloseButton': false,
            'padding': 0,
            'hideOnContentClick': false
        });
        /*Images:end*/
		
		
	$("#PanelAddAll").fancybox({
		'frameWidth': 712,
		'frameHeight': 405,
		'showCloseButton': false,
		'padding': 0,
		'hideOnContentClick': false
	});
        /*Blogs:begin*/
        $("#PanelBlogs_ManageBlogs,#PanelBlogs_AddNewsStory").fancybox({
            'frameWidth': 800,
            'frameHeight': 500,
            'showCloseButton': false,
            'padding': 0,
            'hideOnContentClick': false
        });
        $("#PanelBlogs_AddBlogs").fancybox({
            'frameWidth': 840,
            'frameHeight': 600,
            'showCloseButton': false,
            'padding': 0,
            'hideOnContentClick': false
        });
        /*Blogs:end*/

        /*Videos:begin*/
        $("#PanelVideos_ManageVideos,#PanelVideos_AddAnVideos").fancybox({
            'frameWidth': 800,
            'frameHeight': 500,
            'showCloseButton': false,
            'padding': 0,
            'hideOnContentClick': false
        });
		 $("#PanelVideos_AddAnVideos").fancybox({
            'frameWidth': 800,
            'frameHeight': 480,
            'showCloseButton': false,
            'padding': 0,
            'hideOnContentClick': false
        });
        /*Videos:end*/
    },
    bindPopupToAccountMenu: function () {
        /*Account:begin*/
        $("#PanelAccount_ManageCity,#PanelAccount_ManageCity_InHeader").fancybox({
            'frameWidth': 450,
            'frameHeight': 242,
            'padding': 0,
            'showCloseButton': false,
            'hideOnContentClick': false
        });
        /*Account:end*/
    },
    openSumMenu: function ($this) {
        $this.children('div.js-sub-menu').fadeIn();
    },
    closeSubMenu: function ($this) {
        $this.children('div.js-sub-menu').fadeOut();
    }
}
var leftColumnBg = {
    setHeightOfColumn: function () {
        var $whiteBg = $('#LeftColumnWhiteBg');
        if ($whiteBg.length != 0) {
            $whiteBg.css('height', $whiteBg.parent().height());
        }
        //alert($('#MiddleContentColumn').length);
        $('#MiddleContentColumn').children().each(function () {
            // console.log("-------");
            // console.log($(this).prop("tagName"));
            // console.log($(this).outerHeight(true));
        });
    },
    minHeightMemberWidget: 375,
    setHeightOfMembersWidget: function () {//do this because height of links panels are dynamic
        /**/
        if ($('#mainLaftNavPanel').length != 0) {//check if it's log out screen
            var $firstColumn = $('#LeftCoumn');
            var newHeightMemberWidget = $firstColumn.height();
            newHeightMemberWidget -= $firstColumn.find('#mainLaftNavPanel').first().height();
            newHeightMemberWidget -= $firstColumn.find('#Top10ImagesSlotHeader').first().height();
            newHeightMemberWidget -= $firstColumn.find('#Top10ImagesSlotLinks').first().height();
            newHeightMemberWidget -= $firstColumn.find('#MemberWidgetHeader').first().height();
            newHeightMemberWidget -= $firstColumn.find('#MemberWidgetLinks').first().height();
            newHeightMemberWidget -= (140);//height of groups list
            newHeightMemberWidget -= (1605);//height of images
            newHeightMemberWidget -= (200);//height of dot's panel
            if (newHeightMemberWidget &lt; leftColumnBg.minHeightMemberWidget)//set min height
            {
                newHeightMemberWidget = leftColumnBg.minHeightMemberWidget
            }
            $firstColumn.find('#MembersWDGContentWrp').first().css('height', newHeightMemberWidget + 'px');
        }
    }
}
//for location page
var columnEqualizer = {
    countOfRequest: 0,
    requestBeforeEqualiz: 3,
    init: function () {
        columnEqualizer.countOfRequest++;
        if (columnEqualizer.countOfRequest == columnEqualizer.requestBeforeEqualiz) {
            //align first column
            var heightOfFirstTd = 0;
            var heightOfFirstTd_Content = 0;
            var differentTdAndContent = 0;
            $('#LeftCoumn').children().each(function () {
                if ($(this).is(":visible")) {
                    heightOfFirstTd_Content += $(this).outerHeight(true);
                }
            });

            heightOfFirstTd = $('#LeftCoumn').outerHeight(true);
            // console.log("First COLUMN");
            // console.log("heightOfFirstTd:" + heightOfFirstTd);
            // console.log("heightOfFirstTd_Content:" + heightOfFirstTd_Content);
            // console.log("differentTdAndContent:" + (heightOfFirstTd - heightOfFirstTd_Content));
            //align second column
            var heightOfMiddleTd = 0;
            var heightOfMiddleTd_Content = 0;
            differentTdAndContent = 0;
            // console.log("Middle COLUMN");

            $('#MiddleContentColumn').children('.js-MiddleContentColumn-item').each(function () {
                if ($(this).is(":visible")) {
                    heightOfMiddleTd_Content += $(this).outerHeight(true);
                }
            });


            heightOfMiddleTd = $('#MiddleContentColumn').outerHeight(true);
            // console.log("heightOfMiddleTd:" + heightOfMiddleTd);
            // console.log("heightOfMiddleTd_Content:" + heightOfMiddleTd_Content);
            if (parseInt(heightOfMiddleTd) &gt; parseInt(heightOfMiddleTd_Content)) {
                differentTdAndContent = parseInt(heightOfMiddleTd) - parseInt(heightOfMiddleTd_Content);
                // console.log("differentTdAndContent:" + differentTdAndContent);
                if ($('#ClassifiedWDGContentWrp').length != 0) {
                    // console.log("$('#ClassifiedWDGContentWrp').outerHeight(false):" + $('#ClassifiedWDGContentWrp').outerHeight(false));
                    differentTdAndContent += $('#ClassifiedWDGContentWrp').outerHeight(false);


                    $('#ClassifiedWDGContentWrp').css('height', differentTdAndContent + 'px');
                }
                else if ($('#VideoWDGContentWrp').length != 0) {//for networks
                    // console.log("$('#VideoWDGContentWrp').outerHeight(false):" + $('#VideoWDGContentWrp').outerHeight(false));
                    differentTdAndContent += $('#VideoWDGContentWrp').outerHeight(false);
                    $('#VideoWDGContentWrp').css('height', differentTdAndContent + 'px');
                }
                // console.log('heightOfMiddleTd:' + $('#MiddleContentColumn').outerHeight(true));
                // console.log("AFTER Middle COLUMN");
            }

            var heightOfThirdTd = 0;
            var heightOfThirdTd_Content = 0;
            differentTdAndContent = 0;
            // console.log("THIRD COLUMN");
            //align thing column height
            $('#ThirdColumnContent').children().each(function () {
                if ($(this).is(":visible")) {
                    heightOfThirdTd_Content += $(this).outerHeight(true);
                }

            });
            heightOfThirdTd_Content += $('#AdvertsAppFrame').outerHeight(true);

            heightOfThirdTd = $('#ThirdColumnContent').parent('td').outerHeight(true);

            // console.log("heightOfThirdTd:" + heightOfThirdTd);
            // console.log("heightOfThirdTd_Content:" + heightOfThirdTd_Content);
            if (heightOfThirdTd &gt; heightOfThirdTd_Content) {

                differentTdAndContent = heightOfThirdTd - heightOfThirdTd_Content;

                // console.log("differentTdAndContent:" + differentTdAndContent);
                // console.log("$('#ImageWDGContentWrp').outerHeight(false):" + $('#ImageWDGContentWrp').outerHeight(false));

                differentTdAndContent += $('#ImageWDGContentWrp').outerHeight(false);

                $('#ImageWDGContentWrp').css('height', differentTdAndContent + 'px');
                // console.log('heightOfThirdTd:' + $('#MiddleContentColumn').outerHeight(true));
                // console.log("AFTER THIRD COLUMN");
            }
        }
    },
}

var topWidgetsManager = {
    $topBlogs: '',
    $topVideos: '',
    init: function () {
        this.$topBlogs = $('#Top10VideosSlot');
        this.$topVideos = $('#Top10VideosSlot');
        //bind dotdotdot plugin
        this.$topBlogs.find('.top-list-blog_text').each(function () {
            $(this).dotdotdot({
                ellipsis: '... ',
                wrap: 'word',
                fallbackToLetter: true,
                after: null,
                watch: false,
                height: null,
                tolerance: 0,
                callback: function (isTruncated, orgContent) { },
                lastCharacter: {
                    remove: [' ', ',', ';', '.', '!', '?'],
                    noEllipsis: []
                }
            });
        });
        this.$topVideos.find('.top-list-blog_text').each(function () {
            $(this).dotdotdot({
                ellipsis: '... ',
                wrap: 'word',
                fallbackToLetter: true,
                after: null,
                watch: false,
                height: null,
                tolerance: 0,
                callback: function (isTruncated, orgContent) { },
                lastCharacter: {
                    remove: [' ', ',', ';', '.', '!', '?'],
                    noEllipsis: []
                }
            });
        });
    }
}

var ClassifiedsWidgetPanel = {
    $panel: '',
    init: function () {
        if (this.$panel == '') {
            this.$panel = $('#ClassifiedWDGContentWrp')
        }
        this.$panel.find('.clsf-details span').each(function () {
            $(this).dotdotdot({
                ellipsis: '... ',
                wrap: 'word',
                fallbackToLetter: true,
                after: null,
                watch: false,
                height: null,
                tolerance: 0,
                callback: function (isTruncated, orgContent) { },
                lastCharacter: {
                    remove: [' ', ',', ';', '.', '!', '?'],
                    noEllipsis: []
                }
            });
        });
    }
}


var BlogsWidgetPanel = {
    $panel: '',
    init: function () {
        if (this.$panel == '') {
            this.$panel = $('#BlogsWDGContentWrp')
        }
        this.$panel.find('.widget_item-description').each(function () {
            $(this).dotdotdot({
                ellipsis: '... ',
                wrap: 'word',
                fallbackToLetter: true,
                after: null,
                watch: false,
                height: null,
                tolerance: 0,
                callback: function (isTruncated, orgContent) { },
                lastCharacter: {
                    remove: [' ', ',', ';', '.', '!', '?'],
                    noEllipsis: []
                }
            });
        });
    }
}
//header controls
var logInPopupPanel = {
    isInitialized: false,
    $logInPopup: '',
    $JSpasswordField: '',
    $closeBtn: '',
    openCss: 'js-login-opened',
    logInInProgress: false,
    ErrorFound: 0,
    isRefererForHeader: false,
    isRefererForMiddle: false,
    init: function () {
        this.$logInPopup = $('#LogInPopup')
        this.$JSpasswordField = document.getElementById("LogInPopupPassword");
        this.$closeBtn = this.$logInPopup.find('#LogInPopup_CloseBtn').first();
        this.$closeBtn.on('click', function () {
            logInPopupPanel.closeEvent();
        });
        this.OnEnterSubmitHandler(this.$logInPopup);

        logInPopupPanel.isInitialized = true;
    },
    _setRefererValue: function ($popup) {
        var $cForm = $popup.find('form')
        var actionAttrVal = $cForm.attr('action');
        actionAttrVal += "?referer=" + window.location.href;
        $cForm.attr('action', actionAttrVal);
    },
    setReferer: function (formType) {
        //set referer
        if (formType == 0)//for Header
        {
            if (!this.isRefererForHeader) {
                this.isRefererForHeader = true;
                //set referer, user will log in to current page
                logInPopupPanel._setRefererValue(this.$logInPopup);//popup in the header                
            }
        }
        else {//for Header
            if (!this.isRefererForMiddle) {
                this.isRefererForMiddle = true;
                logInPopupPanel._setRefererValue($('#SigninPopupPanel'));//pop up in the middle of the page
            }
        }
    },
    showHideEvent: function () {
		
        if (logInPopupPanel.isInitialized) {
            logInPopupPanel.showHideEventHandler();
        }
        else {
            logInPopupPanel.init();
            logInPopupPanel.showHideEventHandler();
        }
    },
    showHideEventHandler: function () {
		//debugger
        if (logInPopupPanel.$logInPopup.hasClass(logInPopupPanel.openCss)) {//hide
            logInPopupPanel.$logInPopup.removeClass(logInPopupPanel.openCss);
            logInPopupPanel.$logInPopup.fadeOut(200);
        }
        else {//show
            logInPopupPanel.$logInPopup.addClass(logInPopupPanel.openCss);
            logInPopupPanel.$logInPopup.fadeIn(200);
            if ($('.sign-up-btn').length != 0) {//for sign up page
                //hide other
                //close all opened location item
           //     selectLocationPanel.closeAllDdl();
                //close select location panel
               // selectLocationPanel.closeEvent();
                //close nav menu popup
                navPopupPanel.closeEvent();
                //close Top cities ddl on top Nav Line
                topNavPanel.closeEvent();
                //close category panel
                if (typeof searchPagePanel != "undefined") {
                    searchPagePanel.closeEvent();
                }
                //close SITS tooltip popup
                searchByTagManager.hideInfoPopup_inTheHeader();
            }
        }
    },
    closeEvent: function () {
        if (logInPopupPanel.$logInPopup != '' &amp;&amp; logInPopupPanel.$logInPopup.hasClass(logInPopupPanel.openCss)) {//hide
            logInPopupPanel.$logInPopup.removeClass(logInPopupPanel.openCss);
            logInPopupPanel.$logInPopup.fadeOut(200);
        }
    },
    CheckPassword: function (formType) {
        this.setReferer(formType);

        if (!logInPopupPanel.logInInProgress) {
            logInPopupPanel.logInInProgress = true;
            //init values
            logInPopupPanel.ErrorFound = 0
            var $formSignIn;
            //formType 0: form in the header
            //1: form in the popup              //select the form html tag 
            if (formType == 0) {
                for (i = 0; i &lt; document.frmSignIn.length; i++) {
                    if (document.frmSignIn[i].className.indexOf('js-signin-popup') == -1) {
                        if (document.frmSignIn[i].nodeName == "FORM") {
                            $formSignIn = document.frmSignIn[i];
                        }
                        else {
                            $formSignIn = document.frmSignIn;
                        }
                        break;
                    }
                }
            }
            else {
                for (i = 0; i &lt; document.frmSignIn.length; i++) {
                    if (document.frmSignIn[i].className.indexOf('js-signin-popup') &gt; -1) {
                        if (document.frmSignIn[i].nodeName == "FORM") {
                            $formSignIn = document.frmSignIn[i];
                        }
                        else {
                            $formSignIn = document.frmSignIn;
                        }
                        break;
                    }
                }
            }

            //quick checks
            if ($formSignIn.LoginUID.value == '') {
                alert('Please enter your e-mail address.');
                $formSignIn.LoginUID.focus();
                logInPopupPanel.ErrorFound = logInPopupPanel.ErrorFound + 1
            }
            if (logInPopupPanel.ErrorFound == 0) {
                if ($formSignIn.LoginPWD.value == '') {
                    alert('Please enter your password.');
                    $formSignIn.LoginPWD.focus();
                    logInPopupPanel.ErrorFound = logInPopupPanel.ErrorFound + 1
                }
            }
            if (logInPopupPanel.ErrorFound == 0) {//check if typed information is correct(password and email)


                var AttemptCount = $formSignIn.hidAttempts.value;
                var ToAdd = 1;


                if (logInPopupPanel.ErrorFound == 0) {
                    var eml = $formSignIn.LoginUID.value;
                    var pwd = $formSignIn.LoginPWD.value;

                   /*
                   var xmlHttp = xmlObject.GetXmlHttpObject();
                    var url = '/ajax/check_email.asp?eml=' + eml;

                    $.ajax({
                        url: url,
                        async: false,
                        success: function (res) {
                            if (res == 'CORRECT') {
                                logInPopupPanel.CheckPasswordStage2($formSignIn);
                            }
                            else {
                                alert('The e-mail address you entered is incorrect.');
                                $formSignIn.LoginUID.focus();
                                $formSignIn.hidAttempts.value = AttemptCount;
                                logInPopupPanel.ErrorFound = logInPopupPanel.ErrorFound + 1;
                                //log in finished with error/email not corrected/ false value allows next log in
                                logInPopupPanel.logInInProgress = false;
                            }
                        },
                        error: function () {
                            // console.log('Log In error happened')
                        }
                    });
                    */
                     var xmlHttp = xmlObject.GetXmlHttpObject();
						 url = '/ajax/check_pwd2.asp'
						 var sendInfo2 = {
							eml:eml,
							pwd:pwd
						}
                        $.ajax({
							type: "post",
                            url: url,
							data: sendInfo2,
                            async: false,
                            success: function (res) {
                                if (res == 'CORRECT') {
                                    $formSignIn.submit();
                                }
                                else {
                                    alert('The password you entered is incorrect.');
                                    $formSignIn.LoginUID.focus();
                                    $formSignIn.hidAttempts.value = AttemptCount;
                                    logInPopupPanel.ErrorFound = logInPopupPanel.ErrorFound + 1
                                    //log in finished with error/ password not corrected/ false value allows next log in
                                    logInPopupPanel.logInInProgress = false;
                                }
                            },
                            error: function () {
                                // console.log('Log In error happened')
                            }
                        });
                }
                else {//log in finished with error/ false value allows next log in
                    logInPopupPanel.logInInProgress = false;
                }
            }
        }
    },
    CheckPasswordStage2: function ($formSignIn) {
        var AttemptCount = $formSignIn.hidAttempts.value;
        var ToAdd = 1;
        var eml = $formSignIn.LoginUID.value;
        var pwd = $formSignIn.LoginPWD.value;
        var xmlHttp = xmlObject.GetXmlHttpObject();

        url = '/ajax/check_pwd2.asp?eml=' + eml + '&amp;pwd=' + pwd;
         url = '/ajax/check_pwd2.asp'
		 var sendInfo2 = {
			eml:eml,
			pwd:pwd
		}
		$.ajax({
			type: "post",
			url: url,
			data: sendInfo2,
            async: false,
            success: function (res) {
                if (res == 'CORRECT') {
                    $formSignIn.submit();
                }
                else {
                    alert('The password you entered is incorrect.');
                    $formSignIn.LoginUID.focus();
                    $formSignIn.hidAttempts.value = AttemptCount;
                    logInPopupPanel.ErrorFound = logInPopupPanel.ErrorFound + 1
                    //log in finished with error/ password not corrected/ false value allows next log in
                    logInPopupPanel.logInInProgress = false;
                }
            },
            error: function () {
                // console.log('Log In error happened')
            }
        });
    },
    showHidePassword: function ($this, formType) {
        //typeOfForm: 0 - form in the header
        //1 - form in the popup
        var $formSignIn;
        if (formType == 0) {
            for (i = 0; i &lt; document.frmSignIn.length; i++) {
                if (document.frmSignIn[i].className.indexOf('js-signin-popup') == -1) {
                    if (document.frmSignIn[i].nodeName == "FORM") {
                        $formSignIn = document.frmSignIn[i];
                    }
                    else {
                        $formSignIn = document.frmSignIn;
                    }
                    break;
                }
            }
        }
        else {
            for (i = 0; i &lt; document.frmSignIn.length; i++) {
                if (document.frmSignIn[i].className.indexOf('js-signin-popup') &gt; -1) {
                    if (document.frmSignIn[i].nodeName == "FORM") {
                        $formSignIn = document.frmSignIn[i];
                    }
                    else {
                        $formSignIn = document.frmSignIn;
                    }
                    break;
                }
            }
        }
        var pass = $formSignIn.LogInPopupPassword;
        if ($this.is(':checked')) {
            pass.type = 'text';
        }
        else {
            pass.type = 'password';
        }
    },
    OnEnterSubmitHandler: function ($LoginFormPanel) {
        $LoginFormPanel.find('#LogInUserID,#LogInPopupPassword').each(function () {
            $(this).on("keypress", function (e) {
                if (e.keyCode == 13) {
                    logInPopupPanel.CheckPassword(logInPopupPanel.isLoginFromHeader($(this)))
                    return false; // prevent the button click from happening
                }
            });
        });
    },
    isLoginFromHeader: function ($input) {
        var result = 0;//log in form in the header
        if ($input.parents('form').hasClass('js-signin-popup')) {
            result = 1//log in form in the popup
        }

        return result;
    }
}
var popularVideoPanel = {
    init: function () {
        var $popularVideoList = $('#PopularVideoList');;
        $('#PopularVideoList').find('.js-popular-video-title a').each(function () {
            $(this).dotdotdot({
                ellipsis: '... ',
                wrap: 'word',
                fallbackToLetter: true,
                after: null,
                watch: false,
                height: null,
                tolerance: 0,
                callback: function (isTruncated, orgContent) { },
                lastCharacter: {
                    remove: [' ', ',', ';', '.', '!', '?'],
                    noEllipsis: []
                }
            });
        });
    }
}

var topNavPanel = {
    $ddlTopCitiesWrp: '',
    init: function () {
        this.$ddlTopCitiesWrp = $('#TopCitiesWhiteDropDown');
        $("body").click(function (e) {
            if (!(e.target.id == "TopCitiesWhiteDropDown" || $(e.target).parents("#TopCitiesWhiteDropDown").size())) {
                customDDL.closeEvent($('#TopCitiesWhiteDropDown').find('ul'));
            }
        });

        $("body").click(function (e) {
            if (!(e.target.id == "LocationTopCityDDL" || $(e.target).parents("#LocationTopCityDDL").size())) {
                $('#LocationTopCityDDL').find('ul').each(function () {
                    $(this).slideUp(0);
                    $(this).removeClass(selectLocationPanel.openItemCss);
                });
            }
        });
        //init Top cities dropdown
        if (this.$ddlTopCitiesWrp != 0) {
            customDDL.init(this.$ddlTopCitiesWrp);
            if (this.$ddlTopCitiesWrp.find('ul').length != 0) {
                this.$ddlTopCitiesWrp.find('ul').mCustomScrollbar();
            }
        }
    },
    closeEvent: function () {
        if (topNavPanel.$ddlTopCitiesWrp != '') {
            customDDL.closeEvent(topNavPanel.$ddlTopCitiesWrp.find('ul'))
        }
    }
}

var searchByTagManager = {
    $tbTag: '',
    $tbTagInsideMenu: '',
    $tbTagInsideSits: '',
    $popupWrp: '',
    cssOpen: 'js-opened',
    $searchTagPopupPanel: '',
    $searchTagPopupPanel_InHeader: '',
    $tooltip_InHeader: '',
    isSecondShowOfInfoPopup: false,
    showHideSearchInput: function ($this) {
        if (searchByTagManager.$searchTagPopupPanel == '') {
            searchByTagManager.$searchTagPopupPanel = $this.next('#SearchTagPopupPanel');
        }

        if ($this.hasClass(searchByTagManager.cssOpen)) {
            $this.removeClass(searchByTagManager.cssOpen);
            searchByTagManager.$searchTagPopupPanel.fadeOut(200);
        }
        else {
            $this.addClass(searchByTagManager.cssOpen);
            searchByTagManager.$searchTagPopupPanel.fadeIn(200);
        }
    },
    showHideSearchInput_Header: function ($this) {
        // console.log("VJ : " +searchByTagManager.$searchTagPopupPanel_InHeader)
			
        if (searchByTagManager.$searchTagPopupPanel_InHeader == '') {
            searchByTagManager.$searchTagPopupPanel_InHeader = $this.next('#SearchTagForm_InTheHeader');
        }
         // console.log("VJ : "  +$this.hasClass(searchByTagManager.cssOpen))
        if ($this.hasClass(searchByTagManager.cssOpen)) {//hide event
            searchByTagManager.hideInfoPopup_inTheHeader();
        }
        else {//show event
            // console.log("VJ : 1" )
            $this.addClass(searchByTagManager.cssOpen);
            searchByTagManager.$searchTagPopupPanel_InHeader.fadeIn(0);
             // console.log("VJ : 2" )
           /* if (!searchByTagManager.isSecondShowOfInfoPopup) {
                searchByTagManager.showInfoPopup_inTheHeader();
                searchByTagManager.isSecondShowOfInfoPopup = true;
            }*/
            $('#HdrSearchDDL').html('SB Tag');
             // console.log("VJ : 3" )
            //
            searchByTagManager.markSitsSelectedDll();
             // console.log("VJ : 4" )
        
        }
        //close main ddl with search type in the header, because search box will be particulary hidden       
        hdrSearchPanel.closeEvent(hdrSearchPanel.$searchTypeList);
    },
    hideSearchInput_Header: function ($this) {
        if (searchByTagManager.$searchTagPopupPanel_InHeader == '') {
            searchByTagManager.$searchTagPopupPanel_InHeader = $this.next('#SearchTagForm_InTheHeader');
        }

        if ($this.hasClass(searchByTagManager.cssOpen)) {
            $this.removeClass(searchByTagManager.cssOpen);
            searchByTagManager.$searchTagPopupPanel_InHeader.fadeOut(200);
        }

        searchByTagManager.unmarkSitsSelectedDll();
    },
    hideSearchInputAndPopup_Header: function () {
        //close SITS tooltip popup
        searchByTagManager.hideInfoPopup_inTheHeader();
        //hide SITS textbox popup
        searchByTagManager.hideSearchInput_Header($('#SitsIconInTheHeader'))
    },
    markSitsSelectedDll: function () {
        $('#HdrSearchDDL').addClass('search-ddl_label_sits-active');

    },
    unmarkSitsSelectedDll: function () {
        $('#HdrSearchDDL').removeClass('search-ddl_label_sits-active');
    },
    getUrlByTag_fromDashboard: function () {
        if (this.$tbTag == '') {
            this.$tbTag = $('#SearchTagForm').find('#tbTagName');
        }
        this.getUrlByTag(searchByTagManager.$tbTag);
    },
    getUrlByTag_fromMenu: function () {
        if (this.$tbTagInsideMenu == '') {
            this.$tbTagInsideMenu = $('#SearchTagForm_InsideMenu').find('#tbTagName');
        }
        this.getUrlByTag(searchByTagManager.$tbTagInsideMenu);
    },
    getUrlByTag_fromSitsPage: function () {
        if (this.$tbTagInsideSits == '') {
            this.$tbTagInsideSits = $('#SearchTagForm_InsideSITS').find('#tbTagName');
        }
        
        this.getUrlByTag(searchByTagManager.$tbTagInsideSits);
    },
    getUrlByTag: function ($tagInput) {
        if ($tagInput.val() == '') {
            alert("Please Enter The SB Tag ");
            document.frmTags.tbTagName.focus();
        } else {
            $.getJSON("/ajax/get_url_by_tag.asp?tagname=" + $tagInput.val(), function (data) {
                var items = [];
                $.each(data, function (key, val) {
                    if (val == "NotFound") {
                        alert("There Is No SB Tag For \"" + $tagInput.val() + "\" .");
                        return false;
                    }
                    else {
                        window.location = val;
                    }
                });
            });
        }
    },
    showInfoPopup: function () {
        if (this.$popupWrp == '') {
            this.$popupWrp = $('#SearchTagFormInfoPopup')
            this.openLearnMorePage(searchByTagManager.$popupWrp.find('#OpenLearnMorePage'));
        }
        if (this.$popupWrp.hasClass(searchByTagManager.cssOpen)) {//close
            this.hideInfoPopup();
        }
        else {
            this.$popupWrp.addClass(searchByTagManager.cssOpen)
            this.$popupWrp.fadeIn(200);
        }
    },

    hideInfoPopup: function () {
        this.$popupWrp.removeClass(searchByTagManager.cssOpen)
        this.$popupWrp.fadeOut(200);
    },
    initInfoPopup_inTheHeader: function () {
        if (searchByTagManager.$tooltip_InHeader == '') {
            searchByTagManager.$tooltip_InHeader = $('#SearchTagForm_InHeaderTooltip');
            searchByTagManager.openLearnMorePage(searchByTagManager.$tooltip_InHeader.find('#OpenLearnMorePage'));
        }
    },
    showInfoPopup_inTheHeader: function () {
        searchByTagManager.initInfoPopup_inTheHeader();

        searchByTagManager.$tooltip_InHeader.fadeIn(0);
        //hide serach by location panel
        selectLocationPanel.closeEvent();
        if (typeof searchPagePanel != 'undefined') {
            searchPagePanel.closeEvent();
        }
        //close LogIn popup
        logInPopupPanel.closeEvent();
    },
    hideInfoPopup_inTheHeader: function () {
        searchByTagManager.initInfoPopup_inTheHeader();

       // searchByTagManager.$tooltip_InHeader.fadeOut(0);
    },
    openLearnMorePage: function ($learnBtn) {
        $learnBtn.on('click', function () {
            var $form = $(this).parent('form');

            if (!(typeof currCountryId === 'undefined' || typeof currStateId === 'undefined' || typeof currCountyId === 'undefined'
                || typeof currCityId === 'undefined' || typeof currCategory === 'undefined' || typeof currPgType === 'undefined')) {
                $form.find('#searchCountry').val(currCountryId);
                $form.find('#searchState').val(currStateId)
                $form.find('#searchCounty').val(currCountyId);
                $form.find('#searchCity').val(currCityId);
                $form.find('#searchCategory').val(currCategory);
                $form.find('#searchType').val(currPgType);
            }
            $form.submit();
        });
    },
    openLearnMoreHeaderPage: function () {
        if ($('#OpenLearnMorePageLink').length != 0) {
            $('#OpenLearnMorePageLink').on('click', function () {
                var $form = $('#StepInsideForm');

                $form.find('#searchCountry').val(currCountryId);
                $form.find('#searchState').val(currStateId)
                $form.find('#searchCounty').val(currCountyId);
                $form.find('#searchCity').val(currCityId);
                $form.find('#searchCategory').val(currCategory);
                $form.find('#searchType').val(currPgType);
                $form.submit();
            });
        }
    }
}

widgetRightMenu = {
    $menu: '',
    openCss: 'js-opened',
    openClose: function ($this) {
        if (widgetRightMenu.$menu == '' || widgetRightMenu.$menu.length == 0) {
            widgetRightMenu.$menu = $this.next('ul');
            $("body").click(function (e) {
                if (!(e.target.id == "WidgetRightMenu" || $(e.target).parents("#WidgetRightMenu").size())) {
                    $('#WidgetRightMenu').find('ul').each(function () {
                        $(this).fadeOut(0);
                        $(this).removeClass(widgetRightMenu.openCss);
                    });
                }
            });
        }
        if (widgetRightMenu.$menu.hasClass(widgetRightMenu.openCss)) {
            widgetRightMenu.$menu.removeClass(widgetRightMenu.openCss);
            widgetRightMenu.$menu.fadeOut(0);
        }
        else {
            widgetRightMenu.$menu.addClass(widgetRightMenu.openCss);
            widgetRightMenu.$menu.fadeIn(0);
        }
    }
}


//channels list
var DdlPageControl = {
    init: function (ddlSelectorString) {
        $(ddlSelectorString).mCustomScrollbar();
    }
}</pre></body></html>