var BrowserDetect = {
	init: function () {
		this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
		this.version = this.searchVersion(navigator.userAgent)
			|| this.searchVersion(navigator.appVersion)
			|| "an unknown version";
		this.OS = this.searchString(this.dataOS) || "an unknown OS";
	},
	searchString: function (data) {
		for (var i=0;i<data.length;i++)	{
			var dataString = data[i].string;
			var dataProp = data[i].prop;
			this.versionSearchString = data[i].versionSearch || data[i].identity;
			if (dataString) {
				if (dataString.indexOf(data[i].subString) != -1)
					return data[i].identity;
			}
			else if (dataProp)
				return data[i].identity;
		}
	},
	searchVersion: function (dataString) {
		var index = dataString.indexOf(this.versionSearchString);
		if (index == -1) return;
		return parseFloat(dataString.substring(index+this.versionSearchString.length+1));
	},
	dataBrowser: [
		{ 	string: navigator.userAgent,
			subString: "OmniWeb",
			versionSearch: "OmniWeb/",
			identity: "OmniWeb"
		},
		{
			string: navigator.vendor,
			subString: "Apple",
			identity: "Safari"
		},
		{
			prop: window.opera,
			identity: "Opera"
		},
		{
			string: navigator.vendor,
			subString: "iCab",
			identity: "iCab"
		},
		{
			string: navigator.vendor,
			subString: "KDE",
			identity: "Konqueror"
		},
		{
			string: navigator.userAgent,
			subString: "Firefox",
			identity: "Firefox"
		},
		{
			string: navigator.vendor,
			subString: "Camino",
			identity: "Camino"
		},
		{		// for newer Netscapes (6+)
			string: navigator.userAgent,
			subString: "Netscape",
			identity: "Netscape"
		},
		{
			string: navigator.userAgent,
			subString: "MSIE",
			identity: "Explorer",
			versionSearch: "MSIE"
		},
		{
			string: navigator.userAgent,
			subString: "Gecko",
			identity: "Mozilla",
			versionSearch: "rv"
		},
		{ 		// for older Netscapes (4-)
			string: navigator.userAgent,
			subString: "Mozilla",
			identity: "Netscape",
			versionSearch: "Mozilla"
		}
	],
	dataOS : [
		{
			string: navigator.platform,
			subString: "Win",
			identity: "Windows"
		},
		{
			string: navigator.platform,
			subString: "Mac",
			identity: "Mac"
		},
		{
			string: navigator.platform,
			subString: "Linux",
			identity: "Linux"
		}
	]

};
BrowserDetect.init();


var image;

function highlightadminmenuitem(item, hint) {
	item.style.backgroundColor = "#717AF5";
	item.style.borderStyle = "solid";
	item.style.borderColor = "#0B19DA";
	item.style.borderWidth = "1px";
	window.status = hint;
}

function unhighlightadminmenuitem(item) {
	item.style.backgroundColor="#C3C5EF";
	item.style.borderStyle = "none";
	window.status = "";
}

var dialog;

function openDialog(htmlsource) {
	document.getElementById("pausz").style.visibility = "visible";

	try
	{
		dialog = document.createElement("<div id='dialog' style='position:absolute; top:" + (70 + document.body.scrollTop) + "px; left:200px;' width=100 height=300>");
	}
	catch (e)
	{
		dialog = document.createElement("div");
		dialog.setAttribute("id", "dialog");
		dialog.setAttribute("style", "position:absolute; top:" + (70 + document.body.scrollTop) + "px; left:200px");
		dialog.setAttribute("width", "300");
		dialog.setAttribute("height", "300");
	}
	document.all.adminbody.appendChild(dialog);
	document.getElementById("dialog").innerHTML = htmlsource;
}

function closeDialogAndSubmit() {
//	dialog.style.visibility="hidden";
	document.getElementById("popupform").submit();
	document.all.adminbody.removeChild(dialog);
	document.getElementById("pausz").style.visibility = "hidden";
}

function closeDialog() {
	document.all.adminbody.removeChild(dialog);
	document.getElementById("pausz").style.visibility = "hidden";
}

function highlightEditbox(item) {
	item.className = "admineditbox_active";
}

function unhighlightEditbox(item) {
	item.className = "admineditbox";
}

function highlightTextarea(item) {
	item.className = "admintextarea_active";
}

function unhighlightTextarea(item) {
	item.className = "admintextarea";
}

function executeMenu(file) {
	window.location=file;
}

function addrow(tableitem) {
	cellnum = tableitem.rows[0].cells.length;
	row = tableitem.insertRow(-1);
	cellarray = new Array();
	for (i = 0; i<cellnum; i++) {
		cellarray[i] = row.insertCell(i);
		cellarray[i].innerHTML = "<input type='text'>";	
	}
}

function viewpicture(imgsrc, x, y) {
	try {
		image = document.createElement("<img src='" + imgsrc + "' height=100 style='position:absolute; top:" + y + "; left:" + x + ";'>");
	}
	catch (e) {
//		alert(x + " " + y);
		image = document.createElement("img");
		image.setAttribute("src", imgsrc);
		image.setAttribute("height", 100);
		image.setAttribute("style", "position:absolute; top:" + (y+10) + "px; left:" + (x+10) + "px;");
//		image.setAttribute("innerHTML", "<img src='" + imgsrc + "' height=100>");
	}
	document.all.adminbody.appendChild(image);
}

function hidepicture() {
	document.all.adminbody.removeChild(image);
}

function generateHintContent(txt) {
	result = "<table id='Table_01' width='200' height='81' border='0' cellpadding='0' cellspacing='0'>";
	result += "<tr><td background='../images/bubble_01.gif' width='200' height='34'></td></tr><tr><td background='../images/bubble_content.png' style='background-repeat:repeat-y; width=200; padding-left:3px; padding-right:3px;' class=\"admincontent\">";
	result += txt;
	result += "</td></tr><tr><td background='../images/bubble_03.gif' width='200' height='16'></td></tr></table>";
	return result;
}

