/*
 * 	Easy Slider - jQuery plugin
 *	written by Alen Grakalic	
 *	http://cssglobe.com/post/3783/jquery-plugin-easy-image-or-content-slider
 *
 *	Copyright (c) 2009 Alen Grakalic (http://cssglobe.com)
 *	Dual licensed under the MIT (MIT-LICENSE.txt)
 *	and GPL (GPL-LICENSE.txt) licenses.
 *
 *	Built for jQuery library
 *	http://jquery.com
 */
///eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(5($){$.K.V=5(d){3 e={8:\'U\',v:\'M\',4:\'J\',A:\'E\',B:\'\',j:T};3 d=$.R(e,d);Q f.L(5(){2=$(f);3 s=$("n",2).I;3 w=2.k();3 h=2.D();3 b=s-1;3 t=0;3 c=(d.B==\'S\');$("i",2).z(\'k\',s*w);6(!c)$("n",2).z(\'P\',\'O\');$(2).N(\'<9 u="\'+d.8+\'"><a r=\\"m:q(0);\\">\'+d.v+\'</a></9> <9 u="\'+d.4+\'"><a r=\\"m:q(0);\\">\'+d.A+\'</a></9>\');$("a","#"+d.8).o();$("a","#"+d.4).o();$("a","#"+d.4).y(5(){7("l");6(t>=b)$(f).x();$("a","#"+d.8).g()});$("a","#"+d.8).y(5(){7("H");6(t<=0)$(f).x();$("a","#"+d.4).g()});5 7(a){6(a=="l"){t=(t>=b)?b:t+1}C{t=(t<=0)?0:t-1};6(!c){p=(t*w*-1);$("i",2).7({G:p},d.j)}C{p=(t*h*-1);$("i",2).7({F:p},d.j)}};6(s>1)$("a","#"+d.4).g()})}})(W);',59,59,'||obj|var|nextId|function|if|animate|prevId|span||||||this|fadeIn||ul|speed|width|next|javascript|li|hide||void|href|||id|prevText||fadeOut|click|css|nextText|orientation|else|height|Next|marginTop|marginLeft|prev|length|nextBtn|fn|each|Previous|after|left|float|return|extend|vertical|800|prevBtn|easySlider|jQuery'.split('|'),0,{}))

//jq13var jq13 = jQuery.noConflict(true);

(function ($) {
    $.fn.easySlider = function (d) {
        var e = {   
            prevId: 'prevBtn',
            prevText: '<IMG   align="right" SRC="App_Themes/propmart/images/buttons/bttnPreviousSmall.gif" />',
            nextId: 'nextBtn',
            nextText: '<IMG  align="right" SRC="App_Themes/propmart/images/buttons/bttnNextSmall.gif" />',
            orientation: '',
            speed: 800
        };
        var d = $.extend(e, d);
        return this.each(function () {
            obj = $(this);
            var s = $("li", obj).length;
            var w = obj.width();
            var h = obj.height();
            var b = s - 1;
            var t = 0;
            var c = (d.orientation == 'vertical');
            $("ul", obj).css('width', s * w);
            if (!c) $("li", obj).css('float', 'left');
            $(obj).after('<span id="' + d.prevId + ' align=center"><a href=\"javascript:void(0);\">' + d.prevText + '</a></span> <span id="' + d.nextId + '"><a href=\"javascript:void(0);\">' + d.nextText + '</a></span>');
            $("a", "#" + d.prevId).hide();
            $("a", "#" + d.nextId).hide();
            $("a", "#" + d.nextId).click(function () {
                animate("next");
                if (t >= b) $(this).fadeOut();
                $("a", "#" + d.prevId).fadeIn()
            });
            $("a", "#" + d.prevId).click(function () {
                animate("prev");
                if (t <= 0) $(this).fadeOut();
                $("a", "#" + d.nextId).fadeIn()
            });

            function animate(a) {
                if (a == "next") {
                    t = (t >= b) ? b : t + 1
                } else {
                    t = (t <= 0) ? 0 : t - 1
                };
                if (!c) {
                    p = (t * w * -1);
                    $("ul", obj).animate({
                        marginLeft: p
                    }, d.speed)
                } else {
                    p = (t * h * -1);
                    $("ul", obj).animate({
                        marginTop: p
                    }, d.speed)
                }
            };
            if (s > 1) $("a", "#" + d.nextId).fadeIn()
        })
    }
})(jQuery);

