/**
 * A Siten használt automatikus lefuto functionok
 *
 * @package    mvo
 * @subpackage site
 * @author     Szijártó Tamás ( szicsu ) <szicsu@jquery.hu>
 * @version    SVN: $Id: $
 */


/**
 * activeMenu

Site.Init.menuActive = function(){
	
	$("ul#header_menu li a[href='"+ /^(\/(.*)\.php)?\/([^\/]*)+/.exec( location.pathname )[0] +"']").attr('id', 'hm_active');
} 
  */
/**
 * 
 */
Site.Init.customInit = function(){
	//print init
	$('.jsPrintPage').bind('click',function(){
		window.print();
		return false;
	});
	
	//
	mediaManager.run();
}

/**
 * jsConfirm confirm
 */
Site.Init.confirm = function(){
	
	$('a.jsConfirm').bind('click.confirm', function(){
		
		dialogManager.open({
			title: __('Confirm'),
			text:  Site.Style.getTemplate( {text:$(this).attr('rel'), buttonCLOSE: __('Close'), buttonOK: __('OK')}, 'confirm')
		})
		.find('.confirmOk').attr('href', $(this).attr('href') );
		return false;
	});
	
	$('.jsWindow').bind('click.window', function(){
		
		var obj = $(this);
		
		dialogManager.open({
			title: obj.attr('title'),
			height: 300,
			text: $('#'+obj.attr('rel') ).html()
		});
		
		return false;
	});

}


/**
 *
Site.Init.pagedBoxInit = function(){
	
	$('.jsPagedBox').each( function(){
		
		(function( containerObj ){
			
			containerObj
				.find('.jsPagedLink').bind('click',function(){
					
					$('.jsPagedContent:visible', containerObj ).hide();
					$( $(this).attr('rel') ).show();
					$('.jsPagedLink', containerObj).removeClass('active')
					$(this)
						.addClass('active').trigger('blur');
					return false;
				}).end()
				.find('.jsPagedNextLink').bind('click', function(){
					
					$('.jsPagedLink.active', containerObj ).nextAll('.jsPagedLink').eq(0).trigger('click');
					$(this).trigger('blur');
					
					return false;
					
				}).end()
				.find('.jsPagedPrevLink').bind('click', function(){
					
					$('.jsPagedLink.active', containerObj ).prevAll('.jsPagedLink').eq(0).trigger('click');
					$(this).trigger('blur');
					return false;
					
				}).end()
				.find('.jsPagedLink:eq('+ getRandomPos( containerObj ) +')', containerObj )
					.trigger('click').end()
				
				.bind('autoRotation', function(){
					
					var nextIndex = $('.jsPagedLink', containerObj ).index( $('.jsPagedLink.active', containerObj )[0] ) + 1;
					
					if( nextIndex >= $('.jsPagedLink', containerObj ).size()   ){
						nextIndex = 0;
					}
					
					$('.jsPagedLink', containerObj ).eq( nextIndex ).trigger('click');
				});
				
				window.setInterval( function(){
						containerObj.trigger('autoRotation');
					}, 5000);

				
				function getRandomPos( containerObj ){
					return Math.round( ( $('.jsPagedLink', containerObj ).size() - 1 ) * Math.random() );
				}
				
		})($(this));
	});

}
 */



