
/*
 * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
 *
 * Uses the built in easing capabilities added In jQuery 1.1
 * to offer multiple easing options
 *
 * TERMS OF USE - jQuery Easing
 * 
 * Open source under the BSD License. 
 * 
 * Copyright ?ÇA© 2008 George McGinley Smith
 * All rights reserved.
 * 
 * Redistribution and use in source and binary forms, with or without modification, 
 * are permitted provided that the following conditions are met:
 * 
 * Redistributions of source code must retain the above copyright notice, this list of 
 * conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright notice, this list 
 * of conditions and the following disclaimer in the documentation and/or other materials 
 * provided with the distribution.
 * 
 * Neither the name of the author nor the names of contributors may be used to endorse 
 * or promote products derived from this software without specific prior written permission.
 * 
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 *  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 
 * OF THE POSSIBILITY OF SUCH DAMAGE. 
 *
*/

// t: current time, b: begInnIng value, c: change In value, d: duration
jQuery.easing['jswing'] = jQuery.easing['swing'];

jQuery.extend( jQuery.easing,
{
def: 'easeOutQuad',
swing: function (x, t, b, c, d) {
//alert(jQuery.easing.default);
return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
},
easeInQuad: function (x, t, b, c, d) {
return c*(t/=d)*t + b;
},
easeOutQuad: function (x, t, b, c, d) {
return -c *(t/=d)*(t-2) + b;
},
easeInOutQuad: function (x, t, b, c, d) {
if ((t/=d/2) < 1) return c/2*t*t + b;
return -c/2 * ((--t)*(t-2) - 1) + b;
},
easeInCubic: function (x, t, b, c, d) {
return c*(t/=d)*t*t + b;
},
easeOutCubic: function (x, t, b, c, d) {
return c*((t=t/d-1)*t*t + 1) + b;
},
easeInOutCubic: function (x, t, b, c, d) {
if ((t/=d/2) < 1) return c/2*t*t*t + b;
return c/2*((t-=2)*t*t + 2) + b;
},
easeInQuart: function (x, t, b, c, d) {
return c*(t/=d)*t*t*t + b;
},
easeOutQuart: function (x, t, b, c, d) {
return -c * ((t=t/d-1)*t*t*t - 1) + b;
},
easeInOutQuart: function (x, t, b, c, d) {
if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
return -c/2 * ((t-=2)*t*t*t - 2) + b;
},
easeInQuint: function (x, t, b, c, d) {
return c*(t/=d)*t*t*t*t + b;
},
easeOutQuint: function (x, t, b, c, d) {
return c*((t=t/d-1)*t*t*t*t + 1) + b;
},
easeInOutQuint: function (x, t, b, c, d) {
if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
return c/2*((t-=2)*t*t*t*t + 2) + b;
},
easeInSine: function (x, t, b, c, d) {
return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
},
easeOutSine: function (x, t, b, c, d) {
return c * Math.sin(t/d * (Math.PI/2)) + b;
},
easeInOutSine: function (x, t, b, c, d) {
return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
},
easeInExpo: function (x, t, b, c, d) {
return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
},
easeOutExpo: function (x, t, b, c, d) {
return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
},
easeInOutExpo: function (x, t, b, c, d) {
if (t==0) return b;
if (t==d) return b+c;
if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
},
easeInCirc: function (x, t, b, c, d) {
return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
},
easeOutCirc: function (x, t, b, c, d) {
return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
},
easeInOutCirc: function (x, t, b, c, d) {
if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
},
easeInElastic: function (x, t, b, c, d) {
var s=1.70158;var p=0;var a=c;
if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
if (a < Math.abs(c)) { a=c; var s=p/4; }
else var s = p/(2*Math.PI) * Math.asin (c/a);
return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
},
easeOutElastic: function (x, t, b, c, d) {
var s=1.70158;var p=0;var a=c;
if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
if (a < Math.abs(c)) { a=c; var s=p/4; }
else var s = p/(2*Math.PI) * Math.asin (c/a);
return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
},
easeInOutElastic: function (x, t, b, c, d) {
var s=1.70158;var p=0;var a=c;
if (t==0) return b;  if ((t/=d/2)==2) return b+c;  if (!p) p=d*(.3*1.5);
if (a < Math.abs(c)) { a=c; var s=p/4; }
else var s = p/(2*Math.PI) * Math.asin (c/a);
if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
},
easeInBack: function (x, t, b, c, d, s) {
if (s == undefined) s = 1.70158;
return c*(t/=d)*t*((s+1)*t - s) + b;
},
easeOutBack: function (x, t, b, c, d, s) {
if (s == undefined) s = 1.70158;
return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
},
easeInOutBack: function (x, t, b, c, d, s) {
if (s == undefined) s = 1.70158; 
if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
},
easeInBounce: function (x, t, b, c, d) {
return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
},
easeOutBounce: function (x, t, b, c, d) {
if ((t/=d) < (1/2.75)) {
return c*(7.5625*t*t) + b;
} else if (t < (2/2.75)) {
return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
} else if (t < (2.5/2.75)) {
return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
} else {
return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
}
},
easeInOutBounce: function (x, t, b, c, d) {
if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
}
});





