var SiteThumbs = {
	init: function(){
                SiteThumbs.getThmbs();
                SiteThumbs.thumbStuff();
                  
	},

getThmbs:function(){

$$('a.thmbcontrol ').each(function(item) { // get all anchors inside the element 
	item.addEvent('click', function(e) { 
		new Event(e).stop(); // stop the browser event
		var url = this.getProperty('href'); // get the href 

	 new Ajax (url, { 
                        autoCancel: true,
			method: 'get',
                        update: $('thmbdiv'),
                        onRequest: 

                             function() {			   
                 $('thmbdiv').empty().setHTML("<div class='divloader'> <img src='http://www.zipcodezoo.com/gallery/css/img/loading.gif' alt='Loading' /> </div>");
                 
                 
			}, 

 onComplete: function () {
SiteThumbs.thumbStuff();
Site.zooStuff();

                        },

                        onFailure: function(){
                       

 $('thmbdiv').empty().setHTML("<div class='divloader'> Data Loading Failed. </div>");

                        },   
            
                evalScripts: true
		}).request();  
	}.bind(item)); 
});
},




thumbStuff:function(){


Nifty("div.phpthumb","bottom");
Nifty("h2","top");

}


};
window.addEvent('domready', SiteThumbs.init);