var hintdiv;
var visibleHint = false;
function showHint(txt, x, y) {
//window.status=x + " " + y;
	if (txt.length > 0) {
		try {
			hintdiv = document.createElement("<div style='position:absolute;width=300; height=200; top:" + (document.body.scrollTop+y+5) + "; left:" + (x-130) + "'>");
		}
		catch (e) {
			hintdiv = document.createElement("div");
			hintdiv.setAttribute("id", "asdasdsahint");
			hintdiv.setAttribute("style", "position:absolute;width=300; height=200; top:" + (document.body.scrollTop+y+5) + "; left:" + (x-130));
		}
		document.all.adminbody.appendChild(hintdiv);
		hintdiv.innerHTML = generateHintContent(txt);
		visibleHint = true;
	}
}

function hideHint() {
	if (visibleHint) {
		document.all.adminbody.removeChild(hintdiv);
		visibleHint = false;
	}
}

function showIcon(id) {
	document.getElementById(id).style.visibility="visible";
}

function hideIcon(id) {
	document.getElementById(id).style.visibility="hidden";
}

function generateImageSelectOutput(formprocessor, browsername) {
	result = "";
if (BrowserDetect.browser == "Firefox") {
	result += '<table id="Table_01" width="300" height="200" border="0" cellpadding="0" cellspacing="0">';
	result += '<tr>';
	result += '		<td colspan="4" background="../images/editbubble_01.png" width="300" height="48" alt="" style="background-position:bottom; background-repeat:no-repeat;"></td>';
	result += '	</tr>';
	result += '	<tr>';
	result += '		<td background="../images/editbubble_02.png" width="42" height="30" alt="" style="background-position:bottom;background-repeat:no-repeat;"></td>';
	result += '		<td background="../images/editbubble_title.png" width="201" height="30" alt="" style="background-position:bottom; background-repeat:no-repeat;"><h2>Új kép feltöltése</h2></td>';
	result += '		<td background="../images/editbubble_closebtn.png" width="23" height="30" alt="" style="background-position:bottom; background-repeat:no-repeat;" valign="top"><img src="../images/error.ico" height=15 onclick="closeEnterField()"></td>';
	result += '		<td background="../images/editbubble_05.png" width="34" height="30" alt="" style="background-position:bottom; background-repeat:no-repeat;"></td>';
	result += '	</tr>';
	result += '<tr>';
	result += '		<td colspan="4" class="admincontent" background="../images/editbubble_content.png" width="300" alt="" style="padding-left:10px; padding-right:10px; background-repeat:repeat-y;">';
result += 'Válassza ki a feltöltendő képet!';
result += '<form method="post" enctype="multipart/form-data" action="' + formprocessor + '">';
result += '		<input type="file" name="' + browsername + '">';
result += '		<input type="hidden" name="MAX_FILE_SIZE" value="999999999999">';
result += '<br><input type="submit" value="Változtat" class="editbubblebutton">';
result += '</form>';
	result += '		</td>';
	result += '	</tr>';
	result += '	<tr>';
	result += '		<td colspan="4" background="../images/editbubble_07.png" width="300" height="50" style="background-position:top;"></td>';
	result += '	</tr>';
	result += '</table>';
}
else {
	result += '<table id="Table_01" width="300" height="200" border="0" cellpadding="0" cellspacing="0">';
	result += '	<tr>';
	result += '		<td colspan="4" background="../images/editbubble_01.png" width="300" height="48" alt=""></td>';
	result += '	</tr>';
	result += '	<tr>';
	result += '		<td background="../images/editbubble_02.png" width="42" height="30" alt=""></td>';
	result += '		<td background="../images/editbubble_title.png" width="201" height="30" alt=""><h2>Új kép feltöltése</td>';
	result += '		<td background="../images/editbubble_closebtn.png" width="23" height="30" alt=""><img src="../images/error.ico" onclick="closeEnterField()"></td>';
	result += '		<td background="../images/editbubble_05.png" width="30" alt="" style="background-position:-4px 0px"></td>';
	result += '	</tr>';
	result += '	<tr>';
	result += '		<td colspan="4" background="../images/editbubble_content.png" width="300" height="72" alt="" style="padding-left:10px; padding-right:10px;" class="admincontent">';
result += 'Válassza ki a feltöltendő képet!';
result += '<form method="post" enctype="multipart/form-data" action="' + formprocessor + '">';
result += '		<input type="file" name="' + browsername + '">';
result += '		<input type="hidden" name="MAX_FILE_SIZE" value="999999999999">';
result += '<br><input type="submit" value="Változtat" class="editbubblebutton">';
result += '</form>';
	result += '		</td>';
	result += '	</tr>';
	result += '	<tr>';
	result += '		<td colspan="4">';
	result += '			<img src="../images/editbubble_07.png" width="300" height="50" alt=""></td>';
	result += '	</tr>';
	result += '</table>';
}
	return result;
}

