
function menuOn ( menuitem ) {
	menuitem.id = 'menuA';
}

function menuOff ( menuitem ) {
	menuitem.id = 'menu';
}

function menuOn2 ( menuitem ) {
	menuitem.id = 'balmenuA';
}

function menuOff2 ( menuitem ) {
	menuitem.id = 'balmenu';
}

var isSearch = 0;

function attesz_jobbra( elem, elem2 ) {
 
 	if (elem.selectedIndex != -1) {
 
 		var option;
 		len = elem.length;
 		for (var i=len-1; i>=0; i--) {
 			if (elem[i].selected == true) {
 				var id = elem[i].value;
 				var text = elem.options[i].text;
 				option = new Option(text, id);
 				elem2.options[elem2.length] = option;
 				elem[i] = null;
 			}
 		}
 	}
 }
 
 function attesz_balra( elem, elem2 ) {
 	if (elem2.selectedIndex != -1) {
 		len = elem2.length;
 		for (var i=len-1; i>=0; i--) {
 			if (elem2[i].selected == true) {
 				var option;
 				var id = elem2[i].value;
 				var text = elem2.options[i].text;
 				option = new Option(text, id);
 				elem.options[elem.length] = option;
 				elem2[i] = null;
 			}
 		}
 	}
 }

function attesz_jobbra_es_kivesz( elem, elem2, elemorig ) {
 	if (elem.selectedIndex != -1) {
 		var option;
 		len = elem.length;
 		for (var i=len-1; i>=0; i--) {
 			if (elem[i].selected == true) {
 				var id = elem[i].value;
 				var text = elem.options[i].text;
 				option = new Option(text, id);
 				elem2.options[elem2.length] = option;
 				elem[i] = null;
				// megkeresni az id-et az eredeti listaban es onnan ki kell venni.
				for (var x = 0; x < elemorig.length; x++) {
					if (elemorig[x].id = id) {
						elemorig[x] = null;
						break;
					}
				}
			}
		}
 	}
}
 
function searchList ( listid, list2, mit ) {
	var listtmp = document.getElementById("keresestmp_"  + listid);
	var list = document.getElementById("lista1_"  + listid);

	for (x = 0; x <= listtmp.options.length; x++) {
		listtmp[x] = null;
	}
	listtmp.options.length = 0;
	
	if (mit != "") {
		isSearch = 1;
		
		listtmp.style.display = '';
		list.style.display = 'none';
		document.getElementById("nyilak_"  + listid).style.display = 'none';
		document.getElementById("keresnyilak_"  + listid).style.display = '';
		document.getElementById("pleasewait_"  + listid).style.display = '';		
		
		for (x = 0; x < list.options.length; x++) {
			if (list.options[x].text.toLowerCase().indexOf(mit.toLowerCase()) > -1) {
				
				ok = 1;
				for (x2 = 0; x2 < list2.options.length; x2++) {
					if (list2.options[x2].value == list.options[x].value) {
						ok = 0;
						break;
					}
				}
				if (ok) {
					var option;
					var id = list.options[x].value;
					var text = list.options[x].text;
					option = new Option(text, id);
					listtmp.options[listtmp.length] = option;
				}
			}
		}
		document.getElementById("pleasewait_"  + listid).style.display = 'none';				
	} else {
		listtmp.style.display = 'none';
		list.style.display = '';	
		document.getElementById("pleasewait_"  + listid).style.display = 'none';		
		document.getElementById("nyilak_"  + listid).style.display = '';
		document.getElementById("keresnyilak_"  + listid).style.display = 'none';	
		isSearch = 0;	
	}
}

function kivalasztott_eltavolit( listid, list2 ) {
	var listtmp = document.getElementById("keresestmp_"  + listid);
	var list = document.getElementById("lista1_"  + listid);

	if (isSearch) {
		attesz_balra(listtmp, list2);
		sortlist(listtmp);
	} else {
		attesz_balra(list, list2);
		sortlist(list);
	}
}

function synchronise( list1, list2, listid ) {
	document.getElementById("pleasewait_"  + listid).style.display = '';
	for (x = 0; x < list1.options.length; x++) {
		for (x2 = 0; x2 < list2.options.length; x2++) {
			if (list1.options[x].value == list2.options[x2].value) {
				list1.options[x] = null;
				break;
			}
		}
	}
	sortlist(list1);
	document.getElementById("pleasewait_"  + listid).style.display = 'none';		
}

