<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">$(document).ready(function () {    
	
    if ($('#SelectLocationPanel').length != 0 || $('#HeaderSearchPanel').length != 0) {
        selectLocationPanel.init();
    }

    if ($('#HdrSearchDDL').length != 0) {
        hdrSearchPanel.init();
    }    
	
      if ($('#MediaThirdbar').length != 0) {
        ThirdbarMediaPanel.init();
    }    
    
    if ($('#GearMenuBtn').length != 0) {
        profilePopup.init();
        //'#GearMenuBtn' id need for init
		gearPopup.init();
		friendPopup.init();
		NotificationPopup.init();
		GridPopup.init();
		BellPopup.init();
    }   
	
	//if ($('#MediaTopBarPanel').length != 0) {
  //     MediaTopBarPanel.init();
  //  }   
	navPopupPanel.init();
});

var profilePopup = {
    $btn: '',
    openCss: 'js-opened',
    init: function () {
        this.$btn = $('#ProfileMenuBtn');
        if (this.$btn.length != 0) {
            $("body").click(function (e) {
                if (!(e.target.id == "ProfileMenuBtnWrp" || $(e.target).parents("#ProfileMenuBtnWrp").size())) {
                    profilePopup.close();
                }
            });

            this.$btn.on('click', function () {
                if ($(this).hasClass(profilePopup.openCss)) {
                    profilePopup.close();
                }
                else {
                    hdrSearchPanel.closeEvent(hdrSearchPanel.$searchTypeList);
                    //close nav menu popup
                    navPopupPanel.closeEvent();
                    //close Top cities ddl on top Nav Line
                    topNavPanel.closeEvent();
                    //close all opened location item
                    selectLocationPanel.closeAllDdl();
                    //close select location panel
                  //  selectLocationPanel.closeEvent();
                    //close gear popup
					gearPopup.close();
					GridPopup.close();
					BellPopup.close();
					NotificationPopup.close();
					friendPopup.close();
                    //close category panel
                    if (typeof  searchPagePanel != "undefined") {
                        searchPagePanel.closeEvent();
                    }
                    //close SITS tooltip popup and textbox
                    searchByTagManager.hideSearchInputAndPopup_Header();

                    $(this).addClass(profilePopup.openCss);
                    $(this).next('ul').fadeIn(200);
                }
            });
        }
    },
    close: function () {
        if (profilePopup.$btn != '' &amp;&amp; profilePopup.$btn.length != 0) {
            profilePopup.$btn.removeClass(profilePopup.openCss);
            profilePopup.$btn.next('ul').fadeOut(200);
        }
    }    
}

var gearPopup = {
    $btn: '',
    openCss: 'js-opened',
    init: function () {
        this.$btn = $('#GearMenuBtn');
        if (this.$btn.length != 0) {
            $("body").click(function (e) {
                if (!(e.target.id == "GearMenuBtnWrp" || $(e.target).parents("#GearMenuBtnWrp").size())) {
                    $('#GearMenuBtnWrp').find('ul').first().fadeOut(0);
                    $('#GearMenuBtnWrp').find('#GearMenuBtn').first().removeClass(gearPopup.openCss);
                }
            });

            this.$btn.on('click', function () {
                if ($(this).hasClass(gearPopup.openCss)) {
                    gearPopup.close();
                }
                else {
                    hdrSearchPanel.closeEvent(hdrSearchPanel.$searchTypeList);
                    //close nav menu popup
                    navPopupPanel.closeEvent();
                    //close Top cities ddl on top Nav Line
                    topNavPanel.closeEvent();
                    //close all opened location item
                    selectLocationPanel.closeAllDdl();
                    //close select location panel
                    //selectLocationPanel.closeEvent();
                    //close profile popup
                   
					GridPopup.close();
					BellPopup.close();
					NotificationPopup.close();
					friendPopup.close();
					profilePopup.close();
                    //close category panel
                    if (typeof  searchPagePanel != "undefined") {
                        searchPagePanel.closeEvent();
                    }
                    //close SITS tooltip popup and textbox
                    searchByTagManager.hideSearchInputAndPopup_Header();

                    $(this).addClass(gearPopup.openCss);
                    $(this).next('ul').fadeIn(200);
                }
            });
        }
    },
    close: function () {
        if (gearPopup.$btn != '' &amp;&amp; gearPopup.$btn.length != 0) {
            gearPopup.$btn.removeClass('js-opened');
            gearPopup.$btn.next('ul').fadeOut(200);
        }
    }
}

