


function OpenPopupWindow(winurl, winname, winfeatures) {
    newwin = window.open(winurl, winname, winfeatures);
}
function popup(theURL, theWindowName, theWidth, theHeight) {
    window.open(theURL, theWindowName, "width=" + theWidth + ",height=" + theHeight + ",scrollbars=no");
    //put 'window.self.focus' in html header of popup page
    //instead of win.focus(); here to avoid an error in Internet Explorer
}



function CheckAdsExist(selector) {

    var addisplay = false;
    var object = $(selector);
    object.find(".bannerads").each(function() {

        var obj = $(this);

        if (obj.find("object").length > 0 || obj.find("embed").length > 0 ||
            obj.find("iframe").length > 0) {
            obj.addClass("show_advert");
            addisplay = true;
        }
        else {
            var imageList = obj.find("img");

            if (imageList.length > 0) {
                var img = imageList.get(0);
                if (img != null) {

                    if (img.src == "http://iad.anm.co.uk/house/1x1.gif" ||
                             img.src == "http://iad.anm.co.uk/anmdefaultad.gif" || img.height < 3) {

                        this.style.display = "none";

                    }
                    else {
                        obj.addClass("show_advert");
                        addisplay = true;

                    }

                }
            }

        }

    });

    if (addisplay != false) {
        if (object.hasClass("hideAds")) { object.removeClass("hideAds"); }
        else {
            object.find(".hideAds").removeClass("hideAds");
        }
    }

}
