
Element.implement({
	cmsEl:function(){
		return this.getParentOrSelf('.qgCmsCont');
	},
	cmsPid:function(){
		return this.cmsEl().get('class').replace(/.*cmspid_([0-9]+).*/, '$1');
	},
	cmsReload:function(vs, cb){
		var index = this.cmsEl().getElements( this.get('tag') ).indexOf(this);
		var my = this;
		$fn('page::get')(this.cmsPid(),vs).then( function(res){
			Elements.from(res.html)[0]
			.getElements( my.get('tag') )[index]
			.replaces(my);
			cb && cb();
		})
		return this;
	}
})