var friendPopup = {
    $btn: '',
    openCss: 'js-opened',
    init: function () {
        this.$btn = $('#friendsMenuBtn');
        if (this.$btn.length != 0) {
            $("body").click(function (e) {
                if (!(e.target.id == "friendsMenuBtnWrp" || $(e.target).parents("#friendsMenuBtnWrp").size())) {
                    $('#friendsMenuBtnWrp').find('ul').first().fadeOut(0);
                    $('#friendsMenuBtnWrp').find('#friends-btn_bg').first().removeClass(friendPopup.openCss);
                }
            });

            this.$btn.on('click', function () {
                if ($(this).hasClass(friendPopup.openCss)) {
                    friendPopup.close();
                }
                else {
                    hdrSearchPanel.closeEvent(hdrSearchPanel.$searchTypeList);
                    //close nav menu popup
                    navPopupPanel.closeEvent();
                    //close Top cities ddl on top Nav Line
                    topNavPanel.closeEvent();
                    //close all opened location item
                    selectLocationPanel.closeAllDdl();
                    //close select location panel
                    //selectLocationPanel.closeEvent();
                    //close profile popup
                   gearPopup.close();
					GridPopup.close();
					BellPopup.close();
					NotificationPopup.close();
					
					profilePopup.close();
                    //close category panel
                    if (typeof  searchPagePanel != "undefined") {
                        searchPagePanel.closeEvent();
                    }
                    //close SITS tooltip popup and textbox
                    searchByTagManager.hideSearchInputAndPopup_Header();

                    $(this).addClass(friendPopup.openCss);
                    $(this).next('ul').fadeIn(200);
                }
            });
        }
    },
    close: function () {
        if (friendPopup.$btn != '' &amp;&amp; friendPopup.$btn.length != 0) {
            friendPopup.$btn.removeClass('js-opened');
            friendPopup.$btn.next('ul').fadeOut(200);
        }
    }
}

var NotificationPopup = {
    $btn: '',
    openCss: 'js-opened',
    init: function () {
        this.$btn = $('#notificationMenuBtn');
        if (this.$btn.length != 0) {
            $("body").click(function (e) {
                if (!(e.target.id == "notificationMenuBtnWrp" || $(e.target).parents("#notificationMenuBtnWrp").size())) {
                    $('#notificationMenuBtnWrp').find('ul').first().fadeOut(0);
                    $('#notificationMenuBtnWrp').find('#notification-btn_bg').first().removeClass(NotificationPopup.openCss);
                }
            });

            this.$btn.on('click', function () {
                if ($(this).hasClass(NotificationPopup.openCss)) {
                    NotificationPopup.close();
                }
                else {
                    hdrSearchPanel.closeEvent(hdrSearchPanel.$searchTypeList);
                    //close nav menu popup
                    navPopupPanel.closeEvent();
                    //close Top cities ddl on top Nav Line
                    topNavPanel.closeEvent();
                    //close all opened location item
                    selectLocationPanel.closeAllDdl();
                    //close select location panel
                    //selectLocationPanel.closeEvent();
                    //close profile popup
                    gearPopup.close();
					GridPopup.close();
					BellPopup.close();
					
					friendPopup.close();
					profilePopup.close();
                    //close category panel
                    if (typeof  searchPagePanel != "undefined") {
                        searchPagePanel.closeEvent();
                    }
                    //close SITS tooltip popup and textbox
                    searchByTagManager.hideSearchInputAndPopup_Header();

                    $(this).addClass(NotificationPopup.openCss);
                    $(this).next('ul').fadeIn(200);
                }
            });
        }
    },
    close: function () {
        if (NotificationPopup.$btn != '' &amp;&amp; NotificationPopup.$btn.length != 0) {
            NotificationPopup.$btn.removeClass('js-opened');
            NotificationPopup.$btn.next('ul').fadeOut(200);
        }
    }
}