function compareOptionText(a,b) {

  return a.text!=b.text ? a.text<b.text ? -1 : 1 : 0;
 

}

function sortlist(list) {
  var items = list.options.length;
  // create array and make copies of options in list
  var tmpArray = new Array(items);
  for ( i=0; i<items; i++ )
    tmpArray[i] = new
Option(list.options[i].text,list.options[i].value);
  // sort options using given function
  tmpArray.sort(compareOptionText);
  // make copies of sorted options back to list
  for ( i=0; i<items; i++ )
    list.options[i] = new Option(tmpArray[i].text,tmpArray[i].value);

}

function MSlistSelectAll( id ) {
	var list = document.getElementById(id);
	for (x = 0; x < list.options.length; x++) {
			list.options[x].selected = true;
	}
	if ((document.getElementById('ev1').value != '') || (document.getElementById('ho1').value != '') || (document.getElementById('nap1').value != '')) {
		if ((document.getElementById('ev1').value == '') || (document.getElementById('ho1').value == '') || (document.getElementById('nap1').value == '')) {
			alert("Kérem töltse ki a kezdődátum mezőt!")
			return false;
		}
	}
	if ((document.getElementById('ev2').value != '') || (document.getElementById('ho2').value != '') || (document.getElementById('nap2').value != '')) {
		if ((document.getElementById('ev2').value == '') || (document.getElementById('ho2').value == '') || (document.getElementById('nap2').value == '')) {
			alert("Kérem töltse ki a végedátum mezőt!")
			return false;
		}
	}		 
	return true;
}


function ketesaruk( ) {
	if ((document.getElementById('ev1').value != '')) {
		if ((document.getElementById('ev1').value == '')) {
			alert("Kérem töltse ki a kezdődátum mezőt!")
			return false;
		}
	}
	if ((document.getElementById('ev2').value != '')) {
		if ((document.getElementById('ev2').value == '')) {
			alert("Kérem töltse ki a végedátum mezőt!")
			return false;
		}
	}		 
	return true;
}

function setFontSize( id ) {
	if (document.getElementById('cikk') != null) {
			document.getElementById('cikk').id = 'cikk2'
	} else {
			document.getElementById('cikk2').id = 'cikk'
	}

	if (document.getElementById('tags') != null) {
			document.getElementById('tags').id = 'tags2'
	} else {
			document.getElementById('tags2').id = 'tags'
	}
}

function setFontSizeRasff() {
	if (document.getElementById('hir') != null) {
			document.getElementById('hir').id = 'hir2'
	} else {
			document.getElementById('hir2').id = 'hir'
	}
}

function alaphelyzetRASFF() {
	document.getElementById('ev1').value = "";
	document.getElementById('ho1').value = "";
	document.getElementById('nap1').value = "";	
	document.getElementById('ev2').value = "";
	document.getElementById('ho2').value = "";
	document.getElementById('nap2').value = "";	
	document.getElementById('szabadszo').value = "";
	document.getElementById('bekuldoID').selectedIndex = 0;
	document.getElementById('elelem_tipusID').selectedIndex = 0;
	document.getElementById('honnan').selectedIndex = 0;	
	var list = document.getElementById('cimkeElem');
	for (x = 0; x < list.options.length; x++) {
			list.options[x].selected = true;
	}
	attesz_balra(document.csoport_1.lista1_1, document.csoport_1.cimkeElem); sortlist(document.csoport_1.lista1_1);
}

