Teaser = function(){
//private vars
var defaults={
				  path:'/teaser/',
				  imagePath:"images/",
				  templatePath:"template/"
			     }
	
_init = function(){
	this.teaser=new Array();
	var _this = this;

	//reads the json file
	readJson = function(val){
			for(i in val.teaser){
							o=val.teaser[i];
							o.img=defaults.path+defaults.imagePath+o.img;
							_this.teaser.push(o)
					 	}
			//get the template
			var _templateTeaser=new TemplateReader();
				_templateTeaser.read(defaults.path+defaults.templatePath+"teaser.html","#teaserContainer");
	
			//update template with values
			chainParams={'.teaserLink':{href: "{url}"}};
			_templateTeaser.update(_this.teaser,"#teaserContainer", chainParams);
			
					}
					jQuery.ajax({
					url: '/teaser/json/teaser.json',
					dataType: 'json',
					success: readJson,
					async:false
					});
		}
// initialize the object, creates image and url from json	
_init();		
		
  }