var GridPopup = {
    $btn: '',
    openCss: 'js-opened',
    init: function () {
        this.$btn = $('#GridMenuBtn');
        if (this.$btn.length != 0) {
            $("body").click(function (e) {
                if (!(e.target.id == "GridMenuBtnWrp" || $(e.target).parents("#GridMenuBtnWrp").size())) {
                    $('#GridMenuBtnWrp').find('ul').first().fadeOut(0);
                    $('#GridMenuBtnWrp').find('#Grid-btn_bg').first().removeClass(GridPopup.openCss);
                }
            });

            this.$btn.on('click', function () {
                if ($(this).hasClass(GridPopup.openCss)) {
                    GridPopup.close();
                }
                else {
                    hdrSearchPanel.closeEvent(hdrSearchPanel.$searchTypeList);
                    //close nav menu popup
                    navPopupPanel.closeEvent();
                    //close Top cities ddl on top Nav Line
                    topNavPanel.closeEvent();
                    //close all opened location item
                    selectLocationPanel.closeAllDdl();
                    //close select location panel
                    //selectLocationPanel.closeEvent();
                    //close profile popup
                   gearPopup.close();
					
					BellPopup.close();
					NotificationPopup.close();
					friendPopup.close();
					profilePopup.close();
                    //close category panel
                    if (typeof  searchPagePanel != "undefined") {
                        searchPagePanel.closeEvent();
                    }
                    //close SITS tooltip popup and textbox
                    searchByTagManager.hideSearchInputAndPopup_Header();

                    $(this).addClass(GridPopup.openCss);
                    $(this).next('ul').fadeIn(200);
                }
            });
        }
    },
    close: function () {
        if (GridPopup.$btn != '' &amp;&amp; GridPopup.$btn.length != 0) {
            GridPopup.$btn.removeClass('js-opened');
            GridPopup.$btn.next('ul').fadeOut(200);
        }
    }
}


