var blnCallGetLeftMenu=true
var pageSettings =""
var MediaCategoryID=""
var MediaCategory=""
var MediaCategoryName=""
var MediaBusCategoryID=""
var MediaBusCategoryName=""		
var MemberCat=""
var MemberCatName=""	
var PersonalPref	=""
var LocalPageActionURL=""
var WorldPageActionURL=""
var gparentCategory=""
var gparentCategoryName=""
var OnlyForBusiness=""
var ParentCatClick=''
var CurrSelectedObject=null
locationbreadcrum=0
var peopleMediaTitle=""
var BoardMediaTitle=""
var searchButtonPressed=0
var currSelectedMediatype
var postURL=""
 var curCP
var stringHidePopup
 stringHidePopup="Allcatlist,Alllist,AllParentcatlist,AllBuscatlist,AllBuslist,AllBusParentcatlist,AllCountrylist,AllStatelist,AllCountylist,AllCitylist,AllInternationalCitylist,AllMedialist,MediaCatlist,AllNeighborhoodlist"
function getUrlVars(){
    var vars = [], hash;
    var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
    for(var i = 0; i < hashes.length; i++)
    {
        hash = hashes[i].split('=');
        vars.push(hash[0]);
        vars[hash[0]] = hash[1];
    }
    return vars;
}

function setTopSearchMedia(mediatype){
	
}

function gotolocation(url){
location.href=url;	
}

function MediaChangeView(){
	location.href=$('#ImageBoardURL').attr('href');
 	
}

function GroupChangeView(){
	location.href=$('#groupurl').attr('href');
 	
}

function SetLeftProductCategory(caturl){
	var dataurl=caturl
	$("#Productcatwithicon ul li a[data-url='"+dataurl+"']").first().click();
}

function SetLeftCategory(el){
	var dataurl=$(el).attr("data-url")
	$("#Productcatwithicon ul li a[data-url='"+dataurl+"']").first().click();
}

function SetDirectoryLeftCategory(el){
	var dataurl=$(el).attr("data-url")
	$("#dictorycatwithicon ul li a[data-url='"+dataurl+"']").first().click();
	
}

function SetLeftMediaCategory(el){
	var dataurl=$(el).attr("data-url")
	//console.log(dataurl)
	$("#videocategory div[data-url='"+dataurl+"']").first().click();
}

function SetLeftBusMediaCategory(el){
	var dataurl=$(el).attr("data-url")
	//console.log(dataurl)
	$("#businesscategory div[data-url='"+dataurl+"']").first().click();
	
	
}

function hideAlllistNotThis(id){
	 
	 stringHidePopuparr=stringHidePopup.split(",")
	 
	 for (let i = 0; i < stringHidePopuparr.length; i++) {
		if (stringHidePopuparr[i]!=id){
			var $locationDllLabel1 = $('#'+stringHidePopuparr[i]);
	
			if ($locationDllLabel1){
				if ($locationDllLabel1.attr('data-shown') == 'true') {
					$locationDllLabel1.attr('data-shown', 'false');
					$locationDllLabel1.css('display','none');
				}
			}
			
		}
	}
	
}

function hideAlllist(){
	 
	 stringHidePopuparr=stringHidePopup.split(",")
	 
	 for (let i = 0; i < stringHidePopuparr.length; i++) {
		
		var $locationDllLabel1 = $('#'+stringHidePopuparr[i]);

		if ($locationDllLabel1){
			if ($locationDllLabel1.attr('data-shown') == 'true') {
				$locationDllLabel1.attr('data-shown', 'false');
				$locationDllLabel1.css('display','none');
			}
		}
			
		
	}
	
}

function hideBreadCrumPop(id){
	 
	
		var $locationDllLabel1 = $('#'+id);

		if ($locationDllLabel1){
			if ($locationDllLabel1.attr('data-shown') == 'true') {
				$locationDllLabel1.attr('data-shown', 'false');
				$locationDllLabel1.css('display','none');
			}
		}
			
		
	
}

function ShowMediaList(event){
	hideAlllistNotThis('AllMedialist')
	var $locationDllLabel = $('#AllMedialist');
    if ($locationDllLabel.attr('data-shown') == 'true') {
        $locationDllLabel.attr('data-shown', 'false');
        $locationDllLabel.css('display','none');
    }
    else {
		
        $locationDllLabel.attr('data-shown', 'true');
        $locationDllLabel.css('display','block');
    }	
}

function ShowCatlist(caturl,event){
	hideAlllistNotThis('Allcatlist')
	var $locationDllLabel = $('#Allcatlist');
    if ($locationDllLabel.attr('data-shown') == 'true') {
        $locationDllLabel.attr('data-shown', 'false');
        $locationDllLabel.css('display','none');
    }
    else {
		if ($locationDllLabel.html().length<5){
			var scope = angular.element($("#NgStateApp")).scope();
			var sendInfo2 = {
				id:'Allcatlist',
				caturl:caturl,
				curMediaPage:curMediaPage,
				ViewMediaPage:ViewMediaPage,
				countryid:scope.SelectedCountryID,
				countryurl:scope.SelectedCountryURL,
				stateid:scope.SelectedStateID,
				stateurl:scope.SelectedStateURL,
				countyid:scope.SelectedCountyID,
				countyurl:scope.SelectedCountyURL,
				cityId:scope.SelectedCityID,
				cityurl:scope.SelectedCityURL,
				neighborhoodid:scope.SelectedNeighborhoodID,
				neighborhoodurl:scope.SelectedNeighborhoodURL
			}
			$.ajax({
				type: "get",
				url: "/ajax/getallProductCat.asp",
				data: sendInfo2,
				dataType: "html",
				async: false,
				success: function (data) 
				{
					$locationDllLabel.html(data)
					
				}
			});
		}
        $locationDllLabel.attr('data-shown', 'true');
        $locationDllLabel.css('display','block');
    }	
}

function ShowBusCatlist(caturl,event){
	hideAlllistNotThis('AllBuscatlist')
	var $locationDllLabel = $('#AllBuscatlist');
    if ($locationDllLabel.attr('data-shown') == 'true') {
        $locationDllLabel.attr('data-shown', 'false');
        $locationDllLabel.css('display','none');
    }
    else {
		if ($locationDllLabel.html().length<5){
			var scope = angular.element($("#NgStateApp")).scope();
			var sendInfo2 = {
				id:'AllBuscatlist',
				caturl:caturl,
				curMediaPage:curMediaPage,
				ViewMediaPage:ViewMediaPage,
				countryid:scope.SelectedCountryID,
				countryurl:scope.SelectedCountryURL,
				stateid:scope.SelectedStateID,
				stateurl:scope.SelectedStateURL,
				countyid:scope.SelectedCountyID,
				countyurl:scope.SelectedCountyURL,
				cityId:scope.SelectedCityID,
				cityurl:scope.SelectedCityURL,
				neighborhoodid:scope.SelectedNeighborhoodID,
				neighborhoodurl:scope.SelectedNeighborhoodURL
			}
			$.ajax({
				type: "get",
				url: "/ajax/getallBusCat.asp",
				data: sendInfo2,
				dataType: "html",
				async: false,
				success: function (data) 
				{
					$locationDllLabel.html(data)
					
				}
			});
		}
        $locationDllLabel.attr('data-shown', 'true');
        $locationDllLabel.css('display','block');
    }	
}

function ShowBusallCatlist(caturl,event){
	hideAlllistNotThis('AllBuslist')
	var $locationDllLabel = $('#AllBuslist');
    if ($locationDllLabel.attr('data-shown') == 'true') {
        $locationDllLabel.attr('data-shown', 'false');
        $locationDllLabel.css('display','none');
    }
    else {
		if ($locationDllLabel.html().length<5){
			var scope = angular.element($("#NgStateApp")).scope();
			var sendInfo2 = {
				id:'AllBuslist',
				caturl:caturl,
				curMediaPage:curMediaPage,
				ViewMediaPage:ViewMediaPage,
				countryid:scope.SelectedCountryID,
				countryurl:scope.SelectedCountryURL,
				stateid:scope.SelectedStateID,
				stateurl:scope.SelectedStateURL,
				countyid:scope.SelectedCountyID,
				countyurl:scope.SelectedCountyURL,
				cityId:scope.SelectedCityID,
				cityurl:scope.SelectedCityURL,
				neighborhoodid:scope.SelectedNeighborhoodID,
				neighborhoodurl:scope.SelectedNeighborhoodURL
			}
			$.ajax({
				type: "get",
				url: "/ajax/getallBusCat.asp",
				data: sendInfo2,
				dataType: "html",
				async: false,
				success: function (data) 
				{
					$locationDllLabel.html(data)
					
				}
			});
		}
        $locationDllLabel.attr('data-shown', 'true');
        $locationDllLabel.css('display','block');
    }	
}

function ShowBusParentCatlist(caturl,event){
	hideAlllistNotThis('AllBusParentcatlist')
	var $locationDllLabel = $('#AllBusParentcatlist');
    if ($locationDllLabel.attr('data-shown') == 'true') {
        $locationDllLabel.attr('data-shown', 'false');
        $locationDllLabel.css('display','none');
    }
    else {
		if ($locationDllLabel.html().length<5){
			var scope = angular.element($("#NgStateApp")).scope();
			var sendInfo2 = {
				id:'AllBusParentcatlist',
				caturl:caturl,
				curMediaPage:curMediaPage,
				ViewMediaPage:ViewMediaPage,
				countryid:scope.SelectedCountryID,
				countryurl:scope.SelectedCountryURL,
				stateid:scope.SelectedStateID,
				stateurl:scope.SelectedStateURL,
				countyid:scope.SelectedCountyID,
				countyurl:scope.SelectedCountyURL,
				cityId:scope.SelectedCityID,
				cityurl:scope.SelectedCityURL,
				neighborhoodid:scope.SelectedNeighborhoodID,
				neighborhoodurl:scope.SelectedNeighborhoodURL
			}
			$.ajax({
				type: "get",
				url: "/ajax/getallBusCat.asp",
				data: sendInfo2,
				dataType: "html",
				async: false,
				success: function (data) 
				{
					$locationDllLabel.html(data)
					
				}
			});
		}
        $locationDllLabel.attr('data-shown', 'true');
        $locationDllLabel.css('display','block');
    }	
}

function ShowMediaCatList(caturl,event){
	hideAlllistNotThis('MediaCatlist')
	var $locationDllLabel = $('#MediaCatlist');
    if ($locationDllLabel.attr('data-shown') == 'true') {
        $locationDllLabel.attr('data-shown', 'false');
        $locationDllLabel.css('display','none');
    }
    else {
		if ($locationDllLabel.html().length<5){
			var scope = angular.element($("#NgStateApp")).scope();
			var sendInfo2 = {
				id:'MediaCatlist',
				curMediaPage:curMediaPage,
				ViewMediaPage:ViewMediaPage,
				countryid:scope.SelectedCountryID,
				countryurl:scope.SelectedCountryURL,
				stateid:scope.SelectedStateID,
				stateurl:scope.SelectedStateURL,
				countyid:scope.SelectedCountyID,
				countyurl:scope.SelectedCountyURL,
				cityId:scope.SelectedCityID,
				cityurl:scope.SelectedCityURL,
				neighborhoodid:scope.SelectedNeighborhoodID,
				neighborhoodurl:scope.SelectedNeighborhoodURL
			}
			$.ajax({
				type: "get",
				url: "/ajax/getallMediaCat.asp",
				data: sendInfo2,
				dataType: "html",
				async: false,
				success: function (data) 
				{
					$locationDllLabel.html(data)
					
				}
			});
		}
        $locationDllLabel.attr('data-shown', 'true');
        $locationDllLabel.css('display','block');
    }	
}

function ShowallCatlist(caturl,event){
	hideAlllistNotThis('Alllist')
	var $locationDllLabel = $('#Alllist');
    if ($locationDllLabel.attr('data-shown') == 'true') {
        $locationDllLabel.attr('data-shown', 'false');
        $locationDllLabel.css('display','none');
    }
    else {
		if ($locationDllLabel.html().length<5){
			var scope = angular.element($("#NgStateApp")).scope();
			var sendInfo2 = {
				id:'Alllist',
				caturl:caturl,
				curMediaPage:curMediaPage,
				ViewMediaPage:ViewMediaPage,
				countryid:scope.SelectedCountryID,
				countryurl:scope.SelectedCountryURL,
				stateid:scope.SelectedStateID,
				stateurl:scope.SelectedStateURL,
				countyid:scope.SelectedCountyID,
				countyurl:scope.SelectedCountyURL,
				cityId:scope.SelectedCityID,
				cityurl:scope.SelectedCityURL,
				neighborhoodid:scope.SelectedNeighborhoodID,
				neighborhoodurl:scope.SelectedNeighborhoodURL
			}
			$.ajax({
				type: "get",
				url: "/ajax/getallProductCat.asp",
				data: sendInfo2,
				dataType: "html",
				async: false,
				success: function (data) 
				{
					$locationDllLabel.html(data)
					
				}
			});
		}
        $locationDllLabel.attr('data-shown', 'true');
        $locationDllLabel.css('display','block');
    }	
}

function ShowParentCatlist(caturl,event){
	hideAlllistNotThis('AllParentcatlist')
	var $locationDllLabel = $('#AllParentcatlist');
    if ($locationDllLabel.attr('data-shown') == 'true') {
        $locationDllLabel.attr('data-shown', 'false');
        $locationDllLabel.css('display','none');
    }
    else {
		if ($locationDllLabel.html().length<5){
			var scope = angular.element($("#NgStateApp")).scope();
			var sendInfo2 = {
				id:'AllParentcatlist',
				caturl:caturl,
				curMediaPage:curMediaPage,
				ViewMediaPage:ViewMediaPage,
				countryid:scope.SelectedCountryID,
				countryurl:scope.SelectedCountryURL,
				stateid:scope.SelectedStateID,
				stateurl:scope.SelectedStateURL,
				countyid:scope.SelectedCountyID,
				countyurl:scope.SelectedCountyURL,
				cityId:scope.SelectedCityID,
				cityurl:scope.SelectedCityURL,
				neighborhoodid:scope.SelectedNeighborhoodID,
				neighborhoodurl:scope.SelectedNeighborhoodURL
			}
			$.ajax({
				type: "get",
				url: "/ajax/getallProductCat.asp",
				data: sendInfo2,
				dataType: "html",
				async: false,
				success: function (data) 
				{
					$locationDllLabel.html(data)
					
				}
			});
		}
        $locationDllLabel.attr('data-shown', 'true');
        $locationDllLabel.css('display','block');
    }	
}

function ShowCountryList(event){
	hideAlllistNotThis('AllCountrylist')
	var $locationDllLabel = $('#AllCountrylist');
    if ($locationDllLabel.attr('data-shown') == 'true') {
        $locationDllLabel.attr('data-shown', 'false');
        $locationDllLabel.css('display','none');
    }
    else {
		if ($locationDllLabel.html().length<5){
			var lcaturl
			if (document.getElementById("category"))
				lcaturl=document.frmMedia.category.value
			var sendInfo2 = {
				id:'AllCountrylist',
				curMediaPage:curMediaPage,
				ViewMediaPage:ViewMediaPage,
				caturl:lcaturl
			}
			$.ajax({
				type: "get",
				url: "/ajax/getallCountry.asp",
				data: sendInfo2,
				dataType: "html",
				async: false,
				success: function (data) 
				{
					$locationDllLabel.html(data)
					
				}
			});
		}
        $locationDllLabel.attr('data-shown', 'true');
        $locationDllLabel.css('display','block');
    }	
}

function ShowStateList(event){
	hideAlllistNotThis('AllStatelist')
	var $locationDllLabel = $('#AllStatelist');
    if ($locationDllLabel.attr('data-shown') == 'true') {
        $locationDllLabel.attr('data-shown', 'false');
        $locationDllLabel.css('display','none');
    }
    else {
		if ($locationDllLabel.html().length<5){
		var scope = angular.element($("#NgStateApp")).scope();
		var lcaturl
			if (document.getElementById("category"))
				lcaturl=document.frmMedia.category.value
			var sendInfo2 = {
				id:'AllStatelist',
				curMediaPage:curMediaPage,
				ViewMediaPage:ViewMediaPage,
				countryid:scope.SelectedCountryID,
				countryname:scope.SelectedCountryName,
				countryurl:scope.SelectedCountryURL,
				caturl:lcaturl
			}
			$.ajax({
				type: "get",
				url: "/ajax/getallState.asp",
				data: sendInfo2,
				dataType: "html",
				async: false,
				success: function (data) 
				{
					$locationDllLabel.html(data)
					
				}
			});
		}
        $locationDllLabel.attr('data-shown', 'true');
        $locationDllLabel.css('display','block');
    }	
}

function ShowCountyList(event){
	hideAlllistNotThis('AllCountylist')
	var $locationDllLabel = $('#AllCountylist');
    if ($locationDllLabel.attr('data-shown') == 'true') {
        $locationDllLabel.attr('data-shown', 'false');
        $locationDllLabel.css('display','none');
    }
    else {
		if ($locationDllLabel.html().length<5){
		var scope = angular.element($("#NgStateApp")).scope();
		var lcaturl
			if (document.getElementById("category"))
				lcaturl=document.frmMedia.category.value
			var sendInfo2 = {
				id:'AllCountylist',
				curMediaPage:curMediaPage,
				ViewMediaPage:ViewMediaPage,
				countryid:scope.SelectedCountryID,
				countryname:scope.SelectedCountryName,
				countryurl:scope.SelectedCountryURL,
				stateid:scope.SelectedStateID,
				statename:scope.SelectedStateName,
				stateurl:scope.SelectedStateURL,
				stateabbr:scope.SelectedStateAbbr,
				caturl:lcaturl
			}
			$.ajax({
				type: "get",
				url: "/ajax/getallCounty.asp",
				data: sendInfo2,
				dataType: "html",
				async: false,
				success: function (data) 
				{
					$locationDllLabel.html(data)
					
				}
			});
		}
        $locationDllLabel.attr('data-shown', 'true');
        $locationDllLabel.css('display','block');
    }	
}

function ShowCityList(event){
	hideAlllistNotThis('AllCitylist')
	var $locationDllLabel = $('#AllCitylist');
    if ($locationDllLabel.attr('data-shown') == 'true') {
        $locationDllLabel.attr('data-shown', 'false');
        $locationDllLabel.css('display','none');
    }
    else {
		if ($locationDllLabel.html().length<5){
		var scope = angular.element($("#NgStateApp")).scope();
		var lcaturl
			if (document.getElementById("category"))
				lcaturl=document.frmMedia.category.value
			var sendInfo2 = {
				id:'AllCitylist',
				curMediaPage:curMediaPage,
				ViewMediaPage:ViewMediaPage,
				countryid:scope.SelectedCountryID,
				countryname:scope.SelectedCountryName,
				countryurl:scope.SelectedCountryURL,
				stateid:scope.SelectedStateID,
				statename:scope.SelectedStateName,
				stateurl:scope.SelectedStateURL,
				stateabbr:scope.SelectedStateAbbr,
				countyid:scope.SelectedCountyID,
				countyname:scope.SelectedCountyName,
				countyurl:scope.SelectedCountyURL,
				caturl:lcaturl
			}
			$.ajax({
				type: "get",
				url: "/ajax/getallCity.asp",
				data: sendInfo2,
				dataType: "html",
				async: false,
				success: function (data) 
				{
					$locationDllLabel.html(data)
					
				}
			});
		}
        $locationDllLabel.attr('data-shown', 'true');
        $locationDllLabel.css('display','block');
    }	
}

function ShowNeighborhoodList(event){
	hideAlllistNotThis('AllNeighborhoodlist')
	var $locationDllLabel = $('#AllNeighborhoodlist');
    if ($locationDllLabel.attr('data-shown') == 'true') {
        $locationDllLabel.attr('data-shown', 'false');
        $locationDllLabel.css('display','none');
    }
    else {
		if ($locationDllLabel.html().length<5){
		var scope = angular.element($("#NgStateApp")).scope();
		var lcaturl
			if (document.getElementById("category"))
				lcaturl=document.frmMedia.category.value
			var sendInfo2 = {
				id:'AllNeighborhoodlist',
				curMediaPage:curMediaPage,
				ViewMediaPage:ViewMediaPage,
				countryid:scope.SelectedCountryID,
				countryname:scope.SelectedCountryName,
				countryurl:scope.SelectedCountryURL,
				stateid:scope.SelectedStateID,
				statename:scope.SelectedStateName,
				stateurl:scope.SelectedStateURL,
				stateabbr:scope.SelectedStateAbbr,
				countyid:scope.SelectedCountyID,
				countyname:scope.SelectedCountyName,
				countyurl:scope.SelectedCountyURL,
				cityId:scope.SelectedCityID,
				cityName:scope.SelectedCityName,
				cityurl:scope.SelectedCityURL,
				caturl:lcaturl
			}
			$.ajax({
				type: "get",
				url: "/ajax/getallNeighborhood.asp",
				data: sendInfo2,
				dataType: "html",
				async: false,
				success: function (data) 
				{
					$locationDllLabel.html(data)
					
				}
			});
		}
        $locationDllLabel.attr('data-shown', 'true');
        $locationDllLabel.css('display','block');
    }	
}

function ShowInternationalCityList(event){
	hideAlllistNotThis('AllInternationalCitylist')
	var $locationDllLabel = $('#AllInternationalCitylist');
    if ($locationDllLabel.attr('data-shown') == 'true') {
        $locationDllLabel.attr('data-shown', 'false');
        $locationDllLabel.css('display','none');
    }
    else {
		if ($locationDllLabel.html().length<5){
		var scope = angular.element($("#NgStateApp")).scope();
		var lcaturl
			if (document.getElementById("category"))
				lcaturl=document.frmMedia.category.value
			var sendInfo2 = {
				id:'AllInternationalCitylist',
				curMediaPage:curMediaPage,
				ViewMediaPage:ViewMediaPage,
				countryid:scope.SelectedCountryID,
				countryname:scope.SelectedCountryName,
				countryurl:scope.SelectedCountryURL,
				caturl:lcaturl
			}
			$.ajax({
				type: "get",
				url: "/ajax/getallInternationalCity.asp",
				data: sendInfo2,
				dataType: "html",
				async: false,
				success: function (data) 
				{
					$locationDllLabel.html(data)
					
				}
			});
		}
        $locationDllLabel.attr('data-shown', 'true');
        $locationDllLabel.css('display','block');
    }
}