function generateFileSelectOutput(formprocessor, browsername) {
	result = "";
if (BrowserDetect.browser == "Firefox") {
	result += '<table id="Table_01" width="300" height="200" border="0" cellpadding="0" cellspacing="0">';
	result += '<tr>';
	result += '		<td colspan="4" background="../images/editbubble_01.png" width="300" height="48" alt="" style="background-position:bottom; background-repeat:no-repeat;"></td>';
	result += '	</tr>';
	result += '	<tr>';
	result += '		<td background="../images/editbubble_02.png" width="42" height="30" alt="" style="background-position:bottom;background-repeat:no-repeat;"></td>';
	result += '		<td background="../images/editbubble_title.png" width="201" height="30" alt="" style="background-position:bottom; background-repeat:no-repeat;"><h2>Új kép feltöltése</h2></td>';
	result += '		<td background="../images/editbubble_closebtn.png" width="23" height="30" alt="" style="background-position:bottom; background-repeat:no-repeat;" valign="top"><img src="../images/error.ico" height=15 onclick="closeEnterField()"></td>';
	result += '		<td background="../images/editbubble_05.png" width="34" height="30" alt="" style="background-position:bottom; background-repeat:no-repeat;"></td>';
	result += '	</tr>';
	result += '<tr>';
	result += '		<td colspan="4" class="admincontent" background="../images/editbubble_content.png" width="300" alt="" style="padding-left:10px; padding-right:10px; background-repeat:repeat-y;">';
result += 'Válassza ki a feltöltendő fájlt!';
result += '<form method="post" enctype="multipart/form-data" action="' + formprocessor + '">';
result += '		<input type="file" name="' + browsername + '">';
result += '		<input type="hidden" name="MAX_FILE_SIZE" value="999999999999">';
result += '<br><input type="submit" value="Változtat" class="editbubblebutton">';
result += '</form>';
	result += '		</td>';
	result += '	</tr>';
	result += '	<tr>';
	result += '		<td colspan="4" background="../images/editbubble_07.png" width="300" height="50" style="background-position:top;"></td>';
	result += '	</tr>';
	result += '</table>';
}
else {
	result += '<table id="Table_01" width="300" height="200" border="0" cellpadding="0" cellspacing="0">';
	result += '	<tr>';
	result += '		<td colspan="4" background="../images/editbubble_01.png" width="300" height="48" alt=""></td>';
	result += '	</tr>';
	result += '	<tr>';
	result += '		<td background="../images/editbubble_02.png" width="42" height="30" alt=""></td>';
	result += '		<td background="../images/editbubble_title.png" width="201" height="30" alt=""><h2>Új kép feltöltése</td>';
	result += '		<td background="../images/editbubble_closebtn.png" width="23" height="30" alt=""><img src="../images/error.ico" onclick="closeEnterField()"></td>';
	result += '		<td background="../images/editbubble_05.png" width="30" alt="" style="background-position:-4px 0px"></td>';
	result += '	</tr>';
	result += '	<tr>';
	result += '		<td colspan="4" background="../images/editbubble_content.png" width="300" height="72" alt="" style="padding-left:10px; padding-right:10px;" class="admincontent">';
result += 'Válassza ki a feltöltendő fájlt!';
result += '<form method="post" enctype="multipart/form-data" action="' + formprocessor + '">';
result += '		<input type="file" name="' + browsername + '">';
result += '		<input type="hidden" name="MAX_FILE_SIZE" value="999999999999">';
result += '<br><input type="submit" value="Változtat" class="editbubblebutton">';
result += '</form>';
	result += '		</td>';
	result += '	</tr>';
	result += '	<tr>';
	result += '		<td colspan="4">';
	result += '			<img src="../images/editbubble_07.png" width="300" height="50" alt=""></td>';
	result += '	</tr>';
	result += '</table>';
}
	return result;
}

function generateTextEntryOutput(formprocessor, editboxname, value) {
	result = "";
if (BrowserDetect.browser == "Firefox") {
	result += '<table id="Table_01" width="300" height="200" border="0" cellpadding="0" cellspacing="0">';
	result += '<tr>';
	result += '		<td colspan="4" background="images/editbubble_01.png" width="300" height="48" alt="" style="background-position:bottom; background-repeat:no-repeat;"></td>';
	result += '	</tr>';
	result += '	<tr>';
	result += '		<td background="images/editbubble_02.png" width="42" height="30" alt="" style="background-position:bottom;background-repeat:no-repeat;"></td>';
	result += '		<td background="images/editbubble_title.png" width="201" height="30" alt="" style="background-position:bottom; background-repeat:no-repeat;"><h2>Új érték bevitele</h2></td>';
	result += '		<td background="images/editbubble_closebtn.png" width="23" height="30" alt="" style="background-position:bottom; background-repeat:no-repeat;" valign="top"><img src="images/error.ico" height=15 onclick="closeEnterField()"></td>';
	result += '		<td background="images/editbubble_05.png" width="34" height="30" alt="" style="background-position:bottom; background-repeat:no-repeat;"></td>';
	result += '	</tr>';
	result += '<tr>';
	result += '		<td colspan="4" class="admincontent" background="images/editbubble_content.png" width="300" alt="" style="padding-left:10px; padding-right:10px; background-repeat:repeat-y;">';
	result += '<form method="post" action="' + formprocessor + '">';
	//result += 'Pellentesque id eros quis elit accumsan tempus. Nulla neque enim, accumsan ac, tempor sit amet, viverra ut, odio.<br> Phasellus condimentum rutrum nibh. Sed quis nisi. Proin mollis fringilla sapien. Curabitur suscipit scelerisque quam. Aliquam erat volutpat. Praesent non ligula in odio viverra nonummy. Sed mattis egestas nunc. Duis vel nulla. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos. Praesent neque. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos.';
	result += 'Gépelje be a mező új értékét!<br><input type="text" name="' + editboxname + '" value="' + value + '"><br><input type="submit" value="Változtat" class="editbubblebutton">';
	result += '</form>';
	result += '		</td>';
	result += '	</tr>';
	result += '	<tr>';
	result += '		<td colspan="4" background="images/editbubble_07.png" width="300" height="50" style="background-position:top;"></td>';
	result += '	</tr>';
	result += '</table>';
}
else {
	result += '<table id="Table_01" width="300" height="200" border="0" cellpadding="0" cellspacing="0">';
	result += '	<tr>';
	result += '		<td colspan="4" background="images/editbubble_01.png" width="300" height="48" alt=""></td>';
	result += '	</tr>';
	result += '	<tr>';
	result += '		<td background="images/editbubble_02.png" width="42" height="30" alt=""></td>';
	result += '		<td background="images/editbubble_title.png" width="201" height="30" alt=""><h2>Új érték bevitele</td>';
	result += '		<td background="images/editbubble_closebtn.png" width="23" height="30" alt=""><img src="images/error.ico" onclick="closeEnterField()"></td>';
	result += '		<td background="images/editbubble_05.png" width="30" alt="" style="background-position:-4px 0px"></td>';
	result += '	</tr>';
	result += '	<tr>';
	result += '		<td colspan="4" background="images/editbubble_content.png" width="300" height="72" alt="" style="padding-left:10px; padding-right:10px;" class="admincontent">';
	result += '<form method="post" action="' + formprocessor + '">';
	//result += 'Pellentesque id eros quis elit accumsan tempus. Nulla neque enim, accumsan ac, tempor sit amet, viverra ut, odio.<br> Phasellus condimentum rutrum nibh. Sed quis nisi. Proin mollis fringilla sapien. Curabitur suscipit scelerisque quam. Aliquam erat volutpat. Praesent non ligula in odio viverra nonummy. Sed mattis egestas nunc. Duis vel nulla. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos. Praesent neque. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos.';
	result += 'Gépelje be a mező új értékét!<br><input type="text" name="' + editboxname + '" value="' + value + '"><br><input type="submit" value="Változtat" class="editbubblebutton">';
	result += '</form>';
	result += '		</td>';
	result += '	</tr>';
	result += '	<tr>';
	result += '		<td colspan="4">';
	result += '			<img src="images/editbubble_07.png" width="300" height="50" alt=""></td>';
	result += '	</tr>';
	result += '</table>';
}
	return result;
}
function validateValue(itemid, formid) {
	var result = document.getElementById(itemid).value.replace(/\n/g, "\\r\\n");
	document.getElementById(itemid).value = result;
	document.getElementById(formid).submit();
}

