


var updateUri = '<a href="http://www.adobe.com/go/getflashplayer" target="_blank" class="icon-sheet external">';

var monthNames = [];
monthNames.hu = ['', '. Január', '. Február', '. Március', '. Április', '. Május', '. Június', '. Július', '. Augusztus', '. Szeptember', '. Október', '. November', '. December'];
monthNames.sk = ['', '. Január', '. Február', '. Marec', '. Apríl', '. Máj', '. Jún', '. Júl', '. August', '. September', '. Október', '. November', '. December'];

var i18nGmapLocal = [];
i18nGmapLocal.hu = {'title' : 'Inám Község Önkormányzata', 'address' : 'Cím', 'get_directions' : 'Útvonal tervezése', 'to_here' : 'Ide', 'from_here' : 'Innen', 'back' : 'Vissza', 'go' : 'Menjen', 'start_address' : 'Indulási cím', 'end_address' : 'Érkezési cím'};
i18nGmapLocal.sk = {'title' : 'Obec Dolinka', 'address' : 'Adresa', 'get_directions' : 'Vyhľadať trasu', 'to_here' : 'Sem', 'from_here' : 'Odtiaľto', 'back' : 'Naspäť', 'go' : 'Spustiť', 'start_address' : 'Počiatočná adresa', 'end_address' : 'Cieľová adresa'};

String.prototype.i18nGmap = function () {
    var s;
    if (i18nGmapLocal && (s = i18nGmapLocal[js_lang][this])) {
      return s;
    }
    return this;
};


var i18nLocal = [];

i18nLocal.hu = {
'no_flash' : 'Az oldal helyes megjelenítéséhez szüksége lesz a '+updateUri+'Adobe Flash Player</a>-re.', 
'no_search_query' : 'Kérjük adjon meg egy keresési kifejezést!',
'lightbox_status' : '{y} képből a {x} kép', 
'lightbox_dlimage' : 'Kép letöltése', 
'please_wait' : 'Egy pillanat türelmet ...',
'please_wait_gmap' : 'Egy pillanat türelmet, a térkép töltődik ...', 
'error_gmap' : 'Nem sikerült csatlakozni a google map szolgáltatáshoz.',
'sectext_hear' : 'Meghallgatás',
'link_newwin' : 'Külső tartalomra mutató hivatkozás amely új ablakban fog megnyílni',
'evcal_noevents' : 'Ebben a hónapban nem volt esemény.',
'read_more' : 'Tovább olvasom',
'cp_readon' : 'Olvassa tovább:',
'flashbook_enterno' : 'Kérjük adjon meg egy számot.',
'flashbook_nolesspage' : 'A könyvet nem lehet ennyire vissza lapozni!',
'flashbook_nomorepage' : 'A könyvnek nincsen több oldala!',
'flashbook_samepage' : 'Jelenleg azon az oldalon van amelyre lapozni szeretett volna.',
'flashbook_nolpage' : 'A bal oldali lapot nem lehet nagyítani, lehet, hogy nem tartalmaz szöveget, képet vagy nem létezik.',
'flashbook_norpage' : 'A jobb oldali lapot nem lehet nagyítani, lehet, hogy nem tartalmaz szöveget, képet vagy nem létezik.',
'no_service' : 'A szolgáltatás pillanatnyilag szünetel!',
'service_isntavail' : 'A szolgáltatás nem érhető el!',
'nohqsupport' : 'Az Adobe Flash lejátszó egy régebbi verzióját használod, amely nem támogatja HQ minőségű videók lejátszását. '+updateUri+'Szerezzed be most</a>, nem tart tovább 1-2 percnél.'
};