function SetCategoryBreadcrum(){
	var scope = angular.element($("#NgStateApp")).scope();
	strCategoryBreadcrum=""
	var TNYKACatID=""
	if (document.frmMedia.NYKACatID)
		TNYKACatID=	document.frmMedia.NYKACatID.value
	if (document.getElementById("category"))
		cat=document.getElementById("category").value
	else
		cat="all"
	if (document.getElementById("Categoryname"))
		Categoryname=document.getElementById("Categoryname").value
	else
		Categoryname="All"
	if (Categoryname=="")
		Categoryname="All"
	if (cat=="")
		cat="all"
	if (cat=="all")
		Categoryname="All " +document.getElementById("MediaTypeTitle").innerHTML
	if ((curMediaPage=="product"  ||curMediaPage=="store" )  && TNYKACatID==""){
			// debugger
		
		if (document.getElementById("ParentcategoryName"))
			ParentcategoryName=document.getElementById("ParentcategoryName").value
		else
			ParentcategoryName=""
		if (document.getElementById("Parentcategory"))
			Parentcategory=document.getElementById("Parentcategory").value
		else
			Parentcategory=""
		
		strCategoryBreadcrum+="<a href=\"javascript:void(0);\" style=\"margin-left:8px;\" >"+document.getElementById("MediaTypeTitle").innerHTML +"</a>"
		
		strCategoryBreadcrum+="<span class=\"what-on-board-ddl\" style=\"margin-left:3px;\"><span class=\"special what-on-board-ddl_label\" onclick=\"ShowCatlist('all',event);\" style=\"padding-right:0px;\" >&nbsp;&nbsp;&nbsp;&nbsp;</span><div id=\"Allcatlist\" data-shown=\"false\" class=\"special\" style=\"display: none;min-width:150px;margin-left:-150px;\"></div></span>"
		if (ParentcategoryName!=""){
			strCategoryBreadcrum+="<a href=\"#\" data-url='" +Parentcategory+"'"

			if (ViewMediaPage=="True"){
				strCategoryBreadcrum+=" onclick=\"ChangeLocationBreadCrumMediaNew('"+scope.SelectedCountryID +"','"+scope.SelectedStateID +"','"+scope.SelectedCountyID+"','"+scope.SelectedCityID+"','"+scope.SelectedNeighborhoodID +"','"+scope.SelectedCountryURL +"','"+scope.SelectedStateURL +"','"+scope.SelectedCountyURL+"','"+scope.SelectedCityURL+"','"+scope.SelectedNeighborhoodURL +"','"+Parentcategory+"');\" "
			}else{
				strCategoryBreadcrum+=" onclick=\"setProductParentCat('','');SetLeftCategory(this);\" " 
			}
			strCategoryBreadcrum+=">"+ParentcategoryName+"</a>"
			strCategoryBreadcrum+="<span class=\"what-on-board-ddl\" style=\"margin-left:3px;\"><span class=\"special what-on-board-ddl_label\" onclick=\"ShowParentCatlist('" +Parentcategory+"',event);\" style=\"padding-right:0px;\" >&nbsp;&nbsp;&nbsp;&nbsp;</span><div id=\"AllParentcatlist\" data-shown=\"false\" class=\"special\" style=\"display: none;min-width:150px;margin-left:-150px;\"></div></span>"
			strCategoryBreadcrum+="<a href=\"#\" data-url='" +cat+"' onclick=\"SetLeftCategory(this);\">"+Categoryname+"</a>"
		
		}else{
			strCategoryBreadcrum+="<a href=\"#\" data-url='" +cat+"'"

			if (ViewMediaPage=="True"){
				strCategoryBreadcrum+=" onclick=\"ChangeLocationBreadCrumMediaNew('"+scope.SelectedCountryID +"','"+scope.SelectedStateID +"','"+scope.SelectedCountyID+"','"+scope.SelectedCityID+"','"+scope.SelectedNeighborhoodID +"','"+scope.SelectedCountryURL +"','"+scope.SelectedStateURL +"','"+scope.SelectedCountyURL+"','"+scope.SelectedCityURL+"','"+scope.SelectedNeighborhoodURL +"','"+cat+"');\" "
			}else{
				strCategoryBreadcrum+="	onclick=\"setProductParentCat('','');SetLeftCategory(this);\" "
			}
			strCategoryBreadcrum+=">"+Categoryname+"</a><span class=\"what-on-board-ddl\" style=\"margin-left:3px;\"><span class=\"special what-on-board-ddl_label\" onclick=\"ShowParentCatlist('" +cat+"',event);\" style=\"padding-right:0px;\" >&nbsp;&nbsp;&nbsp;&nbsp;</span><div id=\"AllParentcatlist\" data-shown=\"false\" class=\"special\" style=\"display: none;min-width:150px;margin-left:-150px;\"></div></span>"
		}                                                                                                                                         
		
	}else if (curMediaPage=="profile" || ((curMediaPage=="image" ||curMediaPage=="video"  ||curMediaPage=="blog" ||curMediaPage=="product" ||curMediaPage=="store" ) && TNYKACatID!="") ){
			
		
		if (document.getElementById("ParentcategoryName"))
			ParentcategoryName=document.getElementById("ParentcategoryName").value
		else
			ParentcategoryName=""
		if (document.getElementById("Parentcategory"))
			Parentcategory=document.getElementById("Parentcategory").value
		else
			Parentcategory=""
	
		strCategoryBreadcrum+="<a href=\"javascript:void(0);\" style=\"margin-left:8px;\" >"+document.getElementById("MediaTypeTitle").innerHTML +"</a>"
		
		strCategoryBreadcrum+="<span class=\"what-on-board-ddl\" style=\"margin-left:3px;\"><span class=\"special what-on-board-ddl_label\" onclick=\"ShowBusCatlist('all',event);\" style=\"padding-right:0px;\" >&nbsp;&nbsp;&nbsp;&nbsp;</span><div id=\"AllBuscatlist\" data-shown=\"false\" class=\"special\" style=\"display: none;min-width:150px;margin-left:-150px;\"></div></span>"
		if (ParentcategoryName!=""){
			
				
			strCategoryBreadcrum+="<a href=\"#\" data-url='" +Parentcategory+"'"

			if (ViewMediaPage=="True"){
				strCategoryBreadcrum+=" onclick=\"ChangeLocationBreadCrumMediaNew('"+scope.SelectedCountryID +"','"+scope.SelectedStateID +"','"+scope.SelectedCountyID+"','"+scope.SelectedCityID+"','"+scope.SelectedNeighborhoodID +"','"+scope.SelectedCountryURL +"','"+scope.SelectedStateURL +"','"+scope.SelectedCountyURL+"','"+scope.SelectedCityURL+"','"+scope.SelectedNeighborhoodURL +"','"+Parentcategory+"');\" "
			}else{
				if (curMediaPage=="profile")
					strCategoryBreadcrum+=" onclick=\"setProductParentCat('','');SetDirectoryLeftCategory(this);\" " 
				else
					strCategoryBreadcrum+=" onclick=\"setProductParentCat('','');SetLeftCategory(this);\" " 
			}
			strCategoryBreadcrum+=">"+ParentcategoryName+"</a>"
			strCategoryBreadcrum+="<span class=\"what-on-board-ddl\" style=\"margin-left:3px;\"><span class=\"special what-on-board-ddl_label\" onclick=\"ShowBusParentCatlist('" +Parentcategory+"',event);\" style=\"padding-right:0px;\" >&nbsp;&nbsp;&nbsp;&nbsp;</span><div id=\"AllBusParentcatlist\" data-shown=\"false\" class=\"special\" style=\"display: none;min-width:150px;margin-left:-150px;\"></div></span>"
			
			
			if (curMediaPage=="profile")
				strCategoryBreadcrum+="<a href=\"#\" data-url='" +cat+"' onclick=\"SetDirectoryLeftCategory(this);\">"+Categoryname+"</a>"
			else
				strCategoryBreadcrum+="<a href=\"#\" data-url='" +cat+"' onclick=\"SetLeftCategory(this);\">"+Categoryname+"</a>"
	
		}else{
			strCategoryBreadcrum+="<a href=\"#\" data-url='" +cat+"'"

			if (ViewMediaPage=="True"){
				strCategoryBreadcrum+=" onclick=\"ChangeLocationBreadCrumMediaNew('"+scope.SelectedCountryID +"','"+scope.SelectedStateID +"','"+scope.SelectedCountyID+"','"+scope.SelectedCityID+"','"+scope.SelectedNeighborhoodID +"','"+scope.SelectedCountryURL +"','"+scope.SelectedStateURL +"','"+scope.SelectedCountyURL+"','"+scope.SelectedCityURL+"','"+scope.SelectedNeighborhoodURL +"','"+cat+"');\" "
			}else{
				if (curMediaPage=="profile")
					strCategoryBreadcrum+="	onclick=\"setProductParentCat('','');SetDirectoryLeftCategory(this);\" "
				else
					strCategoryBreadcrum+="	onclick=\"setProductParentCat('','');SetLeftCategory(this);\" "
			}
			strCategoryBreadcrum+=">"+Categoryname+"</a><span class=\"what-on-board-ddl\" style=\"margin-left:3px;\"><span class=\"special what-on-board-ddl_label\" onclick=\"ShowBusParentCatlist('" +cat+"',event);\" style=\"padding-right:0px;\" >&nbsp;&nbsp;&nbsp;&nbsp;</span><div id=\"AllBusParentcatlist\" data-shown=\"false\" class=\"special\" style=\"display: none;min-width:150px;margin-left:-150px;\"></div></span>"
		}
	}else if (curMediaPage=="image" || curMediaPage=="audio" || curMediaPage=="video"||curMediaPage=="blog"||curMediaPage=="coupon"){
		/*
		strCategoryBreadcrum+="<a href=\"#\" data-url='all' onclick=\"SetLeftMediaCategory(this);\">All</a><span class=\"what-on-board-ddl\" style=\"margin-left:3px;\"><span class=\"special what-on-board-ddl_label\" onclick=\"ShowMediaCatList('all',event);\" style=\"padding-right:0px;\" >&nbsp;&nbsp;&nbsp;&nbsp;</span><div id=\"MediaCatlist\" data-shown=\"false\" class=\"special\" style=\"display: none;margin-left:-50px;\"></div></span>"
		if (document.getElementById("category").value!="all"){
			strCategoryBreadcrum+="<a href=\"#\" data-url='" +document.getElementById("category").value+"' onclick=\"SetLeftMediaCategory(this);\">"+document.getElementById("Categoryname").value+"</a>"
		}
		*/
	}
		
	if (((curMediaPage=="image" ||curMediaPage=="video" ||curMediaPage=="blog")  && TNYKACatID=="") || curMediaPage=="audio" ||curMediaPage=="coupon" ){
		
		strCategoryBreadcrum+="<a href=\"javascript:void(0);\" style=\"margin-left:8px;\" >"+document.getElementById("MediaTypeTitle").innerHTML +"</a>"
		
		strCategoryBreadcrum+="<span class=\"what-on-board-ddl\" style=\"margin-left:3px;\"><span class=\"special what-on-board-ddl_label\" onclick=\"ShowMediaCatList('all',event);\" style=\"padding-right:0px;\" >&nbsp;&nbsp;&nbsp;&nbsp;</span><div id=\"MediaCatlist\" data-shown=\"false\" class=\"special\" style=\"display: none;min-width:150px;margin-left:-150px;\"></div></span>"
		
		strCategoryBreadcrum+="<a href=\"#\" data-url='" +cat+"'"
		if (ViewMediaPage=="True"){
			strCategoryBreadcrum+=" onclick=\"ChangeLocationBreadCrumMediaNew('"+scope.SelectedCountryID +"','"+scope.SelectedStateID +"','"+scope.SelectedCountyID+"','"+scope.SelectedCityID+"','"+scope.SelectedNeighborhoodID +"','"+scope.SelectedCountryURL +"','"+scope.SelectedStateURL +"','"+scope.SelectedCountyURL+"','"+scope.SelectedCityURL+"','"+scope.SelectedNeighborhoodURL +"','"+cat+"');\" "
		}else{
				
			strCategoryBreadcrum+=" onclick=\"SetLeftMediaCategory(this);\" "
		}	
			strCategoryBreadcrum+=" >"+Categoryname+"</a>"
		
		
	}else if (curMediaPage=="peoples" ){
		strCategoryBreadcrum+="<a href=\"javascript:void(0);\" style=\"margin-left:8px;\" >"+document.getElementById("MediaTypeTitle").innerHTML +"</a>"
		
			
	}else if (curMediaPage=="board"){
		strCategoryBreadcrum+="<a href=\"javascript:void(0);\" style=\"margin-left:8px;\"  >Board</a>"
		strCategoryBreadcrum+="<span class=\"what-on-board-ddl\" style=\"margin-left:3px;\"><span class=\"special what-on-board-ddl_label\" onclick=\"ShowMediaCatList('all',event);\" style=\"padding-right:0px;\" >&nbsp;&nbsp;&nbsp;&nbsp;</span><div id=\"MediaCatlist\" data-shown=\"false\" class=\"special\" style=\"display: none;min-width:150px;margin-left:-150px;\"></div></span>"

		strCategoryBreadcrum+="<a href=\"#\" data-url='" +MemberCat+"'"

		strCategoryBreadcrum+=" onclick=\"SetLeftBusMediaCategory(this);\" "

		strCategoryBreadcrum+=" >"+MemberCatName+"</a>"
				
	}
	if (document.getElementById("BreadcrumCat"))
		document.getElementById("BreadcrumCat").innerHTML=strCategoryBreadcrum
		
	
}

function ShowBreadCrumBar() {
	document.getElementById("hidLocationBreadcrum").style.display="inline-block";
	document.getElementById("breadcrumfull").style.display="none";
	
}

function SetLocationBreadcrum(blnlast){
	var scope = angular.element($("#NgStateApp")).scope();
	/*console.log("---Location Breadcrum---")
	console.log( scope.SelectedCountryID + " : " + scope.SelectedStateID  + " : " + scope.SelectedCountyID + " : " + scope.SelectedCityID )
	console.log(scope.SelectedCountryName + " : " + scope.SelectedStateName  + " : " + scope.SelectedCountyName + " : " + scope.SelectedCityName  + " : " + scope.SelectedStateAbbr)
	console.log(scope.SelectedCountryURL + " : " + scope.SelectedStateURL  + " : " + scope.SelectedCountyURL + " : " + scope.SelectedCityURL )
	console.log(scope.RedirectURL + " : " + scope.SearchWhere  )
	console.log (scope.neighborhoodList.length
	*/
	
	
	
	locationbreadcrum=locationbreadcrum+1
	setWhatHappingTitleWithScope(scope)
	if (curMediaPage=="map"){
		return;
	}
	
	strBreadcrum="";
	//onclick=\"history.back();\"
	if (document.getElementById("Breadcrum") ){
		var lcaturl
			if (document.getElementById("category"))
				lcaturl=document.frmMedia.category.value
		

		strBreadcrum+="<span style=\"float:left;width:100%;\">"
		
		/*if (scope.neighborhoodList.length>1){
			strBreadcrum+="<span id=\"breadcrumfull\" style=\"float:left;width:30px;\"><a href=\"javascript:void(0);\"  onclick=\"ShowBreadCrumBar()\" style=\"margin-left:0px;\"><img src=\"/css/whiteLayout/images/new/double-arrow-left-3-128.png\" boder=\"0\" style=\"   width:30px;\"></a></span>"
			strBreadcrum+="<span id=\"hidLocationBreadcrum\" style=\"display:none\">"
		}
		*/
		strBreadcrum+="<a href=\"javascript:void(0);\" id=\"worldBreadcrum\" style=\"margin-left:0px;\" class=\"locationbreadcrum\" "
		
		if (curMediaPage=="board"  || curMediaPage=="network" || curMediaPage=="peopleboard" ) {			
			strBreadcrum+="	onclick=\"ChangeBoardView('A','',this,event);\""
		}else{
			if (ViewMediaPage=="True"){
				strBreadcrum+=" onclick=\"ChangeLocationBreadCrumMediaNew('-1','','','','','world','','','','','"+lcaturl+"');\" "
			}else{
				strBreadcrum+=" onclick=\"ChangeLocationBreadCrum(this,'-1','','','');\" "
			}
			
		}	
		strBreadcrum+="	>World</a><span class=\"what-on-board-ddl\" style=\"margin-left:3px;\"><span class=\"special what-on-board-ddl_label\" onclick=\"ShowCountryList(event);\" style=\"padding-right:0px;\" >&nbsp;&nbsp;&nbsp;&nbsp;</span><div id=\"AllCountrylist\" data-shown=\"false\" class=\"special\" style=\"display: none;width: 550px;margin-left: -100px;\"></div></span>"
	
		mediacatvalue=""
		if (document.frmMedia.category){
			mediacatvalue=document.frmMedia.category.value
		}
		
		if (mediacatvalue=="mostactive" ||   mediacatvalue=="featured" ||   mediacatvalue=="power" ||  mediacatvalue=="popular"  ||   mediacatvalue=="premium" ||   mediacatvalue=="certified" )	{
		}else{
	
			if (scope.SelectedCountryID!='-1' ){
				if (scope.SelectedCountryID ==1){
					SelectedCountryName="US"		
				}else{
					SelectedCountryName=scope.SelectedCountryName
				}
				peopleMediaTitle= SelectedCountryName
				BoardMediaTitle= SelectedCountryName
				if (scope.SelectedCountryID=='1'){
					strBreadcrum+="<a id=\"countrybreadcrum\" href=\"javascript:void(0);\" class=\"locationbreadcrum\""
					if (curMediaPage=="board"   || curMediaPage=="network" || curMediaPage=="peopleboard"  ) {
						
						strBreadcrum+="	onclick=\"ChangeBoardViewByCountry('"+scope.SelectedCountryID +"','"+scope.SelectedCountryName +"','','',this,event);\""
					}else{
						if (ViewMediaPage=="True"){
							strBreadcrum+=" onclick=\"ChangeLocationBreadCrumMediaNew('"+scope.SelectedCountryID +"','','','','','"+scope.SelectedCountryURL +"','','','','','"+lcaturl+"');\" "
						}else{
							strBreadcrum+="	onclick=\"ChangeLocationBreadCrum(this,'"+scope.SelectedCountryID +"','','','','');\""
						}
					}
					strBreadcrum+=">"+SelectedCountryName+"</a><span class=\"what-on-board-ddl\" style=\"margin-left:3px;\"><span class=\"special what-on-board-ddl_label\" onclick=\"ShowStateList(event);\" style=\"padding-right:0px;\" >&nbsp;&nbsp;&nbsp;&nbsp;</span><div id=\"AllStatelist\" data-shown=\"false\" class=\"special\" style=\"display: none;width: 550px;margin-left: -130px;\"></div></span>"
				}else{
					strBreadcrum+="<a id=\"countrybreadcrum\" href=\"javascript:void(0);\" class=\"locationbreadcrum\""
					if (curMediaPage=="board"   || curMediaPage=="network" || curMediaPage=="peopleboard"  ) {
						
						strBreadcrum+="	onclick=\"ChangeBoardViewByCountry('"+scope.SelectedCountryID +"','"+scope.SelectedCountryName +"','','',this,event);\""
					}else{
						if (ViewMediaPage=="True"){
							strBreadcrum+=" onclick=\"ChangeLocationBreadCrumMediaNew('"+scope.SelectedCountryID +"','','','','','"+scope.SelectedCountryURL +"','','','','','"+lcaturl+"');\" "
						}else{
							strBreadcrum+="	onclick=\"ChangeLocationBreadCrum(this,'"+scope.SelectedCountryID +"','','','','');\""
						}
					}
					strBreadcrum+=">"+SelectedCountryName+"</a><span class=\"what-on-board-ddl\" style=\"margin-left:3px;\"><span class=\"special what-on-board-ddl_label\" onclick=\"ShowInternationalCityList(event);\" style=\"padding-right:0px;\" >&nbsp;&nbsp;&nbsp;&nbsp;</span><div id=\"AllInternationalCitylist\" data-shown=\"false\" class=\"special\" style=\"display: none;width: 550px;margin-left: -250px;\"></div></span>"
				}
				
			}else{
				BoardMediaTitle="World"
			}

		
			if (scope.SelectedCountryID=='1' ){
				if (scope.SelectedStateID>0){
					strBreadcrum+="<a id=\"countybreadcrum\" href=\"javascript:void(0);\" class=\"locationbreadcrum\""
					if (curMediaPage=="board"  || curMediaPage=="network" || curMediaPage=="peopleboard"  ) {
						
						strBreadcrum+="	onclick=\"ChangeBoardViewByState('"+scope.SelectedStateID +"','"+scope.SelectedStateName +"','"+scope.SelectedCountryName +"','',this,event);\""
					}else{
						if (ViewMediaPage=="True"){
							strBreadcrum+=" onclick=\"ChangeLocationBreadCrumMediaNew('"+scope.SelectedCountryID +"','"+scope.SelectedStateID +"','','','','"+scope.SelectedCountryURL +"','"+scope.SelectedStateURL +"','','','','"+lcaturl+"');\" "
						}else{
							strBreadcrum+="onclick=\"ChangeLocationBreadCrum(this,'"+scope.SelectedCountryID +"','"+scope.SelectedStateID +"','','','');\""
						}
					}

					strBreadcrum+=">"+scope.SelectedStateAbbr+"</a><span class=\"what-on-board-ddl\" style=\"margin-left:3px;\"><span class=\"special what-on-board-ddl_label\" onclick=\"ShowCountyList(event);\" style=\"padding-right:0px;\" >&nbsp;&nbsp;&nbsp;&nbsp;</span><div id=\"AllCountylist\" data-shown=\"false\" class=\"special\" style=\"display: none;width: 550px;margin-left: -130px;\"></div></span>"
				
					peopleMediaTitle= scope.SelectedStateName// +", "+ scope.SelectedCountryName
					BoardMediaTitle= scope.SelectedStateName
				}
			
				if (scope.SelectedCountyID>0){
					strBreadcrum+="<a id=\"statebreadcrum\" href=\"javascript:void(0);\" class=\"locationbreadcrum\""
					if (curMediaPage=="board"   || curMediaPage=="network" || curMediaPage=="peopleboard"   ) {
						
						strBreadcrum+="	onclick=\"ChangeBoardViewByCounty('"+scope.SelectedCountyID +"','"+scope.SelectedCountyName +"','"+scope.SelectedStateID +"','"+scope.SelectedStateAbbr +"','',this,event);\""
					}else{
						if (ViewMediaPage=="True"){
							strBreadcrum+=" onclick=\"ChangeLocationBreadCrumMediaNew('"+scope.SelectedCountryID +"','"+scope.SelectedStateID +"','"+scope.SelectedCountyID+"','','','"+scope.SelectedCountryURL +"','"+scope.SelectedStateURL +"','"+scope.SelectedCountyURL+"','','','"+lcaturl+"');\" "
						}else{
							strBreadcrum+="	onclick=\"ChangeLocationBreadCrum(this,'"+scope.SelectedCountryID +"','"+scope.SelectedStateID +"','"+scope.SelectedCountyID+"','','');\""
						}
					
					}
					
					strBreadcrum+="	>"+scope.SelectedCountyName+"</a><span class=\"what-on-board-ddl\" style=\"margin-left:3px;\"><span class=\"special what-on-board-ddl_label\" onclick=\"ShowCityList(event);\" style=\"padding-right:0px;\" >&nbsp;&nbsp;&nbsp;&nbsp;</span><div id=\"AllCitylist\" data-shown=\"false\" class=\"special\" style=\"display: none;width: 550px;margin-left: -250px;\"></div></span>"
		
					peopleMediaTitle= scope.SelectedCountyName +" County, "+ scope.SelectedStateAbbr
					BoardMediaTitle=scope.SelectedCountyName +" County, "+ scope.SelectedStateAbbr
				
				}
				//if (scope.neighborhoodList.length>1)
				//	strBreadcrum+="</span>"
				if (scope.SelectedCityID>0){
					strBreadcrum+="<a id=\"citybreadcrum\" href=\"javascript:void(0);\" class=\"locationbreadcrum\""
					if (curMediaPage=="board"   || curMediaPage=="network" || curMediaPage=="peopleboard"  ) {
						
						strBreadcrum+="onclick=\"ChangeBoardViewByCountyCity('"+scope.SelectedCountyID +"','"+scope.SelectedCityID +"','"+scope.SelectedCityName +"','"+scope.SelectedStateID +"','"+scope.SelectedStateAbbr +"','',this,event);\""
					}else{
						if (ViewMediaPage=="True"){
							strBreadcrum+=" onclick=\"ChangeLocationBreadCrumMediaNew('"+scope.SelectedCountryID +"','"+scope.SelectedStateID +"','"+scope.SelectedCountyID+"','"+scope.SelectedCityID+"','','"+scope.SelectedCountryURL +"','"+scope.SelectedStateURL +"','"+scope.SelectedCountyURL+"','"+scope.SelectedCityURL+"','','"+lcaturl+"');\" "
						}else{
							strBreadcrum+="	onclick=\"ChangeLocationBreadCrum(this,'"+scope.SelectedCountryID +"','"+scope.SelectedStateID +"','"+scope.SelectedCountyID+"','"+scope.SelectedCityID+"','');\" "
						}
					}
					strBreadcrum+="	>"+scope.SelectedCityName+"</a>"
					if (scope.neighborhoodList.length>1){
					strBreadcrum+="<span class=\"what-on-board-ddl\" style=\"margin-left:3px;\"><span class=\"special what-on-board-ddl_label\" onclick=\"ShowNeighborhoodList(event);\" style=\"padding-right:0px;\" >&nbsp;&nbsp;&nbsp;&nbsp;</span><div id=\"AllNeighborhoodlist\" data-shown=\"false\" class=\"special\" style=\"display: none;width: 550px;margin-left: -250px;\"></div></span>"
				}else{
					strBreadcrum+="<img src=\"/css/whiteLayout/images/new/blackRightarrow.png\" boder=\"0\" style=\"margin-left:8px;width:15px;\"> "
				}
					peopleMediaTitle= scope.SelectedCityName +", "+ scope.SelectedStateAbbr
					BoardMediaTitle= scope.SelectedCityName +", "+ scope.SelectedStateAbbr
				}
				if (scope.SelectedNeighborhoodID>0){
					strBreadcrum+="<a id=\"neighborhoodbreadcrum\" href=\"javascript:void(0);\" class=\"locationbreadcrum\""
					if (curMediaPage=="board"   || curMediaPage=="network" || curMediaPage=="peopleboard"  ) {
						
						strBreadcrum+="onclick=\"ChangeBoardViewByCityNeighborhood('"+scope.SelectedCountyID +"','"+scope.SelectedCityID +"','"+scope.SelectedNeighborhoodName +"','"+scope.SelectedStateID +"','"+scope.SelectedNeighborhoodID +"','"+scope.SelectedCityName +"','',this,event);\""
					}else{
						if (ViewMediaPage=="True"){
							strBreadcrum+=" onclick=\"ChangeLocationBreadCrumMediaNew('"+scope.SelectedCountryID +"','"+scope.SelectedStateID +"','"+scope.SelectedCountyID+"','"+scope.SelectedCityID+"','"+scope.SelectedNeighborhoodID +"','"+scope.SelectedCountryURL +"','"+scope.SelectedStateURL +"','"+scope.SelectedCountyURL+"','"+scope.SelectedCityURL+"','"+scope.SelectedNeighborhoodURL +"','"+lcaturl+"');\" "
						}else{
							strBreadcrum+="	onclick=\"ChangeLocationBreadCrum(this,'"+scope.SelectedCountryID +"','"+scope.SelectedStateID +"','"+scope.SelectedCountyID+"','"+scope.SelectedCityID+"','"+scope.SelectedNeighborhoodID +"');\" "
						}
					}
					strBreadcrum+="	>"+scope.SelectedNeighborhoodName+"</a>"
					strBreadcrum+="<img src=\"/css/whiteLayout/images/new/blackRightarrow.png\" boder=\"0\" style=\"margin-left:8px;width:15px;\"> "
					peopleMediaTitle= scope.SelectedNeighborhoodName +", "+ scope.SelectedCityName
					BoardMediaTitle= scope.SelectedNeighborhoodName +", "+ scope.SelectedCityName
				}
				
			}else{
				if (scope.SelectedCityID>0){
					strBreadcrum+="<a id=\"citybreadcrum\" href=\"javascript:void(0);\" class=\"locationbreadcrum\" "
					
					if (curMediaPage=="board"   || curMediaPage=="network" || curMediaPage=="peopleboard" ) {
						
						strBreadcrum+="	onclick=\"ChangeBoardViewByCountryCity('"+scope.SelectedCountryID +"','"+scope.SelectedCityID +"','"+scope.SelectedCityName +"','"+scope.SelectedCountryName +"','',this,event);\""
					}else{
						if (ViewMediaPage=="True"){
							strBreadcrum+=" onclick=\"ChangeLocationBreadCrumMediaNew('"+scope.SelectedCountryID +"','','','"+scope.SelectedCityID+"','','"+scope.SelectedCountryURL +"','','','"+scope.SelectedCityURL+"','','"+lcaturl+"');\" "
						}else{
							strBreadcrum+="		onclick=\"ChangeLocationBreadCrum(this,'"+scope.SelectedCountryID +"','','','"+scope.SelectedCityID+"');\" "
						}
					}	
					strBreadcrum+="		>"+scope.SelectedCityName+"</a>"
					strBreadcrum+="<img src=\"/css/whiteLayout/images/new/blackRightarrow.png\" boder=\"0\" style=\"margin-left:8px;width:15px;\"> "
					peopleMediaTitle= scope.SelectedCityName +", "+ scope.SelectedCountryName
					BoardMediaTitle= scope.SelectedCityName +", "+ scope.SelectedCountryName
				}
			}
		}
		if (curMediaPage=="peoples"){
			var peoplebdurl='/people/board'+$('#iconBoardURL').attr("href");
			 $('#PageboardURL').attr("href", peoplebdurl);
			 peopleMediaTitle="People"
			 $('#MediaPageTitle').html(peopleMediaTitle);
			 
		}
		if (curMediaPage=="board"){
			
			 $('#MediaBoardPageTitle').html(BoardMediaTitle);
		}
		if (curMediaPage=="channels"){
			if (document.getElementById("category")){
				if (document.getElementById("category").value=="all"){
					$('#MediaPageTitle').html(peopleMediaTitle);
				}
			}			
		}
		
		
		/*strBreadcrum+="<a href=\"javascript:void(0);\" style=\"margin-left:8px;\" class=\"locationbreadcrum\" "
		
		
		strBreadcrum+="	>"+document.getElementById("MediaTypeTitle").innerHTML +"</a><span class=\"what-on-board-ddl\" style=\"margin-left:3px;\"><span class=\"special what-on-board-ddl_label\" onclick=\"ShowMediaList(event);\" style=\"padding-right:0px;\" >&nbsp;&nbsp;&nbsp;&nbsp;</span><div id=\"AllMedialist\" data-shown=\"false\" class=\"special\" style=\"display: none;width: 200px;margin-left: -48px;\">"
		strBreadcrum+="<span onclick=\"selectThirdBarMediaType('profile',this)\" data-MediaType=\"Business\">Businesses</span>"
		strBreadcrum+="<span onclick=\"selectThirdBarMediaType('product',this)\" data-MediaType=\"Products\">Products</span>"
		strBreadcrum+="<span onclick=\"selectThirdBarMediaType('store',this)\" data-MediaType=\"Stores\">Stores</span>"

		strBreadcrum+="<span  onclick=\"selectThirdBarMediaType('board',this)\" data-MediaType=\"Board\">News</span>"

		strBreadcrum+="<span onclick=\"selectThirdBarMediaType('peoples',this)\" data-MediaType=\"People\">People</span>"

		strBreadcrum+="<span onclick=\"selectThirdBarMediaType('video',this)\" data-MediaType=\"Videos\">Videos</span>"
		strBreadcrum+="<span onclick=\"selectThirdBarMediaType('image',this)\" data-MediaType=\"Images\">Images</span>"
		strBreadcrum+="<span onclick=\"selectThirdBarMediaType('blog',this)\" data-MediaType=\"Blogs\">Blogs</span>"

				
		strBreadcrum+="		</div></span>"
		*/
		SetNetworkBoard()
		strBreadcrum+="<span id='BreadcrumCat'></span></span>"
		
		if (document.getElementById("Breadcrum"))
			document.getElementById("Breadcrum").innerHTML=strBreadcrum 
		//if (document.getElementById("BreadcrumBoard"))
		//	document.getElementById("BreadcrumBoard").innerHTML=strBreadcrum+="<span id='BreadcrumCatBoard'></span>"
		
		SetCategoryBreadcrum();
		//$( "#Breadcrum a:last-child" ).addClass('CurrentSelected');
		if (document.getElementById("Breadcrum")){
			$('#Breadcrum').find('.locationbreadcrum:nth-last-child(3)').last().addClass('CurrentSelected');
			$('#Breadcrum').find('.what-on-board-ddl_label:nth-last-child(3)').last().removeClass('special'); 
			$('#Breadcrum').find('.what-on-board-ddl_label:nth-last-child(3)').last().addClass('specialGreen'); 
		
		}
		
		
	//	if (document.getElementById("BreadcrumBoard"))
	//	$('#BreadcrumBoard').find('.locationbreadcrum').last().addClass('CurrentSelected');
		
		
	}
	if (document.getElementById("BreadcrumMedia")){
		strBreadcrum="<a href=\"javascript:void(0);\" onclick=\"history.back();\" style=\"margin-left:0px;\"><img src=\"/css/whiteLayout/images/new/blackLeftArrow.png\" boder=\"0\" style=\"margin-top:-3px; margin-right: 15px;width:15px;\"></a>"

		strBreadcrum+="<a href=\"#\" onclick=\"ChangeLocationBreadCrumMedia('-1','','','','world','','','');\">World</a>"
		if (scope.SelectedCountryID!='-1' ){
			if (scope.SelectedCountryID ==1){
				SelectedCountryName="US"	
			}else{
				SelectedCountryName=scope.SelectedCountryName
			}
			strBreadcrum+=" > <a href=\"javascript:void(0);\" class=\"locationbreadcrum\" onclick=\"ChangeLocationBreadCrumMedia('"+scope.SelectedCountryID +"','','','','"+scope.SelectedCountryURL +"','','','');\">"+SelectedCountryName+"</a>"
		}
		if (scope.SelectedCountryID=='1' ){
			if (scope.SelectedStateID>0){
				strBreadcrum+=" > <a href=\"javascript:void(0);\" class=\"locationbreadcrum\" onclick=\"ChangeLocationBreadCrumMedia('"+scope.SelectedCountryID +"','"+scope.SelectedStateID +"','','','"+scope.SelectedCountryURL +"','"+scope.SelectedStateURL +"','','');\">"+scope.SelectedStateAbbr+"</a>"
			}
			if (scope.SelectedCountyID>0){
			strBreadcrum+=" > <a href=\"javascript:void(0);\" class=\"locationbreadcrum\" onclick=\"ChangeLocationBreadCrumMedia('"+scope.SelectedCountryID +"','"+scope.SelectedStateID +"','"+scope.SelectedCountyID+"','','"+scope.SelectedCountryURL +"','"+scope.SelectedStateURL +"','"+scope.SelectedCountyURL+"','');\">"+scope.SelectedCountyName+"</a>"
			}
			if (scope.SelectedCityID>0){
			strBreadcrum+=" > <a href=\"javascript:void(0);\" class=\"locationbreadcrum\" onclick=\"ChangeLocationBreadCrumMedia('"+scope.SelectedCountryID +"','"+scope.SelectedStateID +"','"+scope.SelectedCountyID+"','"+scope.SelectedCityID+"','"+scope.SelectedCountryURL +"','"+scope.SelectedStateURL +"','"+scope.SelectedCountyURL+"','"+scope.SelectedCityURL+"');\">"+scope.SelectedCityName+"</a>"
			}
		}else{
			if (scope.SelectedCityID>0){
			strBreadcrum+=" > <a href=\"javascript:void(0);\" class=\"locationbreadcrum\" onclick=\"ChangeLocationBreadCrumMedia('"+scope.SelectedCountryID +"','','','"+scope.SelectedCityID+"','"+scope.SelectedCountryURL +"','','','"+scope.SelectedCityURL+"');\">"+scope.SelectedCityName+"</a>"
			}
		}
		if (curMediaPage!="peoples"){
			if (curMediaPage=="product"){
				if (document.getElementById("ParentcategoryName").value!=""){
					strBreadcrum+=" > <a href=\"javascript:void(0);\" onclick=\"ParentCatClick='1';$('#BreadcrumMedia a:nth-last-child(3)').click();\">"+document.getElementById("ParentcategoryName").value+"</a>"
					if (document.getElementById("Categoryname")){
						strBreadcrum+=" > <a href=\"javascript:void(0);\" onclick=\"ParentCatClick='';$('#BreadcrumMedia a:nth-last-child(3)').click();\">"+document.getElementById("Categoryname").value+"</a>"
					}
				}else{
					if (document.getElementById("Categoryname")){
						strBreadcrum+=" > <a href=\"javascript:void(0);\" onclick=\"ParentCatClick='';$('#BreadcrumMedia a:nth-last-child(2)').click();\">"+document.getElementById("Categoryname").value+"</a>"
					}
				}
			}else{
				if (curMediaPage!="store"){
					if (document.getElementById("Categoryname")){
						if (document.getElementById("Categoryname").value!='')
							strBreadcrum+=" > <a href=\"javascript:void(0);\" onclick=\"$('#BreadcrumMedia a:nth-last-child(2)').click();\">"+document.getElementById("Categoryname").value+"</a>"
					}
				}else{
					
				/*	if (document.getElementById("category").value!="all"){
						strBreadcrum+=" > <a href=\"#\" data-url='all' onclick=\"setProductParentCat('','');SetLeftCategory(this);\">All</a><span class=\"what-on-board-ddl\" style=\"margin-left:3px;\"><span class=\"special what-on-board-ddl_label\" onclick=\"ShowallCatlist('all',event);\" style=\"padding-right:0px;\" >&nbsp;&nbsp;&nbsp;&nbsp;</span><div id=\"Alllist\" data-shown=\"false\" class=\"special\" style=\"display: none;\"></div></span>"
					}
					if (document.getElementById("ParentcategoryName").value!=""){
						strBreadcrum+="  <a href=\"#\" data-url='" +document.getElementById("Parentcategory").value+"' onclick=\"setProductParentCat('','');SetLeftCategory(this);\">"+document.getElementById("ParentcategoryName").value+"</a><span class=\"what-on-board-ddl\" style=\"margin-left:3px;\"><span class=\"special what-on-board-ddl_label\" onclick=\"ShowParentCatlist('" +document.getElementById("Parentcategory").value+"',event);\" style=\"padding-right:0px;\" >&nbsp;&nbsp;&nbsp;&nbsp;</span><div id=\"AllParentcatlist\" data-shown=\"false\" class=\"special\" style=\"display: none;\"></div></span>"
					}
					if (document.getElementById("Categoryname").value!=""){
						if (document.getElementById("category").value=="all")
							strBreadcrum+=" > "
						strBreadcrum+="  <a href=\"#\" data-url='" +document.getElementById("category").value+"' onclick=\"SetLeftCategory(this);\">"+document.getElementById("Categoryname").value+"</a><span class=\"what-on-board-ddl\" style=\"margin-left:3px;\"><span class=\"special what-on-board-ddl_label\" onclick=\"ShowCatlist('" +document.getElementById("category").value+"',event);\" style=\"padding-right:0px;\" >&nbsp;&nbsp;&nbsp;&nbsp;</span><div id=\"Allcatlist\" data-shown=\"false\" class=\"special\" style=\"display: none;\"></div></span>"
					
					}
		
		*/
					
				}
			}
		}
		document.getElementById("BreadcrumMedia").innerHTML=strBreadcrum
		
		
	}
	//scope.SetPageURL();
	//console.log("---Location end---")
}

