var BgStrech = JAK.ClassMaker.makeClass({
	NAME:"BgStrech",
	VERSION:"1.0"
});

BgStrech.prototype.$constructor = function(nodeId,mainNodeId){
	this._nodeId = nodeId;
	this._mainNodeId = mainNodeId;
	this._ec = [];
	this._ec.push(JAK.Events.addListener(window,"load",this,"_do"));
	this._ec.push(JAK.Events.addListener(window,"resize",this,"_do"));
	this._ec.push(JAK.Events.addListener(window,"unload",this,"$destructor"));
};

BgStrech.prototype.$destructor = function() {
	JAK.Events.removeListeners(this._ec);
};

BgStrech.prototype._do = function() {
	var node = JAK.gel(this._nodeId);
	var h = JAK.gel(this._mainNodeId).offsetHeight;
	node.style.height = h + "px";
	JAK.gel("page").style.minHeight = h + "px";
};
var nBgS = new BgStrech("bgHelper","main");