i18nLocal.sk = {
'no_flash' : 'Pre zobrazenie našej stránky potrebujete '+updateUri+'Adobe Flash Player</a>-re.', 
'no_search_query' : 'Prosím zadajte hľadaný výraz a skúste to znovu.',
'lightbox_status' : '{x} obrázok s {y}', 
'lightbox_dlimage' : 'Stiahnuť fotografiu', 
'please_wait' : 'Prosím počkajte ...',
'please_wait_gmap' : 'Čakajte prosím, načítava sa mapa ...', 
'error_gmap' : '	Nedá sa pripojiť k službe Google Map.',
'sectext_hear' : 'Vypočuť',
'link_newwin' : 'Externý odkaz, otvorí sa v novom okne',
'evcal_noevents' : 'Žiadne udalosti v tomto mesiaci.',
'read_more' : 'Pokračovať v čítaní',
'cp_readon' : 'Čítajte ďalej:',
'flashbook_enterno' : 'Prosím, zadajte číslo.',
'flashbook_nolesspage' : 'Ste na prvej strane eBrožure!',
'flashbook_nomorepage' : 'eBrožúra nemá ďalšie strane!',
'flashbook_samepage' : 'Teraz nachádzate na tú stranu na ktorej si chceli navigovať.',
'flashbook_nolpage' : 'Nedá sa zväčšiť ľavej strane eBrožury, možno že táto strana nemá obsah alebo neexistuje.',
'flashbook_norpage' : 'Nedá sa zväčšiť pravej strane eBrožury, možno že táto strana nemá obsah alebo neexistuje.',
'no_service' : 'Služba je momentálne nedostupná!',
'service_isntavail' : 'A szolgáltatás nem érhető el!',
'nohqsupport' : 'Az Adobe Flash lejátszó egy régebbi verzióját használod, amely nem támogatja HQ minőségű videók lejátszását. '+updateUri+'Szerezzed be most</a>, nem tart tovább 1-2 percnél.'
};

String.prototype.i18n = function () {
    var s;
    if (i18nLocal && (s = i18nLocal[js_lang][this])) {
      return s;
    }
    return this;

};



// t: current time, b: begInnIng value, c: change In value, d: duration
jQuery.easing['jswing'] = jQuery.easing['swing'];

jQuery.extend( jQuery.easing,
{
	def: 'easeOutQuad',
	swing: function (x, t, b, c, d) {
		//alert(jQuery.easing.default);
		return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
	},
	easeInQuad: function (x, t, b, c, d) {
		return c*(t/=d)*t + b;
	},
	easeOutQuad: function (x, t, b, c, d) {
		return -c *(t/=d)*(t-2) + b;
	},
	easeInOutQuad: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t + b;
		return -c/2 * ((--t)*(t-2) - 1) + b;
	},
	easeInCubic: function (x, t, b, c, d) {
		return c*(t/=d)*t*t + b;
	},
	easeOutCubic: function (x, t, b, c, d) {
		return c*((t=t/d-1)*t*t + 1) + b;
	},
	easeInOutCubic: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t + b;
		return c/2*((t-=2)*t*t + 2) + b;
	},
	easeInQuart: function (x, t, b, c, d) {
		return c*(t/=d)*t*t*t + b;
	},
	easeOutQuart: function (x, t, b, c, d) {
		return -c * ((t=t/d-1)*t*t*t - 1) + b;
	},
	easeInOutQuart: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
		return -c/2 * ((t-=2)*t*t*t - 2) + b;
	},
	easeInQuint: function (x, t, b, c, d) {
		return c*(t/=d)*t*t*t*t + b;
	},
	easeOutQuint: function (x, t, b, c, d) {
		return c*((t=t/d-1)*t*t*t*t + 1) + b;
	},
	easeInOutQuint: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
		return c/2*((t-=2)*t*t*t*t + 2) + b;
	},
	easeInSine: function (x, t, b, c, d) {
		return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
	},
	easeOutSine: function (x, t, b, c, d) {
		return c * Math.sin(t/d * (Math.PI/2)) + b;
	},
	easeInOutSine: function (x, t, b, c, d) {
		return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
	},
	easeInExpo: function (x, t, b, c, d) {
		return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
	},
	easeOutExpo: function (x, t, b, c, d) {
		return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
	},
	easeInOutExpo: function (x, t, b, c, d) {
		if (t==0) return b;
		if (t==d) return b+c;
		if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
		return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
	},
	easeInCirc: function (x, t, b, c, d) {
		return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
	},
	easeOutCirc: function (x, t, b, c, d) {
		return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
	},
	easeInOutCirc: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
		return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
	},
	easeInElastic: function (x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
		if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
	},
	easeOutElastic: function (x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
		if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
	},
	easeInOutElastic: function (x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
		if (t==0) return b;  if ((t/=d/2)==2) return b+c;  if (!p) p=d*(.3*1.5);
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
		return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
	},
	easeInBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158;
		return c*(t/=d)*t*((s+1)*t - s) + b;
	},
	easeOutBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158;
		return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
	},
	easeInOutBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158; 
		if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
		return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
	},
	easeInBounce: function (x, t, b, c, d) {
		return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
	},
	easeOutBounce: function (x, t, b, c, d) {
		if ((t/=d) < (1/2.75)) {
			return c*(7.5625*t*t) + b;
		} else if (t < (2/2.75)) {
			return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
		} else if (t < (2.5/2.75)) {
			return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
		} else {
			return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
		}
	},
	easeInOutBounce: function (x, t, b, c, d) {
		if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
		return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
	}
});