function alaphelyzetRAPEX() {
	document.getElementById('ev1').value = "";
	
	document.getElementById('ev2').value = "";
	
	document.getElementById('szabadszo').value = "";
	document.getElementById('bekuldoID').selectedIndex = 0;
	document.getElementById('arutipusID').selectedIndex = 0;
	document.getElementById('honnan').selectedIndex = 0;	
	document.getElementById('action_rkID').selectedIndex = 0;
	document.getElementById('action_csID').selectedIndex = 0;
}
// TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTicker 1-2-*3///
var richhtmlticker={
loadingtext: '<em>Kérem, várjon a betöltésre...</em>', //Loading text if content is being fetched via Ajax

getajaxcontent:function($, config){
	config.$ticker.html(this.loadingtext)
	$.ajax({
		url: config.msgsource,
		error:function(ajaxrequest){
			config.$ticker.html('Hiba a tartalomtöltésben.<br />Server válasz: '+ajaxrequest.responseText)
		},
		success:function(content){
			config.$ticker.html(content)
			richhtmlticker.setupticker(config)
		}
	})
},

rotate:function(config){
	if (config.$ticker.get(0)._hoverstate=="over"){
		setTimeout(function(){richhtmlticker.rotate(config)}, config.rotatespeed)
	}
	else{
		config.$messages.eq(config.currentmsg).fadeOut(config.animateduration, function(){
			config.currentmsg=(config.currentmsg<config.$messages.length-1)? config.currentmsg+1 : 0
			config.$messages.eq(config.currentmsg).fadeIn(config.animateduration, function(){
				setTimeout(function(){richhtmlticker.rotate(config)}, config.rotatespeed)
			})
		})
	}
},

getCookie:function(Name){ 
	var re=new RegExp(Name+"=[^;]+", "i") //construct RE to search for target name/value pair
	if (document.cookie.match(re)) //if cookie found
		return document.cookie.match(re)[0].split("=")[1] //return its value
	return null
},

setCookie:function(name, value){
	document.cookie = name+"="+value
},

setupticker:function(config){
	config.$messages=config.$ticker.find('div.'+config.msgclass).hide()
	config.currentmsg=Math.min(parseInt(richhtmlticker.getCookie(config.id) || 0), config.$messages.length-1)
	config.$messages.hide().eq(config.currentmsg).fadeIn(config.animateduration)
	setTimeout(function(){richhtmlticker.rotate(config)}, config.rotatespeed)
	$(window).bind('unload', function(){richhtmlticker.cleanup(config)})
},

define:function(config){
  jQuery(document).ready(function($){
		config.$ticker=$('#'+config.id)
		if (config.$ticker.length==0)
			return
		config.$ticker.css({overflow:'hidden'}).hover(
			function(){this._hoverstate="over"},
			function(){this._hoverstate="out"}
		)
		if (config.msgsource=="inline"){
			richhtmlticker.setupticker(config)
		}		
		else{
			richhtmlticker.getajaxcontent($,config)
		}
	})
},

cleanup:function(config){
	this.setCookie(config.id, config.currentmsg)
}

} //end richhtmlticker object

//
//
// DUPLIKÁCIÓ:

var richhtmlticker2={
loadingtext: '<em>Kérem, várjon a betöltésre...</em>', //Loading text if content is being fetched via Ajax

getajaxcontent:function($, config){
	config.$ticker.html(this.loadingtext)
	$.ajax({
		url: config.msgsource,
		error:function(ajaxrequest){
			config.$ticker.html('Hiba a tartalomtöltésben.<br />Server válasz: '+ajaxrequest.responseText)
		},
		success:function(content){
			config.$ticker.html(content)
			richhtmlticker2.setupticker(config)
		}
	})
},

rotate:function(config){
	if (config.$ticker.get(0)._hoverstate=="over"){
		setTimeout(function(){richhtmlticker2.rotate(config)}, config.rotatespeed)
	}
	else{
		config.$messages.eq(config.currentmsg).fadeOut(config.animateduration, function(){
			config.currentmsg=(config.currentmsg<config.$messages.length-1)? config.currentmsg+1 : 0
			config.$messages.eq(config.currentmsg).fadeIn(config.animateduration, function(){
				setTimeout(function(){richhtmlticker2.rotate(config)}, config.rotatespeed)
			})
		})
	}
},

getCookie:function(Name){ 
	var re=new RegExp(Name+"=[^;]+", "i") //construct RE to search for target name/value pair
	if (document.cookie.match(re)) //if cookie found
		return document.cookie.match(re)[0].split("=")[1] //return its value
	return null
},

setCookie:function(name, value){
	document.cookie = name+"="+value
},

setupticker:function(config){
	config.$messages=config.$ticker.find('div.'+config.msgclass).hide()
	config.currentmsg=Math.min(parseInt(richhtmlticker2.getCookie(config.id2) || 0), config.$messages.length-1)
	config.$messages.hide().eq(config.currentmsg).fadeIn(config.animateduration)
	setTimeout(function(){richhtmlticker2.rotate(config)}, config.rotatespeed)
	$(window).bind('unload', function(){richhtmlticker.cleanup(config)})
},

define:function(config){
  jQuery(document).ready(function($){
		config.$ticker=$('#'+config.id2)
		if (config.$ticker.length==0)
			return
		config.$ticker.css({overflow:'hidden'}).hover(
			function(){this._hoverstate="over"},
			function(){this._hoverstate="out"}
		)
		if (config.msgsource=="inline"){
			richhtmlticker2.setupticker(config)
		}		
		else{
			richhtmlticker2.getajaxcontent($,config)
		}
	})
},

cleanup:function(config){
	this.setCookie(config.id2, config.currentmsg)
}

} //end richhtmlticker object