(function ($) {
    $.fn.easySaleSlider = function (dSale) {
        var eSale = {
            prevId: 'prevBtnSale',
            prevText: '<IMG  align="left" border="0" SRC="App_Themes/propmart/images/buttons/bttnPreviousSmall.gif" />',
            nextId: 'nextBtnSale',
            nextText: '<IMG  align="right" border="0" SRC="App_Themes/propmart/images/buttons/bttnNextSmall.gif" />',
            orientation: '',
            speed: 800
        };
        var dSale = $.extend(eSale, dSale);
          
        return this.each(function () {
            objSale = $(this);
            var sSale = $("li", objSale).length;
            var wSale = objSale.width();
            var hSale = objSale.height();
            var bSale = sSale - 1;
            var tSale = 0;
            var cSale = (dSale.orientation == 'vertical');
            $("ul", objSale).css('width', sSale * wSale);
            if (!cSale) $("li", objSale).css('float', 'left');
            $(objSale).after('<span style="float: left;" id="' + dSale.prevId + '"><a href=\"javascript:void(0);\">' + dSale.prevText + '</a></span> <span style="float: right;width:25%" id="' + dSale.nextId + '"><a href=\"javascript:void(0);\">' + dSale.nextText + '</a></span>')
            $("a", "#" + dSale.prevId).hide();
            $("a", "#" + dSale.nextId).hide();
            $("a", "#" + dSale.nextId).click(function () {
                animate("next");
                if (tSale >= bSale) $(this).fadeOut();
                $("a", "#" + dSale.prevId).fadeIn();
                //setMasterHeight();
            });
            $("a", "#" + dSale.prevId).click(function () {
                animate("prev");
                if (tSale <= 0) $(this).fadeOut();
                $("a", "#" + dSale.nextId).fadeIn();
                //setMasterHeight();
            });

            
            function animate(aSale) {
                if (aSale == "next") {
                    tSale = (tSale >= bSale) ? bSale : tSale + 1
                } else {
                    tSale = (tSale <= 0) ? 0 : tSale - 1
                };
                if (!cSale) {
                    pSale = (tSale * wSale * -1);
                    $("ul", objSale).animate({
                        marginLeft: pSale
                    }, dSale.speed)
                } else {
                    pSale = (tSale * hSale * -1);
                    $("ul", objSale).animate({
                        marginTop: pSale
                    }, dSale.speed)
                }
            };
            if (sSale > 1) $("a", "#" + dSale.nextId).fadeIn()
            setMasterHeight();
        })
    }
})(jQuery);