(function($){$.prompt=function(message,options){options=$.extend({},$.prompt.defaults,options);$.prompt.currentPrefix=options.prefix;var ie6=($.browser.msie&&$.browser.version<7);var $body=$(document.body);var $window=$(window);var msgbox='<div class="'+options.prefix+'box" id="'+options.prefix+'box">';if(options.useiframe&&(($('object, applet').length>0)||ie6)){msgbox+='<iframe src="javascript:false;" style="display:block;position:absolute;z-index:-1;" class="'+options.prefix+'fade" id="'+options.prefix+'fade"></iframe>';}else{if(ie6){$('select').css('visibility','hidden');}msgbox+='<div class="'+options.prefix+'fade" id="'+options.prefix+'fade"></div>';}msgbox+='<div class="'+options.prefix+'" id="'+options.prefix+'"><div class="'+options.prefix+'container"><div class="';msgbox+=options.prefix+'close">X</div><div id="'+options.prefix+'states"></div>';msgbox+='</div></div></div>';var $jqib=$(msgbox).appendTo($body);var $jqi=$jqib.children('#'+options.prefix);var $jqif=$jqib.children('#'+options.prefix+'fade');if(message.constructor==String){message={state0:{html:message,buttons:options.buttons,focus:options.focus,submit:options.submit}};}var states="";$.each(message,function(statename,stateobj){stateobj=$.extend({},$.prompt.defaults.state,stateobj);message[statename]=stateobj;states+='<div id="'+options.prefix+'_state_'+statename+'" class="'+options.prefix+'_state" style="display:none;"><div class="'+options.prefix+'message">'+stateobj.html+'</div><div class="'+options.prefix+'buttons">';$.each(stateobj.buttons,function(k,v){states+='<button name="'+options.prefix+'_'+statename+'_button'+k+'" id="'+options.prefix+'_'+statename+'_button'+k+'" value="'+v+'">'+k+'</button>';});states+='</div></div>';});$jqi.find('#'+options.prefix+'states').html(states).children('.'+options.prefix+'_state:first').css('display','block');$jqi.find('.'+options.prefix+'buttons:empty').css('display','none');$.each(message,function(statename,stateobj){var $state=$jqi.find('#'+options.prefix+'_state_'+statename);$state.children('.'+options.prefix+'buttons').children('button').click(function(){var msg=$state.children('.'+options.prefix+'message');var clicked=stateobj.buttons[$(this).text()];var forminputs={};$.each($jqi.find('#'+options.prefix+'states :input').serializeArray(),function(i,obj){if(forminputs[obj.name]===undefined){forminputs[obj.name]=obj.value;}else if(typeof forminputs[obj.name]==Array){forminputs[obj.name].push(obj.value);}else{forminputs[obj.name]=[forminputs[obj.name],obj.value];}});var close=stateobj.submit(clicked,msg,forminputs);if(close===undefined||close){removePrompt(true,clicked,msg,forminputs);}});$state.find('.'+options.prefix+'buttons button:eq('+stateobj.focus+')').addClass(options.prefix+'defaultbutton');});var ie6scroll=function(){$jqib.css({top:$window.scrollTop()});};var fadeClicked=function(){if(options.persistent){var i=0;$jqib.addClass(options.prefix+'warning');var intervalid=setInterval(function(){$jqib.toggleClass(options.prefix+'warning');if(i++>1){clearInterval(intervalid);$jqib.removeClass(options.prefix+'warning');}},100);}else{removePrompt();}};var keyPressEventHandler=function(e){var key=(window.event)?event.keyCode:e.keyCode;if(key==27){removePrompt();}if(key==9){var $inputels=$(':input:enabled:visible',$jqib);var fwd=!e.shiftKey&&e.target==$inputels[$inputels.length-1];var back=e.shiftKey&&e.target==$inputels[0];if(fwd||back){setTimeout(function(){if(!$inputels)return;var el=$inputels[back===true?$inputels.length-1:0];if(el)el.focus();},10);return false;}}};var positionPrompt=function(){$jqib.css({position:(ie6)?"absolute":"fixed",height:$window.height(),width:"100%",top:(ie6)?$window.scrollTop():0,left:0,right:0,bottom:0});$jqif.css({position:"absolute",height:$window.height(),width:"100%",top:0,left:0,right:0,bottom:0});$jqi.css({position:"absolute",top:options.top,left:"50%",marginLeft:(($jqi.outerWidth()/2)*-1)});};var stylePrompt=function(){$jqif.css({zIndex:options.zIndex,display:"none",opacity:options.opacity});$jqi.css({zIndex:options.zIndex+1,display:"none"});$jqib.css({zIndex:options.zIndex});};var removePrompt=function(callCallback,clicked,msg,formvals){$jqi.remove();if(ie6){$body.unbind('scroll',ie6scroll);}$window.unbind('resize',positionPrompt);$jqif.fadeOut(options.overlayspeed,function(){$jqif.unbind('click',fadeClicked);$jqif.remove();if(callCallback){options.callback(clicked,msg,formvals);}$jqib.unbind('keypress',keyPressEventHandler);$jqib.remove();if(ie6&&!options.useiframe){$('select').css('visibility','visible');}});};positionPrompt();stylePrompt();if(ie6){$window.scroll(ie6scroll);}$jqif.click(fadeClicked);$window.resize(positionPrompt);$jqib.bind("keydown keypress",keyPressEventHandler);$jqi.find('.'+options.prefix+'close').click(removePrompt);$jqif.fadeIn(options.overlayspeed);$jqi[options.show](options.promptspeed,options.loaded);$jqi.find('#'+options.prefix+'states .'+options.prefix+'_state:first .'+options.prefix+'defaultbutton').focus();if(options.timeout>0)setTimeout($.prompt.close,options.timeout);return $jqib;};$.prompt.defaults={prefix:'jqi',buttons:{Ok:true},loaded:function(){},submit:function(){return true;},callback:function(){},opacity:0.6,zIndex:999,overlayspeed:'slow',promptspeed:'fast',show:'fadeIn',focus:0,useiframe:false,top:"15%",persistent:true,timeout:0,state:{html:'',buttons:{Ok:true},focus:0,submit:function(){return true;}}};$.prompt.currentPrefix=$.prompt.defaults.prefix;$.prompt.setDefaults=function(o){$.prompt.defaults=$.extend({},$.prompt.defaults,o);};$.prompt.setStateDefaults=function(o){$.prompt.defaults.state=$.extend({},$.prompt.defaults.state,o);};$.prompt.getStateContent=function(state){return $('#'+$.prompt.currentPrefix+'_state_'+state);};$.prompt.getCurrentState=function(){return $('.'+$.prompt.currentPrefix+'_state:visible');};$.prompt.getCurrentStateName=function(){var stateid=$.prompt.getCurrentState().attr('id');return stateid.replace($.prompt.currentPrefix+'_state_','');};$.prompt.goToState=function(state){$('.'+$.prompt.currentPrefix+'_state').slideUp('slow');$('#'+$.prompt.currentPrefix+'_state_'+state).slideDown('slow',function(){$(this).find('.'+$.prompt.currentPrefix+'defaultbutton').focus();});};$.prompt.nextState=function(){var $next=$('.'+$.prompt.currentPrefix+'_state:visible').next();$('.'+$.prompt.currentPrefix+'_state').slideUp('slow');$next.slideDown('slow',function(){$next.find('.'+$.prompt.currentPrefix+'defaultbutton').focus();});};$.prompt.prevState=function(){var $next=$('.'+$.prompt.currentPrefix+'_state:visible').prev();$('.'+$.prompt.currentPrefix+'_state').slideUp('slow');$next.slideDown('slow',function(){$next.find('.'+$.prompt.currentPrefix+'defaultbutton').focus();});};$.prompt.close=function(){$('#'+$.prompt.currentPrefix+'box').fadeOut('fast',function(){$(this).remove();});};})(jQuery);