function generateLargeTextEntryOutput(formprocessor, textareaname, value) {
	result = "";
	var parsedValue = value.replace(/\r\n/g, "newline");
if (BrowserDetect.browser == "Firefox") {
	result += '<table id="Table_01" width="300" border="0" cellpadding="0" cellspacing="0">';
	result += '<tr>';
	result += '		<td colspan="4" background="../images/editbubble_01.png" width="300" height="48" alt="" style="background-position:bottom; background-repeat:no-repeat;"></td>';
	result += '	</tr>';
	result += '	<tr>';
	result += '		<td background="../images/editbubble_02.png" width="42" height="30" alt="" style="background-position:bottom;background-repeat:no-repeat;">&nbsp;</td>';
	result += '		<td background="../images/editbubble_title.png" width="201" height="30" alt="" style="background-position:bottom; background-repeat:no-repeat;"><h2>Új érték bevitele</h2></td>';
	result += '		<td background="../images/editbubble_closebtn.png" width="23" height="30" alt="" style="background-position:bottom; background-repeat:no-repeat;" valign="top"><img src="../images/error.ico" height=15 onclick="closeEnterField()"></td>';
	result += '		<td background="../images/editbubble_05.png" width="34" height="30" alt="" style="background-position:bottom; background-repeat:no-repeat;">&nbsp;</td>';
	result += '	</tr>';
	result += '<tr>';
	result += '		<td colspan="4" class="admincontent" background="../images/editbubble_content.png" width="300" alt="" style="padding-left:10px; padding-right:10px; background-repeat:repeat-y;">';
	result += '<form method="post" action="' + formprocessor + '" id="bubbleform">';
	//result += 'Pellentesque id eros quis elit accumsan tempus. Nulla neque enim, accumsan ac, tempor sit amet, viverra ut, odio.<br> Phasellus condimentum rutrum nibh. Sed quis nisi. Proin mollis fringilla sapien. Curabitur suscipit scelerisque quam. Aliquam erat volutpat. Praesent non ligula in odio viverra nonummy. Sed mattis egestas nunc. Duis vel nulla. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos. Praesent neque. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos.';
	result += 'Gépelje be a mező új értékét!<br><textarea name="' + textareaname + '" rows=5 cols=30 id="' + textareaname + '">' + value + '</textarea><br><input type="button" onclick="validateValue(\'' + textareaname + '\', \'bubbleform\');" value="Változtat" class="editbubblebutton">';
	result += '</form>';
	result += '		</td>';
	result += '	</tr>';
	result += '	<tr>';
	result += '		<td colspan="4" background="../images/editbubble_07.png" width="300" height="50" style="background-position:top;"></td>';
	result += '	</tr>';
	result += '</table>';
}
else {
	result += '<table id="Table_01" width="300" height="200" border="0" cellpadding="0" cellspacing="0">';
	result += '	<tr>';
	result += '		<td colspan="4" background="../images/editbubble_01.png" width="300" height="48" alt=""></td>';
	result += '	</tr>';
	result += '	<tr>';
	result += '		<td background="../images/editbubble_02.png" width="42" height="30" alt=""></td>';
	result += '		<td background="../images/editbubble_title.png" width="201" height="30" alt=""><h2>Új érték bevitele</td>';
	result += '		<td background="../images/editbubble_closebtn.png" width="23" height="30" alt=""><img src="../images/error.ico" onclick="closeEnterField()"></td>';
	result += '		<td background="../images/editbubble_05.png" width="30" alt="" style="background-position:-4px 0px"></td>';
	result += '	</tr>';
	result += '	<tr>';
	result += '		<td colspan="4" background="../images/editbubble_content.png" width="300" height="72" alt="" style="padding-left:10px; padding-right:10px;" class="admincontent">';
	result += '<form method="post" action="' + formprocessor + '">';
	//result += 'Pellentesque id eros quis elit accumsan tempus. Nulla neque enim, accumsan ac, tempor sit amet, viverra ut, odio.<br> Phasellus condimentum rutrum nibh. Sed quis nisi. Proin mollis fringilla sapien. Curabitur suscipit scelerisque quam. Aliquam erat volutpat. Praesent non ligula in odio viverra nonummy. Sed mattis egestas nunc. Duis vel nulla. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos. Praesent neque. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos.';
	result += 'Gépelje be a mező új értékét!<br><textarea name="' + textareaname + '" rows=5 cols=30>' + value + '</textarea><br><input type="submit" value="Változtat" class="editbubblebutton">';
	result += '</form>';
	result += '		</td>';
	result += '	</tr>';
	result += '	<tr>';
	result += '		<td colspan="4">';
	result += '			<img src="../images/editbubble_07.png" width="300" height="50" alt=""></td>';
	result += '	</tr>';
	result += '</table>';
}

	return result;
}

function createDate(year, month, day, hour, min) {
	document.getElementById("date").value = year.value + "-" + month.value + "-" + day.value.split(" ")[0] + " " + hour.value + ":" + min.value + ":00";
}

function createOnlyDate(year, month, day) {
	document.getElementById("date").value = year.value + "-" + (parseInt(month.value) + 1) + "-" + day.value.split(" ")[0];
//	alert(year.value + " " + month.value + " " + day.value);
}