var BellPopup = {
    $btn: '',
    openCss: 'js-opened',
    init: function () {
        this.$btn = $('#BellMenuBtn');
        if (this.$btn.length != 0) {
            $("body").click(function (e) {
                if (!(e.target.id == "BellMenuBtnWrp" || $(e.target).parents("#BellMenuBtnWrp").size())) {
                    $('#BellMenuBtnWrp').find('ul').first().fadeOut(0);
                    $('#BellMenuBtnWrp').find('#Bell-btn_bg').first().removeClass(BellPopup.openCss);
                }
            });

            this.$btn.on('click', function () {
                if ($(this).hasClass(BellPopup.openCss)) {
                    BellPopup.close();
                }
                else {
                    hdrSearchPanel.closeEvent(hdrSearchPanel.$searchTypeList);
                    //close nav menu popup
                    navPopupPanel.closeEvent();
                    //close Top cities ddl on top Nav Line
                    topNavPanel.closeEvent();
                    //close all opened location item
                    selectLocationPanel.closeAllDdl();
                    //close select location panel
                    //selectLocationPanel.closeEvent();
                    //close profile popup
                    gearPopup.close();
					GridPopup.close();
					
					NotificationPopup.close();
					friendPopup.close();
					profilePopup.close();
                    //close category panel
                    if (typeof  searchPagePanel != "undefined") {
                        searchPagePanel.closeEvent();
                    }
                    //close SITS tooltip popup and textbox
                    searchByTagManager.hideSearchInputAndPopup_Header();

                    $(this).addClass(BellPopup.openCss);
                    $(this).next('ul').fadeIn(200);
                }
            });
        }
    },
    close: function () {
        if (BellPopup.$btn != '' &amp;&amp; BellPopup.$btn.length != 0) {
            BellPopup.$btn.removeClass('js-opened');
            BellPopup.$btn.next('ul').fadeOut(200);
        }
    }
}
/*
var MediaTopBarPanel = {
    $MediaTopBarPanel: '',
    openPanelCss: 'js-loc-panel-opened',
    init: function () {
		this.$locationsPanel = $('#MediaTopBarPanel');
        if (this.$locationsPanel.length != 0)
        {
           
		}
        
    },
    open: function () {
		try{
			if (typeof MediaTopBarPanel.$locationsPanel !== 'undefined'	)	{
				if (MediaTopBarPanel.$locationsPanel != "" &amp;&amp; MediaTopBarPanel.$locationsPanel.length != 0) {
					MediaTopBarPanel.$locationsPanel.addClass(MediaTopBarPanel.openPanelCss);
					MediaTopBarPanel.$locationsPanel.fadeIn(200);  
				}
			}
		}catch(e){}
		//close select location panel
       // selectLocationPanel.closeEvent();
		
    },
    close: function(){
        try{
			if (typeof MediaTopBarPanel.$locationsPanel !== 'undefined'	)	{	
				if (MediaTopBarPanel.$locationsPanel != "" &amp;&amp; MediaTopBarPanel.$locationsPanel.length != 0) {
					//if (MediaTopBarPanel.$locationsPanel.hasClass(MediaTopBarPanel.openPanelCss)) {
						MediaTopBarPanel.$locationsPanel.removeClass(MediaTopBarPanel.openPanelCss);
						MediaTopBarPanel.$locationsPanel.fadeOut(200);
				   // }
				}
			}
		}catch(e){}
    }
  
}
*/
var navPopupPanel = {
    $openBtn: '',
    $menuPopup: '',
    openCss: 'js-nav-popup-opened',
    init: function () {
        this.$openBtn = $('#OpenNavBtn');
        this.$menuPopup = $('#NavPopup');
        this.openCloseMenu(this.$openBtn, this.$menuPopup);
        this.closeMenu(this.$menuPopup.find('#NavPopupCloseBtn'), this.$menuPopup);
    },
    openCloseMenu: function ($btn, $panel) {
        $btn.bind('click', function () {
            if ($panel.hasClass(navPopupPanel.openCss)) {//close
                $panel.removeClass(navPopupPanel.openCss);
                $panel.fadeOut(200);
            }
            else {//open
                $panel.addClass(navPopupPanel.openCss);
                $panel.fadeIn(200);

                //close select location panel
                selectLocationPanel.closeEvent();
                //close LogIn popup
                logInPopupPanel.closeEvent();
                //close profile menu
                gearPopup.close();
					GridPopup.close();
					BellPopup.close();
					NotificationPopup.close();
					friendPopup.close();
					profilePopup.close();
                //close Top Links ddl
                TopLinksFrame.closeEvent();
            }
        });
    },
    closeMenu: function ($btnClose, $panel) {
        $btnClose.bind('click', function () {
            $panel.removeClass(navPopupPanel.openCss);
            $panel.fadeOut(200);
        });
    },
    closeEvent: function () {
        if (navPopupPanel.$menuPopup != '' &amp;&amp; navPopupPanel.$menuPopup.hasClass(navPopupPanel.openCss)) {
            navPopupPanel.$menuPopup.removeClass(navPopupPanel.openCss);
            navPopupPanel.$menuPopup.fadeOut(200);
        }        
    }
}

