﻿function MBS_FullFilter() {
    var lastItem = $ektron("div.tablisting_accom_cnt_last");
    var midItems = $ektron("div.tablisting_accom_cnt");
    var midLines = $ektron("div.accomline");
    var midCount = midLines.length - 1;
    var midItemPostRight;
    var lastItemPostRight = $ektron(lastItem[0]).children("div.tablisting_accom_content");
    var midItemTextList;
    var lastItemTextList = $ektron(lastItemPostRight[0]).children("p.text_list");
    var midItemServiceSpan;
    var lastItemServiceSpan = $ektron(lastItemTextList[0]).children("span.service");
    var lastItemChefSpan = $ektron(lastItemTextList[0]).children("span.chef");
    var lastItemPriceSpan = $ektron(lastItemTextList[0]).children("span.pricing");
    var midItemServiceValues;
    var lastItemServiceValues = lastItemServiceSpan[0].innerHTML.split(",");
    var bfastcheck = document.getElementById("Breakfast").checked;
    var lunchcheck = document.getElementById("Lunch").checked;
    var dinnercheck = document.getElementById("Dinner").checked;
    var priceonecheck = document.getElementById("valonecheck").checked;
    var pricetwocheck = document.getElementById("valuetwocheck").checked;
    var pricethreecheck = document.getElementById("valuethreecheck").checked;
    var celebcheck = document.getElementById("Celebrity").checked;
    var showedsomething = false;
    $ektron(lastItem[0]).css("display", "none");
    for (i = 0; i < midItems.length; i++) {
        //Assume hiding it first. Check later if we need to show it.
        $ektron(midItems[i]).css('display', 'none');
        $ektron(midLines[i]).css('display', 'none');

        midItemPostRight = $ektron(midItems[i]).children("div.tablisting_accom_content");
        for (j = 0; j < midItemPostRight.length; j++) {
            midItemTextList = $ektron(midItemPostRight[j]).children("p.text_list");
            if (midItemTextList.length == 0) {
                //We have no info for this one, so just show it and move on
                $ektron(midItems[i]).css('display', 'block');
                $ektron(midLines[i]).css('display', 'block');
            } else {
                for (k = 0; k < midItemTextList.length; k++) {
                    midItemServiceSpan = $ektron(midItemTextList[k]).children("span.service");
                    midItemPriceSpan = $ektron(midItemTextList[k]).children("span.pricing");
                    midItemChefSpan = $ektron(midItemTextList[k]).children("span.chef");
                    var passChef = false;
                    var passPrice = false;
                    var passService = false;
                    if (celebcheck) {
                        if (midItemChefSpan.length == 1) {
                            passChef = true;
                        } else {
                            passChef = false;
                        }
                    } else {
                        passChef = true;
                    }
                    if (passChef) {
                        if (priceonecheck) {
                            if (midItemPriceSpan[0].innerHTML == '$') {
                                passPrice = true;
                            }
                        }
                        if (pricetwocheck) {
                            if (midItemPriceSpan[0].innerHTML == '$$') {
                                passPrice = true;
                            }
                        }
                        if (pricethreecheck) {
                            if (midItemPriceSpan[0].innerHTML == '$$$') {
                                passPrice = true;
                            }
                        }
                        midItemServiceValues = midItemServiceSpan[0].innerHTML.split(",");
                        if (midItemServiceValues.length == 1) {
                            if (document.getElementById(midItemServiceValues[0]).checked) {
                                passService = true;
                            }
                        } else {
                            //Just check each value in the array
                            //If any one of them is checked, show it
                            for (a = 0; a < midItemServiceValues.length; a++) {
                                var thisvalue = tablisting_filter_trim(midItemServiceValues[a]);
                                if (document.getElementById(thisvalue).checked) {
                                    passService = true;
                                }
                            }
                        }
                    }
                    if (passChef && passPrice && passService) {
                        $ektron(midItems[i]).css('display', 'block');
                        $ektron(midLines[i]).css('display', 'block');
                        showedsomething = true;
                    }
                }
            }
        }
    }
    var LastpassChef = false;
    var LastpassPrice = false;
    var LastpassService = false;
    if (lastItemServiceValues.length == 1) {
        if (document.getElementById(lastItemServiceValues[0]).checked) {
            LastpassService = true;
        }
    } else {
        //Just check each value in the array
        //If any one of them is checked, show it
        for (a = 0; a < lastItemServiceValues.length; a++) {
            var thisvalue = tablisting_filter_trim(lastItemServiceValues[a]);
            if (document.getElementById(thisvalue).checked) {
                LastpassService = true;
            }
        }
    }
    if (celebcheck) {
        if (lastItemChefSpan.lenth == 1) {
            LastpassChef = true;
        } else {
            LastpassChef = false;
        }
    } else {
        LastpassChef = true;
    }
    if (priceonecheck) {
        if (lastItemPriceSpan[0].innerHTML == '$') {
            LastpassPrice = true;
        }
    }
    if (pricetwocheck) {
        if (lastItemPriceSpan[0].innerHTML == '$$') {
            LastpassPrice = true;
        }
    }
    if (pricethreecheck) {
        if (lastItemPriceSpan[0].innerHTML == '$$$') {
            LastpassPrice = true;
        }
    }
    if (LastpassChef && LastpassPrice && LastpassService) {
        $ektron(lastItem[0]).css("display", "block");
        showedsomething = true;
    }
    if (showedsomething) {
        document.getElementById("nodata").style.display = "none";
    } else {
        document.getElementById("nodata").style.display = "block";
    }

}