function generateDateEntryOutput(formprocessor, datename, value) {
	result = "";
	year = value.split("-")[0];
	month = value.split("-")[1];
	day = value.split("-")[2];
	time = value.split(" ")[1];
	hour = time.split(":")[0];
	min = time.split(":")[1];
if (BrowserDetect.browser == "Firefox") {
	result += '<table id="Table_01" width="300" height="200" border="0" cellpadding="0" cellspacing="0">';
	result += '<tr>';
	result += '		<td colspan="4" background="../images/editbubble_01.png" width="300" height="48" alt="" style="background-position:bottom; background-repeat:no-repeat;"></td>';
	result += '	</tr>';
	result += '	<tr>';
	result += '		<td background="../images/editbubble_02.png" width="42" height="30" alt="" style="background-position:bottom;background-repeat:no-repeat;"></td>';
	result += '		<td background="../images/editbubble_title.png" width="201" height="30" alt="" style="background-position:bottom; background-repeat:no-repeat;"><h2>Új érték bevitele</h2></td>';
	result += '		<td background="../images/editbubble_closebtn.png" width="23" height="30" alt="" style="background-position:bottom; background-repeat:no-repeat;" valign="top"><img src="../images/error.ico" height=15 onclick="closeEnterField()"></td>';
	result += '		<td background="../images/editbubble_05.png" width="34" height="30" alt="" style="background-position:bottom; background-repeat:no-repeat;"></td>';
	result += '	</tr>';
	result += '<tr>';
	result += '		<td colspan="4" class="admincontent" background="../images/editbubble_content.png" width="300" alt="" style="padding-left:10px; padding-right:10px; background-repeat:repeat-y;">';
	result += '<form method="post" action="' + formprocessor + '">';
	result += 'Válassza ki az időpontot!<br>';
	result += '<center><input type="text" id="h" value="' + hour + '" style="width:40px"> óra <input type="text" id="min" value="' + min + '" style="width:40px"> perc</center><br>';
	result += '<input type="hidden" name="year" value="' + year + '" id="y">';
	if (month[0] == '0') {
		month = parseInt(month[1]) - 1;
	}
	else {
		month = parseInt(month) - 1;
	}
	result += '<input type="hidden" name="month" value="' + month + '" id="m">';
	month += 1;
	result += '<input type="hidden" name="day" value="' + day + '" id="d">';
	result += '<input type="hidden" name="' + datename + '" value="" id="date">';
	result += '<iframe src="bubblecalendar.php?year=' + year + '&month=' + month + '" marginwidth=0 marginheight=0 scrolling=no frameborder=0 width=100% height=210></iframe>';
	result += '<br><input type="submit" onclick="createDate(document.getElementById(\'y\'), document.getElementById(\'m\'), document.getElementById(\'d\'), document.getElementById(\'h\'), document.getElementById(\'min\'));" value="Változtat" class="editbubblebutton">';
	result += '</form>';
	result += '		</td>';
	result += '	</tr>';
	result += '	<tr>';
	result += '		<td colspan="4" background="../images/editbubble_07.png" width="300" height="50" style="background-position:top;"></td>';
	result += '	</tr>';
	result += '</table>';
}
else {
	result += '<table id="Table_01" width="300" height="200" border="0" cellpadding="0" cellspacing="0">';
	result += '	<tr>';
	result += '		<td colspan="4" background="../images/editbubble_01.png" width="300" height="48" alt=""></td>';
	result += '	</tr>';
	result += '	<tr>';
	result += '		<td background="../images/editbubble_02.png" width="42" height="30" alt=""></td>';
	result += '		<td background="../images/editbubble_title.png" width="201" height="30" alt=""><h2>Új érték bevitele</td>';
	result += '		<td background="../images/editbubble_closebtn.png" width="23" height="30" alt=""><img src="../images/error.ico" onclick="closeEnterField()"></td>';
	result += '		<td background="../images/editbubble_05.png" width="30" alt="" style="background-position:-4px 0px"></td>';
	result += '	</tr>';
	result += '	<tr>';
	result += '		<td colspan="4" background="../images/editbubble_content.png" width="300" height="72" alt="" style="padding-left:10px; padding-right:10px;" class="admincontent">';
	result += '<form method="post" action="' + formprocessor + '">';
	result += '<input type="hidden" name="year" value="' + year + '" id="y">';
	if (month[0] == '0') {
		month = parseInt(month[1]) - 1;
	}
	else {
		month = parseInt(month) - 1;
	}
	result += '<input type="hidden" name="month" value="' + month + '" id="m">';
	month += 1;
	result += '<input type="hidden" name="day" value="' + day + '" id="d">';
	result += '<input type="hidden" name="' + datename + '" value="" id="date">';
	result += 'Válassza ki az időpontot!<br>';
	result += '<center><input type="text" id="h" value="' + hour + '" style="width:40px"> óra <input type="text" id="min" value="' + min + '" style="width:40px"> perc</center><br>';
	result += '<iframe src="bubblecalendar.php?year=' + year + '&month=' + month + '" marginwidth=0 marginheight=0 scrolling=no frameborder=0 width=100% height=210></iframe>';
	result += '<br><input type="submit" onclick="createDate(document.getElementById(\'y\'), document.getElementById(\'m\'), document.getElementById(\'d\'));" value="Változtat" class="editbubblebutton">';
	result += '</form>';
	result += '		</td>';
	result += '	</tr>';
	result += '	<tr>';
	result += '		<td colspan="4">';
	result += '			<img src="../images/editbubble_07.png" width="300" height="50" alt=""></td>';
	result += '	</tr>';
	result += '</table>';
}
	return result;
}