function ChangeLocationBreadCrum(objThis,intCountryId,intStateId,intCountyId,intCityId,intNeighborhoodId){
	var mediaurl=curMediaPage
	
		if (document.getElementById("CurrentMediaDiv")){
			mediaurl=document.getElementById("CurrentMediaDiv").innerHTML
		}
			var MediaDisplayBoard=""
			if (MediaDisplay=="scroll")
				MediaDisplayBoard="board"
			ActionURL=	"/ajax/"+mediaurl+"list_"+MediaDisplayBoard+"refine.asp?sl=Y&admintool=0&Layout="+Layout+"&PersonalPref="+PersonalPref
			
			if (document.getElementById("lstneighborhoodid"))
					document.getElementById("lstneighborhoodid").value=''
			
			if (document.getElementById("lstcityid"))
					document.getElementById("lstcityid").value=''
			if (document.getElementById("lstcountryid"))
					document.getElementById("lstcountryid").value=''
			if (document.getElementById("lstcountyid"))
					document.getElementById("lstcountyid").value=''
			if (document.getElementById("lststateid"))
					document.getElementById("lststateid").value=''
			if (intCountryId!=""){
				if (document.getElementById("lstcountryid")){
					document.getElementById("lstcountryid").value=intCountryId
				}else{
					ActionURL+=	"&countryid="+intCountryId
				}
			}
			if (intStateId!=""){
				if (document.getElementById("lststateid")){
					document.getElementById("lststateid").value=intStateId
				}else{
					ActionURL+=	"&stateid="+intStateId
				}
			}
			if (intCountyId!=""){
				if (document.getElementById("lstcountyid")){
					document.getElementById("lstcountyid").value=intCountyId
				}else{
					ActionURL+=	"&countyid="+intCountyId
				}
			}
			if (intCityId!=""){
				if (document.getElementById("lstcityid")){
					document.getElementById("lstcityid").value=intCityId
				}else{
					ActionURL+=	"&cityid="+intCityId
				}
			}
			nid=intNeighborhoodId??""
			if (nid!="" ){
				if (document.getElementById("lstneighborhoodid")){
					document.getElementById("lstneighborhoodid").value=nid
				}else{
					ActionURL+=	"&NeighborhoodId="+nid
				}
			}
			if (document.getElementById("Breadcrum"))
				$('#Breadcrum').find('.locationbreadcrum').removeClass('CurrentSelected');
				//$('#Breadcrum').children('a').removeClass('CurrentSelected'); 
			//if (document.getElementById("BreadcrumBoard"))
			//	$('#BreadcrumBoard').children('a').removeClass('CurrentSelected'); 
			$(objThis).addClass('CurrentSelected');
			CurrSelectedObject=objThis
			
			
			document.frmMedia.action=ActionURL
		//	console.log(ActionURL)
		MediaFormSubmit(1);
	if (typeof ChangeSideAd == 'function') { 
	//	ChangeSideAd()
	}
}

function setProductParentCat(caturl,catname){
	if (document.getElementById("Parentcategory"))
		document.getElementById("Parentcategory").value=caturl
	if (document.getElementById("ParentcategoryName"))
		document.getElementById("ParentcategoryName").value=catname
	
	//gparentCategory=caturl
	//gparentCategoryName=catname
	SetCategoryBreadcrum();
}

function ChangeLocationBreadCrumMedia(countryid,stateid,countyid,cityid,countryurl,stateurl,countyurl,cityurl){
		
	var MediaURLTag=""
	var MediafixedTag="media"
	if (curMediaPage=="profile"){
		MediaURLTag="members"
		 MediafixedTag="network"
	}else if (curMediaPage=="image"){
		MediaURLTag="images"
	}else if (curMediaPage=="classifieds"){
		MediaURLTag="ads"	
	}else if (curMediaPage=="video"){
		MediaURLTag="videos"
	}else if (curMediaPage=="blog"){
		MediaURLTag="blogs"
		
	}else if (curMediaPage=="audio"){
		MediaURLTag="audios"
	}else if (curMediaPage=="product"){
		MediaURLTag="products"
	}else if (curMediaPage=="deal"){
		MediaURLTag="deals"
	}else if (curMediaPage=="coupon"){
		MediaURLTag="coupons"
	}else if (curMediaPage=="store"){
		MediaURLTag="stores"
	}else if (curMediaPage=="peoples"){
		MediaURLTag="people"
	}else if (curMediaPage=="channels"){
		//MediaURLTag="channel"
		MediafixedTag="channel"
		
	}
		
	var redirectUrl;//Creeate redirect url:begin
	
	if (curMediaPage=="peoples"){
		redirectUrl = '/'+MediaURLTag;	
	}else{
		
		if (document.getElementById("category")){
			categoryvalue=document.frmMedia.category.value
			if (curMediaPage=="product"){
				if (ParentCatClick=='1'){
					categoryvalue=document.getElementById("Parentcategory").value
				}
			}
			if (categoryvalue != "" ){
				redirectUrl = '/' +categoryvalue+'/'+MediafixedTag+'/'+MediaURLTag;
				
			}else{
				redirectUrl = '/all/'+MediafixedTag+'/'+MediaURLTag;	
			}
		}
		
	}
		
	if (countryid == 1) {
		if (stateid != '') {
			if (countyid != '') {
				if (cityid != '')//city
				{
					redirectUrl += '/us/' + cityurl;
				}
				else {//redirect ot county
					if (countyid == 23) {
							redirectUrl += '/parish/' + stateurl + '/' + countyurl;
					}
					else {
							redirectUrl += '/county/' + stateurl + '/' + countyurl;
					}
				}
			}
			else if (cityid != '')//city
			{
					redirectUrl += '/us/' + cityurl;
			}
			else {//stale url
					redirectUrl += "/" + stateurl;
			}
		}
		else {
				redirectUrl += '/united-states';
		}
	}
	else if (countryid != '') {
		if (cityid != '') {
		redirectUrl += "/int/" +  cityurl;
		}
		else {
			redirectUrl += "/int/" + countryurl;
		}
	}
	redirectUrl += '/';//Creeate redirect url:end
//console.log(redirectUrl)

location.href=redirectUrl	;
}

function ChangeLocationBreadCrumMediaNew(countryid,stateid,countyid,cityid,neighborhoodid,countryurl,stateurl,countyurl,cityurl,neighborhoodurl,caturl){
		
	var MediaURLTag=""
	var MediafixedTag="media"
	if (curMediaPage=="profile"){
		MediaURLTag="members"
		 MediafixedTag="network"
	}else if (curMediaPage=="image"){
		MediaURLTag="images"
	}else if (curMediaPage=="classifieds"){
		MediaURLTag="ads"	
	}else if (curMediaPage=="video"){
		MediaURLTag="videos"
	}else if (curMediaPage=="blog"){
		MediaURLTag="blogs"
		
	}else if (curMediaPage=="audio"){
		MediaURLTag="audios"
	}else if (curMediaPage=="product"){
		MediaURLTag="products"
	}else if (curMediaPage=="deal"){
		MediaURLTag="deals"
	}else if (curMediaPage=="coupon"){
		MediaURLTag="coupons"
	}else if (curMediaPage=="store"){
		MediaURLTag="stores"
	}else if (curMediaPage=="peoples"){
		MediaURLTag="people"
	}else if (curMediaPage=="channels"){
		//MediaURLTag="channel"
		MediafixedTag="channel"
		
	}
		
	var redirectUrl;//Creeate redirect url:begin
	
	if (curMediaPage=="peoples"){
		redirectUrl = '/'+MediaURLTag;	
	}else{
		
		if (caturl != "" ){
			redirectUrl = '/' +caturl+'/'+MediafixedTag+'/'+MediaURLTag;
			
		}else{
			redirectUrl = '/all/'+MediafixedTag+'/'+MediaURLTag;	
		}
		
		
	}
	
	if (countryid ==-1) {
		redirectUrl += '/world';
	}else if (countryid == 1) {
		var	USredirectUrl = '/united-states';
		if (stateid != 0 && stateid != -1) {
			USredirectUrl = "/" + stateurl;
		}
		
		if (countyid != 0 && countyid != -1) {
			if (countyid == 23) {
				USredirectUrl = '/parish/' + stateurl + '/' + countyurl;
			}
			else {
				USredirectUrl = '/county/' + stateurl + '/' + countyurl;
			}
				}
		if (cityid != 0 && cityid != -1)//city
		{
			USredirectUrl = '/us/' + cityurl;
		}
		
		if (neighborhoodid != 0 && neighborhoodid != -1)//city
		{
			USredirectUrl = '/neighborhood/' + cityurl +'/'+neighborhoodurl;
		}
		redirectUrl +=USredirectUrl
	}else if (countryid > 1) {
		if (cityid != 0 && cityid != -1) {
		redirectUrl += "/int/" +  cityurl;
		}
		else {
			redirectUrl += "/int/" + countryurl;
		}
	}
redirectUrl += '/';	
	/*
	if (countryid == 1) {
		if (stateid != '') {
			if (countyid != '') {
				if (cityid != '')//city
				{
					redirectUrl += '/us/' + cityurl;
				}
				else {//redirect ot county
					if (countyid == 23) {
							redirectUrl += '/parish/' + stateurl + '/' + countyurl;
					}
					else {
							redirectUrl += '/county/' + stateurl + '/' + countyurl;
					}
				}
			}
			else if (cityid != '')//city
			{
					redirectUrl += '/us/' + cityurl;
			}
			else {//stale url
					redirectUrl += "/" + stateurl;
			}
		}
		else {
				redirectUrl += '/united-states';
		}
	}
	else if (countryid != '') {
		if (cityid != '') {
		redirectUrl += "/int/" +  cityurl;
		}
		else {
			redirectUrl += "/int/" + countryurl;
		}
	}
	redirectUrl += '/';
	*///Creeate redirect url:end
//console.log(redirectUrl)

location.href=redirectUrl	;
}

function myStopFunction() {
  clearTimeout(myTimeout);
}

$(document).ready(function () { 

	$('ul.navbar-nav > li') 
			.click(function (e) { 
		$('ul.navbar-nav > li') 
			.removeClass('active'); 
			$('ul.navbar-nav1 > li') 
			.removeClass('active'); 
		$(this).addClass('active'); 
	});
	
	$('a.nav-item') 
			.click(function (e) { 
		$('ul.navbar-nav > li') 
			.removeClass('active'); 
			$('ul.navbar-nav1 > li') 
			.removeClass('active'); 
			document.getElementById("BoardBusinesses").className = " active"; 
	});
	
	
if (curMediaPage=="board"){
	
	
	GetLocalPageInfo(CurrentCountryID,CurrentStateID,CurrentCountyID,CurrentCityID);
	
}


	
	
}); 

function  GetLocalPageInfo(CountryId,StateId,CountyId,CityId){
//	clearTimeout(LocalpageinfoTimeout);
if (CountryId=='')
		CountryId="-1"
	
	
	if(CountryId == "0")
	{
		CountryId = ""
	}
	if(StateId == "0")
	{
		StateId = ""
	}
	if(CountyId == "0")
	{
		CountyId = ""
	}
	if(CityId == "0")
	{
		CityId = ""
	}
	
	
	var sendInfo2 = {
		Token:'W3aIQ1qJkEqN35t9RnY-ow',
		CountryId: CountryId,
		StateId:StateId,
		CountyId:CountyId,
		CityId:CityId
	};
	document.getElementById("siteli").style="display:none;"
//	var managebydefault='<a href="/contact-us/"><img src="/css/whiteLayout/images/managebyNew.png" onmouseover="ddrivetip(\'<div style=padding:10px;><table cellpadding=0 cellspacing=0 border=0 style=width:100%><tr><td  valign=top colspan=2 style=padding-bottom:10px; >Storeboard is actively seeking a partner in your area.  Please Contact Us if you are interested.<td></tr></table></div>\', 400)" onmouseout="hideddrivetip()" height="30px" border="0"></a>'
	// managebydefault='<a href="/contact-us/"><img src="/css/whiteLayout/images/managebyNew.png" height="30px" border="0"></a>'
	
	//document.getElementById("manageby").innerHTML=managebydefault;
	
	//document.getElementById("manageby").style="display:none"
	var BoardsitsURL = document.getElementById("BoardsitsURL");
	
	if (CountryId!="-1" ){
		$.ajax({
				type: 'Post',
				url: '/API1/LocalPageInfo/LocalPageInfo',
				data: sendInfo2,
				dataType: 'json',
				success: function (data) {
					
					
					var SITSMapURL=data.SearchList[0]["SITSMapURL"] ;
					
					if (SITSMapURL!=null ){
						
						document.getElementById("siteli").style="display:block"
						document.getElementById("sitsURL").href=SITSMapURL
						setCookie("BoardsitsURL",SITSMapURL,30);
						if(BoardsitsURL){
							document.getElementById("BoardsitsURL").href=SITSMapURL
						}
					}else{
						document.getElementById("siteli").style="display:block"
						document.getElementById("sitsURL").href="/streetmap/counties/"
						setCookie("BoardsitsURL","/streetmap/counties/",30);
						if(BoardsitsURL){
							document.getElementById("BoardsitsURL").href="/streetmap/counties/"
						}
						
					}
					if(data.SearchList.length == 0)
					{
						document.getElementById("siteli").style="display:none;"
						
					}
					
					/*if (data!="NOTFOUND")
					{
						//console.log(data);
						var myObj = JSON.parse(data);
						var SITSMapURL=myObj.SITSMapURL ;
						if (SITSMapURL!=""){
						
							document.getElementById("siteli").style="display:block"
							document.getElementById("sitsURL").href=SITSMapURL
						}else{
							document.getElementById("siteli").style="display:none;"
						}
						
						
					/*	var ManageBy=myObj.ManageBy ;
						var ManageByURL=myObj.ManageByURL ;
						if (ManageByURL!=""){
								var sendInfo2 = {
									ManageBy:ManageBy,
									ManageByURL:ManageByURL
								};
								$.ajax({
										type: "Get",
										url: "/ajax/GetManageByInfo.asp",
										data: sendInfo2,
										dataType: "html",
										async: false,
										success: function (data) {
											if (data!="NOTFOUND")
											{	
													document.getElementById("manageby").innerHTML=data
													document.getElementById("manageby").style="display:block"
													
											}else{
												document.getElementById("manageby").innerHTML=managebydefault
												document.getElementById("manageby").style="display:block"
											}
										}
									});
							
							
						}else{
							document.getElementById("manageby").innerHTML=managebydefault
							document.getElementById("manageby").style="display:block"
						}*/
					/*}else{
					//	document.getElementById("manageby").innerHTML=managebydefault
						document.getElementById("siteli").style="display:none;"
					//	document.getElementById("manageby").style="display:block"
					}*/
				}
			});
	}else{
		document.getElementById("siteli").style="display:block"
		document.getElementById("sitsURL").href="/streetmap/counties/"
		if(BoardsitsURL){
			document.getElementById("BoardsitsURL").href="/streetmap/counties/"
		}
	}		
}
								