function tablisting_filter_ToggleServiceCheck(value, cboxobj) {
    var firstItem = $ektron("div.listin_post_con_3");
    var midItems = $ektron("div.listin_post_con_4");
    var lastItem = $ektron("div.listin_post_con_2");
    var firstItemPostRight = $ektron(firstItem[0]).children("div.listin_post_right_2");
    var midItemPostRight;
    var lastItemPostRight = $ektron(lastItem[0]).children("div.listin_post_right_2");
    var firstItemTextList = $ektron(firstItemPostRight[0]).children("p.text_list");
    var midItemTextList;
    var lastItemTextList = $ektron(lastItemPostRight[0]).children("p.text_list");
    var firstItemServiceSpan = $ektron(firstItemTextList[0]).children("span.service");
    var midItemServiceSpan;
    var lastItemServiceSpan = $ektron(lastItemTextList[0]).children("span.service");
    var firstItemServiceValues = firstItemServiceSpan[0].innerHTML.split(",");
    var midItemServiceValues;
    var lastItemServiceValues = lastItemServiceSpan[0].innerHTML.split(",");
    if (cboxobj.checked) {
        document.getElementById("nodata").style.display = "none";
        //Show items
        if (firstItemServiceValues.length == 1) {
            if (firstItemServiceValues[0] == value) {
                $ektron(firstItem[0]).css('display', 'block');
            }
        } else {
            var showThis = false;
            //Just check each value in the array
            //If any one of them is checked, show it
            for (a = 0; a < firstItemServiceValues.length; a++) {
                var thisvalue = tablisting_filter_trim(firstItemServiceValues[a]);
                if (document.getElementById(thisvalue) != null) {
                    if (document.getElementById(thisvalue).checked) {
                        showThis = true;
                    }
                }
            }
            if (showThis) {
                $ektron(firstItem[0]).css('display', 'block');
            }
        }
        for (i = 0; i < midItems.length; i++) {
            midItemPostRight = $ektron(midItems[i]).children("div.listin_post_right_2");
            for (j = 0; j < midItemPostRight.length; j++) {
                midItemTextList = $ektron(midItemPostRight[j]).children("p.text_list");
                for (k = 0; k < midItemTextList.length; k++) {
                    midItemServiceSpan = $ektron(midItemTextList[k]).children("span.service");
                    if (midItemServiceSpan[0] != undefined) {
                        midItemServiceValues = midItemServiceSpan[0].innerHTML.split(",");
                        if (midItemServiceValues.length == 1) {
                            if (midItemServiceValues[0] == value) {
                                $ektron(midItems[i]).css('display', 'block');
                            }
                        } else {
                            var showThis = false;
                            //Just check each value in the array
                            //If any one of them is checked, show it
                            for (a = 0; a < midItemServiceValues.length; a++) {
                                var thisvalue = tablisting_filter_trim(midItemServiceValues[a]);
                                if (document.getElementById(thisvalue) != null) {
                                    if (document.getElementById(thisvalue).checked) {
                                        showThis = true;
                                    }
                                }
                            }
                            if (showThis) {
                                $ektron(midItems[i]).css('display', 'block');
                            }
                        }
                    }                    
                }
            }
        }
        if (lastItemServiceValues.length == 1) {
            if (lastItemServiceValues[0] == value) {
                $ektron(lastItem[0]).css('display', 'block');
            }
        } else {
            var showThis = false;
            //Just check each value in the array
            //If any one of them is checked, show it
            for (a = 0; a < lastItemServiceValues.length; a++) {
                var thisvalue = tablisting_filter_trim(lastItemServiceValues[a]);
                if (document.getElementById(thisvalue) != null) {
                    if (document.getElementById(thisvalue).checked) {
                        showThis = true;
                    }
                }
            }
            if (showThis) {
                $ektron(lastItem[0]).css('display', 'block');
            }
        }
    } else {
        var showedsomething = false;
        //Hide items
        if (firstItemServiceValues.length == 1) {
            if (firstItemServiceValues[0] == value) {
                $ektron(firstItem[0]).css('display', 'none');
            }
        } else {
            var showThis = false;
            //Just check each value in the array
            //If any one of them is checked, show it
            for (a = 0; a < firstItemServiceValues.length; a++) {
                var thisvalue = tablisting_filter_trim(firstItemServiceValues[a]);
                if (document.getElementById(thisvalue) != null) {
                    if (document.getElementById(thisvalue).checked) {
                        showThis = true;
                        showedsomething = true;
                    }
                }
            }
            if (!showThis) {
                $ektron(firstItem[0]).css('display', 'none');
            }
        }
        for (i = 0; i < midItems.length; i++) {
            midItemPostRight = $ektron(midItems[i]).children("div.listin_post_right_2");
            for (j = 0; j < midItemPostRight.length; j++) {
                midItemTextList = $ektron(midItemPostRight[j]).children("p.text_list");
                for (k = 0; k < midItemTextList.length; k++) {
                    midItemServiceSpan = $ektron(midItemTextList[k]).children("span.service");
                    if (midItemServiceSpan[0] != undefined) {
                        midItemServiceValues = midItemServiceSpan[0].innerHTML.split(",");
                        if (midItemServiceValues.length == 1) {
                            if (midItemServiceValues[0] == value) {
                                $ektron(midItems[i]).css('display', 'none');
                            }
                        } else {
                            var showThis = false;
                            //Just check each value in the array
                            //If any one of them is checked, show it
                            for (a = 0; a < midItemServiceValues.length; a++) {
                                var thisvalue = tablisting_filter_trim(midItemServiceValues[a]);
                                if (document.getElementById(thisvalue) != null) {
                                    if (document.getElementById(thisvalue).checked) {
                                        showThis = true;
                                        showedsomething = true;
                                    }
                                }
                            }
                            if (!showThis) {
                                $ektron(midItems[i]).css('display', 'none');
                            }
                        }
                    }                    
                }
            }
        }
        if (lastItemServiceValues.length == 1) {
            if (lastItemServiceValues[0] == value) {
                $ektron(lastItem[0]).css('display', 'none');
            }
        } else {
            var showThis = false;
            //Just check each value in the array
            //If any one of them is checked, show it
            for (a = 0; a < lastItemServiceValues.length; a++) {
                var thisvalue = tablisting_filter_trim(lastItemServiceValues[a]);
                if (document.getElementById(thisvalue) != null) {
                    if (document.getElementById(thisvalue).checked) {
                        showThis = true;
                        showedsomething = true;
                    }
                }
            }
            if (!showThis) {
                $ektron(lastItem[0]).css('display', 'none');
            }
        }
        if (!showedsomething) {
            document.getElementById("nodata").style.display = "block";
        }
    }
}

