function flip(rid)
{
	current=(document.getElementById(rid).style.display == 'none') ? 'block' : 'none';
	document.getElementById(rid).style.display = current;
}



function l_popup(url, name) {
	window.open(url, name, 'width=540,height=540,resizable=yes,scrollbars=yes');
// 	win = window.open(url, name, 'width=<?= L_EDIT_POPUP_WIDTH ?>,height=<?= L_EDIT_POPUP_HEIGHT ?>');
// 	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}


function l_confirm(txt, url) {
	if (confirm(txt)) {
		window.location=url;
	}
}


function l_confirm_popup(txt, url, name) {
	if (confirm(txt)) {
		window.open(url, name, 'width=540,height=540,resizable=yes,scrollbars=yes');
	}
}


function l_newwindow(page) {
	var unrounded=Math.random()*10000;
	var rnd=Math.round(unrounded); 
	OpenWin = this.open(page, "asdfasdfasdfa"+rnd, "toolbar=yes,menubar=yes,location=yes,scrollbars=yes,resizable=yes");
}


function l_byt(elmName, text) {
	var newNode = document.createTextNode(text);
	var elm = document.getElementById(elmName);
	elm.replaceChild(newNode, elm.firstChild);
}

function header(str) {
	elmName = "header";
	var newNode = document.createTextNode(str);
	var elm = document.getElementById(elmName);
	elm.replaceChild(newNode, elm.firstChild);
}

function l_seatinfo(ls_id) {
	var inf = s[ls_id].split("|");
	if (!inf[6]) {
		inf[6] = 0;
	}
	if (!inf[7]) {
		inf[7] = 0;
		var flagimg = " ";
	} else {
		var flagimg = "<img src='"+flag[inf[7]]+"' />";
	}
	if (inf[8]) {
		var img = "<img src='userdata/"+inf[3]+"/"+inf[8]+"' class='l_seatinfo_image' /><br />\n";
	} else if (inf[3]) {
		var img = "<img src='userdata/noimg.jpg' class='l_seatinfo_image' /><br />\n";
	} else {
		var img = " ";
	}
	var seatinfohtml =
		"Row: <b>"+inf[0]+"</b> "+
		"Seat: <b>"+inf[1]+"<br />\n"+
		inf[2]+"</b><br />\n<br />\n"+
		img+"<br />\n"+
		inf[4]+"<br />\n"+
		inf[5]+"<br />\n"+
		city[inf[6]]+"<br />\n"+
		flagimg+country[inf[7]]+"<br />\n";


//	var newNode = document.createTextNode(seatinfohtml);
	var elm = document.getElementById("seatinfo");
//	elm.replaceChild(newNode, elm.firstChild);
	elm.innerHTML = seatinfohtml;
}