function ChangeMedia(media){
	
	MediaCategoryID=""
	MediaCategoryName=""
	MediaBusCategoryID=""
	MediaBusCategoryName=""
ChangeMediaData(media)



}

function ChangeWorldLocalSelection(media,cType){
	
	if (cType=="W"){
			LocalPageActionURL=document.frmMedia.action
			document.getElementById("localhref").style.fontWeight='normal';
			document.getElementById("worldhref").style.fontWeight='bold';
			document.getElementById("localhref").style.textDecoration ='none'
			document.getElementById("worldhref").style.textDecoration ='underline';
			WorldPageActionURL= "/ajax/"+media+"list_refine.asp?sl=Y&admintool=0&countryId=-1"
			document.frmMedia.action=WorldPageActionURL
	
	}else{
			//console.log(LocalPageActionURL);
			document.frmMedia.action=LocalPageActionURL
			document.getElementById("localhref").style.fontWeight='bold';
			document.getElementById("worldhref").style.fontWeight='normal';
			document.getElementById("worldhref").style.textDecoration ='none'
			document.getElementById("localhref").style.textDecoration ='underline'
	}

}

function ChangeWorldLocal(media,cType){
	if (document.getElementById("LOCALLIST")){
		if (cType=="W"){
			if (document.getElementById("worldhref").style.fontWeight=='bold'){
				alert("You are already on World")
			}else{
						
				ChangeWorldLocalSelection(media,cType)
				MediaFormSubmit(1);
			}
		
		}else{
			if (document.getElementById("localhref").style.fontWeight=='bold'){
				alert("You are already on "+document.getElementById("localhref").innerHTML)
			}else{
				ChangeWorldLocalSelection(media,cType)
				MediaFormSubmit(1);
			}
		
		}
		
	}else{
		if (cType=="W"){	
			window.location.href = getMediaUrl(media)+"?countryid=-1";
		}else{
			window.location.href = getMediaUrl(media)+"?countryid=1";
		}
		
	}
}

function showhideleftmenu() {
  
 
  if (curCP==7){
	  curCP=1
  }else{
	  curCP= curCP+1
  }
  if (document.getElementById("cp"+curCP).style.display == "block"){
	  ShowHideCCC(curCP)
	  
  }else{
	 showhideleftmenu() 
  }
  /*
  var x = document.getElementById("LeftDiv1");
  var humbermenutitle=""
  if (x.style.display == "none") {
		document.getElementById("LeftDiv1").style.display = "block";
		document.getElementById("AjaxCategory").style.display = "none";
		humbermenutitle="Categories"
		ShowHideCCC(1)
		
  } else {
		document.getElementById("LeftDiv1").style.display = "none";
		document.getElementById("AjaxCategory").style.display = "block";
		humbermenutitle="Control Panel"
		ShowHideCCC(2)
  }
  document.getElementById("humbermenu").alt=humbermenutitle
document.getElementById("humbermenu").title=humbermenutitle
*/
}

function ShowLeftMenu() {

  var x = document.getElementById("LeftMenuPopup");

  if (x.style.display == "none") {
		x.style.display = "block";
		
  } else {
		x.style.display = "none";
	}


}

function HideLeftMenu() {
	if (isMobile=="True"){
	  var x = document.getElementById("LeftMenuPopup");

	  if (x.style.display == "block") {
			x.style.display = "none";
			
	  }
	}
}

function ShowHideCCC(ptypeid) {
	
	for (let i = 1; i <= 7; i++) {
		if (document.getElementById("LeftDiv"+i)){
		//	console.log("LeftDiv"+i + " : " + document.getElementById("LeftDiv"+i).innerHTML.length)
			if (document.getElementById("LeftDiv"+i).innerHTML.length>10){
				document.getElementById("cp"+i).style.display = "block";
			}else{
				document.getElementById("cp"+i).style.display = "none";	
			}
			document.getElementById("LeftDiv"+i).style.display = "none";
			
			if (i == 1)
				$('#dot'+i).attr('src','/css/whiteLayout/images/new/HomeGrey.png');
			else
				$('#dot'+i).attr('src','/css/whiteLayout/images/new/greydot.png');
		}else{
			document.getElementById("cp"+i).style.display = "none";
		}
		
	}

	if (ptypeid==2 || ptypeid==3){
	
		document.getElementById("AjaxCategory").style.display = "block";
	}
	if (document.getElementById("LeftDiv"+ptypeid)){
		curCP=ptypeid
		document.getElementById("LeftDiv"+ptypeid).style.display = "block";
		document.getElementById("cp"+ptypeid).style.display = "block";
		if (ptypeid == 1)
			$('#dot'+ptypeid).attr('src','/css/whiteLayout/images/new/HomeBlue.png');
		else
			$('#dot'+ptypeid).attr('src','/css/whiteLayout/images/new/Bluedot.png');
	
	}
	

}

function GroupsChangeCategory(catValue,caturl,catdisplay,objthis){
		if (document.getElementById("LOCALLIST")){	
			
				$('#businesscategory').children('div').css({"color":"black", "background-color":"transparent"});
				$('#videocategory').children('div').css({"color":"black", "background-color":"transparent"});	
				$('.PRODUCTCATLEFTMENU').css({"color":"black", "background-color":"transparent"});
				$('.subcatli').css({"color":"black", "background-color":"transparent"});		

				if (document.getElementById("filterLable")){
					document.getElementById("filterLable").innerHTML=catdisplay
				}
				
				if (document.getElementById("tbSearchQuery")){
					document.getElementById("tbSearchQuery").value=""
				}
				if (document.frmPagingGroups.tbSearchQuery){
					
					document.frmPagingGroups.tbSearchQuery.value=""
					
				}
				
				
				$(objthis).css({"color":"#fff", "background-color":"#00acee"});
				 
				var TargetObj = "GROUPLIST";
				
				  document.frmPagingGroups.PG.value = "1";
				  document.frmPagingGroups.GroupCatID.value = catValue;
				  document.frmPagingGroups.submit();
				  window.scrollTo(0,0);
				  
				//  document.getElementById("Loadinh1").style.display = "none";
				//  document.getElementById("Ajaxh1").style.display = "block";
				document.getElementById("Ajaxh1").innerHTML = catdisplay  //+" Groups"
				if (document.getElementById("groupurl")){
					grpurl='/groups/'+caturl+'/'
				
					if (MediaDisplay=="scroll" )
						grpurl='/media'+grpurl
					$('#groupurl').attr('href',grpurl)
				}
		}else{
				location.href="/groups/"+caturl+"/"
		}
	
 }

function ResetGroupFilter(){
	if (document.getElementById("GROUPLIST")){	
			
		$('#businesscategory').children('div').css({"color":"black", "background-color":"transparent"});
		$('#videocategory').children('div').css({"color":"black", "background-color":"transparent"});	
		$('.PRODUCTCATLEFTMENU').css({"color":"black", "background-color":"transparent"});
		$('.subcatli').css({"color":"black", "background-color":"transparent"});		
		if (document.getElementById("filterLable")){
			document.getElementById("filterLable").innerHTML="All Groups"
		}
		$("#allgroup").css({"color":"#fff", "background-color":"#00acee"});
		 
		var TargetObj = "GROUPLIST";
		
		  document.frmPagingGroups.PG.value = "1";
		  document.frmPagingGroups.GroupCatID.value = "all";
		  document.frmPagingGroups.submit();
		  window.scrollTo(0,0);
		  
		//  document.getElementById("Loadinh1").style.display = "none";
		//  document.getElementById("Ajaxh1").style.display = "block";
		document.getElementById("Ajaxh1").innerHTML = "All Groups"
	}else{
			location.href="/groups/all/"
	}
}	

function ChannelChangeCategory(catValue,caturl,catdisplay,objthis){
		
			
				$('#businesscategory').children('div').css({"color":"black", "background-color":"transparent"});
				$('#videocategory').children('div').css({"color":"black", "background-color":"transparent"});	
				$('.PRODUCTCATLEFTMENU').css({"color":"black", "background-color":"transparent"});
				$('.subcatli').css({"color":"black", "background-color":"transparent"});		
				if (document.getElementById("filterLable")){
					document.getElementById("filterLable").innerHTML=catdisplay
				}
				$(objthis).css({"color":"#fff", "background-color":"#00acee"});
				 
				var TargetObj = "FORUMS";
				
				  
				  location.href="/"+caturl+"/channel/world/";
				  
				//  document.getElementById("Loadinh1").style.display = "none";
				//  document.getElementById("Ajaxh1").style.display = "block";
				document.getElementById("Ajaxh1").innerHTML = catdisplay 
		
	
 }

function ForumsChangeCategory(catValue,caturl,catdisplay,objthis){
		if (document.getElementById("FORUMS")){	
			
				$('#businesscategory').children('div').css({"color":"black", "background-color":"transparent"});
				$('#videocategory').children('div').css({"color":"black", "background-color":"transparent"});	
				$('.PRODUCTCATLEFTMENU').css({"color":"black", "background-color":"transparent"});
				$('.subcatli').css({"color":"black", "background-color":"transparent"});		

				if (document.getElementById("filterLable")){
					document.getElementById("filterLable").innerHTML=catdisplay
				}
				$(objthis).css({"color":"#fff", "background-color":"#00acee"});
				 
				var TargetObj = "FORUMS";
				
				  document.frmPagingForums.PG.value = "1";
				  document.frmPagingForums.ForumID.value = catValue;
				  document.frmPagingForums.submit();
				  window.scrollTo(0,0);
				  
				//  document.getElementById("Loadinh1").style.display = "none";
				//  document.getElementById("Ajaxh1").style.display = "block";
				document.getElementById("Ajaxh1").innerHTML = catdisplay 
		}else{
				location.href="/forums/"+caturl+"/"
		}
	
 }

function SetGroupSearch(pSearch){
	frmGroupSearch.tbSearchQuery.value=pSearch
	frmPagingGroups.tbSearchQuery.value=pSearch

	$('#businesscategory').children('div').css({"color":"black", "background-color":"transparent"});
	$('#videocategory').children('div').css({"color":"black", "background-color":"transparent"});	
	$('.PRODUCTCATLEFTMENU').css({"color":"black", "background-color":"transparent"});
	$('.subcatli').css({"color":"black", "background-color":"transparent"});		

	if (document.getElementById("filterLable")){
		document.getElementById("filterLable").innerHTML="All"
	}
	var TargetObj = "GROUPLIST";
				
	  document.frmPagingGroups.PG.value = "1";
	  document.frmPagingGroups.GroupCatID.value = "all";
	 
	  window.scrollTo(0,0);
	  
	//  document.getElementById("Loadinh1").style.display = "none";
	//  document.getElementById("Ajaxh1").style.display = "block";
	document.getElementById("Ajaxh1").innerHTML = "All"  //+" Groups"
	if (document.getElementById("groupurl")){
		grpurl='/groups/all/'
	
		if (MediaDisplay=="scroll" )
			grpurl='/media'+grpurl
		$('#groupurl').attr('href',grpurl)
	}
	 frmPagingGroups.submit();
 }

function StateclickThis(objthis){
	 
	$('#countryCat').children('div').css({"color":"black", "background-color":"transparent"});
	$('#stateCat').children('div').css({"color":"black", "background-color":"transparent"});
	$(objthis).css({"color":"#fff", "background-color":"#00acee"});
	
 }

function CountryclickThis(objthis){
	$('#stateCat').children('div').css({"color":"black", "background-color":"transparent"});
	$('#countryCat').children('div').css({"color":"black", "background-color":"transparent"});
	$(objthis).css({"color":"#fff", "background-color":"#00acee"});
 }
 
function ResetForumFilter(){
	if (document.getElementById("FORUMS")){	
			
		$('#businesscategory').children('div').css({"color":"black", "background-color":"transparent"});
		$('#videocategory').children('div').css({"color":"black", "background-color":"transparent"});	
		$('.PRODUCTCATLEFTMENU').css({"color":"black", "background-color":"transparent"});
		$('.subcatli').css({"color":"black", "background-color":"transparent"});		

		
		if (document.getElementById("filterLable")){
					document.getElementById("filterLable").innerHTML="All Forums"
				}
		
		$("#allforum").css({"color":"#fff", "background-color":"#00acee"});
		 
		var TargetObj = "FORUMS";
		
		  document.frmPagingForums.PG.value = "1";
		  document.frmPagingForums.ForumID.value = "all";
		  document.frmPagingForums.submit();
		  window.scrollTo(0,0);
		  
		//  document.getElementById("Loadinh1").style.display = "none";
		//  document.getElementById("Ajaxh1").style.display = "block";
		document.getElementById("Ajaxh1").innerHTML = "All Forums"
	}else{
			location.href="/forums/all/"
	}
}	

function ResetClassifiedFilter(){
	if (document.getElementById("LOCALLIST")){	
			
		$('#businesscategory').children('div').css({"color":"black", "background-color":"transparent"});
		$('#videocategory').children('div').css({"color":"black", "background-color":"transparent"});	
		$('.PRODUCTCATLEFTMENU').css({"color":"black", "background-color":"transparent"});
		$('.subcatli').css({"color":"black", "background-color":"transparent"});		

		
		if (document.getElementById("filterLable")){
					document.getElementById("filterLable").innerHTML="All Classifieds"
		}
		
		$("#allClassifieds").css({"color":"#fff", "background-color":"#00acee"});
		 
		var TargetObj = "LOCALLIST";
		
		  document.frmPagingClass.PG.value = "1";
		  document.frmPagingClass.cat.value = "all";
		  document.frmPagingClass.submit();
		  window.scrollTo(0,0);
		  
		//  document.getElementById("Loadinh1").style.display = "none";
		//  document.getElementById("Ajaxh1").style.display = "block";
		document.getElementById("Ajaxh1").innerHTML = "All Classifieds"
	}else{
			location.href="/ads/all/"
	}
}	

function getfilterlabel(mediatype){
	var allfilterlable=""
	
	if (mediatype=="video"){
		allfilterlable="All Videos"
	}else if(mediatype=="product"){
		allfilterlable="All Products"	
	}else if(mediatype=="blog"){
		allfilterlable="All Blogs"
	}else if(mediatype=="image"){
		allfilterlable="All"
	}else if(mediatype=="audio"){
		allfilterlable="All Audios"
	}else if(mediatype=="coupon"){
		allfilterlable="All Coupons"
	}else if(mediatype=="deal"){
		allfilterlable="All Deals"
	}else if(mediatype=="store"){
		allfilterlable="All Stores"
	}else if(mediatype=="profile"){
		allfilterlable="All Businesses"
	}else if(mediatype=="peoples"){
		allfilterlable="All Peoples"
	}else if(mediatype=="network"){
		allfilterlable="All Networks"
	}else if(mediatype=="group"){
		allfilterlable="All Groups"
	}else if(mediatype=="classifieds"){
		allfilterlable="All Classifieds"
	
	}else if(mediatype=="forums"){
		allfilterlable="All Forums"
	}
	else if(mediatype=="channels"){
		allfilterlable="All Channels"
	}
	return allfilterlable;
}

function onKeyUpLeftMenuSearch(element){
	var value = $(element).val() || '';
	value = value.toLowerCase();
	$("#businesscategory > div[data-name]").each(function(idx,el){
		var name = ($(el).attr('data-name') || '').trim().toLowerCase();
		if(name!=''){
			if(name.includes(value)){
				$(el).show();
			}else{
				$(el).hide();
			}
		}
	})
}

function onKeyUpLeftMenuSearchBusCat(element){
	var value = $(element).val() || '';
	value = value.toLowerCase();
	$("#ControlPanel2 > li > div > h4 > a[data-name]").each(function(idx,el){
		var name = ($(el).attr('data-name') || '').trim().toLowerCase();
		if(name!=''){
			if(name.includes(value)){
				$(el).show();
			}else{
				$(el).hide();
			}
		}
	})
	$("#ControlPanel2 > li > div > ul > li > a[data-name]").each(function(idx,el){
		var name = ($(el).attr('data-name') || '').trim().toLowerCase();
		var parentid= $(el).attr('data-parent')
		if(name!=''){
			if(name.includes(value)){
				$(el).show();
				$('#buscatparent'+parentid).show();
				
			}else{
				$(el).hide();
			}
		}
	})
}

function onKeyUpLeftMenuSearchDC(element){
	$('#SerachLeftnavTbBusiness').val($(element).val())
	onKeyUpLeftMenuSearch($('#SerachLeftnavTbBusiness'))
	ShowHideCCC(3)
	$(element).val('')
	$('#SerachLeftnavTbBusiness').focus();

}

function onKeyUpLeftMenuSearchBC(element){
	$('#SerachLeftnavTbBusiness').val($(element).val())
	onKeyUpLeftMenuSearch($('#SerachLeftnavTbBusiness'))
	ShowHideCCC(3)
	$(element).val('')
	$('#SerachLeftnavTbBusiness').focus();

}

function KeywordSearch(){

		searchButtonPressed=1
		if (curMediaPage=="group"){
			SetGroupSearch($("#searchKeyword").val()); ;
		}else{
			if (document.frmMedia.search){
				frmMedia.search.value=$("#searchKeyword").val();
				ChangeCommonMediaTitle("all","All","1")
			//	$('#worldBreadcrum').click();
				if (document.frmMedia.NYKACatID)
					document.frmMedia.NYKACatID.value=""
					
				if (document.frmMedia.category)
					document.frmMedia.category.value=""
			}	
			$('#Breadcrum').find('.locationbreadcrum:nth-last-child(3)').last().click();
		}
		
			document.getElementById("txtMainSerch").value=$("#searchKeyword").val();
}

function MiddleKeywordSearchClick(){

	if (document.getElementById("PersonalPrefName"))
		document.getElementById("PersonalPrefName").innerHTML="All";
		document.getElementById("txtMainSerch").value=document.getElementById("search").value
	doSearch('1');
}

function onKeyUpMiddleKeyword(element){
	
	document.getElementById("txtMainSerch").value=$(element).val() 
	if (event.key === 'Enter' || event.keyCode === 13) {
	
		$('#btnMiddleKeywordSearch').click();
		
	}
	
}

function onKeyUpLeftKeyword(element){
	
		document.getElementById("txtMainSerch").value=$(element).val() 
	if (event.key === 'Enter' || event.keyCode === 13) {
	
		$('#btnKeywordSearch').click();
		HideLeftMenu()
	}
	
}

function TopicKeywordSearch(){
		SetGroupSearch($("#searchTopicKeyword").val()); ;
}

function onKeyUpLeftTopicKeyword(element){
	
	if (event.key === 'Enter' || event.keyCode === 13) {
		$('#btnTopicKeywordSearch').click();
		HideLeftMenu()
		
	}	
}

function SocialKeywordSearch(){
	
		$('#Breadcrum').find('.locationbreadcrum:nth-last-child(3)').last().click();
		HideLeftMenu()
}

function onKeyUpLeftSocialKeyword(element){
	
	
	if (event.key === 'Enter' || event.keyCode === 13) {
		
		$('#btnSocialKeywordSearch').click();
		HideLeftMenu()
	}
	
	
}

function onKeyUpLeftMenuSearchvc(element){
	var value = $(element).val() || '';
	value = value.toLowerCase();
	$("#videocategory > ul > li > div[data-url]").each(function(idvc,elvc){
		var url = ($(elvc).attr('data-url') || '').trim().toLowerCase();
		if(url!=''){
			if(url.includes(value)){
				$(elvc).show();
			}else{
				$(elvc).hide();
			}
		}
	})
	
	$("#videocategory > div[data-name]").each(function(idvc,elvc){
		var name = ($(elvc).attr('data-name') || '').trim().toLowerCase();
		if(name!=''){
			if(name.includes(value)){
				$(elvc).show();
			}else{
				$(elvc).hide();
			}
		}
	})
}

function onKeyUpLeftMenuSearchss(element){
	var value = $(element).val() || '';
	value = value.toLowerCase();
	$("#stateCat > div[data-url]").each(function(idss,elss){
		var url = ($(elss).attr('data-url') || '').trim().toLowerCase();
		if(url!=''){
			if(url.includes(value)){
				$(elss).show();
			}else{
				$(elss).hide();
			}
		}
	})
}

function onKeyUpLeftMenuSearchsc(element){
	var value = $(element).val() || '';
	value = value.toLowerCase();
	$("#countryCat > div[data-url]").each(function(idsc,elsc){
		var url = ($(elsc).attr('data-url') || '').trim().toLowerCase();
		if(url!=''){
			if(url.includes(value)){
				$(elsc).show();
			}else{
				$(elsc).hide();
			}
		}
	})
}

function onKeyUpMiddleSearch(element){
	var value = $(element).val() || '';
	value = value.toLowerCase();
	var firstElement
	var inti=0;
	$("#middleCat > ul > div > div > li > span[data-url]").each(function(idss,elss){
	
		var url = ($(elss).attr('data-url') || '').trim().toLowerCase();
		if(url!=''){
			if(url.includes(value)){
				$(elss).show();
				if (inti==0) firstElement=$(elss)
					inti++;
			}else{
				$(elss).hide();
			}
		
		}
	})
	if (event.key === 'Enter' || event.keyCode === 13) {
		firstElement.click();
	}
}

function OnclickMiddleSearch(){
	
	var value = $('#SearchMediaMidnavTb1').val() || '';
	value = value.toLowerCase();
	var firstElement
	var inti=0;
	$("#middleCat > ul > div > div > li > span[data-url]").each(function(idss,elss){	
		var url = ($(elss).attr('data-url') || '').trim().toLowerCase();
		if(url!=''){
			if(url.includes(value)){
				$(elss).show();
				if (inti==0) firstElement=$(elss)
					inti++;
			}else{
				$(elss).hide();
			}
		
		}
	})
	
		firstElement.click();
	
}

function onKeyUpBoardMiddleSearch(element){
	var value = $(element).val() || '';
	value = value.toLowerCase();
	var firstElement
	var inti=0;
	$("#boardmiddleCat > ul > div > div > li > span[data-url]").each(function(idss,elss){
	
		var url = ($(elss).attr('data-url') || '').trim().toLowerCase();
		if(url!=''){
			if(url.includes(value)){
				$(elss).show();
				if (inti==0) firstElement=$(elss)
					inti++;
			}else{
				$(elss).hide();
			}
		
		}
	})
	
	if (event.key === 'Enter' || event.keyCode === 13) {
		firstElement.click();
	}
}

function OnclickBoardMiddleSearch(){
	var value = $('#SerachMidnavTb1').val() || '';
	value = value.toLowerCase();
	var firstElement
	var inti=0;
	$("#boardmiddleCat > ul > div > div > li > span[data-url]").each(function(idss,elss){
	
		var url = ($(elss).attr('data-url') || '').trim().toLowerCase();
		if(url!=''){
			if(url.includes(value)){
				$(elss).show();
				if (inti==0) firstElement=$(elss)
					inti++;
			}else{
				$(elss).hide();
			}
		
		}
	})
	firstElement.click();
}