function MBS_tablisting_filter_ToggleServiceCheck(value, cboxobj) {
    var lastItem = $ektron("div.tablisting_accom_cnt_last");
    var midItems = $ektron("div.tablisting_accom_cnt");
    var midLines = $ektron("div.accomline");
    var midCount = midLines.length - 1;
    var midItemPostRight;
    var lastItemPostRight = $ektron(lastItem[0]).children("div.tablisting_accom_content");
    var midItemTextList;
    var lastItemTextList = $ektron(lastItemPostRight[0]).children("p.text_list");
    var midItemServiceSpan;
    var lastItemServiceSpan = $ektron(lastItemTextList[0]).children("span.service");
    var midItemServiceValues;
    var lastItemServiceValues = lastItemServiceSpan[0].innerHTML.split(",");
    if (cboxobj.checked) {
        document.getElementById("nodata").style.display = "none";
        //Show items
        for (i = 0; i < midItems.length; i++) {
            midItemPostRight = $ektron(midItems[i]).children("div.tablisting_accom_content");
            for (j = 0; j < midItemPostRight.length; j++) {
                midItemTextList = $ektron(midItemPostRight[j]).children("p.text_list");
                for (k = 0; k < midItemTextList.length; k++) {
                    midItemServiceSpan = $ektron(midItemTextList[k]).children("span.service");
                    midItemServiceValues = midItemServiceSpan[0].innerHTML.split(",");
                    if (midItemServiceValues.length == 1) {
                        if (midItemServiceValues[0] == value) {
                            $ektron(midItems[i]).css('display', 'block');
                            $ektron(midLines[i]).css('display', 'block');
                        }
                    } else {
                        var showThis = false;
                        //Just check each value in the array
                        //If any one of them is checked, show it
                        for (a = 0; a < midItemServiceValues.length; a++) {
                            var thisvalue = tablisting_filter_trim(midItemServiceValues[a]);
                            if (document.getElementById(thisvalue).checked) {
                                showThis = true;
                            }
                        }
                        if (showThis) {
                            $ektron(midItems[i]).css('display', 'block');
                            $ektron(midLines[i]).css('display', 'block');
                        }
                    }
                }
            }
        }
        if (lastItemServiceValues.length == 1) {
            if (lastItemServiceValues[0] == value) {
                $ektron(lastItem[0]).css('display', 'block');
            }
        } else {
            var showThis = false;
            //Just check each value in the array
            //If any one of them is checked, show it
            for (a = 0; a < lastItemServiceValues.length; a++) {
                var thisvalue = tablisting_filter_trim(lastItemServiceValues[a]);
                if (document.getElementById(thisvalue).checked) {
                    showThis = true;
                }
            }
            if (showThis) {
                $ektron(lastItem[0]).css('display', 'block');
            }
        }
    } else {
        var showedsomething = false;
        //Hide items
        for (i = 0; i < midItems.length; i++) {
            midItemPostRight = $ektron(midItems[i]).children("div.tablisting_accom_content");
            for (j = 0; j < midItemPostRight.length; j++) {
                midItemTextList = $ektron(midItemPostRight[j]).children("p.text_list");
                for (k = 0; k < midItemTextList.length; k++) {
                    midItemServiceSpan = $ektron(midItemTextList[k]).children("span.service");
                    midItemServiceValues = midItemServiceSpan[0].innerHTML.split(",");
                    if (midItemServiceValues.length == 1) {
                        if (midItemServiceValues[0] == value) {
                            $ektron(midItems[i]).css('display', 'none');
                            $ektron(midLines[i]).css('display', 'none');
                        }
                    } else {
                        var showThis = false;
                        //Just check each value in the array
                        //If any one of them is checked, show it
                        for (a = 0; a < midItemServiceValues.length; a++) {
                            var thisvalue = tablisting_filter_trim(midItemServiceValues[a]);
                            if (document.getElementById(thisvalue).checked) {
                                showThis = true;
                                showedsomething = true;
                            }
                        }
                        if (!showThis) {
                            $ektron(midItems[i]).css('display', 'none');
                            $ektron(midLines[i]).css('display', 'none');
                        }
                    }
                }
            }
        }
        if (lastItemServiceValues.length == 1) {
            if (lastItemServiceValues[0] == value) {
                $ektron(lastItem[0]).css('display', 'none');
            }
        } else {
            var showThis = false;
            //Just check each value in the array
            //If any one of them is checked, show it
            for (a = 0; a < lastItemServiceValues.length; a++) {
                var thisvalue = tablisting_filter_trim(lastItemServiceValues[a]);
                if (document.getElementById(thisvalue).checked) {
                    showThis = true;
                    showedsomething = true;
                }
            }
            if (!showThis) {
                $ektron(lastItem[0]).css('display', 'none');
            }
        }
        if (!showedsomething) {
            document.getElementById("nodata").style.display = "block";
        }
    }
}

