/*Radiobuttons, checkbox, and select styled*/var Globals = {initialize: function() {esemenyek();Custom.init();}}var checkboxHeight = "25";var radioHeight = "14";var selectWidth = "190";document.write('<style type="text/css">input.styled { display: none; } select.styled { position: relative; width: ' + selectWidth + 'px; opacity: 0; filter: alpha(opacity=0); z-index: 5; }</style>');var Custom = {init: function() {var inputs = document.getElementsByTagName("input"), span = Array(), textnode, option, active;for(a = 0; a < inputs.length; a++) {if((inputs[a].type == "checkbox" || inputs[a].type == "radio") && inputs[a].className == "styled") {span[a] = document.createElement("span");span[a].className = inputs[a].type;if(inputs[a].checked == true) {if(inputs[a].type == "checkbox") {position = "0 -" + (checkboxHeight*2) + "px";span[a].style.backgroundPosition = position;} else {position = "0 -" + (radioHeight*2) + "px";span[a].style.backgroundPosition = position;}}inputs[a].parentNode.insertBefore(span[a], inputs[a]);inputs[a].onchange = Custom.clear;//span[a].onmousedown = Custom.pushed;//span[a].onmouseup = Custom.check;document.onmouseup = Custom.clear;// hogyha az adott parent -re kattintunk akkor is kattintsa mar be a gombotjQuery(inputs[a]).parent().click(function() {var actInput = jQuery(this).find("input").get(0);var actSpan = jQuery(this).find("span").get(0);Custom.pushed(actInput, actSpan);Custom.check(actInput, actSpan);});}}inputs = document.getElementsByTagName("select");for(a = 0; a < inputs.length; a++) {if(inputs[a].className == "styled") {option = inputs[a].getElementsByTagName("option");active = option[0].childNodes[0].nodeValue;textnode = document.createTextNode(active);for(b = 0; b < option.length; b++) {if(option[b].selected == true) {textnode = document.createTextNode(option[b].childNodes[0].nodeValue);}}span[a] = document.createElement("span");span[a].className = "select";span[a].id = "select" + inputs[a].name;span[a].appendChild(textnode);inputs[a].parentNode.insertBefore(span[a], inputs[a]);inputs[a].onchange = Custom.choose;}}},pushed: function(actInput, actSpan) {var element = actInput;if(actInput.checked == true && element.type == "checkbox") {actSpan.style.backgroundPosition = "0 -" + checkboxHeight*3 + "px";} else if(element.checked == true && element.type == "radio") {actSpan.style.backgroundPosition = "0 -" + radioHeight*4 + "px";} else if(element.checked != true && element.type == "checkbox") {actSpan.style.backgroundPosition = "0 -" + checkboxHeight + "px";} else {actSpan.style.backgroundPosition = "0 -" + radioHeight + "px";}},check: function(actInput, actSpan) {var element = actInput;if(element.checked == true && element.type == "checkbox") {actSpan.style.backgroundPosition = "0 0";element.checked = false;} else {if(element.type == "checkbox") {actSpan.style.backgroundPosition = "0 -" + checkboxHeight*2 + "px";} else {actSpan.style.backgroundPosition = "0 -" + radioHeight*4 + "px";group = element.name;inputs = document.getElementsByTagName("input");for(a = 0; a < inputs.length; a++) {if(inputs[a].name == group && inputs[a] != element) {inputs[a].previousSibling.style.backgroundPosition = "0 0";}}}element.checked = true;}},clear: function() {inputs = document.getElementsByTagName("input");for(var b = 0; b < inputs.length; b++) {if(inputs[b].type == "checkbox" && inputs[b].checked == true && inputs[b].className == "styled") {inputs[b].previousSibling.style.backgroundPosition = "0 -" + checkboxHeight*2 + "px";} else if(inputs[b].type == "checkbox" && inputs[b].className == "styled") {inputs[b].previousSibling.style.backgroundPosition = "0 0";} else if(inputs[b].type == "radio" && inputs[b].checked == true && inputs[b].className == "styled") {inputs[b].previousSibling.style.backgroundPosition = "0 -" + radioHeight*4 + "px";} else if(inputs[b].type == "radio" && inputs[b].className == "styled") {inputs[b].previousSibling.style.backgroundPosition = "0 0";}}},choose: function() {option = this.getElementsByTagName("option");for(d = 0; d < option.length; d++) {if(option[d].selected == true) {document.getElementById("select" + this.name).childNodes[0].nodeValue = option[d].childNodes[0].nodeValue;}}}}function showHideIds(shortIds, longIds) {for (var i=0;i<longIds.length;i++) {var longId=longIds[i];jQuery("#" + longId).hide();}for (var i=0;i<shortIds.length;i++) {var shortId=shortIds[i];jQuery("#" + shortId).show();}}esemenyek=function() {var foDiv = jQuery("#esemenyek");jQuery("[@changeFelirat='changeFelirat']", foDiv).each(    function(p) {    var feliratDiv = jQuery(this);    var shortDiv = jQuery("[@shortDiv='shortDiv']", feliratDiv);    var longDiv = jQuery("[@longDiv='longDiv']", feliratDiv);    feliratDiv.hover(function() {    	longDiv.show();    	shortDiv.hide();    	}, function() {    	shortDiv.show();    	longDiv.hide();	    	});});}/* Creates a new Queue. A Queue is a first-in-first-out (FIFO) data structure.* Functions of the Queue object allow elements to be enqueued and dequeued, the* first element to be obtained without dequeuing, and for the current size of* the Queue and empty/non-empty status to be obtained.*/function Queue(){ // the list of elements, initialised to the empty array var queue = []; // the amount of space at the front of the queue, initialised to zero var queueSpace = 0; /* Returns the size of this Queue. The size of a Queue is equal to the number  * of elements that have been enqueued minus the number of elements that have  * been dequeued.  */ this.getSize = function(){   // return the number of elements in the queue   return queue.length - queueSpace; } /* Returns true if this Queue is empty, and false otherwise. A Queue is empty  * if the number of elements that have been enqueued equals the number of  * elements that have been dequeued.  */ this.isEmpty = function(){   // return true if the queue is empty, and false otherwise   return (queue.length == 0); }    this.isEmpty = function(){   // return true if the queue is empty, and false otherwise   return (queue.length == 0); } /* Enqueues the specified element in this Queue. The parameter is:  *  * element - the element to enqueue  */ this.enqueue = function(element){   queue.push(element); } /* Dequeues an element from this Queue. The oldest element in this Queue is  * removed and returned. If this Queue is empty then undefined is returned.  */ this.dequeue = function(){   // initialise the element to return to be undefined   var element = undefined;   // check whether the queue is empty   if (queue.length){     // fetch the oldest element in the queue     element = queue[queueSpace];     // update the amount of space and check whether a shift should occur     if (++queueSpace * 2 >= queue.length){       // set the queue equal to the non-empty portion of the queue       queue = queue.slice(queueSpace);       // reset the amount of space at the front of the queue       queueSpace=0;     }   }   // return the removed element   return element; }}function slideDownDiv(divId, infoBoxId, image) {     jQuery(divId).css("background-image", "url(/ctk/img/" + image + "_tarskereses_active.png)");         jQuery(infoBoxId).slideDown("normal", dequeEvent);     jQuery("#infobox").css({'z-index':'-1'});     jQuery("#left").css({'background':'url(/ctk/img/info_box_bottom.png) bottom left no-repeat'});}function slideDownKlasszikus() {slideDownDiv("#klasszikus", "#infobox_klasszikus", "klasszikus");}function slideDownOnline() {slideDownDiv("#online", "#infobox_online", "online");}function slideUpDiv(divId, infoBoxId, image) {jQuery(divId).css("background-image", "url(/ctk/img/" + image + "_tarskereses.png)");        jQuery(infoBoxId).slideUp("normal", dequeEvent);}function slideUpKlasszikus() {slideUpDiv("#klasszikus", "#infobox_klasszikus", "klasszikus");}function slideUpOnline() {slideUpDiv("#online", "#infobox_online", "online");}var queue = new Queue();function enqueEvent(theFunction) {if (theFunction == slideDownKlasszikus) {klasszikusOpened = true;} else if (theFunction == slideDownOnline) {onlineOpened = true;} else if (theFunction == slideUpOnline) {onlineOpened = false;} else if (theFunction == slideUpKlasszikus) {klasszikusOpened = false;}queue.enqueue(theFunction);startDispatch();}var dispatchStarted = false;var klasszikusOpened = false;var onlineOpened = false;function dequeEvent() {if (queue.isEmpty() == false) {var celFunction = queue.dequeue();if (celFunction != null && celFunction != undefined) {celFunction();} } else {// nincs mit feldolgozni mardispatchStarted = false;}}function startDispatch() {if (dispatchStarted == false) {dispatchStarted = true;dequeEvent();}}function animateElonyok() {        jQuery("#klasszikus_div").hover(null,function () {if (klasszikusOpened == true) {// ha nem volt legorgetes azaz nem latszik az elem akkor nem is kell felgorgetes(sildeup sem)enqueEvent(slideUpKlasszikus);}});jQuery("#online_div").hover(null,function () {if (onlineOpened == true) {// ha nem volt legorgetes azaz nem latszik az elem akkor nem is kell felgorgetes(sildeup sem)enqueEvent(slideUpOnline);}});        jQuery("#klasszikus").hover(function () {if (klasszikusOpened == false) {enqueEvent(slideDownKlasszikus);}},null    	);jQuery("#online").hover(function () {if (onlineOpened == false) {enqueEvent(slideDownOnline);}},null);		} jQuery(document).ready(function(){Globals.initialize(); });		     function changeLeirasKinyilio(link, divId) {var divElement = jQuery("#" + divId);        var linkElement = jQuery(link);	var cssClass = divElement.attr("class");if (cssClass.indexOf("lenyilo_div") >= 0) {divElement.attr("class", "becsuko_div");linkElement.attr("class", "becsuk");} else {divElement.attr("class", "lenyilo_div");linkElement.attr("class", "lenyit");}}