function  GetLeftMenuVj(mediatype){
	
//console.log("getleftmenu called");
	
	if(mediatype == "product" || mediatype == "video" || mediatype == "audio" || mediatype == "image" || mediatype == "blog" || mediatype == "coupon" || mediatype == "profile"  || mediatype == "store" || mediatype == "deal" || mediatype == "network" || mediatype == "group" || mediatype == "forums" || mediatype == "channels"  || mediatype == "channel" || mediatype == "classifieds" || mediatype == "board" || mediatype == "peopleboard"  || mediatype == "map"|| mediatype == "peoples")
	{
		if (ShowControlPanel==""){
			document.getElementById("LeftDiv1").style.display = "none";
			document.getElementById("AjaxCategory").style.display = "block";
			
			
			/*if(mediatype == "product" || mediatype == "video" || mediatype == "audio" || mediatype == "image" || mediatype == "blog" || mediatype == "coupon" || mediatype == "profile"  || mediatype == "store" || mediatype == "deal"  ){
			if(document.getElementById("hdrsearchbox")!= null)
				{
				
				document.getElementById("hdrsearchbox").style.display= "none";
				}
			}*/
			
		}
		
		if (document.getElementById("filterLable")){
			
				
			filterLabel="All" //getfilterlabel(mediatype)//document.getElementById("filterLable").innerHTML
			if ($("#TScategoryname").val()!=""){
				document.getElementById("filterLable").value=$("#TScategoryname").val()
				filterLabel=$("#TScategoryname").val()
			}
		}
		if(mediatype == "product" || mediatype == "video" || mediatype == "audio" || mediatype == "image" || mediatype == "blog" || mediatype == "coupon" || mediatype == "profile"  || mediatype == "store" || mediatype == "deal"  ){
			sq = getUrlVars()["sq"];
			
			if (currPage=="board" && mediatype!="board"){
				if (MediaCatName!="")
					filterLabel=MediaCatName
			}
			//if ($.cookie("NYKACatID")!="" && sq=="")										
			//	filterLabel=$.cookie("NYKACatName");
				
		//	console.log(filterLabel + " :"  + sq)
		}
		
		var sendInfo2 = {
			mediatype:mediatype,
			filterLabel:filterLabel
		}
	
		if (document.getElementById("LeftDiv41"))
			document.getElementById("LeftDiv41").innerHTML= ''
		document.getElementById("LeftDiv5").innerHTML= ''
		document.getElementById("AjaxCategory").innerHTML=''
	

		$.ajax({
			type: "get",
			url: "/ajax/GetLeftMenuVj.asp",
			data: sendInfo2,
			dataType: "html",
			async: false,
			success: function (data) 
			{
				if(document.getElementById("AjaxCategory")!= null)
				{
					
					document.getElementById("AjaxCategory").innerHTML=data;	
					if (mediatype!="board")
						$("#searchSocialBox").hide();
					if (mediatype=="network"  || mediatype=="deal"){
						ShowHideCCC(3);
						ShowControlPanel=""
					}else if (mediatype=="profile"){
						//if ($.cookie("NYKACatID")!="")
						//	ShowHideCCC(3);
						//else
							ShowHideCCC(4);
						if (OpenManageProfile=="")
							ShowControlPanel=""
					}else if (mediatype=="peoples"){
						ShowHideCCC(6);
						ShowControlPanel=""
					}else if (mediatype=="board" || mediatype == "peopleboard" || mediatype=="map"){
						var HCPL 
						HCPL=""
						MemberCat	=''
				MemberCatName=''
						ShowControlPanel="1"
						HCPL = getUrlVars()["HCP"];
							
						if (HCPL!="" &&  typeof HCPL != "undefined"){
						
							ShowHideCCC(HCPL);
						}else{
							HCPL=HCP
							if (HCPL!="" &&  typeof HCPL != "undefined"){
							
								ShowHideCCC(HCPL);
							}else{
								ShowHideCCC(1)
							}
						}
					}else if (mediatype == "product" || mediatype == "video" || mediatype == "audio" || mediatype == "image" || mediatype == "blog" || mediatype == "coupon" || mediatype == "store" ||  mediatype == "group" || mediatype == "forums" || mediatype == "channels"  || mediatype == "channel" || mediatype == "classifieds"  ){
						ShowHideCCC(2);
						ShowControlPanel=""
					}else{
						if (ShowControlPanel=="1"){
				
							document.getElementById("LeftDiv1").style.display = "block";
							ShowHideCCC(1)
						}	
					
					}
					
					
					
					
					
					
				//	document.getElementById("AjaxCategory").style.display = "block";
					//document.getElementById("hear").style.display = "inline-block";	
				//	var humbermenutitle=""
					//humbermenutitle="Control Panel"

					//document.getElementById("humbermenu").alt=humbermenutitle
					//document.getElementById("humbermenu").title=humbermenutitle
				}
				
					callAllLeftPanel();
				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);
						});


					});
				}
				getButtonset();
				
			}
			});
			
			if( mediatype == "video" || mediatype == "audio" || mediatype == "image" || mediatype == "blog" || mediatype == "coupon" || mediatype == "profile" || mediatype == "deal" || mediatype == "network" || mediatype == "product1" || mediatype == "store1"|| mediatype == "board"){
				document.getElementById("cp4").style.display = "block";
				$.ajax({
				type: "get",
				url: "/ajax/Directorycat.asp",
				data: sendInfo2,
				dataType: "html",
				async: false,
				success: function (data) 
				{
				
					if(document.getElementById("LeftDiv41")!= null)
					{
						document.getElementById("LeftDiv41").innerHTML=data;	
						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);
								});


							});
						}
					}
				}
				});
			}else{
				if (document.getElementById("LeftDiv4"))
					document.getElementById("LeftDiv4").style.display = "none";
				if (document.getElementById("cp4"))
					document.getElementById("cp4").style.display = "none";
			}
			if( mediatype == "profile" ){
				document.getElementById("cp5").style.display = "block";
				$.ajax({
				type: "get",
				url: "/ajax/BusinessCat.asp",
				data: sendInfo2,
				dataType: "html",
				async: false,
				success: function (data) 
				{
				
					if(document.getElementById("LeftDiv5")!= null)
					{
						document.getElementById("LeftDiv5").innerHTML=data;	
						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);
								});


							});
						}
					}
				}
				});
			}else{
				document.getElementById("LeftDiv5").style.display = "none";
				document.getElementById("cp5").style.display = "none";
			}
		//	console.log("VJ start product")
		callAllSearchBox()
		//console.log("VJ product")
	}
	else
	{
		//if(mediatype == "peoples"){
			//if(document.getElementById("hdrsearchbox")!= null)
			//{
			
			//document.getElementById("hdrsearchbox").style.display= "none";
		//	}
		//	document.getElementById("hear").style.display = "none";	
		//	var humbermenutitle=""
		//	humbermenutitle="Categories"

		//	document.getElementById("humbermenu").alt=humbermenutitle
		//	document.getElementById("humbermenu").title=humbermenutitle
		//}
		if (ShowControlPanel==""){
			document.getElementById("LeftDiv1").style.display = "block";
			ShowHideCCC(1)
			document.getElementById("AjaxCategory").style.display = "none";
			document.getElementById("AjaxCategory").innerHTML="";	
		}
	}
	SetLeftPanelwithSearcbbox()
					//console.log("VJ "+mediatype + " : " +ShowControlPanel)
					if (mediatype=="network"  || mediatype=="deal"){
						ShowHideCCC(3);
					}else if (mediatype=="profile"){
						
						if (ShowControlPanel=="1"){
				
							document.getElementById("LeftDiv1").style.display = "block";
							ShowHideCCC(1)
						//}else if ($.cookie("NYKACatID")!=""){
						//	ShowHideCCC(3);
						}else{
							ShowHideCCC(4);
						}
						
					}else if (mediatype=="peoples"){
						ShowHideCCC(6);
						document.getElementById("AjaxCategory").style.display= "block";
					}else if (mediatype=="board" || mediatype == "peopleboard" || mediatype=="map"){
						var HCPL 
						HCPL=""
						
						HCPL = getUrlVars()["HCP"];
							
						if (HCPL!="" &&  typeof HCPL != "undefined"){
						
							ShowHideCCC(HCPL);
						}else{
							HCPL=HCP
							if (HCPL!="" &&  typeof HCPL != "undefined"){
							
								ShowHideCCC(HCPL);
							}else{
								ShowHideCCC(1)
							}
						}
					}else if (mediatype == "product" || mediatype == "video" || mediatype == "audio" || mediatype == "image" || mediatype == "blog" || mediatype == "coupon" || mediatype == "store" ||  mediatype == "group" || mediatype == "forums" || mediatype == "channels"  || mediatype == "channel" || mediatype == "classifieds"  ){
						ShowHideCCC(2);
					}
					/*else{
						if (ShowControlPanel=="1"){
				
							document.getElementById("LeftDiv1").style.display = "block";
							ShowHideCCC(1)
						}	
					
					}*/
					
					
					
}
		
function SetLeftPanelwithSearcbbox(){
	
			
		var selectedElement =  $("[id^='LeftDiv'] div").filter(function(){
			var color = $(this).css("background-color");
			return color === "rgb(0, 172, 238)" ;
		})
		//selectedObjectInLeftPanel(selectedElement)
		
		var selectedElement =  $("[id^='LeftDiv'] a").filter(function(){
			var color = $(this).css("background-color");
			return color === "rgb(0, 172, 238)" ;
			})
			
		//	selectedObjectInLeftPanel(selectedElement)
		

}

function selectedObjectInLeftPanel(ObjSelectedElement){
		if(ObjSelectedElement && ObjSelectedElement.length)
		{
			var text = ObjSelectedElement.first().attr('data-name')
		
			var parent = ObjSelectedElement.first().closest("[id^='LeftDiv']")

			var parentID = parent.attr('id')
			var dotNo = Number(parentID.replace('LeftDiv', ''))||0
			var searchbox=parent.find('input[type=search]')
			try{
			if(searchbox && searchbox.length)
			{
				
				if (text.toLowerCase()=="all"){
					setCookie("searchSQ",'',-1);
					searchbox.val('')
					var sq = getUrlVars()["sq"];
					if (sq=="")
						$('#tbSearchFor').val('');
				}else{
					searchbox.val(text)
					$('#tbSearchFor').val(text);
				}
			}
			if (text.toLowerCase()!="all"){
				ShowHideCCC(dotNo)
			}
			}catch(ex){}
		}
}

function searchkeyup(objthis){
	return 
	var searchtype=""
	searchtype=curMediaPage
	
	if (searchtype=="profile"){
		searchtype="members"
	}else if (searchtype=="video"){ 
		searchtype="videos"
	}else if (searchtype=="image"){ 
		searchtype="images"
	}else if (searchtype=="blog"){ 
		searchtype="blogs"
	}else if (searchtype=="audio"){ 
		searchtype="audios"
	}else if (searchtype=="copoun"){ 
		searchtype="coupons"
	}else if (searchtype=="product"){ 
		searchtype="products"
	}else{
		searchtype=""
	}
	var search = $(objthis).val();
	search=search.trim();
	if(search.length>=0 && searchtype!=""){
		$.ajax({
			url: '/API1/SearchbyCategory/SearchbyCategory',
			type: 'Post',
			data: {Token:'W3aIQ1qJkEqN35t9RnY-ow',search:search, searchtype:searchtype},
			dataType: 'json',
			success:function(data){
				var len = data.SearchList.length;
				$("#TSsearchResultmini").empty();
				if (len>0){
					for( var i = 0; i<len; i++){
						var id = data.SearchList[i]['id'];
						var name = data.SearchList[i]['name'];
						if (i==0){
							setRealForMiniText(id,name);
						}
						$("#TSsearchResultmini").append("<li data-value='"+id+"'>"+name+"</li>");
					}
				
					// binding click event to li
					$("#TSsearchResultmini li").bind("click",function(){											
						setForMiniText(this);
					});
				}else{
					ClearRealForMiniText()
				}
			}
		});
	}else{
		$("#TSsearchResultmini").empty();
		$("#category").val('');
		$("#MiniCategoryid").val('');
		//$("#TScategoryid").val('');
		$("#Categoryname").val('');
		$("#MiniCategoryname").val('');
	}
}

function Productsearchkeyup(objthis){
	var searchtype=""
		searchtype="products"
		
		var search = $(objthis).val();
		//console.log(search.length)
		search=search.trim();
		if(search.length>=0 && searchtype!=""){
			$.ajax({
				url: '/API1/SearchbyCategory/SearchbyCategory',
				type: 'Post',
				data: {Token:'W3aIQ1qJkEqN35t9RnY-ow',search:search, searchtype:searchtype},
				dataType: 'json',
				success:function(data){
					var len = data.SearchList.length;
					$("#ProductCatSearchResult").empty();
					if (len>0){
						for( var i = 0; i<len; i++){
							var id = data.SearchList[i]['id'];
							var name = data.SearchList[i]['name'];
							
							$("#ProductCatSearchResult").append("<li data-value='"+id+"'>"+name+"</li>");
						}
						$("#ProductCatSearchResult li")?.unbind("click")
						 /* $(document).on("click", "#ProductCatSearchResult li", function(event) {
							  console.log($(this).text()+" clicked");
							  setForProductText(this);
							});
							*/
						// binding click event to li
						$("#ProductCatSearchResult li").bind("click",function(){	
						 // console.log($(this).text()+" clicked");
							setForProductText(this);
						});
					}
				}
			});
		}
}

function setRealForMiniText(id,value){
							
	const myArr = id.split("|");
	$("#category").val(myArr[1]);
	$("#MiniCategoryid").val(myArr[0]);
	
	//$("#TScategory").val(myArr[1]);
	$("#Categoryname").val(value);
	$("#MiniCategoryname").val(value);
	
	
}

function ClearRealForMiniText(){
							
	$("#category").val('');
	//$("#TScategory").val('');
	$("#Categoryname").val('');
	$("#MiniCategoryid").val('');
	$("#MiniCategoryname").val('');
	
}

function setForMiniText(element){
	var value = $(element).text();
	var id =  $(element).attr('data-value');
	setRealForMiniText(id,value)
	$("#search").val(value);
	$("#TSsearchResultmini").empty();
}	

function GoForAdEvent(){
	$("#TScategory").val('events');
	$("#TScategoryname").val('Events');
	$('#boardMediatype').find('li> span[data-MediaType="Ads"]').first().click()
}	

function selectBusinessMediaType(meditype,objThis){
	
//	MediaCategoryID=""
//	MediaCategoryName=""
	//MediaBusCategoryID=""
//	MediaBusCategoryName=""
	var currSelectedMediatype = $(objThis).attr("data-MediaType");
	blnCallGetLeftMenu=false
	OnlyForBusiness="1"
	if (meditype=="profile" || meditype=="store"   || meditype=="product")
		URLRewriteOnThisPage="true"
	else
		URLRewriteOnThisPage="false"
	ChangeMediaData(meditype)
}
function ChangeMediaData(media){
	
	if (typeof pageSettings != "undefined") {
	
		if (document.getElementById("LOCALLIST")){
			if (blnCallGetLeftMenu!=false){
				PersonalPref	=""
				MediaCategoryID=""
				MediaCategoryName=""
				MediaBusCategoryID=""
				MediaBusCategoryName=""
				if (OnlyForBusiness=="1"){
					if (document.getElementById("Parentcategory"))
						document.getElementById("Parentcategory").value=''
					if (document.getElementById("ParentcategoryName"))
						document.getElementById("ParentcategoryName").value=''
				}
				GetLeftMenuVj(media)
				
			}
			if (document.getElementById("board"))
					document.getElementById("board").style.display="none";
			if (document.getElementById("RefreshLink"))
					document.getElementById("RefreshLink").style.display="none";	
			//if (document.getElementById("MediaPageTitle1"))
			//		document.getElementById("MediaPageTitle1").style.display="none";	
				
			if (document.getElementById("sitsmap"))
					document.getElementById("sitsmap").style.display="none";	
			if (document.getElementById("Media"))	
				document.getElementById("Media").style.display="block";
					
			curMediaPage=media
			//PersonalPref	=""
			
			var SearchStr=""
			if (document.getElementById("search"))	
				SearchStr=document.getElementById("search").value;
			var category="";
		
			var NYKACatID=""
			var BusCategoryName="";
				//debugger
			if (typeof MediaCategoryID != 'undefined') {
				category= MediaCategoryID
			}
			if (typeof MediaCat != 'undefined') {
				category= MediaCat
			}		
			if (category=="")
			{
				category=$("#TScategory").val();
				categoryName=$("#TScategoryname").val();
			}
			if (typeof MediaBusCategoryID != 'undefined') {
				//if ($.cookie("NYKACatID")!="")									
				//	MediaBusCategoryID=$.cookie("NYKACatID");
					
				NYKACatID= MediaBusCategoryID
			}	
			if (CurrentNYKACatID!="" && NYKACatID=="")
				NYKACatID=CurrentNYKACatID
			
				
			if (typeof MediaCategoryName != 'undefined') {
				categoryName= MediaCategoryName
			}
			if (typeof MediaCatName != 'undefined') {
				categoryName= MediaCatName
			}
		
			if (typeof MediaBusCategoryName != 'undefined') {
					BusCategoryName= MediaBusCategoryName
			}	
			if (CurrentNYKACatName!="" && BusCategoryName=="")
				BusCategoryName=CurrentNYKACatName
			if (SearchStr==""){
				SearchStr=document.getElementById("txtMainSerch").value
			}				
			if ((media=="profile"|| media=="peoples"|| media=="deal") && CurrentNYKACatID!=""){
				category=CurrentNYKACatURL
				categoryName=categoryName
				MediaCategoryID=category
				MediaCategoryName=categoryName
				NYKACatID=""
				BusCategoryName=""
			}
			var Parentcategory=""
			var ParentcategoryName=""
			if (document.getElementById("Parentcategory"))
				Parentcategory=document.getElementById("Parentcategory").value
			if (document.getElementById("ParentcategoryName"))
				ParentcategoryName=document.getElementById("ParentcategoryName").value		
			var sendInfo2 = {
				media: media,
				SearchStr:SearchStr,
				category:category,
				categoryName:categoryName,
				Parentcategory:Parentcategory,
				ParentcategoryName:ParentcategoryName,
				filterLabel:categoryName,
				OnlyForBusiness:OnlyForBusiness,
				NYKACatID:NYKACatID,
				MediaDisplay:MediaDisplay,
				Layout:Layout,
				PersonalPref:PersonalPref,
				currPage:currPage,
				MediaFullWidth:MediaFullWidth
			};
			
			var suffixpage=""
			if (media=="product"){
				 suffixpage=""
			}
			//if (media=="video"){
			//	 suffixpage="_v2"
			//}
			//if (media=="image"){
			//	 suffixpage="_v2"
			//}
			
				$.ajax({
					type: "post",
					url: "/inc/searchingtopbar.asp",
					data: sendInfo2,
					dataType: "html",
					async: false,
					success: function (data) {
						
						document.getElementById("searchtopbar").innerHTML=data
						
						ShopCenterCategory.init();
						//ShopCenterCategory1.init();
						//ShopCenterCategory2.init();
						ShopCenterCategory3.init();
						ShopCenterCategory5.init();
						ShopCenterCategory6.init()
						MemberDeleteManager.init();
						VideoDeleteManager.init();
					//	$("#search").off('keyup')
					//	$("#search").keyup(function(){
					//			searchkeyup(this)
					//	});
					
						if (document.getElementById("search")){
							document.getElementById("search").addEventListener("search", function(event) {
								document.getElementById("txtMainSerch").value=$("#search").val();
							});
						}
						var mediaactionurl
						var MediaDisplayBoard=""
						if (MediaDisplay=="scroll")
							MediaDisplayBoard="board"
						 if (typeof pageSettings != "undefined") {
							pageSettings.searchUrl="/ajax/"+media+"list_"+MediaDisplayBoard+"refine.asp"
						}
						mediaactionurl="/ajax/"+media+"list_"+MediaDisplayBoard+"refine"+suffixpage+".asp?sl=Y&admintool=0&Layout="+Layout+"&PersonalPref="+PersonalPref +"&MediaFullWidth="+MediaFullWidth
				
						if (CurrentCountryID!="") mediaactionurl+= "&countryId="+CurrentCountryID
						if (CurrentStateID!="") mediaactionurl+= "&stateId="+CurrentStateID
						if (CurrentCountyID!="") mediaactionurl+= "&countyId="+CurrentCountyID
						if (CurrentCityID!="") mediaactionurl+= "&cityId="+CurrentCityID
						
						if (CurrentNeighborhoodID!="" && CurrentNeighborhoodID!="undefined") mediaactionurl+= "&NeighborhoodID="+CurrentNeighborhoodID
						//console.log(mediaactionurl)
						if (media=="profile"|| media=="store"|| media=="peoples"|| media=="deal"){
						
							if (typeof MediaCategoryID != 'undefined') {
								if (document.frmMedia.category)
									document.frmMedia.category.value=MediaCategoryID; 
							}	
							
						}else{
							
							if (CurrentNYKACatID!="") {
							}else{
								if (typeof MediaCategoryID != 'undefined') {
										if (document.frmMedia.category)
											document.frmMedia.category.value=MediaCategoryID; 
								}	
								if (typeof MediaBusCategoryID != 'undefined') {
										if (document.frmMedia.NYKACatID)
												document.frmMedia.NYKACatID.value=MediaBusCategoryID;
								}	
							}
							
						}
							//debugger	
						document.frmMedia.action=mediaactionurl
						LocalPageActionURL=document.frmMedia.action
						
						if  (document.getElementById("SelectedCategoryName")){
							if (media=="profile"){	
									
								if (category==""){
									document.getElementById("SelectedCategoryName").innerHTML="All";
									document.frmMedia.category.value="all";
									document.getElementById("MediaPageTitle").innerHTML="All Businesses";
								}else{
									document.getElementById("SelectedCategoryName").innerHTML=categoryName;
									document.frmMedia.category.value=category;
									document.getElementById("MediaPageTitle").innerHTML=categoryName
								}
								/*if (document.getElementById(/*)){
										document.getElementById("MediaTypeTitle").innerHTML="All Businesses";

								}*/
								document.getElementById("MediaTypeTitle").innerHTML="Businesses";
							//	document.getElementById("MediaPageTitle").innerHTML=document.getElementById("SelectedCategoryName").innerHTML
								
								//SetLocationBreadcrum('')
								//debugger
								doSearch('0')
							
							}else if (media=="peoples"){
													
								if (category==""){
									document.getElementById("SelectedCategoryName").innerHTML="All";
									document.frmMedia.category.value="all";
								}else{
									document.getElementById("SelectedCategoryName").innerHTML=categoryName;
									document.frmMedia.category.value=category;
								}
								
								/*if (document.getElementById("MediaTypeTitle")){
								 document.getElementById("MediaTypeTitle").innerHTML="People";
								}
								*/
								document.getElementById("MediaPageTitle").innerHTML="All People";
								document.getElementById("MediaTypeTitle").innerHTML="People";
								//SetLocationBreadcrum('')
								doSearch('0')
							
							}else if (media=="product"){
								
								if (category==""){
									document.getElementById("SelectedCategoryName").innerHTML="All";
									document.frmMedia.category.value="all";
									document.frmMedia.Categoryname.value="All";
								}else{
									document.getElementById("SelectedCategoryName").innerHTML=categoryName;
									document.frmMedia.category.value=category;
									document.frmMedia.Categoryname.value=categoryName;
								}
								/*if (document.getElementById("MediaTypeTitle")){
										document.getElementById("MediaTypeTitle").innerHTML="All Products";
								}
								*/
								if (NYKACatID==""){
									document.getElementById("SelectedBizCategoryName").innerHTML="All";
									document.frmMedia.NYKACatID.value="";
								}else{
									document.getElementById("SelectedBizCategoryName").innerHTML=BusCategoryName;
									document.frmMedia.NYKACatID.value=NYKACatID;
								}
								document.getElementById("MediaTypeTitle").innerHTML="Products";
								if (categoryName==""){
									document.getElementById("MediaPageTitle").innerHTML="All "+ document.getElementById("MediaTypeTitle").innerHTML	
								}else{
									document.getElementById("MediaPageTitle").innerHTML=categoryName //+ ' '+ document.getElementById("MediaTypeTitle").innerHTML
								}
								//SetLocationBreadcrum('')
								
								$("#txtProductCatSearch").keyup(function(){
	
										Productsearchkeyup(this)
									});		
								doSearch('0')
						
							}else if (media=="video"){
								if (category==""){
									document.getElementById("SelectedCategoryName").innerHTML="All";
									document.frmMedia.category.value="all";
								}else{
									document.getElementById("SelectedCategoryName").innerHTML=categoryName;
									document.frmMedia.category.value=category;
								}
								/*if (document.getElementById("MediaTypeTitle")){
										document.getElementById("MediaTypeTitle").innerHTML="All Videos";
								}
								*/
								if (NYKACatID==""){
									document.getElementById("SelectedBizCategoryName").innerHTML="All";
									document.frmMedia.NYKACatID.value="";
								}else{
									document.getElementById("SelectedBizCategoryName").innerHTML=BusCategoryName;
									document.frmMedia.NYKACatID.value=NYKACatID;
								}
							
								document.getElementById("MediaTypeTitle").innerHTML="Videos";
								if (categoryName==""){
									document.getElementById("MediaPageTitle").innerHTML= "All "+document.getElementById("MediaTypeTitle").innerHTML	
								}else{
									document.getElementById("MediaPageTitle").innerHTML=categoryName //+ ' '+ document.getElementById("MediaTypeTitle").innerHTML
								}
								//SetLocationBreadcrum('')
								doSearch('0')
								
							}else if (media=="blog"){
								if (category==""){
									document.getElementById("SelectedCategoryName").innerHTML="All";
									document.frmMedia.category.value="all";
								}else{
									document.getElementById("SelectedCategoryName").innerHTML=categoryName;
									document.frmMedia.category.value=category;
								}
								/*	if (document.getElementById("MediaTypeTitle")){
										document.getElementById("MediaTypeTitle").innerHTML="All Blogs";
								}
								*/
								if (NYKACatID==""){
									document.getElementById("SelectedBizCategoryName").innerHTML="All";
									document.frmMedia.NYKACatID.value="";
								}else{
									document.getElementById("SelectedBizCategoryName").innerHTML=BusCategoryName;
									document.frmMedia.NYKACatID.value=NYKACatID;
								}
								document.getElementById("MediaTypeTitle").innerHTML="Blogs";
								if (categoryName==""){
									document.getElementById("MediaPageTitle").innerHTML= "All "+document.getElementById("MediaTypeTitle").innerHTML	
								}else{
									document.getElementById("MediaPageTitle").innerHTML=categoryName //+ ' '+ document.getElementById("MediaTypeTitle").innerHTML
								}
								//SetLocationBreadcrum('')
								doSearch('0')
								
							}else if (media=="classifieds"){
								if (document.getElementById("SelectedCategoryName")){
									if (category==""){
										document.getElementById("SelectedCategoryName").innerHTML="All";
										document.frmMedia.category.value="all";
									}else{
										document.getElementById("SelectedCategoryName").innerHTML=categoryName;
										document.frmMedia.category.value=category;
									}
								}
								/*		if (document.getElementById("MediaTypeTitle")){
											document.getElementById("MediaTypeTitle").innerHTML="All Classifieds";
									}
									*/
								if (document.getElementById("SelectedBizCategoryName")){
									if (NYKACatID==""){
										document.getElementById("SelectedBizCategoryName").innerHTML="All";
										document.frmMedia.NYKACatID.value="";
									}else{
										document.getElementById("SelectedBizCategoryName").innerHTML=BusCategoryName;
										document.frmMedia.NYKACatID.value=NYKACatID;
									}
								}
								document.getElementById("MediaTypeTitle").innerHTML="Ads";
								if (categoryName==""){
									document.getElementById("MediaPageTitle").innerHTML= "All "+document.getElementById("MediaTypeTitle").innerHTML	
								}else{
									document.getElementById("MediaPageTitle").innerHTML=categoryName //+ ' '+ document.getElementById("MediaTypeTitle").innerHTML
								}
								//SetLocationBreadcrum('')
								doSearch('0')
								
							}else if (media=="image"){
								if (category==""){
									document.getElementById("SelectedCategoryName").innerHTML="All";
									document.frmMedia.category.value="all";
								}else{
									document.getElementById("SelectedCategoryName").innerHTML=categoryName;
									document.frmMedia.category.value=category;
								}
								/*	if (document.getElementById("MediaTypeTitle")){
										document.getElementById("MediaTypeTitle").innerHTML="All Images";
								}
								*/
								if (NYKACatID==""){
									document.getElementById("SelectedBizCategoryName").innerHTML="All";
									document.frmMedia.NYKACatID.value="";
								}else{
									document.getElementById("SelectedBizCategoryName").innerHTML=BusCategoryName;
									document.frmMedia.NYKACatID.value=NYKACatID;
								}
								document.getElementById("MediaTypeTitle").innerHTML="Images";
								if (categoryName==""){
									document.getElementById("MediaPageTitle").innerHTML= "All "+document.getElementById("MediaTypeTitle").innerHTML	
								}else{
									document.getElementById("MediaPageTitle").innerHTML=categoryName //+ ' '+ document.getElementById("MediaTypeTitle").innerHTML
								}
								//SetLocationBreadcrum('')
								doSearch('0')
								
							}else if (media=="coupon"){
								if (category==""){
									document.getElementById("SelectedCategoryName").innerHTML="All";
									document.frmMedia.category.value="all";
								}else{
									document.getElementById("SelectedCategoryName").innerHTML=categoryName;
									document.frmMedia.category.value=category;
								}
								/*	if (document.getElementById("MediaTypeTitle")){
										document.getElementById("MediaTypeTitle").innerHTML="All Coupons";
								}*/
								if (NYKACatID==""){
									document.getElementById("SelectedBizCategoryName").innerHTML="All";
									document.frmMedia.NYKACatID.value="";
								}else{
									document.getElementById("SelectedBizCategoryName").innerHTML=BusCategoryName;
									document.frmMedia.NYKACatID.value=NYKACatID;
								}
								document.getElementById("MediaTypeTitle").innerHTML="Coupons";
								if (categoryName==""){
									document.getElementById("MediaPageTitle").innerHTML= "All "+document.getElementById("MediaTypeTitle").innerHTML	
								}else{
									document.getElementById("MediaPageTitle").innerHTML=categoryName //+ ' '+ document.getElementById("MediaTypeTitle").innerHTML
								}
								//SetLocationBreadcrum('')
								doSearch('0')
								
							}else if (media=="audio"){
								if (category==""){
									document.getElementById("SelectedCategoryName").innerHTML="All";
									document.frmMedia.category.value="all";
								}else{
									document.getElementById("SelectedCategoryName").innerHTML=categoryName;
									document.frmMedia.category.value=category;
								}
								/*	if (document.getElementById("MediaTypeTitle")){
										document.getElementById("MediaTypeTitle").innerHTML="All Audios";
								}
								*/
								if (NYKACatID==""){
									document.getElementById("SelectedBizCategoryName").innerHTML="All Businesses";
									document.frmMedia.NYKACatID.value="";
								}else{
									document.getElementById("SelectedBizCategoryName").innerHTML=BusCategoryName;
									document.frmMedia.NYKACatID.value=NYKACatID;
								}
								document.getElementById("MediaTypeTitle").innerHTML="Audios";
								if (categoryName==""){
									document.getElementById("MediaPageTitle").innerHTML= "All "+document.getElementById("MediaTypeTitle").innerHTML	
								}else{
									document.getElementById("MediaPageTitle").innerHTML=categoryName //+ ' '+ document.getElementById("MediaTypeTitle").innerHTML
								}
								//SetLocationBreadcrum('')
								doSearch('0')
								
							}else if (media=="deal"){
							
								if (category==""){
									document.getElementById("SelectedCategoryName").innerHTML="All";
									document.frmMedia.category.value="all";
								}else{
									document.getElementById("SelectedCategoryName").innerHTML=categoryName;
									document.frmMedia.category.value=category;
								}
								/*	if (document.getElementById("MediaTypeTitle")){
										document.getElementById("MediaTypeTitle").innerHTML="All Deals";
								}
								*/
								document.getElementById("MediaTypeTitle").innerHTML="Deals";
								if (categoryName==""){
									document.getElementById("MediaPageTitle").innerHTML= "All "+document.getElementById("MediaTypeTitle").innerHTML	
								}else{
									document.getElementById("MediaPageTitle").innerHTML=categoryName //+ ' '+ document.getElementById("MediaTypeTitle").innerHTML
								}
								//SetLocationBreadcrum('')
								doSearch('0')
							}else if (media=="channels"){
								if (category==""){
									document.getElementById("SelectedCategoryName").innerHTML="All";
									document.frmMedia.category.value="all";
								}else{
									document.getElementById("SelectedCategoryName").innerHTML=categoryName;
									document.frmMedia.category.value=category;
								}
								/*	if (document.getElementById("MediaTypeTitle")){
										document.getElementById("MediaTypeTitle").innerHTML="All Channels";
								}
								*/
								if (NYKACatID==""){
									if (document.getElementById("SelectedBizCategoryName"))
										document.getElementById("SelectedBizCategoryName").innerHTML="All";
									if (document.frmMedia.NYKACatID)
										document.frmMedia.NYKACatID.value="";
								}else{
									if (document.getElementById("SelectedBizCategoryName"))
										document.getElementById("SelectedBizCategoryName").innerHTML=BusCategoryName
									if (document.frmMedia.NYKACatID)
										document.frmMedia.NYKACatID.value=NYKACatID
									
								}
								document.getElementById("MediaTypeTitle").innerHTML="Channels";
								if (categoryName==""){
									document.getElementById("MediaPageTitle").innerHTML= "All "+document.getElementById("MediaTypeTitle").innerHTML	
								}else{
									document.getElementById("MediaPageTitle").innerHTML=categoryName //+ ' '+ document.getElementById("MediaTypeTitle").innerHTML
								}
								//SetLocationBreadcrum('')
								doSearch('0')
							}else if (media=="store"){
							
								if (category==""){
									document.getElementById("SelectedCategoryName").innerHTML="All";
									document.frmMedia.category.value="all";
								}else{
									document.getElementById("SelectedCategoryName").innerHTML=categoryName;
									document.frmMedia.category.value=category;
								}
								/*	if (document.getElementById("MediaTypeTitle")){
										document.getElementById("MediaTypeTitle").innerHTML="All Stores";
								}
								*/
								document.getElementById("MediaTypeTitle").innerHTML="Stores";
								if (categoryName==""){
									document.getElementById("MediaPageTitle").innerHTML= "All "+document.getElementById("MediaTypeTitle").innerHTML	
								}else{
									document.getElementById("MediaPageTitle").innerHTML=categoryName //+ ' '+ document.getElementById("MediaTypeTitle").innerHTML
								}
								//SetLocationBreadcrum('')
								doSearch('0')
							}
							else{
								document.getElementById("SelectedCategoryName").innerHTML="All";
								ChangeCategory("all","All")
							}
							DefaultCatDropdown=document.getElementById("SelectedCategoryName").innerHTML
						}else{
							//SetLocationBreadcrum('')
							doSearch('0')
							
						}
						if (OnlyForBusiness=="1"){
							document.getElementById("MediaTypeTitle").innerHTML="Businesses";
						}
						SetLocationBreadcrum('')
						
					}
				});
			
			
			
			}else{
				window.location.href = getMediaUrl(media);
			}
		}else{
				window.location.href = getMediaUrl(media);
			}
	
}