function tablisting_filter_TogglePricingCheck(value, cboxobj) {
    var firstItem = $ektron("div.listin_post_con_3");
    var midItems = $ektron("div.listin_post_con_4");
    var lastItem = $ektron("div.listin_post_con_2");
    var firstItemPostRight = $ektron(firstItem[0]).children("div.listin_post_right_2");
    var midItemPostRight;
    var lastItemPostRight = $ektron(lastItem[0]).children("div.listin_post_right_2");
    var firstItemTextList = $ektron(firstItemPostRight[0]).children("p.text_list");
    var midItemTextList;
    var lastItemTextList = $ektron(lastItemPostRight[0]).children("p.text_list");
    var firstItemPricingSpan = $ektron(firstItemTextList[0]).children("span.pricing");
    var midItemPricingSpan;
    var lastItemPricingSpan = $ektron(lastItemTextList[0]).children("span.pricing");
    if (cboxobj.checked) {
        document.getElementById("nodata").style.display = "none";
        //Show items
        if (firstItemPricingSpan[0].innerHTML == value) {
            $ektron(firstItem[0]).css('display', 'block');
        }
        for (i = 0; i < midItems.length; i++) {
            midItemPostRight = $ektron(midItems[i]).children("div.listin_post_right_2");
            for (j = 0; j < midItemPostRight.length; j++) {
                midItemTextList = $ektron(midItemPostRight[j]).children("p.text_list");
                for (k = 0; k < midItemTextList.length; k++) {
                    midItemPricingSpan = $ektron(midItemTextList[k]).children("span.pricing");
                    if (midItemPricingSpan[0].innerHTML == value) {
                        $ektron(midItems[i]).css('display', 'block');
                    }
                }
            }
        }
        if (lastItemPricingSpan[0].innerHTML == value) {
            $ektron(lastItem[0]).css('display', 'block');
        }
    } else {
        var showedsomething = false;
        //Hide items
        if (firstItemPricingSpan[0].innerHTML == value) {
            $ektron(firstItem[0]).css('display', 'none');
        } else {
            if ($ektron(firstItem[0]).css("display") != "none") {
                showedsomething = true;
            }
        }
        for (i = 0; i < midItems.length; i++) {
            midItemPostRight = $ektron(midItems[i]).children("div.listin_post_right_2");
            for (j = 0; j < midItemPostRight.length; j++) {
                midItemTextList = $ektron(midItemPostRight[j]).children("p.text_list");
                for (k = 0; k < midItemTextList.length; k++) {
                    midItemPricingSpan = $ektron(midItemTextList[k]).children("span.pricing");
                    if (midItemPricingSpan[0].innerHTML == value) {
                        $ektron(midItems[i]).css('display', 'none');
                    } else {
                    if ($ektron(midItems[i]).css("display") != "none") {
                        showedsomething = true;
                    }
                    }
                }
            }
        }
        if (lastItemPricingSpan[0].innerHTML == value) {
            $ektron(lastItem[0]).css('display', 'none');
        } else {
        if ($ektron(lastItem[0]).css("display") != "none") {
            showedsomething = true;
        }
    }
    if (!showedsomething) {
        document.getElementById("nodata").style.display = "block";
    }
    }
}