var selectLocationPanel = {
    $locationsPanel: '',
    openPanelCss: 'js-loc-panel-opened',
    openItemCss: 'js-opened-location-item',
    init: function () {
        var $loclabel = $('#HdrLocationLabel');
        var $whereToBtn = $('#WhereToBtn');
        var $whatElseBtn = $('#WhatElseBtn');
        this.$locationsPanel = $('#SelectLocationPanel');
        if (this.$locationsPanel.length == 0)
        {
            this.$locationsPanel = $('#HeaderSearchPanel');
        }
        //init open/close event
        this.openCloseHandler($loclabel, this.$locationsPanel, this.openPanelCss);
        this.openCloseHandler($whereToBtn, this.$locationsPanel, this.openPanelCss);//FOR DEFAULT LOCATION PAGE
        this.openCloseHandler($whatElseBtn, this.$locationsPanel, this.openPanelCss);
        // for  first link of the section(Networks, Locations, Channels) On default location page
      //  this.openCloseHandler($("#NetworksLinkBtn"), this.$locationsPanel, this.openPanelCss);
      //  this.openCloseHandler($("#LocationsLinkBtn"), this.$locationsPanel, this.openPanelCss);
      //  this.openCloseHandler($("#ChannelsLinkBtn"), this.$locationsPanel, this.openPanelCss);

        var currentItemMarkerCss = 'js-current-location';
        this.$locationsPanel.find('.location-item').each(function () {
            var $thisBlock = $(this);
            var $thisLabel = $thisBlock.children('span');
            var $thisLocationList = $thisBlock.find('ul');
            //bind scroll to ul
            $thisBlock.find('ul').first().mCustomScrollbar();
            if ($thisLabel.next('ul').length == 0)
            {
                $thisLocationList = $thisBlock.find('.js-ul-ddl');
            }
          
            $thisLabel.on('click', function () {
                if ($thisLocationList.hasClass(selectLocationPanel.openItemCss)) {//close
                    $thisLocationList.removeClass(selectLocationPanel.openItemCss);
                    $thisLocationList.slideUp(100);
                    if ($thisLocationList.hasClass('js-ul-ddl')) {
                        $thisLocationList.find('#SerachCountryTb').val('');
						$thisLocationList.find('#SerachStateTb').val('');
						$thisLocationList.find('#SerachCountyTb').val('');
						$thisLocationList.find('#SerachCityTb').val('');
						$thisLocationList.find('#SerachNeighborhoodTb').val('');
                    }
                }
                else {//open
                    //close search type ddl
                    hdrSearchPanel.closeEvent(hdrSearchPanel.$searchTypeList);
                    //Close other items   
					selectLocationPanel.closeAllOtherDdl($thisLabel, selectLocationPanel.$locationsPanel, currentItemMarkerCss);
                    $thisLocationList.addClass(selectLocationPanel.openItemCss);
									
                   gearPopup.close();
					GridPopup.close();
					BellPopup.close();
					NotificationPopup.close();
					friendPopup.close();
					profilePopup.close();
				//	MediaTopBarPanel.close();
                    //open current location item
                    $thisLocationList.slideDown(100);
                    //for ddl with search inputs
                    if ($thisLocationList.hasClass('js-ul-ddl'))
                    {
                        $thisLocationList.find('ul').slideDown(100);
                        angular.element('#NgStateApp').scope().rebindAllCountries();
												angular.element('#NgStateApp').scope().rebindAllStates();
												angular.element('#NgStateApp').scope().rebindAllCounties();
												angular.element('#NgStateApp').scope().rebindAllCities();
                    }
					 $thisLocationList.find('input').focus();
                    //close SITS tooltip popup
                    searchByTagManager.hideInfoPopup_inTheHeader();
                }
            });
            $thisLocationList.find('span').each(function () {
                $(this).on('click', function () {
                    $thisLabel.html($(this).text());
                    $thisLocationList.removeClass(selectLocationPanel.openItemCss);
                    $thisLocationList.slideUp(0);
                    //for ddl with search inputs
                    if ($thisLocationList.hasClass('js-ul-ddl')) {
                        $thisLocationList.find('ul').slideUp(0);
                        $thisLocationList.find('#SerachCountryTb').val('');
                    }
                })
            });
        });
    },
    openEvent: function () {
			
		  //close search type ddl
        hdrSearchPanel.closeEvent(hdrSearchPanel.$searchTypeList);
        //Close other items   
		if (typeof $thisLabel !== 'undefined'	)	
				selectLocationPanel.closeAllOtherDdl($thisLabel, selectLocationPanel.$locationsPanel, currentItemMarkerCss);
		if (typeof $thisLocationList !== 'undefined'	)	
			$thisLocationList.addClass(selectLocationPanel.openItemCss);

        profilePopup.close();
        //close gear popup
        gearPopup.close();
		//MediaTopBarPanel.close();
        //open current location item
		if (typeof $thisLocationList !== 'undefined'	)	{
			$thisLocationList.slideDown(100);
			//for ddl with search inputs
			if ($thisLocationList.hasClass('js-ul-ddl')) {
				$thisLocationList.find('ul').slideDown(100);
				angular.element('#NgStateApp').scope().rebindAllCountries();
			}
		}
        //close SITS tooltip popup
        searchByTagManager.hideInfoPopup_inTheHeader();
    },
    closeEvent: function(){
	
        if (selectLocationPanel.$locationsPanel != "" &amp;&amp; selectLocationPanel.$locationsPanel.length != 0) {
            if (selectLocationPanel.$locationsPanel.hasClass(selectLocationPanel.openPanelCss)) {
                selectLocationPanel.$locationsPanel.removeClass(selectLocationPanel.openPanelCss);
                selectLocationPanel.$locationsPanel.fadeOut();
            }
			
			//MediaTopBarPanel.open();
        }
    },
    closeAllDdl: function () {
		   //for dropdowns, and all dropdowns with search textboxes
        $('#SelectLocationPanel').find('.location-item ul,.location-item .js-ul-ddl').each(function () {
            $(this).slideUp(0);
            $(this).removeClass(selectLocationPanel.openItemCss);
        });
	//	MediaTopBarPanel.open();
    },
    closeAllOtherDdl: function ($this, $panel, currentCss) {
	    $this.next('ul').first().addClass(currentCss);
        $panel.find('.location-item ul,.location-item .js-ul-ddl').each(function () {
            if (!$(this).hasClass(currentCss)) {
                $(this).removeClass(selectLocationPanel.openItemCss);
                $(this).slideUp(100);
            }
        });
        
        if($this.next('ul').length == 0)
        {
            $this.next('ul').first().removeClass(currentCss);
        }
        else{
            $this.next('.js-ul-ddl').first().removeClass(currentCss);
        }
    },
    openCloseHandler: function ($btn, $panel, cssMarker) {
		if ($btn.length != 0) {
            $btn.on('click', function () {
               
              /* if ($btn.attr('id') == "NetworksLinkBtn") {
                    $("#NgStateApp").css("display", "none");
                    $("#divLocationSelectDLL").css("display", "block");
                    $("#SelectLocationPanel").css({ "top": "" });
                   // $("#SelectLocationPanel").css({ "left": 80 });
                }
                else if ($btn.attr('id') == "LocationsLinkBtn") {
                    var position = $('#tblLocations').position();
                    $("#SelectLocationPanel").css({ "top": "" });
                    $("#NgStateApp").css("display", "block");
                    $("#divLocationSelectDLL").css("display", "none");
                  //  $("#SelectLocationPanel").css({ "left": 80 });

                } else if ($("#SelectLocationPanel").attr('page-type') == "C") {
                    $("#SelectLocationPanel").css({ "top": "" });
                   // $("#SelectLocationPanel").css({ "left": 80 });
                    $("#NgStateApp").css("display", "none");
                    $("#divLocationSelectDLL").css("display", "Block");
                    
                }
                else if ($("#SelectLocationPanel").attr('page-type') == "L") {
                    $("#SelectLocationPanel").css({ "top": "" });
                  //  $("#SelectLocationPanel").css({ "left": 80 });
                    $("#NgStateApp").css("display", "block");
                    $("#divLocationSelectDLL").css("display", "none");


                }*/
                if ($panel.hasClass(cssMarker)) {//close
                    $panel.removeClass(cssMarker);
                    $panel.fadeOut(0);
                    selectLocationPanel.closeAllDdl()
									//	if ($('#HdrLocationLabel').hasClass("HdrLocationLabelup")) {//close
										//	$('#HdrLocationLabel').removeClass("HdrLocationLabelup");
										//	$('#HdrLocationLabel').addClass("HdrLocationLabeldown");
										
										//}
											$('#HdrLocationIcon').attr("src","/css/whiteLayout/images/White-Triangle.png");
										
								setCookie("LocationBarOpen","1",1);		
                }
                else {//open
									/*if ($('#HdrLocationLabel').hasClass("HdrLocationLabeldown")) {//close
											$('#HdrLocationLabel').removeClass("HdrLocationLabeldown");
											$('#HdrLocationLabel').addClass("HdrLocationLabelup");*/
										//	setCookie("LocationBarOpen","1",1);
										//}
											setCookie("LocationBarOpen","1",1);
										$('#HdrLocationIcon').attr("src","/css/whiteLayout/images/White-TriangleUp.png");
									
									
                    //close search type ddl
                    hdrSearchPanel.closeEvent(hdrSearchPanel.$searchTypeList);
                    //close nav menu popup
                    navPopupPanel.closeEvent();
                    //close Top cities ddl on top Nav Line
                    topNavPanel.closeEvent();
                    //close LogIn popup
                    logInPopupPanel.closeEvent();

                  gearPopup.close();
					GridPopup.close();
					BellPopup.close();
					NotificationPopup.close();
					friendPopup.close();
					profilePopup.close();
                    //close  
										//MediaTopBarPanel.close();
                    TopLinksFrame.closeEvent();

                    $panel.addClass(cssMarker);
                    $panel.fadeIn(200, function () {
                        $(this).css('overflow', 'initial')
                    });

                    //close SITS tooltip popup
                    searchByTagManager.hideInfoPopup_inTheHeader();
                }
            });
        }
    }
}