function GetBoardURL(countryid,countryurl,stateid,stateurl,countyid,countyurl,cityid,cityurl){
		var  strBoardURL=""
		if (countryid == 1) {
				if (stateid != 0 && stateid != -1) {
						if (countyid != 0 && countyid != -1) {
								if (cityid != 0 && cityid != -1)//city
								{
										strBoardURL = '/us/' + cityurl;
								}
								else {//redirect ot county
										if (countyid == 23) {
												strBoardURL = '/parish/' + stateurl + '/' + countyurl;
										}
										else {
												strBoardURL = '/county/' + stateurl + '/' + countyurl;
										}
								}
						}
						else if (cityid != 0 && cityid != -1)//city
						{
								strBoardURL = '/us/' + cityurl;
						}
						else {//stale url
								strBoardURL = "/" + stateurl;
						}
				}
				else {
						strBoardURL = '/united-states';
				}
		}
		else if (countryid != 0) {
				if (cityid != 0 && cityid != -1) {
						strBoardURL = "/" + cityurl;
				}
				else {
						strBoardURL = "/" + $scope.countryurl;
				}
		}
		GetBoardURL=strBoardURL
}

function SubmitTopSearch(){
	 document.frmMainSearch.action=document.frmMainSearch.KeySearchURL.value + "?sq=" + document.frmMainSearch.txtKeyword.value;
	
	 document.frmMainSearch.submit();
}

function getMediaUrl(curMediaPage){
var MediaUrl;
	var tmpcaturl="all"
	if (curMediaPage=="video"){
		MediaUrl="/videos/"+tmpcaturl+"/"
	}else if(curMediaPage=="product"){
		MediaUrl="/products/"+tmpcaturl+"/"	
	}else if(curMediaPage=="blog"){
		MediaUrl="/blogs/"+tmpcaturl+"/"
	}else if(curMediaPage=="image"){
		MediaUrl="/images/"+tmpcaturl+"/"
	}else if(curMediaPage=="channel"){
		MediaUrl="/channels/"+tmpcaturl+"/"
	}else if(curMediaPage=="audio"){
		MediaUrl="/audios/"+tmpcaturl+"/"
	}else if(curMediaPage=="coupon"){
		MediaUrl="/coupons/"+tmpcaturl+"/"
	}else if(curMediaPage=="deal"){
		MediaUrl="/deals/"
	}else if(curMediaPage=="store"){
		MediaUrl="/stores/"+tmpcaturl+"/"
	}else if(curMediaPage=="profile"){
		MediaUrl="/members/"
			
	}else if(curMediaPage=="peoples"){
		MediaUrl="/people/"
	}else if(curMediaPage=="network"){
		MediaUrl="/business-networking/network/world/"
	}else if(curMediaPage=="group"){
		MediaUrl="/groups/all/"
	}else if(curMediaPage=="premium"){
		MediaUrl="/premiumpackages/"
	}else if(curMediaPage=="locations"){
		MediaUrl="/locations/"	
		
	}else if(curMediaPage=="classifieds"){
		MediaUrl="/ads/all/"
	
	}else if(curMediaPage=="forums"){
		MediaUrl="/forums/"
	}
	else if(curMediaPage=="channels"){
		MediaUrl="/channels/"
	}
	return MediaUrl;
}

function getMediaUrlNew(curMediaPage){
var MediaUrl;
	var tmpcaturl="all"
	var tmpNykaCatId=""
	if (document.frmMedia) {
		if (document.frmMedia.category){
			if (document.frmMedia.category.value!=''){
				tmpcaturl=document.frmMedia.category.value
			}
		}
		if (document.frmMedia.NYKACatID){
			if (document.frmMedia.NYKACatID.value!=''){
				tmpNykaCatId=document.frmMedia.NYKACatID.value
			}
		}
	}
	if(curMediaPage!="profile"){
			if (tmpNykaCatId!="")
				tmpcaturl="all"
	}
	if (curMediaPage=="video"){
		MediaUrl="/videos/"+tmpcaturl+"/"
	}else if(curMediaPage=="product"){
		MediaUrl="/products/"+tmpcaturl+"/"	
	}else if(curMediaPage=="blog"){
		MediaUrl="/blogs/"+tmpcaturl+"/"
	}else if(curMediaPage=="image"){
		MediaUrl="/images/"+tmpcaturl+"/"
	}else if(curMediaPage=="channel"){
		MediaUrl="/channels/"+tmpcaturl+"/"
	}else if(curMediaPage=="audio"){
		MediaUrl="/audios/"+tmpcaturl+"/"
	}else if(curMediaPage=="coupon"){
		MediaUrl="/coupons/"+tmpcaturl+"/"
	}else if(curMediaPage=="deal"){
		MediaUrl="/deals/"
	}else if(curMediaPage=="store"){
		MediaUrl="/stores/"+tmpcaturl+"/"
	}else if(curMediaPage=="profile"){
		MediaUrl="/members/"
		if (document.frmMedia) {
			if (document.frmMedia.category){
				if (document.frmMedia.category.value!=''){
					MediaUrl="/"+document.frmMedia.category.value+"/network/members/"
				}
			}
		}
		
		
	}else if(curMediaPage=="peoples"){
		MediaUrl="/people/"
	}else if(curMediaPage=="network"){
		MediaUrl="/business-networking/network/world/"
	}else if(curMediaPage=="group"){
		MediaUrl="/groups/all/"
	}else if(curMediaPage=="premium"){
		MediaUrl="/premiumpackages/"
	}else if(curMediaPage=="locations"){
		MediaUrl="/locations/"	
		
	}else if(curMediaPage=="classifieds"){
		MediaUrl="/ads/all/"
	
	}else if(curMediaPage=="forums"){
		MediaUrl="/forums/"
	}
	else if(curMediaPage=="channels"){
		MediaUrl="/channels/"
	}
	//debugger
	if(curMediaPage!="profile"){
			if (tmpNykaCatId!="")
				MediaUrl+='?NYKACatID='+tmpNykaCatId
	}
	if (document.getElementById("txtMainSerch").value!=""){
		MediaUrl+='?sq='+document.getElementById("txtMainSerch").value
	}
	return MediaUrl;
}

function getButtonset(){
	$(".Products_AddProduct").fancybox({
		'frameWidth': 550,
		'frameHeight': 450,
		'showCloseButton': false,
		'title': false,
		'padding': 0,
		'hideOnContentClick': false
	});
	$("#PanelImages_ManageImages,#PanelImages_AddImages").fancybox({
		'frameWidth': 712,
		'frameHeight': 475,
		'showCloseButton': false,
		'padding': 0,
		'hideOnContentClick': false
	});
	$(".PanelAddAll").fancybox({
		helpers: { 
			title: null
		},
		'frameWidth': 712,
		'frameHeight': 580,
		'showCloseButton': false,
		'padding': 0,
		'hideOnContentClick': false
		
	});
	$("#Deals_AddDeal").fancybox({
		'frameWidth': 711,
		'frameHeight': 420,
		'padding': 0,
		'showCloseButton': false,
		'hideOnContentClick': false
	});	
	$("#AddCouon").fancybox({
		'frameWidth':560,
		'showCloseButton': false,
		'padding':0,
		'frameHeight':480
	});	
	$(".Blogs_AddBlogs").fancybox({
		'frameWidth': 840,
		'frameHeight': 600,
		'showCloseButton': false,
		'padding': 0,
		'hideOnContentClick': false
	});
	$("#PanelAudios_ManageAudios,#PanelAudios_AddAudios").fancybox({
		'frameWidth': 650,
		'showCloseButton': false,
		'padding': 0,
		'frameHeight': 350
	});
	$("#PanelVideos_ManageVideos").fancybox({
		'frameWidth': 800,
		'frameHeight': 520,
		'showCloseButton': false,
		'padding': 0,
		'hideOnContentClick': false
	});   
$(".PanelVideos_AddAnVideos").fancybox({
		'frameWidth': 800,
		'frameHeight': 500,
		'showCloseButton': false,
		'padding': 0,
		'hideOnContentClick': false
	}); 
        $("[class=MapIt]").fancybox({
            'frameWidth':500,
            'frameHeight':500,
            'hideOnContentClick':false
        });
        
        $("#ContactMe").fancybox({
            'frameWidth':500,
            'frameHeight':340,
            'padding':0,
	        'showCloseButton': false,
            'hideOnContentClick':false
        });	
		
$("input[type='search']").on("click", function () {
   $(this).select();
});
}

function setLocationCookies(boardurl,CurrentCountryID,CurrentStateID,CurrentCountyID,CurrentCityID,CurrentNeighborhoodID){
	//	SetLocationBreadcrum('');
	if (document.getElementById("lockLocation")){
		if (document.getElementById("lockLocation").checked){
			setCookie("LockBoardURL",boardurl,30);	
			//setCookie("LockedWhere",boardurl,30);					
			setCookie("LockCountryID",CurrentCountryID,30);		
			setCookie("LockStateID",CurrentStateID,30);		
			setCookie("LockCountyID",CurrentCountyID,30);		
			setCookie("LockCityID",CurrentCityID,30);	
			setCookie("LockNeighborhoodID",CurrentNeighborhoodID,30);			
		}else{
			setCookie("LockBoardURL",'',-1);
			//setCookie("LockedWhere",boardurl,30);	
			setCookie("LockCountryID",'',-1);		
			setCookie("LockStateID",'',-1);		
			setCookie("LockCountyID",'',-1);		
			setCookie("LockCityID",'',-1);	
			setCookie("LockNeighborhoodID",'',-1);
			
		}
}
}

function Setlocation(boardurl,country, countryID,  state, stateID, county, countyID, city, cityID,neighborhood,neighborhoodID,stateAbbr,MediaType,url){  //
	if (curMediaPageTec=="group" || MediaType=="group" || curMediaPageTec=="premium" || MediaType=="premium"){
		window.location.href = getMediaUrl(MediaType);
	
	}else{
		postURL=url
		curMediaPage=MediaType
		if (curMediaPage!=PrevMediaPage){
			
			MediaBusCategoryID=""
			MediaCategoryID=""
		
			blnCallGetLeftMenu=true
		}else{
			blnCallGetLeftMenu=false
		}
		
		PrevMediaPage=MediaType
		if (countryID=="0" || countryID=="-1")
				CurrentCountryID=""
		else
				CurrentCountryID=countryID
			
		if (stateID=="0" || stateID=="-1")
				CurrentStateID=""
		else
				CurrentStateID=stateID
		if (countyID=="0" || countyID=="-1")
				CurrentCountyID=""
		else
				CurrentCountyID =countyID
				
		if (cityID=="0" || cityID=="-1")
				CurrentCityID=""
		else
				CurrentCityID=cityID
		if (neighborhoodID=="0" || neighborhoodID=="-1")
				CurrentNeighborhoodID=""
		else
				CurrentNeighborhoodID=neighborhoodID
		setLocationCookies(boardurl,CurrentCountryID,CurrentStateID,CurrentCountyID,CurrentCityID,CurrentNeighborhoodID);
		GetLocalPageInfo(CurrentCountryID,CurrentStateID,CurrentCountyID,CurrentCityID);
		setLocationTitle(countryID,country,state,stateAbbr,county,city,neighborhood)
		if (document.getElementById("BoardURL"))
			document.getElementById("BoardURL").href=boardurl
		if (document.getElementById("BoardURL1"))
			document.getElementById("BoardURL1").href=boardurl
		if (document.getElementById("iconBoardURL"))
			document.getElementById("iconBoardURL").href=boardurl
		//if (document.getElementById("SelectedCategoryName"))
		//	document.getElementById("SelectedCategoryName").innerHTML="New";
		ChangeMediaData(curMediaPage)
	}
}

function setLocationTitle(countryID,country,state,stateAbbr,county,city,neighborhoodname){
	return ;
	var LocationTitle
	LocationTitle=""
	if (country!="Country" &&  country!="All")
		LocationTitle=country
	if (state!="State" && state!="States" && state!="All States"){
		LocationTitle=state
	}
	if (county!="County" &&  county!="Counties"  && county!="All Counties"){
		LocationTitle=county 
		LocationTitle +=" County, "+stateAbbr
	}
	if (city!="City" && city!="Cities"   && city!="All Cities"){
		LocationTitle=city
		if (countryID=="1") 	
			LocationTitle +=", "+stateAbbr
	}
	if (neighborhoodname!="Neighborhood" && neighborhoodname!="Neighborhoods"   && neighborhoodname!="All Neighborhoods"){
		LocationTitle=Neighborhood
		LocationTitle +=", "+city
	}
	setCookie("LocationTitle",LocationTitle.replaceAll(' ','-'),30);	
	//console.log("Setlocation BoardURL1 : "+boardurl)
	if (document.getElementById("LocationTitle"))
		document.getElementById("LocationTitle").innerHTML=LocationTitle
	

	
	
}

function SetlocationSITS(boardurl,country, countryID,  state, stateID, county, countyID, city, cityID,neighborhood,neighborhoodID,stateAbbr){  //

	if (countryID=="0" || countryID=="-1")
			CurrentCountryID=""
	else
			CurrentCountryID=countryID
		
	if (stateID=="0" || stateID=="-1")
			CurrentStateID=""
	else
			CurrentStateID=stateID
	if (countyID=="0" || countyID=="-1")
			CurrentCountyID=""
	else
			CurrentCountyID =countyID
			
	if (cityID=="0" || cityID=="-1")
			CurrentCityID=""
	else
			CurrentCityID=cityID
	if (neighborhoodID=="0" || neighborhoodID=="-1")
			CurrentNeighborhoodID=""
	else
			CurrentNeighborhoodID=neighborhoodID
	setLocationCookies(boardurl,CurrentCountryID,CurrentStateID,CurrentCountyID,CurrentCityID,CurrentNeighborhoodID);
	//GetLocalPageInfo(CurrentCountryID,CurrentStateID,CurrentCountyID,CurrentCityID);
	setLocationTitle(countryID,country,state,stateAbbr,county,city,neighborhood)
	if (document.getElementById("BoardURL"))
		document.getElementById("BoardURL").href=boardurl
	if (document.getElementById("BoardURL1"))
		document.getElementById("BoardURL1").href=boardurl
	if (document.getElementById("iconBoardURL"))
		document.getElementById("iconBoardURL").href=boardurl
	
}