function MBS_tablisting_filter_TogglePricingCheck(value, cboxobj) {
    var lastItem = $ektron("div.tablisting_accom_cnt_last");
    var midItems = $ektron("div.tablisting_accom_cnt");
    var midLines = $ektron("div.accomline");
    var midCount = midLines.length - 1;
    var midItemPostRight;
    var lastItemPostRight = $ektron(lastItem[0]).children("div.tablisting_accom_content");
    var midItemTextList;
    var lastItemTextList = $ektron(lastItemPostRight[0]).children("p.text_list");
    var midItemPricingSpan;
    var lastItemPricingSpan = $ektron(lastItemTextList[0]).children("span.pricing");
    if (cboxobj.checked) {
        document.getElementById("nodata").style.display = "none";
        //Show items
        for (i = 0; i < midItems.length; i++) {
            midItemPostRight = $ektron(midItems[i]).children("div.tablisting_accom_content");
            for (j = 0; j < midItemPostRight.length; j++) {
                midItemTextList = $ektron(midItemPostRight[j]).children("p.text_list");
                for (k = 0; k < midItemTextList.length; k++) {
                    midItemPricingSpan = $ektron(midItemTextList[k]).children("span.pricing");
                    if (midItemPricingSpan[0].innerHTML == value) {
                        $ektron(midItems[i]).css('display', 'block');
                        $ektron(midLines[i]).css('display', 'block');
                    }
                }
            }
        }
        if (lastItemPricingSpan[0].innerHTML == value) {
            $ektron(lastItem[0]).css('display', 'block');
        }
    } else {
        var showedsomething = false;
        //Hide items
        for (i = 0; i < midItems.length; i++) {
            midItemPostRight = $ektron(midItems[i]).children("div.tablisting_accom_content");
            for (j = 0; j < midItemPostRight.length; j++) {
                midItemTextList = $ektron(midItemPostRight[j]).children("p.text_list");
                for (k = 0; k < midItemTextList.length; k++) {
                    midItemPricingSpan = $ektron(midItemTextList[k]).children("span.pricing");
                    if (midItemPricingSpan[0].innerHTML == value) {
                        $ektron(midItems[i]).css('display', 'none');
                        $ektron(midLines[i]).css('display', 'none');
                    } else {
                        if ($ektron(midItems[i]).css("display") != "none") {
                            showedsomething = true;
                        }
                    }
                }
            }
        }
        if (lastItemPricingSpan[0].innerHTML == value) {
            $ektron(lastItem[0]).css('display', 'none');
        } else {
            if ($ektron(lastItem[0]).css("display") != "none") {
                showedsomething = true;
            }
        }
        if (!showedsomething) {
            document.getElementById("nodata").style.display = "block";
        }
    }
}