function generateDateOnlyEntryOutput(formprocessor, datename, value) {
	result = "";
	year = value.split("-")[0];
	month = value.split("-")[1];
	day = value.split("-")[2];
if (BrowserDetect.browser == "Firefox") {
	result += '<table id="Table_01" width="300" height="200" border="0" cellpadding="0" cellspacing="0">';
	result += '<tr>';
	result += '		<td colspan="4" background="../images/editbubble_01.png" width="300" height="48" alt="" style="background-position:bottom; background-repeat:no-repeat;"></td>';
	result += '	</tr>';
	result += '	<tr>';
	result += '		<td background="../images/editbubble_02.png" width="42" height="30" alt="" style="background-position:bottom;background-repeat:no-repeat;"></td>';
	result += '		<td background="../images/editbubble_title.png" width="201" height="30" alt="" style="background-position:bottom; background-repeat:no-repeat;"><h2>Új érték bevitele</h2></td>';
	result += '		<td background="../images/editbubble_closebtn.png" width="23" height="30" alt="" style="background-position:bottom; background-repeat:no-repeat;" valign="top"><img src="../images/error.ico" height=15 onclick="closeEnterField()"></td>';
	result += '		<td background="../images/editbubble_05.png" width="34" height="30" alt="" style="background-position:bottom; background-repeat:no-repeat;"></td>';
	result += '	</tr>';
	result += '<tr>';
	result += '		<td colspan="4" class="admincontent" background="../images/editbubble_content.png" width="300" alt="" style="padding-left:10px; padding-right:10px; background-repeat:repeat-y;">';
	result += '<form method="post" action="' + formprocessor + '">';
	result += 'Válassza ki az időpontot!<br>';
	result += '<input type="hidden" name="' + datename + '" value="" id="date">';
	result += '<input type="hidden" name="year" value="' + year + '" id="y">';
	if (month[0] == '0') {
		month = parseInt(month[1]) - 1;
	}
	else {
		month = parseInt(month) - 1;
	}
	result += '<input type="hidden" name="month" value="' + month + '" id="m">';
	month += 1;
	result += '<input type="hidden" name="day" value="' + day + '" id="d">';
	result += '<iframe src="bubblecalendar.php?year=' + year + '&month=' + month + '" marginwidth=0 marginheight=0 scrolling=no frameborder=0 width=100% height=210></iframe>';
	result += '<br><input type="submit" onclick="createOnlyDate(document.getElementById(\'y\'), document.getElementById(\'m\'), document.getElementById(\'d\'));" value="Változtat" class="editbubblebutton">';
	result += '</form>';
	result += '		</td>';
	result += '	</tr>';
	result += '	<tr>';
	result += '		<td colspan="4" background="../images/editbubble_07.png" width="300" height="50" style="background-position:top;"></td>';
	result += '	</tr>';
	result += '</table>';
}
else {
	result += '<table id="Table_01" width="300" height="200" border="0" cellpadding="0" cellspacing="0">';
	result += '	<tr>';
	result += '		<td colspan="4" background="../images/editbubble_01.png" width="300" height="48" alt=""></td>';
	result += '	</tr>';
	result += '	<tr>';
	result += '		<td background="../images/editbubble_02.png" width="42" height="30" alt=""></td>';
	result += '		<td background="../images/editbubble_title.png" width="201" height="30" alt=""><h2>Új érték bevitele</td>';
	result += '		<td background="../images/editbubble_closebtn.png" width="23" height="30" alt=""><img src="../images/error.ico" onclick="closeEnterField()"></td>';
	result += '		<td background="../images/editbubble_05.png" width="30" alt="" style="background-position:-4px 0px"></td>';
	result += '	</tr>';
	result += '	<tr>';
	result += '		<td colspan="4" background="../images/editbubble_content.png" width="300" height="72" alt="" style="padding-left:10px; padding-right:10px;" class="admincontent">';
	result += '<form method="post" action="' + formprocessor + '">';
	result += '<input type="hidden" name="' + datename + '" value="" id="date">';
	result += '<input type="hidden" name="year" value="' + year + '" id="y">';
	if (month[0] == '0') {
		month = parseInt(month[1]) - 1;
	}
	else {
		month = parseInt(month) - 1;
	}
	result += '<input type="hidden" name="month" value="' + month + '" id="m">';
	month += 1;
	result += '<input type="hidden" name="day" value="' + day + '" id="d">';
	result += 'Válassza ki az időpontot!<br>';
	result += '<iframe src="bubblecalendar.php?year=' + year + '&month=' + month + '" marginwidth=0 marginheight=0 scrolling=no frameborder=0 width=100% height=210></iframe>';
	result += '<br><input type="submit" onclick="createOnlyDate(document.getElementById(\'y\'), document.getElementById(\'m\'), document.getElementById(\'d\'));" value="Változtat" class="editbubblebutton">';
	result += '</form>';
	result += '		</td>';
	result += '	</tr>';
	result += '	<tr>';
	result += '		<td colspan="4">';
	result += '			<img src="../images/editbubble_07.png" width="300" height="50" alt=""></td>';
	result += '	</tr>';
	result += '</table>';
}
	return result;
}

function generateListEntryOutput(formprocessor, listname, listitems, value) {
	result = "";
//alert(value);
if (BrowserDetect.browser == "Firefox") {
	result += '<table id="Table_01" width="300" height="200" border="0" cellpadding="0" cellspacing="0">';
	result += '<tr>';
	result += '		<td colspan="4" background="../images/editbubble_01.png" width="300" height="48" alt="" style="background-position:bottom; background-repeat:no-repeat;"></td>';
	result += '	</tr>';
	result += '	<tr>';
	result += '		<td background="../images/editbubble_02.png" width="42" height="30" alt="" style="background-position:bottom;background-repeat:no-repeat;"></td>';
	result += '		<td background="../images/editbubble_title.png" width="201" height="30" alt="" style="background-position:bottom; background-repeat:no-repeat;"><h2>Új érték bevitele</h2></td>';
	result += '		<td background="../images/editbubble_closebtn.png" width="23" height="30" alt="" style="background-position:bottom; background-repeat:no-repeat;" valign="top"><img src="../images/error.ico" height=15 onclick="closeEnterField()"></td>';
	result += '		<td background="../images/editbubble_05.png" width="34" height="30" alt="" style="background-position:bottom; background-repeat:no-repeat;"></td>';
	result += '	</tr>';
	result += '<tr>';
	result += '		<td colspan="4" class="admincontent" background="../images/editbubble_content.png" width="300" alt="" style="padding-left:10px; padding-right:10px; background-repeat:repeat-y;">';
	result += 'Válassza ki a mező új értékét!<br>';
	result += '<form method="post" action="' + formprocessor + '">';
	result += '<select name="' + listname + '">';
	result += '<option value="0">Nincs érték</option>';
	for (i in listitems) {
		result += '<option value=' + i + ' ' + (value == listitems[i] ? 'selected' : '') + '>' + listitems[i] + '</option>';
	}
	result += '</select>';	
	result += '<br><input type="submit" value="Változtat" class="editbubblebutton">';
	result += '</form>';
	result += '		</td>';
	result += '	</tr>';
	result += '	<tr>';
	result += '		<td colspan="4" background="../images/editbubble_07.png" width="300" height="50" style="background-position:top;"></td>';
	result += '	</tr>';
	result += '</table>';
}
else {
	result += '<table id="Table_01" width="300" height="200" border="0" cellpadding="0" cellspacing="0">';
	result += '	<tr>';
	result += '		<td colspan="4" background="../images/editbubble_01.png" width="300" height="48" alt=""></td>';
	result += '	</tr>';
	result += '	<tr>';
	result += '		<td background="../images/editbubble_02.png" width="42" height="30" alt=""></td>';
	result += '		<td background="../images/editbubble_title.png" width="201" height="30" alt=""><h2>Új érték bevitele</td>';
	result += '		<td background="../images/editbubble_closebtn.png" width="23" height="30" alt=""><img src="../images/error.ico" onclick="closeEnterField()"></td>';
	result += '		<td background="../images/editbubble_05.png" width="30" alt="" style="background-position:-4px 0px"></td>';
	result += '	</tr>';
	result += '	<tr>';
	result += '		<td colspan="4" background="../images/editbubble_content.png" width="300" height="72" alt="" style="padding-left:10px; padding-right:10px;" class="admincontent">';
	result += 'Válassza ki a mező új értékét!<br>';
	result += '<form method="post" action="' + formprocessor + '">';
	result += '<select name="' + listname + '">';
	result += '<option value="0">Nincs érték</option>';
	for (i in listitems) {
		result += '<option value=' + i + ' ' + (value == listitems[i] ? 'selected' : '') + '>' + listitems[i] + '</option>';
//		result += '<option value=' + i + '>' + listitems[i] + '</option>';
	}
	result += '</select>';	
	result += '<br><input type="submit" value="Változtat" class="editbubblebutton">';
	result += '</form>';
	result += '		</td>';
	result += '	</tr>';
	result += '	<tr>';
	result += '		<td colspan="4">';
	result += '			<img src="../images/editbubble_07.png" width="300" height="50" alt=""></td>';
	result += '	</tr>';
	result += '</table>';
}
	return result;
}