function SetlocationDash(boardurl,country, countryID,  state, stateID, county, countyID, city, cityID,neighborhood,neighborhoodID,NYKACatID,NYKACatName,NYKACatURL,MediaType,stateAbbr){
		
	if (NYKACatID==""){
		CurrentNYKACatID=""
	}else{
		CurrentNYKACatID=NYKACatID

		if (NYKACatName!="undefined")
			CurrentNYKACatName=NYKACatName
		CurrentNYKACatURL=NYKACatURL
		curMediaPage=MediaType
	}
	if (curMediaPage!=PrevMediaPage){
		MediaBusCategoryID=""
		MediaCategoryID=""
	
		blnCallGetLeftMenu=true
	}else{
		blnCallGetLeftMenu=false
	}

	PrevMediaPage=MediaType	
	if (countryID=="0" || countryID=="-1")
			CurrentCountryID=""
	else
			CurrentCountryID=countryID
		
	if (stateID=="0" || stateID=="-1")
			CurrentStateID=""
	else
			CurrentStateID=stateID
	if (countyID=="0" || countyID=="-1")
			CurrentCountyID=""
	else
			CurrentCountyID =countyID
			
	if (cityID=="0" || cityID=="-1")
			CurrentCityID=""
	else
		CurrentCityID=cityID

	if (neighborhoodID=="0" || neighborhoodID=="-1")
			CurrentNeighborhoodID=""
	else
			CurrentNeighborhoodID=neighborhoodID
	setLocationCookies(boardurl,CurrentCountryID,CurrentStateID,CurrentCountyID,CurrentCityID,CurrentNeighborhoodID);
	GetLocalPageInfo(CurrentCountryID,CurrentStateID,CurrentCountyID,CurrentCityID);
	setLocationTitle(countryID,country,state,stateAbbr,county,city,neighborhood)
	
	if (document.getElementById("BoardURL"))
		document.getElementById("BoardURL").href=boardurl
	if (document.getElementById("BoardURL1"))
		document.getElementById("BoardURL1").href=boardurl
	if (document.getElementById("iconBoardURL"))
		document.getElementById("iconBoardURL").href=boardurl
		
		ChangeMediaData(curMediaPage)
	
	if (typeof ChangeSideAd == 'function') { 
		if (View4box=="")
			ChangeSideAd()
	}
}

function Getlocation(){
	
	var scope = angular.element($("#NgStateApp")).scope();

	var LocationTitle
	if (scope.SelectedCountryName!="Country")
		LocationTitle=scope.SelectedCountryName
	if (scope.SelectedStateName!="State"){
		LocationTitle=scope.SelectedStateName
	}
	if (scope.SelectedCityName!="City"){
		LocationTitle=scope.SelectedCityName
	}
//	console.log("LocationTitle : "+LocationTitle)
	document.getElementById("LocationTitle").innerHTML=LocationTitle

}

function setWhatHappingTitle(countryid,countryname,countryurl,stateid,statename,stateurl,stateabbr,countyid,countyname,countyurl,cityid,cityname,cityurl,neighborhoodid,neighborhoodname,neighborhoodurl){
	var whathappeningtitleAbbr
	
	if (countryid== 1) {
		whathappeningtitleAbbr= "United States"
		if (stateid!= 0 && stateid != -1) {
			whathappeningtitleAbbr=statename
		}
		
		if (countyid != 0 && countyid != -1) {
			whathappeningtitleAbbr= countyname + " County, "+ statename
		}
		if (cityid != 0 && cityid != -1)//city
		{
			whathappeningtitleAbbr= cityname+ ", "+ statename
		}
		if (neighborhoodid != 0 && neighborhoodid != -1)//city
		{
			whathappeningtitleAbbr= neighborhoodname + ", "+ cityname
		}
	}else if (countryid >1) {
		
		whathappeningtitleAbbr=  countryname
		if (cityid != 0 && cityid != -1) {
				whathappeningtitleAbbr= cityname + ", "+ countryname
		}
		
	}else{
		whathappeningtitleAbbr="the World"
		
	}
	if (document.getElementById("whathappeningtitle"))
	{
		document.getElementById("whathappeningtitle").innerHTML="What's Happening In " + whathappeningtitleAbbr+"!"
	}
}

function setWhatHappingTitleWithScope(scope){
	var whathappeningtitleAbbr
	
	if (scope.SelectedCountryID == 1) {
		whathappeningtitleAbbr= "United States"
		if (scope.SelectedStateID != 0 && scope.SelectedStateID != -1) {
			whathappeningtitleAbbr= scope.SelectedStateName + ", United States"
		}
		
		if (scope.SelectedCountyID != 0 && scope.SelectedCountyID != -1) {
			whathappeningtitleAbbr= scope.SelectedCountyName + " County, "+ scope.SelectedStateName
		}
		if (scope.SelectedCityID != 0 && scope.SelectedCityID != -1)//city
		{
			whathappeningtitleAbbr= scope.SelectedCityName + ", "+ scope.SelectedStateName
		}
		if (scope.SelectedNeighborhoodID != 0 && scope.SelectedNeighborhoodID != -1)//city
		{
			whathappeningtitleAbbr= scope.SelectedNeighborhoodName + ", "+ scope.SelectedCityName
		}
	}else if (scope.SelectedCountryID >1) {
		
		whathappeningtitleAbbr=  scope.SelectedCountryName
		if (scope.SelectedCityID != 0 && scope.SelectedCityID != -1) {
				whathappeningtitleAbbr= scope.SelectedCityName + ", "+ scope.SelectedCountryName
		}
		
	}else{
		whathappeningtitleAbbr="The World"
		
	}
	if (document.getElementById("whathappeningtitle"))
	{
		document.getElementById("whathappeningtitle").innerHTML="What's Happening In " + whathappeningtitleAbbr +"!"
	}
}

function setSearchLocation(countryid,countryname,countryurl,stateid,statename,stateurl,stateabbr,countyid,countyname,countyurl,cityid,cityname,cityurl,neighborhoodid,neighborhoodname,neighborhoodurl){
	
	/*if (document.frmMedia) {
		if (document.frmMedia.search)
			document.frmMedia.search.value=""

		if (document.frmMedia.category)
			document.frmMedia.category.value=""
		
		if (document.frmMedia.NYKACatID)
			document.frmMedia.NYKACatID.value=""
		
		ChangeCommonMediaTitle("all","All","1")
	}
*/
	//if (document.frmMedia.PersonalPref)
	//	document.frmMedia.PersonalPref.value=""
	//PersonalPref=""
	var scope = angular.element($("#NgStateApp")).scope();
	if (countryid!="")
		scope.loadStateOrCities(countryid,countryname,countryurl,false)
	if (countryid=="1"){
		if (stateid!="")
			 scope.loadCountyForState(stateid, statename, stateurl,stateabbr,false)

		if (countyid!="")
			 scope.loadCitiesForCounty(countyid, countyname, countyurl,false)
	}
	if (cityid!=""){
		 scope.selectCity(cityid, cityname, cityurl,false)
	}
	 
	 
	if (neighborhoodid!=""){
		 scope.selectNeighborhood(neighborhoodid, neighborhoodname, neighborhoodurl,false)	

	}
	//else{
		if (typeof scope.RedirectToLocation == 'function') { 
			scope.RedirectToLocation(false)
		}else{
			scope.SearchContentByLocation(false);
		}

	//}		
	
	
}

function setSearchLocationDisplay(countryid,countryname,countryurl,stateid,statename,stateurl,stateabbr,countyid,countyname,countyurl,cityid,cityname,cityurl,neighborhoodid,neighborhoodname,neighborhoodurl){
	
	if (document.frmMedia.PersonalPref)
		document.frmMedia.PersonalPref.value=""
	PersonalPref=""
	var scope = angular.element($("#NgStateApp")).scope();
	if (countryid!="")
		scope.loadStateOrCities(countryid,countryname,countryurl,false)
	if (countryid=="1"){
		if (stateid!="")
			 scope.loadCountyForState(stateid, statename, stateurl,stateabbr,false)

		if (countyid!="")
			 scope.loadCitiesForCounty(countyid, countyname, countyurl,false)
	}
	if (cityid!="")
		 scope.selectCity(cityid, cityname, cityurl,false)
	if (neighborhoodid!="")
		 scope.selectNeighborhood(neighborhoodid, neighborhoodname, neighborhoodurl,false)	 
	
	SetLocationBreadcrum('')
	HideLeftMenu()
	if (typeof ChangeSideAd == 'function') { 
		if (View4box=="")
			ChangeSideAd()
	}
}

function setSearchLocationBoard(countryid,countryname,countryurl,stateid,statename,stateurl,stateabbr,countyid,countyname,countyurl,cityid,cityname,cityurl,neighborhoodid,neighborhoodname,neighborhoodurl){

	var scope = angular.element($("#NgStateApp")).scope();
	if (countryid!="")
		scope.loadStateOrCities(countryid,countryname,countryurl,false)
	if (countryid=="1"){
		if (stateid!="")
			 scope.loadCountyForState(stateid, statename, stateurl,stateabbr,false)

		if (countyid!="")
			 scope.loadCitiesForCounty(countyid, countyname, countyurl,false)
	}
	if (cityid!="")
		 scope.selectCity(cityid, cityname, cityurl,false)
	if (neighborhoodid!="")
		 scope.selectNeighborhood(neighborhoodid, neighborhoodname, neighborhoodurl,false)
	scope.SetBoardURL();	 
	SetNetworkBoard()
	SetLocationBreadcrum('')
	HideLeftMenu()
	if (typeof ChangeSideAd == 'function') { 
		if (View4box=="")
			ChangeSideAd()
	}
}

function gotoSBBusinesswithLocation(catvalue,profiletypeid,countryid,countryname,countryurl,stateid,statename,stateurl,stateabbr,countyid,countyname,countyurl,cityid,cityname,cityurl){

	setSearchLocationBoard(countryid,countryname,countryurl,stateid,statename,stateurl,stateabbr,countyid,countyname,countyurl,cityid,cityname,cityurl);
	
	
	if (profiletypeid!="1"){
		gotoSBBusiness(catvalue);
		
	}else{
		gotoPeople('');
	}
	
}

function GetMediaPageSetting(mediatype){
	
	//alert(pageSettings.searchUrl);
	var url = pageSettings.searchUrl;
	var mediacontentId = pageSettings.contentId;
	var mediacontentPagingId = pageSettings.contentPagingId;
	
	if(mediatype == "blog")
	{
		var mediasectionSearchPage = '/blogs/all/';
	}
	if(mediatype == "audio")
	{
		var mediasectionSearchPage = '/audios/all/';
	}
	if(mediatype == "video")
	{
		var mediasectionSearchPage = '/videos/all/';
	}
	if(mediatype == "image")
	{
		var mediasectionSearchPage = '/images/all/';
	}
	if(mediatype == "coupon")
	{
		var mediasectionSearchPage = '/coupons/';
	}
	if(mediatype == "product")
	{
		var mediasectionSearchPage = '/products/';
	}
	if(mediatype == "deal")
	{
		var mediasectionSearchPage = '/deals/';
	}
	if(mediatype == "profile")
	{
		var mediasectionSearchPage = '/members/';
	}
	if(mediatype == "store")
	{
		var mediasectionSearchPage = '/stores/all/';
	}

	if(mediatype == "peoples")
	{
		var mediasectionSearchPage = '';
	}
	
	
	
	pageSettings = {
			searchUrl: url,
			sectionSearchPage: "",
			contentId: mediacontentId,
			contentPagingId: mediacontentPagingId
		}
	
}

function selecthome(){
	var scope = angular.element($("#NgStateApp")).scope();
	var rurl=scope.generateRedirectURL();
	rurl=rurl.replace("/board","")
	window.open(rurl, "_self");
}

function setSearchMedia(mediatype){
	
	var scope = angular.element($("#NgStateApp")).scope();
		MediaCategoryID=""
		MediaBusCategoryID=""
	scope.selectMediaType(mediatype);
	HideLeftMenu()
}

function setSearchMediaNetwork(catid,catname,caturl,objthis){
	
	var scope = angular.element($("#NgStateApp")).scope();
	MediaCategoryID=""
	MediaBusCategoryID=""
	
	scope.selectNYKACatID(catid,catname,caturl);
	ClearSelectedCategory(objthis)

	$(objthis).css({"color":"#fff", "background-color":"#00acee"});
	HideLeftMenu()

}

function setSearchMediaTopic(caturl,catname,objthis){
	
	var scope = angular.element($("#NgStateApp")).scope();
	MediaCategoryID=""
	MediaBusCategoryID=""

	scope.selectMediaTopic(caturl);
	
   $(objthis).css({"color":"#fff", "background-color":"#00acee"});
	HideLeftMenu()
}
  
function VarifyMemberDelete(id,name){
     var c = confirm("Are you sure you want to delete this Member '"+ name.replace("'","\'") +"'?");
     if(c)
     {
	 	
		$.ajax({
			url: '/profile/image_delete_admin.asp?id=' + id,
			type: 'get',
			success:function(response){

				
			}
         });
		doSearch('0')
		
     }
}
   
function AfterDataLoad(){


    $('.js-delete-member-link').fancybox({
        'frameWidth': 440,
        'frameHeight': 310,
        'showCloseButton': false,
        'padding': 0,
        'hideOnContentClick': false
    });
	
	$("[class=directorycategory]").fancybox({
            'frameWidth':450,
            'frameHeight':250,
	          'showCloseButton': false,
            'padding':0,
            'hideOnContentClick':true
        });
}

function LocationToggle(){
	if (document.getElementById("NgStateApp")){

		if (document.getElementById("NgStateApp").style.display=="inline-block" || document.getElementById("NgStateApp").style.display==""){
			document.getElementById("NgStateApp").style.display="none"
			document.getElementById("SelectLocationPanel").style.height="1px";
		}else{
			document.getElementById("NgStateApp").style.display="inline-block"
			document.getElementById("SelectLocationPanel").style.height="42px";
		}
	}

}

function clearlocalStorageData(){
	
}

function MediaFormSubmit(pageNo){
	if(document.frmMedia.PG)
		document.frmMedia.PG.value = pageNo;
//	document.getElementById('tbSearchFor').value="";
//debugger
	clearAllLeftPanel()
	document.frmMedia.submit();
	if (pageNo==1)
		window.scrollTo(0,0);
	
	if (MediaDisplay!="scroll" && pageNo==1 ){   ///
		document.getElementById('LOCALLIST').innerHTML = '<table cellspacing="0" cellpadding="0" border="0" style="width:100%"><tr><td align="center" style="padding-top:50px"><img src="https://www.storeboard.com/images/schemes/lblu/ajax_loader_large.gif" alt="Loading..."/></td></tr></table>';
		document.getElementById('LOCALLIST_PAGING').innerHTML = '&nbsp;';
	
	}else if (MediaDisplay=="scroll" && pageNo==1){
		document.getElementById('LOCALLIST').innerHTML = '<table cellspacing="0" cellpadding="0" border="0" style="width:100%"><tr><td align="center" style="padding-top:50px"><img src="https://www.storeboard.com/images/schemes/lblu/ajax_loader_large.gif" alt="Loading..."/></td></tr></table>';
		document.getElementById('LOCALLIST_PAGING').innerHTML = '&nbsp;';
		
	}else{
		$('#Laoding'+ pageNo).html('<div  class="widget-loader-icon"><div class="rounded3 gry allbord" style="padding:3px 10px;margin-top:10px;    margin-bottom: 10px;display:inline-block"><table cellpadding="0" cellspacing="0" border="0"><tr style="height:22px"><td><img src="https://www.storeboard.com/images/schemes/lblu/trans_ajax_loader.gif" alt="Loading..."/></td><td class="f5" style="color:#999;padding-left:10px">&nbsp;Loading...</td></tr></table></div></div>');
	}
	
	var scope = angular.element($("#NgStateApp")).scope();
	scope.SetPageURL()

	return false;
}

function ResetFilter(){
	document.frmMedia.NYKACatID.value='';
	MediaBusCategoryID=''
	MediaBusCategoryName=''
	
	document.frmMedia.category.value='all';
	MediaCategoryID='all';
	MediaCategoryName='All';
	document.getElementById("filterLable").innerHTML="All"
	ClearSelectedCategory()
	MediaFormSubmit(1);
}

function ChangeCommonMediaTitle(catValue,catdisplay,pst){

	if  (pst=="1"){
		if (catValue=="") {
			catValue="all"
			catdisplay="All"
		}
		//if (catValue=="all") {
		//	catdisplay="All"
		//}
		if (document.frmMedia) {
			document.frmMedia.category.value=catValue;
			document.frmMedia.Categoryname.value=catdisplay;
			//setCookie(curMediaPage+"CatUrl",catValue,'');
			//if (catValue=="mostactive")
			//	SetLocationBreadcrum('')
			SetCategoryBreadcrum();
		}
		MediaCategoryID=catValue;
		MediaCategoryName=catdisplay;
		
		if (document.getElementById("SelectedCategoryName"))
			document.getElementById("SelectedCategoryName").innerHTML=catdisplay;
		//if (document.getElementById("Categoryname"))
		//	document.getElementById("Categoryname").innerHTML=catdisplay;
		document.getElementById("filterLable").innerHTML=catdisplay
		
		if (document.getElementById("MediaPageTitle")){
			if (catValue=="all"){
				if (curMediaPage == "channels" )
					document.getElementById("MediaPageTitle").innerHTML=peopleMediaTitle
				else
					
					document.getElementById("MediaPageTitle").innerHTML= "All " +document.getElementById("MediaTypeTitle").innerHTML
			
				if(curMediaPage == "product" || curMediaPage == "video" || curMediaPage == "audio" || curMediaPage == "image" || curMediaPage == "blog" || curMediaPage == "coupon" || curMediaPage == "profile"  || curMediaPage == "store" || curMediaPage == "deal"  ){
					if (document.getElementById("PersonalPrefName"))
						document.getElementById("PersonalPrefName").innerHTML=document.getElementById("MediaPageTitle").innerHTML
					//if (document.getElementById("ParentcategoryName").value==""){
						if (document.getElementById("PersonalPrefName5"))
							document.getElementById("PersonalPrefName5").innerHTML="All Businesses";
						if (document.getElementById("PersonalPrefName6"))
							document.getElementById("PersonalPrefName6").innerHTML="All Businesses";
					/*}else{
						if (document.getElementById("PersonalPrefName6"))
							document.getElementById("PersonalPrefName6").innerHTML=catdisplay;
						if (document.getElementById("PersonalPrefName5"))
							document.getElementById("PersonalPrefName5").innerHTML=document.getElementById("ParentcategoryName").value;
					}*/
					
				//if ($.cookie("NYKACatID")!="")		{								
				//	document.getElementById("MediaPageTitle").innerHTML=$.cookie("NYKACatName");
				//	document.getElementById("filterLable").innerHTML=	$.cookie("NYKACatName");
				//}
				
				}
			
			}else{
				if (curMediaPage == "channels" )
					document.getElementById("MediaPageTitle").innerHTML=catdisplay + ' Channel'//+ document.getElementById("MediaThirdbar").innerHTML	
				else
					document.getElementById("MediaPageTitle").innerHTML=catdisplay
				
				if(curMediaPage == "product" || curMediaPage == "video" || curMediaPage == "audio" || curMediaPage == "image" || curMediaPage == "blog" || curMediaPage == "coupon" || curMediaPage == "profile"  || curMediaPage == "store" || curMediaPage == "deal"  ){
					if (document.getElementById("PersonalPrefName"))
						document.getElementById("PersonalPrefName").innerHTML=catdisplay;
					
					if (document.getElementById("ParentcategoryName").value==""){
						if (document.getElementById("PersonalPrefName5"))
							document.getElementById("PersonalPrefName5").innerHTML=catdisplay;
						if (document.getElementById("PersonalPrefName6"))
							document.getElementById("PersonalPrefName6").innerHTML="All Businesses";
					}else{
						if (document.getElementById("PersonalPrefName6"))
							document.getElementById("PersonalPrefName6").innerHTML=catdisplay;
						if (document.getElementById("PersonalPrefName5"))
							document.getElementById("PersonalPrefName5").innerHTML=document.getElementById("ParentcategoryName").value;
					}
					
					
				//if ($.cookie("NYKACatID")!="")		{								
				//	document.getElementById("MediaPageTitle").innerHTML=$.cookie("NYKACatName");
				//	document.getElementById("filterLable").innerHTML=	$.cookie("NYKACatName");
				//}
				
				}
			}
			
			
		}
		
		
	
	}
}

function ChangeCommonMediaTitleNew(catValue,catdisplay,pst){
	
	if  (pst=="1"){
		if (catValue=="") {
			catValue="all"
			catdisplay="All"
		}
		if (document.frmMedia) {
			document.frmMedia.Buscategory.value=catValue;
			document.frmMedia.BuscategoryName.value=catdisplay;
			//if (catValue=="mostactive")
			//	SetLocationBreadcrum('')
			SetCategoryBreadcrum();
		}
		MediaCategoryID=catValue;
		MediaCategoryName=catdisplay;
		
		if (document.getElementById("SelectedCategoryName"))
			document.getElementById("SelectedCategoryName").innerHTML=catdisplay;
		//if (document.getElementById("Categoryname"))
		//	document.getElementById("Categoryname").innerHTML=catdisplay;
		document.getElementById("filterLable").innerHTML=catdisplay
		if (document.getElementById("MediaPageTitle")){
			if (catValue=="all"){
				if (curMediaPage == "channels" )
					document.getElementById("MediaPageTitle").innerHTML=peopleMediaTitle
				else
					document.getElementById("MediaPageTitle").innerHTML= "All " +document.getElementById("MediaTypeTitle").innerHTML
			
				if(curMediaPage == "product" || curMediaPage == "video" || curMediaPage == "audio" || curMediaPage == "image" || curMediaPage == "blog" || curMediaPage == "coupon" || curMediaPage == "profile"  || curMediaPage == "store" || curMediaPage == "deal"  ){
					if (document.getElementById("PersonalPrefName"))
						document.getElementById("PersonalPrefName").innerHTML=catdisplay;
					
				
				//if ($.cookie("NYKACatID")!="")		{								
				//	document.getElementById("MediaPageTitle").innerHTML=$.cookie("NYKACatName");
				//	document.getElementById("filterLable").innerHTML=	$.cookie("NYKACatName");
				//}
				
				}
			
			}else{
				if (curMediaPage == "channels" )
					document.getElementById("MediaPageTitle").innerHTML=catdisplay + ' Channel'//+ document.getElementById("MediaThirdbar").innerHTML	
				else
					document.getElementById("MediaPageTitle").innerHTML=catdisplay
				
				if(curMediaPage == "product" || curMediaPage == "video" || curMediaPage == "audio" || curMediaPage == "image" || curMediaPage == "blog" || curMediaPage == "coupon" || curMediaPage == "profile"  || curMediaPage == "store" || curMediaPage == "deal"  ){
					if (document.getElementById("PersonalPrefName"))
						document.getElementById("PersonalPrefName").innerHTML=catdisplay;
					
				//if ($.cookie("NYKACatID")!="")		{								
				//	document.getElementById("MediaPageTitle").innerHTML=$.cookie("NYKACatName");
				//	document.getElementById("filterLable").innerHTML=	$.cookie("NYKACatName");
				//}
				
				}
			}
			
			
		}
		
		
	
	}
}

function changeMediaTitleFromCookie(){
	if(curMediaPage == "product" || curMediaPage == "video" || curMediaPage == "audio" || curMediaPage == "image" || curMediaPage == "blog" || curMediaPage == "coupon" || curMediaPage == "profile"  || curMediaPage == "store" || curMediaPage == "deal"  ){
			//	console.log(document.getElementById("MediaPageTitle").innerHTML,$.cookie("NYKACatName"))
			sq = getUrlVars()["sq"];
			
			//if ($.cookie("NYKACatID")!="" && sq=="")		{								
			//		document.getElementById("MediaPageTitle").innerHTML=$.cookie("NYKACatName");
			//		document.getElementById("filterLable").innerHTML=	$.cookie("NYKACatName");
			//	}
				
			}
}

function ClassifiedChangeCategory(catValue,caturl,catdisplay,objthis){
	if (document.getElementById("LOCALLIST")){	
		
		ChangeCommonMediaTitle(catValue,catdisplay,'1')
		ClearSelectedCategory(objthis)
		
		$(objthis).css({"color":"#fff", "background-color":"#00acee"});
			MediaFormSubmit(1);
		//  document.getElementById("Loadinh1").style.display = "none";
		//  document.getElementById("Ajaxh1").style.display = "block";
		
		//location.href="/ads/"+caturl+"/"
	}else{
		location.href="/ads/"+caturl+"/"
	}
			
			
	
 }

