// ----------------------------------------------------------------------------
// DOM READY
// ----------------------------------------------------------------------------

$(document).ready(function() {

	// BIND EVENTS FOR CLICKABLE ITEMS
	/*$('.clickable').bind('click', function() {
		var url = $(this).find('a[href]:first').attr('href');
		if(url) {
			window.location.href = url;
		}
	});*/

	// BIND EVENTS FOR FORMS
	$('.formline, .formarea, .formselect').bind('focus blur', function() {
		$(this).toggleClass('focus');
	});
	$('.formbut').bind('mouseenter mouseleave', function() {
		$(this).toggleClass('hover');
	});

	// COLORBOX
	if($('a.articlethumb').length>0) {

		// LOAD PLUGIN FOR FULLSCREEN / COLORBOX GALLERY
		$.getScript(jquery_coreurl+'/include/jquery/getcss.latest.js', function() {

			$.getCSS(jquery_siteurl+'/css/colorbox.css', function () {

				$.getScript(jquery_coreurl+'/include/jquery/colorbox.latest.js', function() {

					$('a.articlethumb').colorbox({
						initialWidth: 40,
						initialHeight: 40,
						speed: 400,
						overlayClose: true,
						opacity: 0.85
					});

				});

			});

		});

	}


	// ------------------------------------------------------------------------
	// LOAD EXTERNAL SCRIPTS / PLUGINS
	// ------------------------------------------------------------------------

	/*$.getScript(jquery_coreurl+'/include/jquery/ui.latest.js', function() {

		// CUSTOM CODE

	});*/


	// ------------------------------------------------------------------------
	// ONLOAD / LOAD COMPLETE
	// ------------------------------------------------------------------------

	/*$(window).load(function() {

		// CUSTOM CODE

	});*/

});


// ----------------------------------------------------------------------------
// CUSTOM FUNCTIONS | CALLED BEFORE DOM READY FROM INSIDE TEMPLATE
// ----------------------------------------------------------------------------

/*function jquery_include_submenu() {

	// REMOVE EMPTY SUBMENU
	$('#tpl_submenu ul:empty').each(function() {
		$('#tpl_submenu').remove();
		$('#tpl_content').attr('id', 'tpl_content_wide');
	});

}*/