jQuery.fn.flashBookify = function (flashvars) {
  $(this).find('span.no-script').css('display', 'none');

  swfobject.switchOffAutoHideShow();

  var def_flashvars = {};
  var flashvars = $.extend(def_flashvars, flashvars);

  var params = {menu: "false", wmode: "opaque", "allowScriptAccess": "sameDomain", "bgcolor": "#EEE1C6"};
  var attributes = {};

  swfobject.embedSWF("/vector-images/brochure.swf", $(this).attr("id"), 774, 554, "9.0.115","/vector-images/expressInstall.swf", flashvars, params, attributes);

  ebrochure = new flipBook(); 

$('#next a').click( function () { 
  ebrochure.nextPage();
  return false;
});
$('#previous a').click( function () { 
  ebrochure.prevPage();
  return false; 
});

$('#page-no').keyup( function () { 
  this.value = this.value.replace(/^0{0}[^1-9]/g,''); 
});

  $('#page-control').bind("keypress", function(e) { if (e.which == 13) { ebrochure.gotoPageForm(); return false; } });
  $('#page-control').bind("submit", function() { ebrochure.gotoPageForm(); return false; });

$('#first-page a').click( function () { 
  ebrochure.gotoFirstPage();
  return false;
});
$('#last-page a').click( function () { 
  ebrochure.gotoLastPage();
  return false; 
});

$('#zoom-left a').click( function () { 
  ebrochure.zoomPage('left');
  return false;
});
$('#zoom-right a').click( function () {
  ebrochure.zoomPage('right'); 
  return false; 
});

  return $(this);
};