(function ($) {
    $.fn.easyRentSlider = function (dRent) {
        var eRent = {
            prevId: 'prevBtnRent',
            prevText: '<IMG  align="left" SRC="App_Themes/propmart/images/buttons/bttnPreviousSmall.gif" />',
            nextId: 'nextBtnRent',
            nextText: '<IMG  align="right" SRC="App_Themes/propmart/images/buttons/bttnNextSmall.gif" />',
            orientation: '',
            speed: 800
        };
        var dRent = $.extend(eRent, dRent);
        return this.each(function () {
            objRent = $(this);
            var sRent = $("li", objRent).length;
            var wRent = objRent.width();
            var hRent = objRent.height();
            var bRent = sRent - 1;
            var tRent = 0;
            var cRent = (dRent.orientation == 'vertical');
            $("ul", objRent).css('width', sRent * wRent);
            //$("ul", objRent).css('background-color', 'red');
            
            if (!cRent) $("li", objRent).css('float', 'left');
            //if (!cRent) $("li", objRent).css('background-color', 'yellow');
            
            $(objRent).after('<span style="float: left;" id="' + dRent.prevId + '"><a href=\"javascript:void(0);\">' + dRent.prevText + '</a></span><span style="float: right;width:25%" id="' + dRent.nextId + '"><a href=\"javascript:void(0);\">' + dRent.nextText + '</a></span>')
            $("a").addclass
            $("a", "#" + dRent.prevId).hide();
            $("a", "#" + dRent.nextId).hide();
            $("a", "#" + dRent.nextId).click(function () {
                animate("next");
                if (tRent >= bRent) $(this).fadeOut();
                $("a", "#" + dRent.prevId).fadeIn()
            });
            $("a", "#" + dRent.prevId).click(function () {
                animate("prev");
                if (tRent <= 0) $(this).fadeOut();
                $("a", "#" + dRent.nextId).fadeIn()
            });

            function animate(aRent) {
                if (aRent == "next") {
                    tRent = (tRent >= bRent) ? bRent : tRent + 1
                } else {
                    tRent = (tRent <= 0) ? 0 : tRent - 1
                };
                if (!cRent) {
                    pRent = (tRent * wRent * -1);
                    $("ul", objRent).animate({
                        marginLeft: pRent
                    }, dRent.speed)
                } else {
                    pRent = (tRent * hRent * -1);
                    $("ul", objRent).animate({
                        marginTop: pRent
                    }, dRent.speed)
                }
            };
            if (sRent > 1) $("a", "#" + dRent.nextId).fadeIn()
            setMasterHeight();
        })
    }
})(jQuery);


(function ($) {
    $.fn.easyFurnishedRentSlider = function (dFurnishedRent) {
        var eFurnishedRent = {
            prevId: 'prevBtnFurnishedRent',
            prevText: '<IMG align="left"  SRC="App_Themes/propmart/images/buttons/bttnPreviousSmall.gif" />',
            nextId: 'nextBtnFurnishedRent',
            nextText: '<IMG align="right" SRC="App_Themes/propmart/images/buttons/bttnNextSmall.gif" />',
            orientation: '',
            speed: 800
        };
        var dFurnishedRent = $.extend(eFurnishedRent, dFurnishedRent);
        return this.each(function () {
            objFurnishedRent = $(this);
            var sFurnishedRent = $("li", objFurnishedRent).length;
            var wFurnishedRent = objFurnishedRent.width();
            var hFurnishedRent = objFurnishedRent.height();
            var bFurnishedRent = sFurnishedRent - 1;
            var tFurnishedRent = 0;
            var cFurnishedRent = (dFurnishedRent.orientation == 'vertical');
            $("ul", objFurnishedRent).css('width', sFurnishedRent * wFurnishedRent);
            if (!cFurnishedRent) $("li", objFurnishedRent).css('float', 'left');
            $(objFurnishedRent).after('<span style="float: left;" id="' + dFurnishedRent.prevId + '"><a href=\"javascript:void(0);\">' + dFurnishedRent.prevText + '</a></span> <span style="float: right;width:25%;" id="' + dFurnishedRent.nextId + '"><a href=\"javascript:void(0);\">' + dFurnishedRent.nextText + '</a></span>')
            $("a").addclass
            $("a", "#" + dFurnishedRent.prevId).hide();
            $("a", "#" + dFurnishedRent.nextId).hide();
            $("a", "#" + dFurnishedRent.nextId).click(function () {
                animate("next");
                if (tFurnishedRent >= bFurnishedRent) $(this).fadeOut();
                $("a", "#" + dFurnishedRent.prevId).fadeIn()
            });
            $("a", "#" + dFurnishedRent.prevId).click(function () {
                animate("prev");
                if (tFurnishedRent <= 0) $(this).fadeOut();
                $("a", "#" + dFurnishedRent.nextId).fadeIn()
            });

            function animate(aFurnishedRent) {
                if (aFurnishedRent == "next") {
                    tFurnishedRent = (tFurnishedRent >= bFurnishedRent) ? bFurnishedRent : tFurnishedRent + 1
                } else {
                    tFurnishedRent = (tFurnishedRent <= 0) ? 0 : tFurnishedRent - 1
                };
                if (!cFurnishedRent) {
                    pFurnishedRent = (tFurnishedRent * wFurnishedRent * -1);
                    $("ul", objFurnishedRent).animate({
                        marginLeft: pFurnishedRent
                    }, dFurnishedRent.speed)
                } else {
                    pFurnishedRent = (tFurnishedRent * hFurnishedRent * -1);
                    $("ul", objFurnishedRent).animate({
                        marginTop: pFurnishedRent
                    }, dFurnishedRent.speed)
                }
            };
            if (sFurnishedRent > 1) $("a", "#" + dFurnishedRent.nextId).fadeIn()
            setMasterHeight();
        })
    }
})(jQuery);




