﻿var $j = jQuery.noConflict();
//alert("Alert Message");


function showMenu(ID) {
    var mnu = document.getElementById(ID);
    mnu.style.display = 'block';
}
function hideMenu(ID) {
    var mnu = document.getElementById(ID);
    mnu.style.display = 'none';
}






//function mainmenu() {
//  $("#menu ul").css({display: "none"}); // Opera Fix
//  $("#menu li").hover(function() {
//    $(this).find('ul:first').css({visibility: "visible", display: "none"}).fadeIn(300);
//	},function() {
//	  $(this).find('ul:first').css({visibility: "hidden"}).fadeOut(300);
//	});

//}

$j(document).ready(function () {

//    mainmenu();

    $j(document).pngFix();

//    $j("#menu li ul").children("li:nth-child(1)").css({ "border-top": "none" });

    // Google Maps Hiding Script
    $j('.mover').hide();

//    $j('#slideToggle').click(function () {

//        $j(this).siblings('.mover').slideToggle();

//    });


//    $j('#ctl00_ContentPlaceHolder1_ModPropertyDisplay1_img_main a, #img_thumbs a').lightBox(); // Select all links in object with gallery ID

    $j.ajax({

        url: 'get_fp.aspx',
        type: 'POST',
        dataType: 'json',
        async: false,
        success: function (obj) {
            var FPHTML = "";
            for (var i = 0, x = obj.Results.length; i < x; i++) {
                var z = 0;
                FPHTML += "<div class=\"fp\">";
                FPHTML += "<div class=\"fp_img\"><a href=\"search/display.aspx?ln=" + obj.Results[i].ListingNumber + "\">" +
                          "     <img src=\"http://www.eac.com.au/photos350/" + obj.Results[i].ListingNumber + ".jpg\" alt=\"\" height=\"242px\" width=\"387px\" style=\"border:none;\" class=\"fp_img_1\" />";

               
         
               
               
               
                if (obj.Results[i].PhotoCount > 1) {
                    for (var a = 0, b = obj.Results[i].PhotoCount - 1; a < b; a++) {
                        z++;

                        FPHTML += "     <img src=\"http://www.eac.com.au/photos80/" + obj.Results[i].ListingNumber + "_" + z + ".jpg\" alt=\"\" height=\"0px\" width=\"0px\" style=\"border:none;\" class=\"fp_img_small\" />";

                        if (z == 4)
                            break;
                    }
                }

                FPHTML += "</a></div>";
                FPHTML += "<div class=\"fp_details\"><p class=\"fp_left\">" + obj.Results[i].Suburb + (obj.Results[i].PriceView != "" ? " - " + obj.Results[i].PriceView : "") + "</p>" +
                          "<p class=\"fp_right\">&raquo <a href=\"search/display.aspx?ln=" + obj.Results[i].ListingNumber + "\">More Details</a></p></div>";
                FPHTML += "</div>";
            }
            $j("#feature_prop").html(FPHTML);
        },
        error: function () {
        }
    });

//    $j('#slideshow').cycle('fade');
    $j('#feature_prop').cycle({
        fx: 'fade',
        timeout: 5000
    });

});


