jQuery.fn.accessNews_tienda = function(settings) {    settings = jQuery.extend({        newsHeadline: "Top Stories",        newsSpeed: "normal"    }, settings);    return this.each(function(i) {        aNewsSlider_tienda.itemWidth = 1+parseInt(jQuery(".item_tienda:eq(" + i + ")",".news_slider_tienda").css("width")) + parseInt(jQuery(".item_tienda:eq(" + i + ")",".news_slider_tienda").css("margin-right"));        aNewsSlider_tienda.init(settings,this);        jQuery(".view_all_tienda > a", this).click(function() {            aNewsSlider_tienda.vAll(settings,this);            return false;        });    });};var aNewsSlider_tienda = {    itemWidth: 0,    init: function(s,p) {        jQuery(".messaging_tienda",p).css("display","none");        itemLength = jQuery(".item_tienda",p).length;                   // -------------------------------------------------------------------------------------------var valofcual=0;if(document.cookie){cookieArray=document.cookie.split(";");    for(i in cookieArray){        iscual=(cookieArray[i].indexOf("cual=")>=0);    if(iscual){	   valofcual=cookieArray[i].split("=");     }} }// -------------------------------------------------------------------------------------------                        newsContainerWidth = itemLength * aNewsSlider_tienda.itemWidth;        jQuery(".container_tienda",p).css("width",newsContainerWidth + "px");        jQuery(".prev_tienda",p).css("display","block");        animating = false;                // -------------------------------------------------------------------------------------------	        	if(valofcual[1]){			if (animating == false) {			animating = true;			animateLeft = parseInt(valofcual[1]);						if (animateLeft + parseInt(jQuery(".container_tienda",p).css("width")) > 0) {				jQuery(".next_tienda",p).css("display","block");				jQuery(".container_tienda",p).animate({left: animateLeft}, s.newsSpeed, function() {					jQuery(this).css("left",animateLeft);										if (parseInt(jQuery(".container_tienda",p).css("left")) + parseInt(jQuery(".container",p).css("width")) <= aNewsSlider_tienda.itemWidth * 1) {						jQuery(".prev_tienda",p).css("display","none");					}					animating = false;				});			} else {				animating = false;			}		}		}	// -------------------------------------------------------------------------------------------                        jQuery(".prev_tienda",p).click(function() {            if (animating == false) {                animating = true;                animateLeft = parseInt(jQuery(".container_tienda",p).css("left")) - (aNewsSlider_tienda.itemWidth * 1);                writeCookie(animateLeft);                if (animateLeft + parseInt(jQuery(".container_tienda",p).css("width")) > 0) {                    jQuery(".next_tienda",p).css("display","block");                    jQuery(".container_tienda",p).animate({left: animateLeft}, s.newsSpeed, function() {                        jQuery(this).css("left",animateLeft);                        if (parseInt(jQuery(".container_tienda",p).css("left")) + parseInt(jQuery(".container_tienda",p).css("width")) <= aNewsSlider_tienda.itemWidth * 1) {                            jQuery(".prev_tienda",p).css("display","none");                        }                        animating = false;                    });                } else {                    animating = false;                }            }            return false;        });        jQuery(".next_tienda",p).click(function() {            if (animating == false) {                animating = true;                animateLeft = parseInt(jQuery(".container_tienda",p).css("left")) + (aNewsSlider_tienda.itemWidth * 1);                writeCookie(animateLeft);                if ((animateLeft + parseInt(jQuery(".container_tienda",p).css("width"))) <= parseInt(jQuery(".container_tienda",p).css("width"))) {                    jQuery(".prev_tienda",p).css("display","block");                    jQuery(".container_tienda",p).animate({left: animateLeft}, s.newsSpeed, function() {                        jQuery(this).css("left",animateLeft);                        if (parseInt(jQuery(".container_tienda",p).css("left")) == 0) {                            jQuery(".next_tienda",p).css("display","none");                        }                        animating = false;                    });                } else {                    animating = false;                }            }            return false;        });    },    vAll: function(s,p) {        var o = p;        while (p) {            p = p.parentNode;            if (jQuery(p).attr("class") != undefined && jQuery(p).attr("class").indexOf("news_slider_tienda") != -1) {                break;            }        }        if (jQuery(o).text().indexOf("View All") != -1) {            jQuery(".prev_tienda",p).css("display","none");            jQuery(".next_tienda",p).css("display","none");            jQuery(o).text("View Less");            jQuery(".container_tienda",p).css("left","0px").css("width",aNewsSlider_tienda.itemWidth * 2 + "px");        } else {            jQuery(o).text("View All");            aNewsSlider_tienda.init(s,p);        }    }};function writeCookie(left){     document.cookie="cual="+left+";expires="+new Date(new Date().getTime() + 60*1000).toGMTString();}