(function ($) {
    $.fn.easyRelatedPropertiesSlider = function (dRelatedProperties) {
        var eRelatedProperties = {
            prevId: 'prevBtnRelatedProperties',
            prevText: '<IMG  align="left" SRC="App_Themes/propmart/images/buttons/bttnPreviousSmall.gif" />',
            nextId: 'nextBtnRelatedProperties',
            nextText: '<IMG  align="right" SRC="App_Themes/propmart/images/buttons/bttnNextSmall.gif" />',
            orientation: '',
            speed: 800
        };
        //alert(getElementWidth("tdMasterCenter"));
        var dRelatedProperties = $.extend(true,eRelatedProperties, dRelatedProperties);
        return this.each(function () {
            objRelatedProperties = $(this);
            var sRelatedProperties = $("li", objRelatedProperties).length;
            var wRelatedProperties = objRelatedProperties.width();
            var hRelatedProperties = objRelatedProperties.height();
            var bRelatedProperties = sRelatedProperties - 1;
            var tRelatedProperties = 0;
            var cRelatedProperties = (dRelatedProperties.orientation == 'vertical');
            $("ul", objRelatedProperties).css('width', sRelatedProperties * wRelatedProperties);
            if (!cRelatedProperties) $("li", objRelatedProperties).css('float', 'left');
            $(objRelatedProperties).after('<span style="float: left;" id="' + dRelatedProperties.prevId + '"><a href=\"javascript:void(0);\">' + dRelatedProperties.prevText + '</a></span> <span style="float: right;width:10%" id="' + dRelatedProperties.nextId + '"><a href=\"javascript:void(0);\">' + dRelatedProperties.nextText + '</a></span>')
            $("a").addclass
            $("a", "#" + dRelatedProperties.prevId).hide();
            $("a", "#" + dRelatedProperties.nextId).hide();
            $("a", "#" + dRelatedProperties.nextId).click(function () {
                animate("next");
                if (tRelatedProperties >= bRelatedProperties) $(this).fadeOut();
                $("a", "#" + dRelatedProperties.prevId).fadeIn()
            });
            $("a", "#" + dRelatedProperties.prevId).click(function () {
                animate("prev");
                if (tRelatedProperties <= 0) $(this).fadeOut();
                $("a", "#" + dRelatedProperties.nextId).fadeIn()
            });

            function animate(aRelatedProperties) {
                if (aRelatedProperties == "next") {
                    tRelatedProperties = (tRelatedProperties >= bRelatedProperties) ? bRelatedProperties : tRelatedProperties + 1
                } else {
                    tRelatedProperties = (tRelatedProperties <= 0) ? 0 : tRelatedProperties - 1
                };
                if (!cRelatedProperties) {
                    pRelatedProperties = (tRelatedProperties * wRelatedProperties * -1);
                    $("ul", objRelatedProperties).animate({
                        marginLeft: pRelatedProperties
                    }, dRelatedProperties.speed)
                } else {
                    pRelatedProperties = (tRelatedProperties * hRelatedProperties * -1);
                    $("ul", objRelatedProperties).animate({
                        marginTop: pRelatedProperties
                    }, dRelatedProperties.speed)
                }
            };
            if (sRelatedProperties > 1) $("a", "#" + dRelatedProperties.nextId).fadeIn()
            //setMasterHeight();
        })
    }
})(jQuery);