var enterfield;
var enterfieldOn = false;
function openImageSelect(id, x, y, processor) {
	if (!enterfieldOn) {
		try
		{
			enterfield = document.createElement("<div class=\"enterfield\" id=\"ef\" style=\"position:absolute; top:" + (document.body.scrollTop + y) + "px; left:" + (x-204) + "px; width:320px;\">");
		}
		catch (e)
		{
			enterfield = document.createElement("div");
			enterfield.setAttribute("class", "enterfield");
			enterfield.setAttribute("id", "ef");
			enterfield.setAttribute("style","position:absolute; top:" + (document.body.scrollTop + y) + "px; left:" + (x-204) + "px; width:200px;");
		}
		document.all.adminbody.appendChild(enterfield);
		enterfield.innerHTML = generateImageSelectOutput(processor, id);
		enterfieldOn = true;
	}
	else {
		document.all.adminbody.removeChild(enterfield);
		enterfieldOn = false;
		openImageSelect(id, x, y, processor);
	}
}

function openFileSelect(id, x, y, processor) {
	if (!enterfieldOn) {
		try
		{
			enterfield = document.createElement("<div class=\"enterfield\" id=\"ef\" style=\"position:absolute; top:" + (document.body.scrollTop + y) + "px; left:" + (x-204) + "px; width:320px;\">");
		}
		catch (e)
		{
			enterfield = document.createElement("div");
			enterfield.setAttribute("class", "enterfield");
			enterfield.setAttribute("id", "ef");
			enterfield.setAttribute("style","position:absolute; top:" + (document.body.scrollTop + y) + "px; left:" + (x-204) + "px; width:200px;");
		}
		document.all.adminbody.appendChild(enterfield);
		enterfield.innerHTML = generateFileSelectOutput(processor, id);
		enterfieldOn = true;
	}
	else {
		document.all.adminbody.removeChild(enterfield);
		enterfieldOn = false;
		openImageSelect(id, x, y, processor);
	}
}

function fadeIn(phase) {
	enterfield.style.opacity="." + (phase*10);
	enterfield.style.filter="alpha(opacity=" + (phase*10) + ")";
	if (phase == 9)
	{
		enterfield.style.opacity="1";
		enterfield.style.filter="alpha(opacity=100)";
	}
}

function fadeOut(phase) {
	x=document.getElementsByTagName('body')[0];
	enterfield.style.opacity="." + ((10-phase)*10);
	enterfield.style.filter="alpha(opacity=" + ((10-phase)*10) + ")";
	if (phase == 9)
	{
		x.removeChild(enterfield);
	}
}

function openTextEntry(id, x, y, processor, value) {
//alert(x+"."+y);
	x=document.getElementsByTagName('body')[0];
	if (!enterfieldOn) {
		try
		{
			enterfield = document.createElement("<div class=\"enterfield\" id=\"ef\" style=\"position:absolute; top:" + (y + document.body.scrollTop) + "px; left:" + (x-204) + "px; width:320px; filter:alpha(opacity=0);\">");
		}
		catch (e)
		{
			enterfield = document.createElement("div");
			enterfield.setAttribute("class", "enterfield");
			enterfield.setAttribute("id", "ef");
			enterfield.setAttribute("style","position:absolute; top:" + (y + document.body.scrollTop) + "px; left:" + (x-204) + "px; width:300px; opacity:.10;");
		}
		x.appendChild(enterfield);
		//document.getElementById("contentframe").body[0].appendChild(enterfield);
		//document.all.adminbody.appendChild(enterfield);
		enterfield.innerHTML = generateTextEntryOutput(processor, id, value);
		for (i = 0; i<10; i++) {
			setTimeout("fadeIn(" + i + ")", i*30);
		}
		enterfieldOn = true;
	}
	else {
		x.removeChild(enterfield);
		enterfieldOn = false;
		openTextEntry(id, x, y, processor);
	}
}