var LinkPanelObj = {
    cssMarker: 'js-showed-pnl',
    $moreChannelPanel: '',
    $moreNetworkPanel: '',
    showChannelsPanel: function () {
        if (LinkPanelObj.$moreChannelPanel == '')
        {
            LinkPanelObj.$moreChannelPanel = $('#ChannelsSelectLinkPanel');
            $("#ChannelsDDL").html("&lt;span&gt;Loading...&lt;/span&gt;");
            $.ajax({
                url: "/profile/inc/ajax_top_channels_links_default.asp", success: function (result) {
                    $("#ChannelsDDL").html(result);
                }
            });
           
        }
        if (LinkPanelObj.$moreChannelPanel.hasClass(LinkPanelObj.cssMarker)) {
            LinkPanelObj.hideChannelsPanel();
        }
        else {
            LinkPanelObj.$moreChannelPanel.addClass(LinkPanelObj.cssMarker);
            LinkPanelObj.$moreChannelPanel.fadeIn();
        }
    },
    hideChannelsPanel: function () {
        LinkPanelObj.$moreChannelPanel.removeClass(LinkPanelObj.cssMarker);
        LinkPanelObj.$moreChannelPanel.fadeOut();
    },
    showNetworksPanel: function () {
        if (LinkPanelObj.$moreNetworkPanel == '') {
            LinkPanelObj.$moreNetworkPanel = $('#NetworksSelectLinkPanel');
        }
        if (LinkPanelObj.$moreNetworkPanel.hasClass(LinkPanelObj.cssMarker)) {
            LinkPanelObj.hideNetworksPanel();
        }
        else {
            LinkPanelObj.$moreNetworkPanel.addClass(LinkPanelObj.cssMarker);
            LinkPanelObj.$moreNetworkPanel.fadeIn();
        }
    },
    hideNetworksPanel: function () {
        LinkPanelObj.$moreNetworkPanel.removeClass(LinkPanelObj.cssMarker);
        LinkPanelObj.$moreNetworkPanel.fadeOut();
    }
}