function MBS_tablisting_filter_ToggleChefCheck(radioobj) {
    var lastItem = $ektron("div.tablisting_accom_cnt_last");
    var midItems = $ektron("div.tablisting_accom_cnt");
    var midLines = $ektron("div.accomline");
    var midCount = midLines.length - 1;
    var midItemPostRight;
    var lastItemPostRight = $ektron(lastItem[0]).children("div.tablisting_accom_content");
    var midItemTextList;
    var lastItemTextList = $ektron(lastItemPostRight[0]).children("p.text_list");
    var midItemPricingSpan;
    var lastItemPricingSpan = $ektron(lastItemTextList[0]).children("span.chef");
    var radioid = radioobj.id;
    if (radioid == 'All') {
        //Show All
        for (i = 0; i < midItems.length; i++) {

            $ektron(midItems[i]).css('display', 'block');
            $ektron(midLines[i]).css('display', 'block');
        }
        $ektron(lastItem[0]).css('display', 'block');
        document.getElementById("nodata").style.display = "none";
    } else {
        //Hide Celebrity Only
        var showedsomething = false;
        for (i = 0; i < midItems.length; i++) {
            midItemPostRight = $ektron(midItems[i]).children("div.tablisting_accom_content");
            for (j = 0; j < midItemPostRight.length; j++) {
                midItemTextList = $ektron(midItemPostRight[j]).children("p.text_list");
                for (k = 0; k < midItemTextList.length; k++) {
                    midItemPricingSpan = $ektron(midItemTextList[k]).children("span.chef");
                    if (midItemPricingSpan.length == 0) {
                        $ektron(midItems[i]).css('display', 'none');
                        $ektron(midLines[i]).css('display', 'none');
                    } else {
                        if ($ektron(midItems[i]).css("display") != "none") {
                            showedsomething = true;
                        }
                    }
                }
            }
        }
        if (lastItemPricingSpan.length == 0) {
            $ektron(lastItem[0]).css('display', 'none');
        } else {
            if ($ektron(lastItem[0]).css("display") != "none") {
                showedsomething = true;
            }
        }
        if (!showedsomething) {
            document.getElementById("nodata").style.display = "block";
        }
    }
}

