function setDynamicSpacerHeight()
{
	var size = window.getSize();
	var dynSpacerHeight = size.y - 885;
	try
	{
	
    	dynamicFooterSpacer = $('dynamicFooterSpacer');
	    if(dynamicFooterSpacer)
	    {
	        dynamicFooterSpacer.set('height', dynSpacerHeight);
	    }
	}
	catch(l_ex)
	{
	}
}

var scj = {};
scj.windowGrid = new Class({
	Implements : [Options, Events],
	options: {
		snapToGrid: false,
		animate: true,
		/*dependId: 'footer',*/
		smallSizeClass: 'smallwindow',
		normalSizeClass: 'normalwindow',
		largeSizeClass: 'largewindow',
		minWidth: 1003,
		maxWidth: 1280
	},
	presets : {
		CONTAINER_ID: 'wrapper'
	},
	initialize: function (options) {
		this.setOptions(options);
		this.resizeNode = $(this.presets.CONTAINER_ID);
		if (this.options.dependId) {
			this.dependNode = $(this.options.dependId);
			this.dependFX = new Fx.Morph(this.dependNode, {duration: 500});
		}
		this.widthFX = new Fx.Morph(this.resizeNode, {duration: 500});
		if (this.options.snapToGrid) this.sizeTimer = this.setWindowSize.periodical(150, this);
	},
	setWindowSize: function () {
		if (window.getSize().x < this.options.maxWidth) {
			if (this.options.animate && this.resizeNode.getSize().x !== this.options.minWidth){
				this.widthFX.start({'width': this.options.minWidth});
				if (this.dependNode) this.dependFX.start({'width': this.options.minWidth});
			}
			this.resizeNode.addClass(this.options.normalSizeClass);
		} else {
			if (this.options.animate && this.resizeNode.getSize().x !== this.options.maxWidth){
				this.widthFX.start({'width': this.options.maxWidth});
				if (this.dependNode) this.dependFX.start({'width': this.options.maxWidth});
			}
			this.resizeNode.addClass(this.options.largeSizeClass);
		}
	}
});

scj.omniture = {
	cleartracking: function() {
		s = s_gi(s_account);
	    s.events='';
    	s.products='';
    	s.pageName='';
	    s.linkTrackVars = '';
	    s.linkTrackEvents = '';
	    for (i=1; i<51; i++) {
		    s['prop' + i.toString()] = '';
		    s['eVar' + i.toString()] = '';
	    }    	    
	    return true;
	},
	track: function(obj) {
		scj.omniture.cleartracking();
		var obj = obj ? obj : {};
		for (key in obj) {
			s[key] = obj[key];
		}
		var s_code=s.t();if(s_code)document.write(s_code);
	},
	trackLink: function(obj) {
		//obj.linkType = o|d|e; 
		scj.omniture.cleartracking();
		for (key in obj) {
			s[key] = obj[key];
	        s.linkTrackVars += key + ',';
	    }
		if (obj.events) s.linkTrackEvents = obj.events;
		s.tl(this, obj.linkType, obj.linkName); //linkType && linkName (required and case sensitive)
 	}
};

window.addEvent('domready', function() {
	scj.gridManager = new scj.windowGrid();
	setDynamicSpacerHeight();
});

window.addEvent('resize', setDynamicSpacerHeight);

function update_tracking(obj) {

	var obj = obj ? obj : {};

	for (key in obj) {
		s[key] = obj[key];
	}
	
	var s_code=s.t();if(s_code)document.write(s_code);
	clear_tracking();
}

function clear_tracking() {
	s.events='';
	s.products='';

	for (i=1; i<30; i++) {
		s['prop' + i.toString()] = '';
	}

	for (i=1; i<30; i++) {
		s['eVar' + i.toString()] = '';
	}

}