var jsAdjustFontSize_v2 = {
			init : function(cImageIDdown , cImageIDup , opts){
				this.currentResizeState = 0;
				this.maxIncrements = 4;
				this.ImageIDdown = cImageIDdown
				this.ImageIDup = cImageIDup
				this.TargetParentNode = getParentNodeByTagName(document.getElementById(this.ImageIDdown) , 'TD');
				this.onFontResize = (typeof opts['onFontResize'] != 'undefined' ? opts['onFontResize']  : null);
				this.targetChildNodes = new Array();
			},
			getTargetChildNodes : function(){						
				var arrElements = this.TargetParentNode.getElementsByTagName('*');
				var oElement;
				var arrReturnElements = new Array();
				for(var i=0; i<arrElements.length; i++){
					oElement = arrElements[i];
					if(oElement.className != ''){
						this.targetChildNodes.push(oElement);
					}
				}	
			},
			changeFontSize :  function(cDirection) {
				var cFontSize = '';
				var nDelta = (cDirection == '+' ? 1 : -1);
				this.isIncreasing = (nDelta > 0 ? true : false)
				if(this.currentResizeState != (this.isIncreasing ? this.maxIncrements : 0) && this.targetChildNodes.length > 0){
					for(var i=0;i<this.targetChildNodes.length ;i++){
						if(!this.targetChildNodes[i].className.match(/FeatureHeader|FontResizeModule/gi)){ 
							try{
								if(typeof getComputedStyle == 'undefined'){
									cFontSize = this.targetChildNodes[i].currentStyle.fontSize
								}else{
									cFontSize = getComputedStyle(this.targetChildNodes[i], '').getPropertyValue("font-size");
								}
								this.targetChildNodes[i].style.fontSize = (parseFloat(cFontSize) + nDelta) + cFontSize.replace(/\d|\./gi,'');
							}catch(e){}
						}
					}
					this.currentResizeState = this.currentResizeState + nDelta
					if(this.onFontResize != null){
						var obj = this;
						this.onFontResize(obj);
					}
					this.updateButtonState();
				}				
			},
			updateButtonState : function(){
				var oImageDown = document.getElementById(this.ImageIDdown);
				var oImageUp = document.getElementById(this.ImageIDup);
				if(this.currentResizeState >= 0 && this.currentResizeState != this.maxIncrements ){
					if(!this.isIncreasing && this.currentResizeState == 0){
						oImageDown.src = oImageDown.src.replace(/_transp\./ , '_light\.');
					}else{
						oImageDown.src = oImageDown.src.replace(/_light\./ , '_transp\.');
					}
					oImageUp.src = oImageUp.src.replace(/_light\./ , '_transp\.');
				}else if(this.currentResizeState == this.maxIncrements ){
					oImageUp.src = oImageUp.src.replace(/_transp\./ , '_light\.');
					oImageDown.src = oImageDown.src.replace(/_light\./ , '_transp\.');
				}
			}
		}
		
function initFontChange(){ //override legacy function and use it to support jsAdjustFontSize_v2 without requiring changes to templates.
	if(document.getElementById('MainNewLayout_Content')){
		jsAdjustFontSize_v2.TargetParentNode = document.getElementById('MainNewLayout_Content');
		jsAdjustFontSize_v2.onFontResize = resizePromoElements;
	}
	jsAdjustFontSize_v2.getTargetChildNodes();
}