//
//
// DUPLIKÁCIÓ : a HARMADIK obj

var richhtmlticker3={
loadingtext: '<em>Kérem, várjon a betöltésre...</em>', //Loading text if content is being fetched via Ajax

getajaxcontent:function($, config){
	config.$ticker.html(this.loadingtext)
	$.ajax({
		url: config.msgsource,
		error:function(ajaxrequest){
			config.$ticker.html('Hiba a tartalomtöltésben.<br />Server válasz: '+ajaxrequest.responseText)
		},
		success:function(content){
			config.$ticker.html(content)
			richhtmlticker3.setupticker(config)
		}
	})
},

rotate:function(config){
	if (config.$ticker.get(0)._hoverstate=="over"){
		setTimeout(function(){richhtmlticker3.rotate(config)}, config.rotatespeed)
	}
	else{
		config.$messages.eq(config.currentmsg).fadeOut(config.animateduration, function(){
			config.currentmsg=(config.currentmsg<config.$messages.length-1)? config.currentmsg+1 : 0
			config.$messages.eq(config.currentmsg).fadeIn(config.animateduration, function(){
				setTimeout(function(){richhtmlticker3.rotate(config)}, config.rotatespeed)
			})
		})
	}
},

getCookie:function(Name){ 
	var re=new RegExp(Name+"=[^;]+", "i") //construct RE to search for target name/value pair
	if (document.cookie.match(re)) //if cookie found
		return document.cookie.match(re)[0].split("=")[1] //return its value
	return null
},

setCookie:function(name, value){
	document.cookie = name+"="+value
},

setupticker:function(config){
	config.$messages=config.$ticker.find('div.'+config.msgclass).hide()
	config.currentmsg=Math.min(parseInt(richhtmlticker3.getCookie(config.id3) || 0), config.$messages.length-1)
	config.$messages.hide().eq(config.currentmsg).fadeIn(config.animateduration)
	setTimeout(function(){richhtmlticker3.rotate(config)}, config.rotatespeed)
	$(window).bind('unload', function(){richhtmlticker.cleanup(config)})
},

define:function(config){
  jQuery(document).ready(function($){
		config.$ticker=$('#'+config.id3)
		if (config.$ticker.length==0)
			return
		config.$ticker.css({overflow:'hidden'}).hover(
			function(){this._hoverstate="over"},
			function(){this._hoverstate="out"}
		)
		if (config.msgsource=="inline"){
			richhtmlticker3.setupticker(config)
		}		
		else{
			richhtmlticker3.getajaxcontent($,config)
		}
	})
},

cleanup:function(config){
	this.setCookie(config.id3, config.currentmsg)
}

} //end richhtmlticker object 3

richhtmlticker.define({
	id: "myhtmlticker", //main ticker DIV id
	msgclass: "messagediv", //CSS class of DIVs containing each ticker message
	msgsource: "inline", //Where to look for the messages: "inline", or "path_to_file_on_your_server"
	rotatespeed: 9000, //pause in milliseconds between rotation
	animateduration: 900 //duration of fade animation in milliseconds 
})

//richhtmlticker object duplikáció:

richhtmlticker2.define({
	id2: "myhtmlticker2", //main ticker DIV id
	msgclass: "messagediv2", //CSS class of DIVs containing each ticker message
	msgsource: "inline", //Where to look for the messages: "inline", or "path_to_file_on_your_server"
	rotatespeed: 9000, //pause in milliseconds between rotation
	animateduration: 1500 //duration of fade animation in milliseconds 
})

//richhtmlticker object duplikáció:

richhtmlticker3.define({
	id3: "myhtmlticker3", //main ticker DIV id
	msgclass: "messagediv3", //CSS class of DIVs containing each ticker message
	msgsource: "inline", //Where to look for the messages: "inline", or "path_to_file_on_your_server"
	rotatespeed: 9000, //pause in milliseconds between rotation
	animateduration: 800 //duration of fade animation in milliseconds 
})