var hdrSearchPanel = {
	$hdrSearchDllLabel: '',
	$searchTypeList: '',
	openDDLCss: 'js-opened-search-ddl',
	init: function () {
		hdrSearchPanel.$hdrSearchDllLabel = $('#HdrSearchDDL');
		hdrSearchPanel.$searchTypeList = hdrSearchPanel.$hdrSearchDllLabel.next('ul');

		hdrSearchPanel.$hdrSearchDllLabel.on('click', function () {
			if (hdrSearchPanel.$searchTypeList.hasClass(hdrSearchPanel.openDDLCss)) {//close
				hdrSearchPanel.closeEvent(hdrSearchPanel.$searchTypeList)
			}
			else {//open
				hdrSearchPanel.$searchTypeList.addClass(hdrSearchPanel.openDDLCss);
				hdrSearchPanel.$searchTypeList.slideDown(100);
				//close all opened location item
			//	selectLocationPanel.closeAllDdl();
				//close select location panel
			//	selectLocationPanel.closeEvent();
				//close LogIn popup
			//	logInPopupPanel.closeEvent();

			//	profilePopup.close();
				//close gear popup
			//	gearPopup.close();
				//close category panel
				if (typeof  searchPagePanel != "undefined") {
					searchPagePanel.closeEvent();
				}
			}
		});
		//select other search type
		var $searchForm = hdrSearchPanel.$hdrSearchDllLabel.parents('form');
		var $hfNoSearchURL = $searchForm.find('#hfNoSearchURL');
		var $hfKeySearchURL = $searchForm.find('#hfKeySearchURL');
		var $HeaderMedia = $searchForm.find('#HeaderMedia');
		var $HeaderMediaType = $searchForm.find('#HeaderMediaType');
		hdrSearchPanel.$hdrSearchDllLabel.next('ul').find('span').each(function () {
			$(this).on('click', function () {
				
				hdrSearchPanel.$hdrSearchDllLabel.html($(this).text());
				hdrSearchPanel.$searchTypeList.removeClass(hdrSearchPanel.openDDLCss);
				hdrSearchPanel.$searchTypeList.slideUp(0);
				//reinit form fields
				$searchForm.attr('action', $(this).attr('data-FormUrl'))
				$hfNoSearchURL.val($(this).attr('data-NoSearchURL'));
				$hfKeySearchURL.val($(this).attr('data-KeySearchURL'));
				$HeaderMedia.val($(this).attr('data-media'));
				$HeaderMediaType.val($(this).attr('data-MediaType'));
				//$("#tbSearchFor").val('')
				//$("#tbSearchFor").trigger('keyup');
			})
		});
	},
	closeEvent: function ($srchTypeList) {
		$srchTypeList.removeClass(hdrSearchPanel.openDDLCss);
		$srchTypeList.slideUp(100);
	}
}

