

jQuery(document).ready(function()

{

        /*var bgs = new Array();

        bgs[0] = "main_bg.jpg";

        bgs[1] = "main_bg2.jpg";



                var rand = Math.floor(Math.random()*bgs.length);*/

            

       /* $('#homeWrapper, #innerWrapper, #promoWrapper, #classiWrapper, #articleWrapper').css({ 'background-image' : 'url('+DEFAULT_URL+'/images/design/' + bgs[rand] + ')' });

        var sbgs = new Array();

        sbgs[0] = "ban1.jpg";

        sbgs[1] = "ban2.jpg";

        sbgs[2] = "ban3.jpg";

        sbgs[3] = "ban4.jpg";

        sbgs[4] = "ban5.jpg";

        sbgs[5] = "ban6.jpg";

        sbgs[6] = "ban7.jpg";

        sbgs[7] = "ban8.jpg";

        sbgs[8] = "ban9.jpg";

        sbgs[9] = "ban10.jpg";

        sbgs[10] = "ban11.jpg";

        sbgs[11] = "ban12.jpg";

        

        

        var srand = Math.floor(Math.random()*sbgs.length);

        $('#resultWrapper').css({ 'background-image' : 'url('+DEFAULT_URL+'/images/design/' + sbgs[srand] + ')' });*/

        $('#mainMenu li').each(function() 

        {

            $(this).hover(function () 

            {

                $(this).addClass("mHover");

                $(this).find(".dmenu").css({'top' : '42px', 'display' : 'block', 'z-index' : '99999'});

            }, 

            function () 

            {

                $(this).removeClass("mHover");

                $(this).find(".dmenu").css('display','none');

            }); 

        });

        





    jQuery("ul.comments li:last").addClass("last");

    jQuery("#sideNav li:last").addClass("last");

    jQuery(".resultList li:last").addClass("last");

    jQuery("#plans ul, .bLinks ul").each(function()

    { 

        jQuery(this).find('li:last').addClass('last'); 

    }); 



    jQuery(".zoomBox ul li:last").addClass("last");

    

    $('ul#tabs li').click(function()

    { 

    

            $(this).addClass('selected').siblings('li').removeClass('selected'); 

            var _iindex =  jQuery(this).index(); 

            

            $('div.tabContent').hide().eq(_iindex).show(); 

                sIFR.replace(hstdlt, {

                    selector: '#tabContents .boxes .box h2'

                    ,css: {

                    '.sIFR-root': { 'color': '#19CCE1','font-size':'18px' }

                    }

                    ,wmode: 'transparent'

                });

                sIFR.replace(hstdlt, {

                    selector: '.highlightBox h3 a, .thumbDetail h3 a'

                    ,css: {

                    '.sIFR-root': { 'color': '#19CCE1','font-size':'18px' }

                    }

                    ,wmode: 'transparent'

                });

                

                sIFR.replace(hstdlt, {

                    selector: '#tabContents .boxes .box h4'

                    ,css: {

                    '.sIFR-root': { 'color': '#787878','font-size':'12px' }

                    }

                    ,wmode: 'transparent'

                });            

    }).eq(0).click();

    

    jQuery("ul#tabsAds li").click(function()

    { 

            jQuery(this).addClass('selected').siblings('li').removeClass('selected'); 

            var _index =  jQuery(this).index(); 

            jQuery('div.tabAdsContent').hide().eq(_index).show(); 

            sIFR.replace(hstdlt, {

                selector: '.cInfo h2'

                ,css: {

                '.sIFR-root': { 'color':'#19CCE1','font-size':'24px', 'letter-spacing':'0.4' }

                }

                ,wmode: 'transparent'

            });        

            

    }).eq(0).click();

    

    

    

    jQuery("ul#tabsReview li").click(function()

    { 

            jQuery(this).addClass('selected').siblings('li').removeClass('selected'); 

            var _index =  jQuery(this).index(); 

            jQuery('div.tabInnContent').hide().eq(_index).show(); 

            $('#myGallery').css('display','block');

            //$('#locationInfo').css('display','none');

            $('#locationInfo').css('position','absolute');

            $('#locationInfo').css('visibility','hidden');

            

            sIFR.replace(hstdlt, {

            selector: '.entry h3'

            ,css: {

            '.sIFR-root': { 'color': '#19CCE1','font-size':'18px' }

            }

            ,wmode: 'transparent'

            });    

            

    }).eq(0).click();

    

    jQuery("ul#tabsReview li.location").click(function()

    {                        

    $('#myGallery').css('display','none');

    $('#locationInfo').css('visibility','visible');

    $('#locationInfo').css('position','relative');

    //$('#locationInfo').css('display','block');

        sIFR.replace(hstdlt, {

        selector: '#locationInfo h3'

            ,css: {

            '.sIFR-root': { 'font-weight': 'normal','color': '#19cce1','font-size':'18px' }

            }

            ,wmode: 'transparent'

            ,forceSingleLine: true

        });

    });

    //result list

    

    $('ul.resultList li, .searchResultList li').hover(function () 

    {

        $(this).addClass("hover");        

    }, 

    function () 

    {

        $(this).removeClass("hover");

    }); 

    

    

    

    //classified drop down    

    // append image for dropdown        

    if ( jQuery('#plans .classiBox ul.pList li').children('ul').size() > 0 )

    { 

        jQuery('<span class="ddArw"></span>').insertBefore('ul.pList li ul'); 

    } 

    

    $(".ddArw").toggle(function () 

    {

        $('.ddArw').next('ul').slideUp('slow'); 

        $(this).parent().addClass("rel");

        $(this).parent().find("ul").slideDown("slow");

        

    },

    function () 

    {

        

        $(this).parent().find("ul").slideUp("200");

        setTimeout(function()

        { 

            $("#plans").find(".rel").removeClass("rel");

            //alert(this);

        },400); 

    });

        $(".hide").toggle(

    function () {    

        $('.title').animate({

    height: 0



    }, 300, function() {

    $(".hide a").css({'background-position':'left bottom'});

    });

    },

    function () {

    $('.title').animate({

    height: 169



    }, 300, function() 

    {

        $(".hide a").css({'background-position':'left top'});

        });

    });



    $(".hideMap").toggle(

    function () {    

        $('.title').animate({

    height: 0



    }, 300, function() {

    $(".hideMap a").css({'background-position':'left bottom'});

    });

    },

    function () {

    $('.title').animate({

    height: 169



    }, 300, function() 

    {

        $(".hideMap a").css({'background-position':'left top'});

        });

    });



    $('input[type="text"]').addClass("idleField");

    $('input[type="text"]').focus(function() 

    {

        $(this).removeClass("blur").addClass("focus");

        if (this.value == this.defaultValue)

        { 

            this.value = '';

        }

        if(this.value != this.defaultValue)

        {

            this.select();

        }

    });

    $('input[type="text"]').blur(function() 

    {

        $(this).removeClass("focus").addClass("blur");

        if ($.trim(this.value) == '')

        {

            this.value = (this.defaultValue ? this.defaultValue : '');

        }

    });

    

    



    

});