function openLargeTextEntry(id, x, y, processor, value) {
	if (!enterfieldOn) {
		try
		{
			enterfield = document.createElement("<div class=\"enterfield\" id=\"ef\" style=\"position:absolute; top:" + (y + document.body.scrollTop) + "px; left:" + (x-204) + "px; filter:alpha(opacity=0); width:200px;\">");
		}
		catch (e)
		{
			enterfield = document.createElement("div");
			enterfield.setAttribute("class", "enterfield");
			enterfield.setAttribute("id", "ef");
			enterfield.setAttribute("style","position:absolute; top:" + (y + document.body.scrollTop) + "px; left:" + (x-204) + "px; opacity:.10; width:200px;");
		}
		document.all.adminbody.appendChild(enterfield);
		enterfield.innerHTML = generateLargeTextEntryOutput(processor, id, value);
		for (i = 0; i<10; i++) {
			setTimeout("fadeIn(" + i + ")", i*30);
		}
		enterfieldOn = true;
	}
	else {
		document.all.adminbody.removeChild(enterfield);
		enterfieldOn = false;
		openLargeTextEntry(id, x, y, processor);
	}
}

function openDateEntry(id, x, y, processor, value) {
	if (!enterfieldOn) {
//		alert(document.body.scrollTop);
		try
		{
			enterfield = document.createElement("<div class=\"enterfield\" id=\"ef\" style=\"position:absolute; top:" + (document.body.scrollTop + y) + "px; left:" + (x-204) + "px; filter:alpha(opacity=0); width:200px;\">");
		}
		catch (e)
		{
			enterfield = document.createElement("div");
			enterfield.setAttribute("class", "enterfield");
			enterfield.setAttribute("id", "ef");
			enterfield.setAttribute("style","position:absolute; top:" + (document.body.scrollTop + y) + "px; left:" + (x-204) + "px; opacity:.10; width:200px;");
		}
		document.all.adminbody.appendChild(enterfield);
		enterfield.innerHTML = generateDateEntryOutput(processor, id, value);
		for (i = 0; i<10; i++) {
			setTimeout("fadeIn(" + i + ")", i*30);
		}
		enterfieldOn = true;
	}
	else {
		document.all.adminbody.removeChild(enterfield);
		enterfieldOn = false;
		openDateEntry(id, x, y, processor);
	}
}

function openDateOnlyEntry(id, x, y, processor, value) {
	if (!enterfieldOn) {
//		alert(document.body.scrollTop);
		try
		{
			enterfield = document.createElement("<div class=\"enterfield\" id=\"ef\" style=\"position:absolute; top:" + (document.body.scrollTop + y) + "px; left:" + (x-204) + "px; filter:alpha(opacity=0); width:200px;\">");
		}
		catch (e)
		{
			enterfield = document.createElement("div");
			enterfield.setAttribute("class", "enterfield");
			enterfield.setAttribute("id", "ef");
			enterfield.setAttribute("style","position:absolute; top:" + (document.body.scrollTop + y) + "px; left:" + (x-204) + "px; opacity:.10; width:200px;");
		}
		document.all.adminbody.appendChild(enterfield);
		enterfield.innerHTML = generateDateOnlyEntryOutput(processor, id, value);
		for (i = 0; i<10; i++) {
			setTimeout("fadeIn(" + i + ")", i*30);
		}
		enterfieldOn = true;
	}
	else {
		document.all.adminbody.removeChild(enterfield);
		enterfieldOn = false;
		openDateEntry(id, x, y, processor);
	}
}

function openListEntry(id, x, y, processor, listitems, value) {
	if (!enterfieldOn) {
		try
		{
			enterfield = document.createElement("<div class=\"enterfield\" id=\"ef\" style=\"position:absolute; top:" + (y + document.body.scrollTop) + "px; left:" + (x-204) + "px; filter:alpha(opacity=0); width:200px;\">");
		}
		catch (e)
		{
			enterfield = document.createElement("div");
			enterfield.setAttribute("class", "enterfield");
			enterfield.setAttribute("id", "ef");
			enterfield.setAttribute("style","position:absolute; top:" + (y + document.body.scrollTop) + "px; left:" + (x-204) + "px; opacity:.10; width:200px;");
		}
		document.all.adminbody.appendChild(enterfield);
		enterfield.innerHTML = generateListEntryOutput(processor, id, listitems, value);
		for (i = 0; i<10; i++) {
			setTimeout("fadeIn(" + i + ")", i*30);
		}
		enterfieldOn = true;
	}
	else {
		document.all.adminbody.removeChild(enterfield);
		enterfieldOn = false;
		openListEntry(id, x, y, processor);
	}
}

function closeEnterField() {
	if (enterfieldOn) {
		for (i = 1; i<10; i++) {
			setTimeout("fadeOut(" + i + ")", i*30);
		}
		enterfieldOn = false;
	}
}

function highlightDay(item) {
	item.style.backgroundColor="#ffff56";
}

function unhighlightDay(item) {
	item.style.backgroundColor="#ffffcc";
}
var prevSelected = -1;
function selectDay(item) {
	item.style.textDecoration="underline";
	item.style.fontWeight = "bold";
	if (prevSelected >= 0)
	{
		document.getElementById(prevSelected).style.textDecoration = "none";
		document.getElementById(prevSelected).style.fontWeight = "normal";
	}
	prevSelected = item.id;
	self.parent.parent.document.getElementById("d").value = item.innerHTML;
}

function highlightTab(item) {
	item.className="highlighttab";
}

function unhighlightTab(item) {
	item.className="normaltab";
}

function selectTab(item, actionphp, itemid) {
	window.location=actionphp + "?teamid=" + itemid;
	selectedTab = itemid;
}

function startsWith(str, value) {
	return str.search(value) == 0;
}

function actualizeForm(select) {
	var paramlist = document.getElementById("paramstr").value.split(";");
	var chkvalue = select.value;
	if (select.value.split("_").length > 0) {
		chkvalue = select.value.split("_")[0];
	}
	for (var x in paramlist) {
		if (paramlist[x] != undefined) {
			var selectvalue = paramlist[x].split(":")[0];
//			alert(selectvalue + " " + chkvalue);
			if (!startsWith(selectvalue,chkvalue)) {
				continue;
			}
			var style = paramlist[x].split(":")[1];
			var stylelist = style.split(",");
			for (var s in stylelist) {
				var element = stylelist[s].split("-")[0];
				var stylevalue = stylelist[s].split("-")[1];
//				alert(element + " -> " + stylevalue);
				document.getElementById(element).style.visibility = stylevalue;
			}
		}
	}
}

function changeChampionship(item) {
	newValue = item.value;
	var url = window.location.toString().split("?")[0];
	window.location = url + "?bajnoksagid=" + item.value;
}

