$(document).ready(function() {
	
	var qString = window.location.toString();
	var qHash = window.location.hash.toString().substr(1);
	
	$("a.fancy").fancybox({
		'overlayOpacity' : '0.7',
		'transitionIn' : 'elastic',
		'transitionOut' : 'elastic',
		'padding' : 0,
		'type' : 'image',
		'cyclic' : true,
		'margin' : 100,
		'titlePosition' : 'over',
		'titleFormat' : function(title, currentArray, currentIndex, currentOpts) {
			return '<span id="fancybox-title-over">' + title + ' &nbsp;&nbsp;&nbsp;[ ' + (currentIndex + 1) + ' / ' + currentArray.length + ' ] - <a href="' + currentOpts.href + '" target="_blank">teljes méret</a></span>';
		}
	});
	
	$("a.fancyframe").fancybox({
		'width': '85%',
		'height': '85%',
		'overlayOpacity' : '0.7',
		'autoScale': false,
		'transitionIn' : 'none',
		'transitionOut' : 'none',
		'type': 'iframe'
	});
	
	$("a.fancy1024").fancybox({
		'width': 1024,
		'height': '85%',
		'overlayOpacity' : '0.7',
		'autoScale': false,
		'transitionIn' : 'none',
		'transitionOut' : 'none',
		'type': 'iframe'
	});

	if ($.browser.msie) {
		if ($.browser.version.substr(0,1)<"8") {
			$(function() {
				$('<div></div>').html('Az oldal helyes megjelenítéséhez az Internet Explorer legújabb verziójára van szükség! Kattintson ide, a böngésző frissítéséhez...').activebar({
					'path': 'includes/js/activebar/',
					'url': 'http://www.microsoft.com/hun/windows/internet-explorer/worldwide-sites.aspx'
				});
			});
		}
	}
	
	$("a[href^=programok\\#]").click(function(){
		if (window.location.href.indexOf('programok')>=0) {
			var hash = this.hash.substr(1);
			if ($("a[name="+hash+"]").length) {
				$.scrollTo( $("a[name="+hash+"]"), 600, {easing:'easeOut'} );
				return false;
			}
		}
	});
	
	$("a[href^=kep_es_video_letoltesek\\#]").click(function(){
		if (window.location.href.indexOf('kep_es_video_letoltesek')>=0) {
			var hash = this.hash.substr(1);
			if ($("a[name="+hash+"]").length) {
				$.scrollTo( $("a[name="+hash+"]"), 600, {easing:'easeOut'} );
				return false;
			}
		}
	});
	
	$("a[href^=kepiras\\#]").click(function(){
		if (window.location.href.indexOf('kepiras')>=0) {
			var hash = this.hash.substr(1);
			if ($("a[name="+hash+"]").length) {
				$.scrollTo( $("a[name="+hash+"]"), 600, {easing:'easeOut'} );
				return false;
			}
		}
	});
	
	$("a[href^=galeria\\#]").click(function(){
		if (window.location.href.indexOf('galeria')>=0) {
			var hash = this.hash.substr(1);
			if ($("a[name="+hash+"]").length) {
				$.scrollTo( $("a[name="+hash+"]"), 600, {easing:'easeOut'} );
				return false;
			}
		}
	});
	
	if (qHash.length) {
		if ($("a[name="+qHash+"]").length) {
			$.scrollTo( $("a[name="+qHash+"]"), 600, {easing:'easeOut'} );
		}
	}
	
	/*
	var flashvars = {};
	var params = {};
	var attributes = {};
	swfobject.embedSWF("", "flash", "550", "400", "10.1.0","static/js/swfobject/expressInstall.swf", flashvars, params, attributes);
	*/

});

$(window).unload(function () {
	
});
