// (c) 2009 Experian.com - Author: Brian Kueck http://www.briankueck.com

$(document).ready(function(){try{jQuery.dynamicBackgroundBoxesIsAnimating=false;$('.showContent').hide();$('.noMarker').contents('.icon').css('backgroundPosition','0px 0px');if(!jQuery.dynamicBackgroundBoxesMaxWidth){jQuery.dynamicBackgroundBoxesMaxWidth='440px';}
if(!jQuery.dynamicBackgroundBoxesMinWidth){jQuery.dynamicBackgroundBoxesMinWidth='440px';}
if(!jQuery.noSpotlights){jQuery.noSpotlights=false;}
$('.dynamicLearnMore').click(function(e){var evtClick=(e&&e.detail)?e.detail:window.event;if((evtClick==1)||(evtClick.button==0)){toggleBox($(this),'toggle','toggle',0);}});$('.noMarker').contents('.icon').click(function(e){var evtClick=(e&&e.detail)?e.detail:window.event;if((evtClick==1)||(evtClick.button==0)){toggleBox($(this),'toggle','toggle',0);}});$('.dynamicClose').click(function(e){var evtClick=(e&&e.detail)?e.detail:window.event;if((evtClick==1)||(evtClick.button==0)){toggleBox($(this),'toggle','toggle',1);}});}catch(e){}finally{}});function toggleBox(objTag,strAction,strSpeed,strIconClicked){try{objTag=objTag.parents('.noMarker');if(jQuery.dynamicBackgroundBoxesIsAnimating==false){jQuery.dynamicBackgroundBoxesIsAnimating=true;var strOpen='|none|expand|expandAll|';var strClose='|block|collapse|collapseAll|';strAction=(strAction=='toggle')?objTag.contents('.showContent').css('display'):strAction;if(strSpeed=='toggle'){strSpeed=(strClose.indexOf('|'+strAction+'|')>-1)?'normal':(strOpen.indexOf('|'+strAction+'|')>-1)?'slow':strSpeed;}
switch(strAction){case'none':case'expand':objTag.contents('.showContent').slideDown(strSpeed,resizeAllBoxes);objTag.contents('.icon').css('backgroundPosition','-5px 0px');if(navigator.userAgent.indexOf('MSIE 6.0')>-1){objTag.contents('.rightBorder').css('margin-top','-10px');}
break;case'block':case'collapse':resizeAllBoxes('close',objTag,strIconClicked);objTag.contents('.showContent').slideUp(strSpeed,cancelIsAnimating);objTag.contents('.icon').css('backgroundPosition','0px 0px');break;}}}catch(e){}finally{}}
function resizeAllBoxes(strAction,objTag,strIconClicked){try{var intAnimatedDivs=0;var intLastOpenBoxTopCoords=0;var objSpotlightBottomSliver=$('.spotlightBottom').offset();var strDebug='';if(objSpotlightBottomSliver){var arrayFAQs=$('.noMarker');for(var i=0,j=arrayFAQs.length;i<j;i++){if($(arrayFAQs[i]).contents('.showContent').css('display')==='block'){intLastOpenBoxTopCoords=$(arrayFAQs[i]).offset().top;switch(strAction){case'close':var intLastBox=$(arrayFAQs[i]).prev().contents('.showContent').offset().top-$(document).scrollTop();intLastBox=(intLastBox>=0)?intLastBox:0;if(intLastBox>objSpotlightBottomSliver.top){$(arrayFAQs[i]).contents('.showContent').css('width',jQuery.dynamicBackgroundBoxesMaxWidth);strDebug+='a';}else if(objTag.offset().top>=objSpotlightBottomSliver.top){strDebug+='b';}else if($(arrayFAQs[i]).contents('.showContent').offset().top<=objSpotlightBottomSliver.top){$(arrayFAQs[i]).contents('.showContent').animate({width:jQuery.dynamicBackgroundBoxesMinWidth},'normal');strDebug+='c';}else if((intAnimatedDivs==0)&&(intLastOpenBoxTopCoords>=objSpotlightBottomSliver.top)){$(arrayFAQs[i]).contents('.showContent').animate({width:jQuery.dynamicBackgroundBoxesMinWidth},'normal');intAnimatedDivs++;strDebug+='d';}else{strDebug+='e';}
break;default:if($(arrayFAQs[i]).offset().top>objSpotlightBottomSliver.top){$(arrayFAQs[i]).contents('.showContent').animate({width:jQuery.dynamicBackgroundBoxesMaxWidth},'fast');strDebug+='f';}else{$(arrayFAQs[i]).contents('.showContent').css('width',jQuery.dynamicBackgroundBoxesMinWidth);strDebug+='g';}
break;}}else{if(jQuery.noSpotlights&&$(arrayFAQs[i]).offset().top>objSpotlightBottomSliver.top){$(arrayFAQs[i]).contents('.showContent').css('width',jQuery.dynamicBackgroundBoxesMaxWidth);strDebug+='h';}else{$(arrayFAQs[i]).contents('.showContent').css('width',jQuery.dynamicBackgroundBoxesMinWidth);strDebug+='i';}}}
var objTraceDiv=document.getElementById('traceDiv');if(objTraceDiv){objTraceDiv.innerHTML+=strDebug+'<BR>';}
if(strAction!='close'){cancelIsAnimating();}}}catch(e){}finally{}}
function cancelIsAnimating(){try{jQuery.dynamicBackgroundBoxesIsAnimating=false;}catch(e){}finally{}}