/* ***********************************************************************
* Plugins initialization
*/
function initColorbox(){
		$("a[rel='simple']").colorbox();
		$("a[rel='gallery']").colorbox({slideshow:true});
		$("a[rel='gallery-promo']").colorbox({slideshow:true});
		$("div.gallery a").colorbox({slideshow:true});
		$("div.content-promocion a img").each(function(){
			var imgItem = $(this);
			imgItem.parent('a').colorbox();
		});	
}

function initGalSimple(){
	if (jQuery(".block-gal-slider").length) {
		$(".controls-gal-slider a").each(function(){
			var item = $(this);
			item.click(function () { 
				var selected = $(this).html();
				// active controls
				$(".controls-gal-slider a").removeClass('active');
				$(this).addClass('active');
				// active content
				$(".block-gal-slider li").removeClass('active');
				$(".block-gal-slider li[rel='item-"+selected+"'] ").addClass('active');
				return false;
		    });
		});
	}
}
 



/* ***********************************************************************
* Event handlers
*/

function domloader() {
	initColorbox();
	initGalSimple();
}

function windowloader() {
	 //initIstant();
	 //initTableSorter();
}

/** Event resize**/
function windowOnResize() {
    //InitNewsslider();
};





/* ***********************************************************************
* Secondary functions
*/


/* ***********************************************************************
* Event controllers
*/




$(document).ready(function(){
	 domloader();    
});

$(window).ready(function(){
	 windowloader();
	 windowOnResize();
});