function gotoPageLink(obj, p) {
  $('li#page-leaflets ul li').removeClass('selected');
  $('li#page-leaflets ul li.'+obj).addClass('selected');
  ebrochure.gotoPageLink(p);
}


  var ebrochure;
  var xdata = '';
  var totalPages = 0;
  var leftPageNumber = 0;
  var leftPageName = '';
  var rightPageNumber = 0;
  var rightPageName = '';

function flipBook(){

	this.ebrochure = document['ebrochure'];

	this.nextPage = function () {
		this.ebrochure.nextPage();		
	}
	
	this.prevPage = function () {
		this.ebrochure.prevPage();		
	}

	this.gotoFirstPage = function () {
		this.ebrochure.gotoFront();		
	}
	
	this.gotoLastPage = function () {
		this.ebrochure.gotoBack();			
	}

	this.gotoPageLink = function (p) {
    this.ebrochure.gotoPage(p);
	}

  this.buildPageNav = function () {
    var startPage = 2;
    var endPage = totalPages;
    output = '';

    for(var i=startPage; i < endPage; i+=2){
      output += '<li class="page-'+i+'"><a href="#" onclick="gotoPageLink(\'page-'+i+'\', '+i+'); return false;">'+i+'-'+(i+1)+'</a></li>';
    }

    $('li#page-leaflets').html( '<ul>' + output + '</ul>' );
  }

	this.gotoPageForm = function () {
	  var curPage = leftPageNumber;
    var op = parseInt( $('#page-no').val() );
    if ( curPage == undefined ) curPage = 0;
    var p = (op - 1);
    if (isNaN(p)) {
      $.prompt('flashbook_enterno'.i18n(), {persistent: false, callback: function () { $('#page-no').val(1); $('#page-no').focus(); } });
    } else {
      
      if ( op <= 0 ) {
        $.prompt('flashbook_nolesspage'.i18n(), {persistent: false, callback: function () { $('#page-no').val(1); $('#page-no').focus(); } });
      } else if ( op > totalPages ) {
        $.prompt('flashbook_nomorepage'.i18n(), {persistent: false, callback: function () { $('#page-no').val(totalPages); $('#page-no').focus(); } });
      } else if ( op == (curPage+1) || op-1 == (curPage+1) ) {
        $.prompt('flashbook_samepage'.i18n(), {persistent: false, callback: function () { $('#page-no').focus(); } });
      } else {
        this.ebrochure.gotoPage(p);
      }
      //1-es az első oldal a borito
    }
	}

	this.updateStatus = function (m){		
		var r = eval('(' + m + ')');
		totalPages = r.totalPages;
		xdata = r.xdata;
		this.buildPageNav();
	}

	this.updatePageInfo = function (m){		
	  //alert(m);
		var r = eval('(' + m + ')');
		var p = 1;
		leftPageNumber = r.leftPageNumber;
		leftPageName = (r.leftPageName !== undefined) ? r.leftPageName : '';
		rightPageNumber = r.rightPageNumber;
		rightPageName = (r.rightPageName !== undefined) ? r.rightPageName : '';
		if ( !isNaN(leftPageNumber) ) p = (leftPageNumber+1);
		else p = 1;
    $('#page-no').val(p);
    $('li#page-leaflets ul li').removeClass('selected');
    $('li#page-leaflets ul li.page-'+p).addClass('selected');

		if(isNaN(leftPageNumber)){ leftPageName = ''; }
		if(isNaN(rightPageNumber)){ rightPageName = ''; }

	}

	this.zoomPage = function (d){
    if (d == 'left') {	
		  if(leftPageName !== '') this.openZoomPage(leftPageName);
		  else $.prompt( 'flashbook_nolpage'.i18n(), {persistent: false} );
		} else if (d == 'right') {
		  if(rightPageName !== '') this.openZoomPage(rightPageName);
		  else $.prompt( 'flashbook_norpage'.i18n(), {persistent: false} );
		}
	}
	
	this.openZoomPage = function(id){	
    window.open("http://media.dolinka.org/bre/"+xdata+"/zoom/"+id+".jpg", "ebrochure-print");
	}

}

$(document).ready(function() {
  $('a[rel*=external]')
      .attr({ target: "_blank", title: 'link_newwin'.i18n() })
      .not(':has(img)').addClass("icon-sheet external");
  $("#site-statistic").prepend("<a href=\"http://www.toplist.sk/stat/1022061\" target=\"_blank\"><img src=\"http://toplist.sk/count.asp?id=1022061&amp;logo=mc&amp;start=226&amp;http="+escape(document.referrer)+"&amp;wi="+escape(window.screen.width)+"&amp;he="+escape(window.screen.height)+"&amp;cd="+escape(window.screen.colorDepth)+"&amp;t="+document.title+"\" width=\"88\" height=\"60\" alt=\"TOPlist\" /></a>");
});