jQuery(window).load(function(){
  if (!jQuery.browser.msie) {
    jQuery('.image_wrapper').css({opacity: 0, visibility: 'hidden'});
    _xGothamFeatureArea.init(); 
    setTimeout(function(){
      jQuery('.image_wrapper').css({visibility: 'visible'}).animate({opacity: 1});
    }, 2000);
  } else {
    jQuery('.image_wrapper').fadeOut();
    _xGothamFeatureArea.init(); 
    setTimeout(function(){
      jQuery('.image_wrapper').fadeIn();
    }, 2000);
  }
});

_xGothamFeatureArea = {

_nAmountBelowFold: 250, //pixel height to be shown below features
_nMinimumFeatureHeight: 480, //400, TODO: uncomment this line to return to prev dynamic height settings
_nAnimationTime: 800,
_aFeatures: {},
_nCurrentFeature: 0,
_nNextFeature: '',
_nPrevFeature: '',
_nNextNextFeature: '',
_nPrevPrevFeature: '',

_nCurrentImageHeight: '',
_nCurrentImageWidth: 0,

_nCurrentWindowHeight: 0,
_nCurrentWindowWidth: 0,

_xLoadInterval: '',

_bLoadOne: false,
_bLoadTwo: false,
_bLoadThree: false,

_nAutoTimer: 5000,
_xAutoInterval: '',


_nAdPollTime: 100,
_xAdPollInterval: '',
_sAdBackupImage1: '',
_sAdBackupImage2: '',
_bAdOneLoaded: false,
_bAdTwoLoaded: false,

 
init:function(){
if (jQuery('#slide_show').length) {
this.setClickHandlers();
this.setHovers();
this.setNextPrev();
this.checkForInitialAds();
this.loadImages();
this._xLoadInterval = setInterval(function(){ _xGothamFeatureArea.checkForLoadedImages(); }, _xGothamFeatureArea._nAdPollTime);
this._xAdPollIntervalOne = setInterval(function(){ _xGothamFeatureArea.pollForAdOne(); }, _xGothamFeatureArea._nAdPollTime);
this._xAdPollIntervalTwo = setInterval(function(){ _xGothamFeatureArea.pollForAdTwo(); }, _xGothamFeatureArea._nAdPollTime);
}


//jQuery(window).resize(function(){ _xGothamFeatureArea.adjustImages(); });

 //temporary replacement for calling adjustImages on resize
jQuery(window).resize(function(){
_xGothamFeatureArea.getWindowDimensions();
_xGothamFeatureArea.adjustImagePositions(); 
}); 
},


pollForAdOne:function(){ 
var l_sPollReturn = this.pollForAd('feature_ad_holder_1');
if(l_sPollReturn){
clearInterval(this._xAdPollIntervalOne);
this._sAdBackupImage1 = l_sPollReturn;
this._bAdOneLoaded = true;
} 
},

pollForAdTwo:function(){ 
var l_sPollReturn = this.pollForAd('feature_ad_holder_2');
if(l_sPollReturn){
clearInterval(this._xAdPollIntervalTwo);
this._sAdBackupImage2 = l_sPollReturn; 
this._bAdTwoLoaded = true;
} 
},

pollForAd:function(p_sDivId){
return true;
},


checkForInitialAds:function(){
if(this.isAd(this._nCurrentFeature))
this._bLoadOne = true;
if(this.isAd(this._nNextFeature))
this._bLoadTwo = true;
if(this.isAd(this._nPrevFeature))
this._bLoadThree = true;
},

alterLogo:function(p_sVariation){
switch(p_sVariation){
case "D":
    jQuery('#logo').addClass('dark').fadeIn(400);
       break;
  case "H":
    jQuery('#logo').fadeIn(400);
       break;
 case "N":
    jQuery('#logo').removeClass('dark').fadeIn(400);
}
},

setNextPrev:function(){
this._nPrevFeature = this._nCurrentFeature - 1;
this._nPrevPrevFeature = this._nCurrentFeature - 2;
this._nNextFeature = this._nCurrentFeature + 1;
this._nNextNextFeature = this._nCurrentFeature + 2;

if(this._nCurrentFeature == 0){
this._nPrevFeature = this._aFeatures.length - 1;
this._nPrevPrevFeature = this._aFeatures.length - 2;
}
else if(this._nCurrentFeature == 1){
this._nPrevPrevFeature = this._aFeatures.length - 1;
}
else if(this._nCurrentFeature == this._aFeatures.length - 1){
this._nNextFeature = 0;
this._nNextNextFeature = 1;
}
else if(this._nCurrentFeature == this._aFeatures.length - 2){
this._nNextNextFeature = 0;
}
},

loadImages:function(){
jQuery('#imageloadone').load( function(){ _xGothamFeatureArea._bLoadOne = true; } );
jQuery('#imageloadone').attr('src',this._aFeatures[this._nCurrentFeature].image_uri);

this.alterLogo(this._aFeatures[this._nCurrentFeature].variation);

jQuery('#imageloadtwo').load(function(){ _xGothamFeatureArea._bLoadTwo = true; } );
jQuery('#imageloadtwo').attr('src',this._aFeatures[this._nNextFeature].image_uri);

jQuery('#imageloadthree').load( function(){ _xGothamFeatureArea._bLoadThree = true; } );
jQuery('#imageloadthree').attr('src',this._aFeatures[this._nPrevFeature].image_uri);
},

checkForLoadedImages:function(){
if(this._bLoadOne && this._bLoadTwo && this._bLoadThree && this._bAdOneLoaded && this._bAdTwoLoaded){
clearInterval(this._xLoadInterval);

_xGothamFeatureArea.setFeatureImages();
setTimeout(function(){  
_xGothamFeatureArea.adjustImages(true); 
jQuery('#slide_show').find('.init_wrapper').fadeIn(400);
if(_xGothamFeatureArea._aFeatures[_xGothamFeatureArea._nCurrentFeature].variation != 'H')
jQuery('#logo').fadeIn(400);
jQuery('#left_arrow,#right_arrow').show();
}, 100);

_xGothamFeatureArea.startAutoAdvance();
jQuery('img.hero_text').eq(1).css('display', 'block').delay(3500).fadeOut(this._nAutoTimer/3);
}
},


startAutoAdvance:function(){
_xGothamFeatureArea._xAutoInterval = setInterval ( function(){ _xGothamFeatureArea.getNextFeature(); _xGothamFeatureArea.updateArrowInfo(); }, _xGothamFeatureArea._nAutoTimer );
},

stopAutoAdvance:function(){
clearInterval(_xGothamFeatureArea._xAutoInterval);
},

autoScrollToContent:function(){
//_xGothamFeatureArea.adjustImages();
jQuery('#slide_show').height(480)
$.scrollTo(0);
},


adjustImages:function(p_bInit){
// For Nordstrom & Unicast
jQuery('body').children('div[id$=Div2]').hide();

this.getWindowDimensions();
this._nAmountBelowFold = this._nCurrentWindowHeight*.33; //delete this line if _nAmountBelowFold should remain constant

var $l_axImgs = jQuery('#slide_show').find('.image_wrapper').find('img');
var $l_axOverlays = jQuery('#slide_show').find('.hero_overlay');
var $l_axAd1 = jQuery('#feature_ad_holder_1');
var $l_axAd2 = jQuery('#feature_ad_holder_2');

this._nCurrentImageHeight = 480; //parseInt(this._nCurrentWindowHeight-this._nAmountBelowFold); TODO: uncomment this line for dynamic header sizing
if(this._nCurrentWindowHeight <= this._nAmountBelowFold + this._nMinimumFeatureHeight){ 
this._nCurrentImageHeight = parseInt(this._nMinimumFeatureHeight); 
}

$l_axImgs.height(this._nCurrentImageHeight);
if(p_bInit===true){
//jQuery('#header').animate({height: this._nCurrentImageHeight},400);
}
else
jQuery('#slide_show').height(this._nCurrentImageHeight);
this._nCurrentImageWidth = parseInt($l_axImgs.width());


this.adjustImagePositions();
this.adjustArrowPosition(this._nCurrentImageHeight);

if(jQuery('#ad_wrapper_1').length > 0){
var l_nAdOffset = jQuery('#ad_wrapper_1').offset().left;
$l_axAd1.css({'height': this._nCurrentImageHeight, 'width':this._nCurrentImageWidth, 'left': l_nAdOffset });
}

if(jQuery('#ad_wrapper_2').length > 0){
var l_nAdOffset = jQuery('#ad_wrapper_2').offset().left;
$l_axAd2.css({'height': this._nCurrentImageHeight, 'width':this._nCurrentImageWidth, 'left': l_nAdOffset });
}
},


getWindowDimensions:function(){
this._nCurrentWindowHeight = jQuery(window).height();
this._nCurrentWindowWidth = jQuery(window).width();
},


adjustImagePositions:function(){
var $l_axImgs = jQuery('#slide_show').find('.image_wrapper');

var l_nPositionOne = parseInt(this._nCurrentWindowWidth/2)-(this._nCurrentImageWidth/2);
var l_nPositionZero = l_nPositionOne - this._nCurrentImageWidth;
var l_nPositionTwo = l_nPositionOne + this._nCurrentImageWidth;

$l_axImgs.eq(0).css('left', l_nPositionZero);
$l_axImgs.eq(1).css('left', l_nPositionOne).find('.hero_overlay').hide();
$l_axImgs.eq(2).css('left', l_nPositionTwo-1);


jQuery('#logo').css('left',l_nPositionOne);

_xGothamFeatureArea.checkLogo();
},


adjustArrowPosition:function(p_nImageHeight){
jQuery('#left_arrow, #right_arrow').css('top', parseInt(p_nImageHeight/2 - 35));
},


setFeatureATag:function(p_nIndex,p_nHeight){
var l_sExtra = '';
if(parseInt(p_nHeight))
l_sExtra += ' style="height:'+p_nHeight+'px"';

var l_xFeatureObj = this._aFeatures[p_nIndex]

return '<a href="'+this._aFeatures[p_nIndex].url+'" ><div class="hero_overlay"></div><img src="'+this._aFeatures[p_nIndex].image_uri+'" '+l_sExtra+' alt="'+this._aFeatures[p_nIndex].title+'"/><img src="'+this._aFeatures[p_nIndex].hero_text+'" '+l_sExtra+' alt="'+this._aFeatures[p_nIndex].title+'" class="hero_text"/></a>';
},

getInitialAdHtml:function(p_nIndex, p_nAdNumber){
if(p_nAdNumber == 1)
var l_sAdHtml = this._sAdBackupImage1;
else
var l_sAdHtml = this._sAdBackupImage2;

l_sAdHtml = '<div class="hero_overlay"></div>' + l_sAdHtml;
return l_sAdHtml;
},

setFeatureImages:function(){
$l_axImageWrappers = jQuery('#slide_show').children('.image_wrapper');

if(this.isAd(this._nPrevFeature)){
var l_nAdNumber = this._aFeatures[this._nPrevFeature].ad_number;
var l_sAdHtml = this.getInitialAdHtml(this._nPrevFeature, l_nAdNumber);
$l_axImageWrappers.eq(0).addClass('ad_wrapper').attr('id', 'ad_wrapper_'+l_nAdNumber).html(l_sAdHtml);
}
else{
$l_axImageWrappers.eq(0).html(this.setFeatureATag(this._nPrevFeature));
}

if(this.isAd(this._nCurrentFeature)){
var l_nAdNumber = this._aFeatures[this._nCurrentFeature].ad_number;
var l_sAdHtml = this.getInitialAdHtml(this._nCurrentFeature, l_nAdNumber);
$l_axImageWrappers.eq(1).addClass('ad_wrapper').attr('id', 'ad_wrapper_'+l_nAdNumber).html(l_sAdHtml);
}
else{
$l_axImageWrappers.eq(1).html(this.setFeatureATag(this._nCurrentFeature));
}

if(this.isAd(this._nNextFeature)){
var l_nAdNumber = this._aFeatures[this._nNextFeature].ad_number;
var l_sAdHtml = this.getInitialAdHtml(this._nNextFeature, l_nAdNumber);
$l_axImageWrappers.eq(2).addClass('ad_wrapper').attr('id', 'ad_wrapper_'+l_nAdNumber).html(l_sAdHtml);
}
else{
$l_axImageWrappers.eq(2).html(this.setFeatureATag(this._nNextFeature));
}

//this.switchHighlighted();
},

getFeatureHtml:function(p_nIndex, p_nPosition){
p_nPosition = parseInt(p_nPosition);
if(this.isAd(p_nIndex)){
var l_nAdNumber = _xGothamFeatureArea._aFeatures[p_nIndex].ad_number;

if(l_nAdNumber == 1){
var l_sHtml = '<div id="ad_wrapper_'+l_nAdNumber+'" class="image_wrapper ad_wrapper" style="left:'+p_nPosition+'px;">';
l_sHtml +='<div class="hero_overlay"></div>'+this._sAdBackupImage1; 
l_sHtml += '</div>';
}
else if(l_nAdNumber == 2){
var l_sHtml = '<div id="ad_wrapper_'+l_nAdNumber+'" class="image_wrapper ad_wrapper" style="left:'+p_nPosition+'px;">';
l_sHtml +='<div class="hero_overlay"></div>'+this._sAdBackupImage2;
l_sHtml += '</div>';
}
}
else{
var l_sHtml = '<div class="image_wrapper" style="left:'+p_nPosition+'px;">'+this.setFeatureATag(p_nIndex,this._nCurrentImageHeight)+'</div>';
}
return l_sHtml;
},

getPrevFeature:function(){
jQuery('#slide_show').find('.hero_overlay').show();
var l_nPosition = parseInt(this._nCurrentWindowWidth/2 - (this._nCurrentImageWidth*2.5));

var l_sPrevPrevHtml = this.getFeatureHtml(this._nPrevPrevFeature, l_nPosition);
jQuery('#slide_show').find('.image_wrapper').eq(0).before(l_sPrevPrevHtml).find('.hero_overlay').hide();;
 

$l_axImgWrappers = jQuery('#slide_show').find('.image_wrapper'); 

$l_axImgWrappers.each(function(){
var l_nLeftPosition = jQuery(this).offset().left;
var l_nNewPosition = l_nLeftPosition + _xGothamFeatureArea._nCurrentImageWidth;
jQuery(this).animate({'left': l_nNewPosition}, _xGothamFeatureArea._nAnimationTime, 'easeOutExpo');
});
setTimeout(function(){
$l_axImgWrappers.eq(3).remove();
//_xGothamFeatureArea.switchHighlighted();
}, _xGothamFeatureArea._nAnimationTime);

this._nCurrentFeature = this._nPrevFeature;
this.setNextPrev();

if(this.isAd(this._nCurrentFeature)){ 
jQuery('#logo').fadeOut(_xGothamFeatureArea._nAnimationTime*.5, function(){ _xGothamFeatureArea.showSwfAd(_xGothamFeatureArea._aFeatures[_xGothamFeatureArea._nCurrentFeature].ad_number); }); 
}
else{ 
jQuery('#logo').fadeIn(_xGothamFeatureArea._nAnimationTime*.5); 
_xGothamFeatureArea.hideSwfAd();
}

if(!_xGothamFeatureArea.checkLogo())
jQuery('#logo').css('visibility','hidden');
this.alterLogo(this._aFeatures[this._nCurrentFeature].variation);
},


getNextFeature:function(){
jQuery('img.hero_text').eq(2).css('display', 'block').delay(2000).fadeOut(3000);
jQuery('#slide_show').find('.hero_overlay').show();
var l_nPosition = parseInt(this._nCurrentWindowWidth/2 + (this._nCurrentImageWidth*1.5));

var l_sNextNextHtml = this.getFeatureHtml(this._nNextNextFeature, l_nPosition);
jQuery('#slide_show').find('.image_wrapper').eq(2).after(l_sNextNextHtml);

$l_axImgWrappers = jQuery('#slide_show').find('.image_wrapper');
$l_axImgWrappers.eq(2).find('.hero_overlay').hide();

$l_axImgWrappers.each(function(){
var l_nLeftPosition = jQuery(this).offset().left;
var l_nNewPosition = l_nLeftPosition - _xGothamFeatureArea._nCurrentImageWidth;
jQuery(this).animate({'left': l_nNewPosition}, _xGothamFeatureArea._nAnimationTime, 'easeOutExpo');
});
setTimeout(function(){
$l_axImgWrappers.eq(0).remove();
//_xGothamFeatureArea.switchHighlighted();
}, _xGothamFeatureArea._nAnimationTime);

this._nCurrentFeature = this._nNextFeature;
this.setNextPrev();

if(this.isAd(this._nCurrentFeature)){ 
jQuery('#logo').fadeOut(_xGothamFeatureArea._nAnimationTime*.5, function(){ _xGothamFeatureArea.showSwfAd(_xGothamFeatureArea._aFeatures[_xGothamFeatureArea._nCurrentFeature].ad_number); }); 
}
else{ 
jQuery('#logo').fadeIn(_xGothamFeatureArea._nAnimationTime*.5); 
_xGothamFeatureArea.hideSwfAd();
}

if(!_xGothamFeatureArea.checkLogo())
jQuery('#logo').css('visibility','hidden');
this.alterLogo(this._aFeatures[this._nCurrentFeature].variation);
},


isAd:function(p_nFeatureNumber){
return false;
},

hideSwfAd:function(){
jQuery('.feature_ad_holder').hide();
// For Nordstrom & Unicast
jQuery('body').children('div[id$=Div2]').hide();
},

showSwfAd:function(p_nAdNumber){
setTimeout(function(){
var l_sLeft = jQuery('.ad_wrapper').offset().left;
jQuery('#feature_ad_holder_'+p_nAdNumber).show().css({ 'width':_xGothamFeatureArea._nCurrentImageWidth, 'height':_xGothamFeatureArea._nCurrentImageHeight, 'left':l_sLeft+'px' });
// For Nordstrom & Unicast
jQuery('body').children('div[id$=Div2]').show();
}, _xGothamFeatureArea._nAnimationTime*.5);
},


updateArrowInfo:function(){
jQuery('#right_arrow').find('.info').each(function(){
if(jQuery(this).attr('data-id')==_xGothamFeatureArea._aFeatures[_xGothamFeatureArea._nNextFeature].id){
jQuery(this).addClass('selected').siblings().removeClass('selected');
}
});

jQuery('#left_arrow').find('.info').each(function(){
if(jQuery(this).attr('data-id')==_xGothamFeatureArea._aFeatures[_xGothamFeatureArea._nPrevFeature].id){
jQuery(this).addClass('selected').siblings().removeClass('selected');
}
});
},

setClickHandlers:function(){
jQuery('#left_arrow').data('disabled', false).click(function(){
if(jQuery(this).data('disabled') === false){
jQuery('img.hero_text').stop(true, true).hide();
_xGothamFeatureArea.getPrevFeature();
_xGothamFeatureArea.updateArrowInfo();
_xGothamFeatureArea.tempDisableClick(this);
_xGothamFeatureArea.stopAutoAdvance();
_xGothamFeatureArea.checkLogo();
jQuery('img.hero_text').eq(1).css('display', 'block').delay(2000).fadeOut(3000);
}
});
jQuery('#right_arrow').data('disabled', false).click(function(){
if(jQuery(this).data('disabled') === false){
jQuery('img.hero_text').stop(true, true).hide();
_xGothamFeatureArea.getNextFeature();
_xGothamFeatureArea.updateArrowInfo();
_xGothamFeatureArea.tempDisableClick(this);
_xGothamFeatureArea.stopAutoAdvance();
_xGothamFeatureArea.checkLogo();
jQuery('img.hero_text').eq(2).css('display', 'block').delay(2000).fadeOut(3000);
}
});
},

checkLogo:function(){
return true;
},


setHovers:function(){
jQuery('#left_arrow').children('.button').hover(
function(){
$this = jQuery(this);
$this.data('ishover',true);
$this.css('background-image','url(/images/updated_ss/core/arrow-left-on.gif)');
$this.parent('.mf_arrow').addClass('more_zindex');
},
function(){
jQuery(this).data('ishover',false);
jQuery(this).css('background-image','url(/images/updated_ss/core/arrow-left-off.gif)');
jQuery(this).parent('.mf_arrow').removeClass('more_zindex');
}
);

jQuery('#right_arrow').children('.button').hover(
function(){
$this = jQuery(this);
$this.data('ishover',true);
$this.css('background-image','url(/images/updated_ss/core/arrow-right-on.gif)');
$this.parent('.mf_arrow').addClass('more_zindex');
},
function(){
jQuery(this).data('ishover',false);
jQuery(this).css('background-image','url(/images/updated_ss/core/arrow-right-off.gif)');
jQuery(this).parent('.mf_arrow').removeClass('more_zindex');
}
);
},


tempDisableClick:function(p_xElement){
jQuery(p_xElement).data('disabled', true);
setTimeout(function(){ jQuery(p_xElement).data('disabled', false); }, _xGothamFeatureArea._nAnimationTime+200);
}


}