function SetNetworkBoard(){
	
	if (curMediaPage=="profile"){
		var peoplebdurl= $('#iconBoardURL').attr("href");
		if (document.getElementById("category")){
			catvalue=document.getElementById("category").value
			
			if (catvalue=="" ||catvalue=="all" || catvalue=="featured"|| catvalue=="mostactive"|| catvalue=="popular"|| catvalue=="premium"|| catvalue=="certified"|| catvalue=="power"|| catvalue=="new"){
				peoplebdurl="/business-networking/network"+peoplebdurl
			}else{
				peoplebdurl="/"+ document.getElementById("category").value+"/network"+ peoplebdurl
			}
		}else{
			peoplebdurl="/business-networking/network"+peoplebdurl
		}
		
		$('#NetworkBoardURL').attr("href", peoplebdurl);
		$('#networkIconBoard').attr("href", peoplebdurl);
		 
	}else if (curMediaPage=="network" || curMediaPage=="board"){
		var scope = angular.element($("#NgStateApp")).scope();
		
			
		var peoplebdurl= $('#iconBoardURL').attr("href");
		var sbBusinessURL=peoplebdurl
		if (scope.SelectedCountryID>1)
			peoplebdurl='/int'+peoplebdurl
		// console.log(peoplebdurl)
		if (document.getElementById("BoardCategory")){
			catvalue=document.getElementById("BoardCategory").value
			
			if (catvalue=="" ||catvalue=="all" || catvalue=="featured"|| catvalue=="mostactive"|| catvalue=="popular"|| catvalue=="premium"|| catvalue=="certified"|| catvalue=="power"|| catvalue=="new"){
				peoplebdurl="/business-networking/board/members"+peoplebdurl
				
			}else{
				peoplebdurl="/"+ catvalue+"/board/members"+ peoplebdurl
			}
		}else{
			peoplebdurl="/business-networking/board/members"+peoplebdurl
		}
		sbBusinessURL="/all/board/members"+sbBusinessURL
		 $('#NetworkSBBusiness').attr("href", peoplebdurl);
		 $('#SBBusiness').attr("href", sbBusinessURL);
		 
		 $('#networkIconBoard').attr("href", peoplebdurl.replace("/board/members","/network").replace("/int",""));
	}else if (curMediaPage=="store" ){
		var scope = angular.element($("#NgStateApp")).scope();
		var peoplebdurl= $('#iconBoardURL').attr("href");
		if (scope.SelectedCountryID>1)
			peoplebdurl='/int'+peoplebdurl
		if (document.getElementById("category")){
			catvalue=document.getElementById("category").value
			if (catvalue=="")
					catvalue="all"
				peoplebdurl="/"+ document.getElementById("category").value+"/media/products"+ peoplebdurl
		
		}else{
			peoplebdurl="/all/media/products"+ peoplebdurl
		}
		
		$('#ProudctPageURL').attr("href", peoplebdurl);
	
	}else if (curMediaPage=="product" ){
		var scope = angular.element($("#NgStateApp")).scope();
		var peoplebdurl= $('#iconBoardURL').attr("href");
		if (scope.SelectedCountryID>1)
			peoplebdurl='/int'+peoplebdurl
		if (document.getElementById("category")){
			catvalue=document.getElementById("category").value
			if (catvalue=="")
					catvalue="all"
				peoplebdurl="/"+ document.getElementById("category").value+"/media/stores"+ peoplebdurl
		
		}else{
			peoplebdurl="/all/media/stores"+ peoplebdurl
		}
		
		$('#StorePageURL').attr("href", peoplebdurl);
	
	}
	 
 }
 
function gotoSBBusiness(catvalue){
	 var scope = angular.element($("#NgStateApp")).scope();
		var peoplebdurl= $('#iconBoardURL').attr("href");
		
		if (scope.SelectedCountryID>1)
			peoplebdurl='/int'+peoplebdurl
		 
		if (catvalue!='')
			peoplebdurl="/"+ catvalue+"/network/members"+ peoplebdurl
		else
			peoplebdurl="/all/network/members"+ peoplebdurl	
		
		 $('#SBHiddenLink').attr("href", peoplebdurl);
		$('#SBHiddenLink').click();
 }
 
function gotoPeople(){
	 var scope = angular.element($("#NgStateApp")).scope();
		
			
		var peoplebdurl= $('#iconBoardURL').attr("href");
		if (scope.SelectedCountryID>1)
			peoplebdurl='/int'+peoplebdurl
		
		peoplebdurl="/people"+ peoplebdurl	
		
		
		 $('#SBHiddenLink').attr("href", peoplebdurl);
		$('#SBHiddenLink').click();
		
 }
 
function ChangeBusinessCategory(catValue,catdisplay,objthis){
	HideLeftMenu()
	if (document.frmMedia) {
		if (document.frmMedia.search)
			document.frmMedia.search.value=""

		if (document.frmMedia.category)
			document.frmMedia.category.value=""
	}

	document.frmMedia.NYKACatID.value=catValue;
	MediaBusCategoryID=catValue
	MediaBusCategoryName=catdisplay
	
	
	if (document.getElementById("SelectedCategoryName"))
		document.getElementById("SelectedCategoryName").innerHTML=catdisplay;
	document.getElementById("filterLable").innerHTML=catdisplay
	
	
	
	if (catValue=="all" || catValue==""){
		document.getElementById("MediaPageTitle").innerHTML=catdisplay //+ ' '+ document.getElementById("MediaTypeTitle").innerHTML
	}else{
		document.getElementById("MediaPageTitle").innerHTML=catdisplay //+ ' '+ document.getElementById("MediaThirdbar").innerHTML	
	}
	
	ClearSelectedCategory(objthis)
	$(objthis).css({"color":"#fff", "background-color":"#00acee"});
	MediaFormSubmit(1);
	SetLeftPanelwithSearcbbox()

}

function ChangeMiddlecolumn(catname,ptype){
	if (OnlyForBusiness=""){
		if (curMediaPage=="image" ||curMediaPage=="video"||curMediaPage=="blog"||curMediaPage=="product"||curMediaPage=="store"){
			var sendInfo2 = {
				catname:catname,
				curMediaPage:curMediaPage,
				ptype:ptype
			}
			$.ajax({
				type: "get",
				url: "/ajax/GetAllMiddlecolumn.asp",
				data: sendInfo2,
				dataType: "html",
				async: false,
				success: function (data) 
				{
					$('#middleColumn').html(data)
						ShopCenterCategory5.init()
					
				}
			});
		}	
	}
}

function ChangeBusinessCategoryNew(caturl,catdisplay,objthis,catid){
	HideLeftMenu()
	if (document.frmMedia) {
		if (document.frmMedia.search)
			document.frmMedia.search.value=""

		if (document.frmMedia.NYKACatID)
			document.frmMedia.NYKACatID.value=""
	}
	document.frmMedia.NYKACatID.value=catid;
	MediaBusCategoryID=catid
	MediaBusCategoryName=catdisplay
	ChangeCommonMediaTitle(caturl,catdisplay,'1')
	ChangeMiddlecolumn(catdisplay,'B')
	changeMediaTitleFromCookie()
	ClearSelectedCategory(objthis)
	SetNetworkBoard()
	$(objthis).css({"color":"#fff", "background-color":"#00acee"});
	MediaFormSubmit(1);
	SetLeftPanelwithSearcbbox()
}

function ChangeCategory(caturl,catdisplay,objthis,catid){
	HideLeftMenu()
	if (document.frmMedia) {
		if (document.frmMedia.search)
			document.frmMedia.search.value=""
		
		if (OnlyForBusiness=="1"){
			MediaBusCategoryID=catid
			MediaBusCategoryName=catdisplay	
			if (document.frmMedia.NYKACatID)
				document.frmMedia.NYKACatID.value=catid	
		}else{
			if (document.frmMedia.NYKACatID)
				document.frmMedia.NYKACatID.value=""
		}
	}
	
	ChangeCommonMediaTitle(caturl,catdisplay,'1')
	ChangeMiddlecolumn(catdisplay,'M')
	changeMediaTitleFromCookie()
	ClearSelectedCategory(objthis)
	SetNetworkBoard()
	$(objthis).css({"color":"#fff", "background-color":"#00acee"});
	MediaFormSubmit(1);
	SetLeftPanelwithSearcbbox()
}

function ChangeCategoryNew(caturl,catdisplay,objthis,catid){
	HideLeftMenu()
	if (document.frmMedia) {
		if (document.frmMedia.search)
			document.frmMedia.search.value=""

		if (document.frmMedia.NYKACatID)
			document.frmMedia.NYKACatID.value=""
	}
	//document.frmMedia.NYKACatID.value=catid;
	ChangeCommonMediaTitleNew(caturl,catdisplay,'1')
	ChangeMiddlecolumn(catdisplay,'M')
	changeMediaTitleFromCookie()
	ClearSelectedCategory(objthis)
	SetNetworkBoard()
	$(objthis).css({"color":"#fff", "background-color":"#00acee"});
	MediaFormSubmit(1);
	SetLeftPanelwithSearcbbox()
	
}

function ClearSelectedCategory(objthis){
	$('#businesscategory').children('div').css({"color":"black", "background-color":"transparent"});
	$('#videocategory').children('div').css({"color":"black", "background-color":"transparent"});
	$('.PRODUCTCATLEFTMENU').css({"color":"black", "background-color":"transparent"});
	$('.subcatli').css({"color":"black", "background-color":"transparent"});
	$('#ProductControlPanel').find('.LeftSelected').css({"color":"black", "background-color":"transparent"});
	$('#ProductControlPanel').find('.LeftSelected').removeClass("LeftSelected")
	$('#ControlPanel1').find('.LeftSelected').css({"color":"black", "background-color":"transparent"});
	$('#ControlPanel1').find('.LeftSelected').removeClass("LeftSelected")
	$('#ControlPanel2').find('.LeftSelected').css({"color":"black", "background-color":"transparent"});
	$('#ControlPanel2').find('.LeftSelected').removeClass("LeftSelected")
	/*$(objthis).closest('#ProductControlPanel').find('.LeftSelected').css({"color":"black", "background-color":"transparent"});
	$(objthis).closest('#ProductControlPanel').find('.LeftSelected').removeClass("LeftSelected")
	$(objthis).closest('#ControlPanel1').find('.LeftSelected').css({"color":"black", "background-color":"transparent"});
	$(objthis).closest('#ControlPanel1').find('.LeftSelected').removeClass("LeftSelected")
	 */
	$(objthis).addClass("LeftSelected") 

	
}			
		
function doSearch(pst){
	if (OnlyForBusiness==""){
		if (document.frmMedia.NYKACatID)
			document.frmMedia.NYKACatID.value=""
	}
	//debugger

		ChangeCommonMediaTitle(document.frmMedia.category.value,document.frmMedia.Categoryname.value,pst)
		//debugger
	changeMediaTitleFromCookie()
		//debugger
//	$('#Breadcrum a:nth-last-child(1)').click();
	if (document.getElementById("Breadcrum"))
		$('#Breadcrum').find('.locationbreadcrum:nth-last-child(3)').last().click();
	//if (document.getElementById("BreadcrumBoard"))
	//	$('#BreadcrumBoard').find('.locationbreadcrum').last().click();
	
	MediaFormSubmit(1);
//	return true
}	

function refreshList(){
	if (document.frmMedia.PG)
		MediaFormSubmit(document.frmMedia.PG.value);
}

function ChangePersonalPref(objthis){
	
		document.frmMedia.PersonalPref.value=$(objthis).attr("data-val")
		PersonalPref=$(objthis).attr("data-val")
		 $('#PersonalPrefName').html($(objthis).attr("data-name"))
		MediaFormSubmit(1);
	
}

function ChangePersonalPrefDisplay(objthis){
	
		document.frmMedia.PersonalPref.value=$(objthis).attr("data-val")
		PersonalPref=$(objthis).attr("data-val")
		 $('#PersonalPrefName').html($(objthis).attr("data-name"))
		 ChangeCommonMediaTitleNew("all","All","1");
	//	MediaFormSubmit(1);
	
}


function getBoardUrlNew(curMediaPage){
var MediaUrl;
	var tmpcaturl="all"
	
	if (document.frmMedia) {
			if (document.frmMedia.category){
				if (document.frmMedia.category.value!=''){
					tmpcaturl=document.frmMedia.category.value
				}
			}
		}
	if (curMediaPage=="video"){
		MediaUrl="/videos/"+tmpcaturl+"/"
	}else if(curMediaPage=="product"){
		MediaUrl="/products/"+tmpcaturl+"/"	
	}else if(curMediaPage=="blog"){
		MediaUrl="/blogs/"+tmpcaturl+"/"
	}else if(curMediaPage=="image"){
		MediaUrl="/images/"+tmpcaturl+"/"
	}else if(curMediaPage=="channel"){
		MediaUrl="/channels/"+tmpcaturl+"/"
	}else if(curMediaPage=="audio"){
		MediaUrl="/audios/"+tmpcaturl+"/"
	}else if(curMediaPage=="coupon"){
		MediaUrl="/coupons/"+tmpcaturl+"/"
	}else if(curMediaPage=="deal"){
		MediaUrl="/deals/"
	}else if(curMediaPage=="store"){
		MediaUrl="/stores/"+tmpcaturl+"/"
	}else if(curMediaPage=="profile"){
		MediaUrl="/members/"
		if (document.frmMedia) {
			if (document.frmMedia.category){
				if (document.frmMedia.category.value!=''){
					MediaUrl="/"+document.frmMedia.category.value+"/network/members/"
				}
			}
		}
		
		
	}else if(curMediaPage=="peoples"){
		MediaUrl="/people/"
	}else if(curMediaPage=="network"){
		MediaUrl="/business-networking/network/world/"
	}else if(curMediaPage=="group"){
		MediaUrl="/groups/all/"
	}else if(curMediaPage=="premium"){
		MediaUrl="/premiumpackages/"
	}else if(curMediaPage=="locations"){
		MediaUrl="/locations/"	
		
	}else if(curMediaPage=="classifieds"){
		MediaUrl="/ads/all/"
	
	}else if(curMediaPage=="forums"){
		MediaUrl="/forums/"
	}
	else if(curMediaPage=="channels"){
		MediaUrl="/channels/"
	}
	//debugger
	if (document.getElementById("txtMainSerch").value!=""){
		MediaUrl+='?sq='+document.getElementById("txtMainSerch").value
	}
	return MediaUrl;
}

function ChangeLayout(layouttype,objthis){
	if (layouttype=="4"){
		window.location.href = getMediaUrlNew(curMediaPage);
	}else if (layouttype=="b"){
		var scope = angular.element($("#NgStateApp")).scope();
		brdurl=scope.generateRedirectURL()
		brdurl=brdurl+'?MediaType='+curMediaPage
		if (document.getElementById("category").value!="" && document.getElementById("category").value!="all"){
		//	brdurl+='&MediaCat='+document.getElementById("category").value
		}
		window.location.href = brdurl;
		
	}else{
		document.frmMedia.Layout.value=layouttype
		Layout=layouttype
		if (isMobile=="True"){
			//if (layouttype=="g"){
			//	$('#LayoutTypeName').html("4 Box")
				//$('#LayoutTypeName1').html($('#LayoutTypeName').html())
			//}else{
				$('#LayoutTypeName').html($(objthis).attr("data-name"))
				//$('#LayoutTypeName1').html($('#LayoutTypeName').html())
			//}
		}else{
			$('#LayoutTypeName').html($(objthis).attr("data-name"))
			//$('#LayoutTypeName1').html($('#LayoutTypeName').html())
		}
		MediaFormSubmit(1);
	}
}

function ChangeBoardLayout(layouttype,objthis){
	
	if (layouttype=="4"){
		var scope = angular.element($("#NgStateApp")).scope();
		brdurl="/board"+scope.generateRedirectURL()
		window.location.href = brdurl;
	}else if (layouttype=="5"){
		View4box=""
		var scope = angular.element($("#NgStateApp")).scope();
		brdurl=scope.generateRedirectURL()
		window.location.href = brdurl;
	}else{
		
		BoardLayout=layouttype
		Layout=layouttype
		if (isMobile=="True"){
			//if (layouttype=="g"){
			//	$('#BoardLayoutTypeName').html("4 Box")
				
			//}else{
				 $('#BoardLayoutTypeName').html($(objthis).attr("data-name"))
			//}
		}else{
		 $('#BoardLayoutTypeName').html($(objthis).attr("data-name"))
		}
			if (layouttype=="g"){
				$('#board').css("height","2625px");
			}else{
				$('#board').css("height","3625px");
			}
		$('#Breadcrum').find('.locationbreadcrum:nth-last-child(3)').last().click();
	}
}

function doPaging(str){
	MediaFormSubmit(str);
}

function selectBoardThirdBarMediaType(meditype,objThis){
	
	if (meditype=="map"){
		var currSelectedMediatype = $(objThis).attr("data-MediaType");
		$('#MediaType').find('li> span[data-MediaType="'+currSelectedMediatype+'"]').first().click()
		$('#topMediaType').find('li> span[data-MediaType="'+currSelectedMediatype+'"]').first().click()
	}else{
		window.location.href = getMediaUrl(meditype);
	}
	
}

function selectautoLoadBoardThirdBarMediaType(meditype){
	
	
		$('#boardMediatype').find('li> span[data-media="'+meditype+'"]').first().click()
	
	
}

function selectThirdBarMediaType(meditype,objThis){
	if (document.getElementById("search"))	
		document.getElementById("search").value="";
	//if (document.getElementById("BreadcrumBoard"))	
	//	document.getElementById("BreadcrumBoard").innerHTML="";
	//if (meditype=="board")
		
		if (document.getElementById("dashboardIcon-profile"))	
			document.getElementById("dashboardIcon-profile").src=document.getElementById("dashboardIcon-profile").src.replace("Blue","Grey");
		if (document.getElementById("dashboardIcon-product"))	
			document.getElementById("dashboardIcon-product").src=document.getElementById("dashboardIcon-product").src.replace("Blue","Grey");
		if (document.getElementById("dashboardIcon-board"))	
			document.getElementById("dashboardIcon-board").src=document.getElementById("dashboardIcon-board").src.replace("Blue","Grey");
		if (document.getElementById("dashboardIcon-video"))	
			document.getElementById("dashboardIcon-video").src=document.getElementById("dashboardIcon-video").src.replace("Blue","Grey");
		if (document.getElementById("dashboardIcon-image"))	
			document.getElementById("dashboardIcon-image").src=document.getElementById("dashboardIcon-image").src.replace("Blue","Grey");
		if (document.getElementById("dashboardIcon-more"))	
			document.getElementById("dashboardIcon-more").src=document.getElementById("dashboardIcon-more").src.replace("Blue","Grey");
		
	if (meditype=="profile" || meditype=="product" || meditype=="board" || meditype=="image" || meditype=="video"){
		
		
		if (document.getElementById("dashboardIcon-"+meditype))	
			document.getElementById("dashboardIcon-"+meditype).src=document.getElementById("dashboardIcon-"+meditype).src.replace("Grey","Blue");
	}else{
		if (document.getElementById("dashboardIcon-more"))	
			document.getElementById("dashboardIcon-more").src=document.getElementById("dashboardIcon-more").src.replace("Grey","Blue");
	}
	if(meditype=="board" ){
		if (document.getElementById("txtMainSerch") && document.getElementById("searchKeyword"))
			document.getElementById("searchKeyword").value=document.getElementById("txtMainSerch").value
	}
//	MediaCategoryID=""
//	MediaCategoryName=""
	MediaBusCategoryID=""
	MediaBusCategoryName=""
	
	var currSelectedMediatype = $(objThis).attr("data-MediaType");
	if (meditype=="peoples")
	{
		if (document.getElementById('WhatsOnBoardNetwork'))
			document.getElementById('WhatsOnBoardNetwork').innerHTML = "People"; 
						
	}
	if (typeof updateIconAndText == 'function') { 
		updateIconAndText(meditype);
	}
	if (meditype=="profile"){
		OnlyForBusiness="1"
	}else{
		OnlyForBusiness=""
		URLRewriteOnThisPage="true"
	}
		
	//if (meditype=="board"){
	//	$('#RefreshLink').click();
	//}else{
		
		$('#MediaType').find('li> span[data-MediaType="'+currSelectedMediatype+'"]').first().click()
		$('#topMediaType').find('li> span[data-MediaType="'+currSelectedMediatype+'"]').first().click()
	//}
	

}

function selectThirdBarMediaTypeFromHeader(media,Mediatype){
	if (document.getElementById("search"))	
		document.getElementById("search").value="";
	if (document.getElementById("dashboardIcon-profile"))	
		document.getElementById("dashboardIcon-profile").src=document.getElementById("dashboardIcon-profile").src.replace("Blue","Grey");
	if (document.getElementById("dashboardIcon-product"))	
		document.getElementById("dashboardIcon-product").src=document.getElementById("dashboardIcon-product").src.replace("Blue","Grey");
	if (document.getElementById("dashboardIcon-board"))	
		document.getElementById("dashboardIcon-board").src=document.getElementById("dashboardIcon-board").src.replace("Blue","Grey");
	if (document.getElementById("dashboardIcon-video"))	
		document.getElementById("dashboardIcon-video").src=document.getElementById("dashboardIcon-video").src.replace("Blue","Grey");
	if (document.getElementById("dashboardIcon-image"))	
		document.getElementById("dashboardIcon-image").src=document.getElementById("dashboardIcon-image").src.replace("Blue","Grey");
	if (document.getElementById("dashboardIcon-more"))	
		document.getElementById("dashboardIcon-more").src=document.getElementById("dashboardIcon-more").src.replace("Blue","Grey");
		
	if (media=="profile" || media=="product" || media=="board" || media=="image" || media=="video"){
		
		
		if (document.getElementById("dashboardIcon-"+media))	
			document.getElementById("dashboardIcon-"+media).src=document.getElementById("dashboardIcon-"+media).src.replace("Grey","Blue");
	}else{
		if (document.getElementById("dashboardIcon-more"))	
			document.getElementById("dashboardIcon-more").src=document.getElementById("dashboardIcon-more").src.replace("Grey","Blue");
	}
	//MediaCategoryID=""
	//MediaCategoryName=""
	//MediaBusCategoryID=""
	//MediaBusCategoryName=""
	var currSelectedMediatype = Mediatype
	if (media=="peoples")
	{
		if (document.getElementById('WhatsOnBoardNetwork'))
			document.getElementById('WhatsOnBoardNetwork').innerHTML = "People"; 
						
	}
	if (typeof updateIconAndText == 'function') { 
		updateIconAndText(media);
	}
	
	
	
	//if (meditype=="board"){
	//	$('#RefreshLink').click();
	//}else{
		
		$('#MediaType').find('li> span[data-MediaType="'+currSelectedMediatype+'"]').first().click()
		//$('#topMediaType').find('li> span[data-MediaType="'+currSelectedMediatype+'"]').first().click()
	//}
	

}

function ClickAll(){

	if (curMediaPage=="board")
	{
		$('#Breadcrum').find('.locationbreadcrum:nth-last-child(3)').last().click();
	//	$('#WhatsOnBoardNetwork').html('Select Category');
	}else{
		
		$('#BoardIconinBar').click(); 
	}
}
var scrlheight=75
if (isMobile=="True")	scrlheight=30								
function scrollEvent(e){
	hideddrivetip()
	/*if (isMobile=="True"){
		if($(window).scrollTop() + $(window).height() > $("#LOCALLIST").height()-1000 )
		{
			var id = $("#BOTTOMPAGING .NextPageLink").last().attr('id')
			$(window).off('scroll');	
			$('#' + id).click();
		}

	}else{*/
		let div = $('#LOCALLIST').get(0);
		//console.log((div.scrollTop + div.clientHeight)+1000, (div.scrollHeight*75/100) ,div.scrollHeight)
		if((div.scrollTop + div.clientHeight) >= (div.scrollHeight*scrlheight/100)) {
		  var id = $("#BOTTOMPAGING .NextPageLink").first().attr('id')
		  $('#LOCALLIST').off('scroll');	
		  $('#' + id).click();
		}
	//}
}

function bindscrollEvent(){	
	/*if (isMobile=="True"){
		$(window).on('scroll', scrollEvent);
	}else{
	*/	
		$('#LOCALLIST').on('scroll', scrollEvent);
	//}	
							

}
	
function dataload(pg,data){	
	console.log(pg)
	if (pg==1){
		$('#LOCALLIST').html(data);
	}else{
		
		$('#Laoding'+ pg).hide();
		$('#LOCALLIST').append(data);
		
	}					
	$('#TOPPAGGING').hide() ;
	
}

function loadScrollViewData(){
	var id = $("#BOTTOMPAGING .NextPageLink").first().attr('id')
	//console.log(id)
	$('#LOCALLIST').off('scroll');	
	$('#' + id).click();
	
}
					
function boardscrollEvent(e){
hideddrivetip()

/*if (isMobile=="True"){
	if($(window).scrollTop() + $(window).height() > $("#fmeFriendStatus").height()-1000 )
	{
		var id = $("#fmeFriendStatus .NextBoard").last().attr('id')
		$(window).off('scroll');	
		$('#' + id).click();
	}

}else{
	*/
	let div = $('#fmeFriendStatus').get(0);
	if((div.scrollTop + div.clientHeight) >= (div.scrollHeight*scrlheight/100)) {
      var id = $("#fmeFriendStatus .NextBoard").last().attr('id')
	
	  $('#fmeFriendStatus').off('scroll');	
	  $('#' + id).click();
    }
//}

}

function bindBoardscrollEvent(){	
	/*if (isMobile=="True"){
		$(window).on('scroll', boardscrollEvent);
	}else{
	*/	
		$('#fmeFriendStatus').on('scroll', boardscrollEvent);
	//}						

}

function setForProductTextNew(element){

	var value = $(element).text();
	var id =  $(element).attr('data-value');
	const myArr = id.split("|");
	catid=myArr[0];
	caturl=myArr[1];
	SetLeftProductCategory(caturl);
	$("#txtProductCatSearch").val('');
	$("#ProductCatSearchResult").empty();
}