var ThirdbarMediaPanel = {
	$ThirdbarDllLabel: '',
	$searchTypeList: '',
	openDDLCss: 'js-opened-search-ddl',
	init: function () {
		ThirdbarMediaPanel.$ThirdbarDllLabel = $('#MediaThirdbar');
		ThirdbarMediaPanel.$searchTypeList = ThirdbarMediaPanel.$ThirdbarDllLabel.next('ul');

		ThirdbarMediaPanel.$ThirdbarDllLabel.on('click', function () {
			if (ThirdbarMediaPanel.$searchTypeList.hasClass(ThirdbarMediaPanel.openDDLCss)) {//close
				ThirdbarMediaPanel.closeEvent(ThirdbarMediaPanel.$searchTypeList)
			}
			else {//open
				ThirdbarMediaPanel.$searchTypeList.addClass(ThirdbarMediaPanel.openDDLCss);
				ThirdbarMediaPanel.$searchTypeList.slideDown(100);
			
				//close category panel
				if (typeof  searchPagePanel != "undefined") {
					searchPagePanel.closeEvent();
				}
			}
		});
		
		ThirdbarMediaPanel.$ThirdbarDllLabel.next('ul').find('span').each(function () {
			$(this).on('click', function () {
				ThirdbarMediaPanel.$ThirdbarDllLabel.html($(this).text());
				ThirdbarMediaPanel.$searchTypeList.removeClass(ThirdbarMediaPanel.openDDLCss);
				ThirdbarMediaPanel.$searchTypeList.slideUp(0);
				
			})
		});
	},
	closeEvent: function ($srchTypeList) {
		$srchTypeList.removeClass(ThirdbarMediaPanel.openDDLCss);
		$srchTypeList.slideUp(100);
	}
}
function getCookie(name) {
    var v = document.cookie.match('(^|;) ?' + name + '=([^;]*)(;|$)');
    return v ? v[2] : null;
}
function setCookie(name, value, days) {
    var d = new Date;
    d.setTime(d.getTime() + 24*60*60*1000*days);
    document.cookie = name + "=" + value + ";path=/;expires=" + d.toGMTString();
}</pre></body></html>