function tablisting_filter_ToggleHotelCheck(value, cboxobj) {
    var firstItem = $ektron("div.listin_post_con_3");
    var firstItemPostRight = $ektron(firstItem[0]).children("div.listin_post_right_2");
    var firstItemSubList = $ektron(firstItemPostRight[0]).children("div.post_titile_con");
    var firstItemTextList = $ektron(firstItemSubList[0]).children("div.post_titile_con_left_2");
    var firstItemPricingSpan = $ektron(firstItemTextList[0]).children("h2.post_title_2");
    var midItems = $ektron("div.listin_post_con_4");
    var midItemPostRight;
    var midItemSubList;
    var midItemTextList;
    var midItemPricingSpan;
    var lastItem = $ektron("div.listin_post_con_2");
    var lastItemPostRight = $ektron(lastItem[0]).children("div.listin_post_right_2");
    var lastItemSubList = $ektron(lastItemPostRight[0]).children("div.post_titile_con");
    var lastItemTextList = $ektron(lastItemSubList[0]).children("div.post_titile_con_left_2");
    var lastItemPricingSpan = $ektron(lastItemTextList[0]).children("h2.post_title_2");
    if (cboxobj.checked) {
        document.getElementById("nodata").style.display = "none";
        //Show items
        if ($(firstItemPricingSpan[0]).children("span")[0].innerHTML.indexOf(value) > 0) {
            $ektron(firstItem[0]).css('display', 'block');
        }
        for (i = 0; i < midItems.length; i++) {
            midItemPostRight = $ektron(midItems[i]).children("div.listin_post_right_2");
            for (j = 0; j < midItemPostRight.length; j++) {
                midItemSubList = $ektron(midItemPostRight[j]).children("div.post_titile_con");
                midItemTextList = $ektron(midItemSubList[0]).children("div.post_titile_con_left_2");
                for (k = 0; k < midItemTextList.length; k++) {
                    midItemPricingSpan = $ektron(midItemTextList[k]).children("h2.post_title_2");
                    if ($(midItemPricingSpan[0]).children("span")[0].innerHTML.indexOf(value) > 0) {
                        $ektron(midItems[i]).css('display', 'block');
                    }
                }
            }
        }
        if ($(lastItemPricingSpan[0]).children("span")[0].innerHTML.indexOf(value) > 0) {
            $ektron(lastItem[0]).css('display', 'block');
        }
    } else {
        var showedsomething = false;
        //Hide items
        if ($(firstItemPricingSpan[0]).children("span")[0].innerHTML.indexOf(value) > 0) {
            $ektron(firstItem[0]).css('display', 'none');
        } else {
            if ($ektron(firstItem[0]).css("display") != "none") {
                showedsomething = true;
            }
        }
        for (i = 0; i < midItems.length; i++) {
            midItemPostRight = $ektron(midItems[i]).children("div.listin_post_right_2");
            for (j = 0; j < midItemPostRight.length; j++) {
                midItemSubList = $ektron(midItemPostRight[j]).children("div.post_titile_con");
                midItemTextList = $ektron(midItemSubList[0]).children("div.post_titile_con_left_2");
                for (k = 0; k < midItemTextList.length; k++) {
                    midItemPricingSpan = $ektron(midItemTextList[k]).children("h2.post_title_2");
                    if ($(midItemPricingSpan[0]).children("span")[0].innerHTML.indexOf(value) > 0) {
                        $ektron(midItems[i]).css('display', 'none');
                    } else {
                        if ($ektron(midItems[i]).css("display") != "none") {
                            showedsomething = true;
                        }
                    }
                }
            }
        }
        if ($(lastItemPricingSpan[0]).children("span")[0].innerHTML.indexOf(value) > 0) {
            $ektron(lastItem[0]).css('display', 'none');
        } else {
            if ($ektron(lastItem[0]).css("display") != "none") {
                showedsomething = true;
            }
        }
        if (!showedsomething) {
            document.getElementById("nodata").style.display = "block";
        }
    }
}



function tablisting_filter_trim(stringToTrim) {
    return stringToTrim.replace(/^\s+|\s+$/g, "");
}
