function chmurka_img(e, v, src) {

	if (src) {

		var t = document.createElement("div");

		var chmurka_box;

		t.className = "chmurka";

		chmurka_box = '<table cellpadding="0" cellspacing="0">';

		chmurka_box += '<tr>';

		chmurka_box += '<td class="chmurka_top"><div>&nbsp;</div></td>';

		chmurka_box += '<tr>';

		chmurka_box += '<td class="chmurka_box"><div class="chmurka_box"><img src="' + src + '" alt="" style="margin: 3px;"></div></td>';

		chmurka_box += '</tr>';

		chmurka_box += '</table>';

		t.innerHTML = chmurka_box;

		v.move = function(e) {

			e = e || event;

			t.style.left = e.clientX + document.body.scrollLeft + 0 + "px";

			t.style.top = e.clientY + 25 + document.body.scrollTop + "px";

		}

		v.move(e);

		document.body.appendChild(t);

		v.onmousemove = function(e) {
			v.move(e);
		}

		v.onmouseout = function(e) {

			document.body.removeChild(t);

		}

	}

}

function chmurka_text(e, v, text) {

	if (text) {

		var t = document.createElement("div");

		var chmurka_box;

		t.className = "chmurka";

		chmurka_box = '<table cellpadding="0" cellspacing="0">';

		chmurka_box += '<tr>';

		chmurka_box += '<td class="chmurka_top"><div>&nbsp;</div></td>';

		chmurka_box += '<tr>';

		chmurka_box += '<td class="chmurka_box"><div class="chmurka_box"><div class="chmurka_box_text"><div>' + text + '</div></div></div></td>';

		chmurka_box += '</tr>';

		chmurka_box += '</table>';

		t.innerHTML = chmurka_box;

		v.move = function(e) {

			e = e || event;

			t.style.left = e.clientX + document.body.scrollLeft + 0 + "px";

			t.style.top = e.clientY + 25 + document.body.scrollTop + "px";

		}

		v.move(e);

		document.body.appendChild(t);

		v.onmousemove = function(e) {
			v.move(e);
		}

		v.onmouseout = function(e) {

			document.body.removeChild(t);

		}

	}

}

function top_menu(id) {

	for (i = 1; i < 14; i++) {

		document.getElementById('top_menu_' + i).className = 'top_menu_' + i;

		document.getElementById('top_submenu_' + i).className = 'top_submenu';

	}

	document.getElementById('top_menu_' + id).className = 'top_menu_' + id + '_over';

	document.getElementById('top_submenu_' + id).className = 'top_submenu_over';

}

function fb_box(t, id) {

	if (t.className == 'zwin') {

		t.className = 'rozwin';

		document.getElementById('fb_box_' + id).style.display = 'none';

	}

	else if (t.className == 'rozwin') {

		t.className = 'zwin';

		document.getElementById('fb_box_' + id).style.display = 'block';

	}

}

function p3l_box(t, id) {

	if (t.className == 'zwin') {

		t.className = 'rozwin';

		document.getElementById('p3l_box_' + id).style.display = 'none';

	}

	else if (t.className == 'rozwin') {

		t.className = 'zwin';

		document.getElementById('p3l_box_' + id).style.display = 'block';

	}

}

function p4l_box(t, id) {

	if (t.className == 'zwin') {

		t.className = 'rozwin';

		document.getElementById('p4l_box_' + id).style.display = 'none';

	}

	else if (t.className == 'rozwin') {

		t.className = 'zwin';

		document.getElementById('p4l_box_' + id).style.display = 'block';

	}

}

function p5l_box(t, id) {

	if (t.className == 'zwin') {

		t.className = 'rozwin';

		document.getElementById('p5l_box_' + id).style.display = 'none';

	}

	else if (t.className == 'rozwin') {

		t.className = 'zwin';

		document.getElementById('p5l_box_' + id).style.display = 'block';

	}

}

function p6l_box(t, id) {

	if (t.className == 'zwin') {

		t.className = 'rozwin';

		document.getElementById('p6l_box_' + id).style.display = 'none';

	}

	else if (t.className == 'rozwin') {

		t.className = 'zwin';

		document.getElementById('p6l_box_' + id).style.display = 'block';

	}

}

function p7l_box(t, id) {

	if (t.className == 'zwin') {

		t.className = 'rozwin';

		document.getElementById('p7l_box_' + id).style.display = 'none';

	}

	else if (t.className == 'rozwin') {

		t.className = 'zwin';

		document.getElementById('p7l_box_' + id).style.display = 'block';

	}

}

var map = null;

var geocoder = null;

function initialize(addres, photos, nick, plec, wiek) {

	if (GBrowserIsCompatible()) {

		map = new GMap2(document.getElementById("map_canvas"));

		map.setCenter(new GLatLng(17.4419, -32.1419), 1);

		map.addControl(new GSmallMapControl());

		geocoder = new GClientGeocoder();

		if (geocoder) {

			geocoder.getLatLng(

			addres,

			function(point) {

				if (!point) {

					alert(addres + " not found");

				} else {

					map.setCenter(point, 5);

					var marker = new GMarker(point);

					map.addOverlay(marker);

					// marker.openInfoWindowHtml("<table border=0><tr><td
					// rowspan=3><img src="+photos+"></td><td><b>Nick:</b>
					// "+nick+"</td></tr><tr><td><b>Płeć:</b>
					// "+plec+"</td></tr><tr><td><b>Wiek:</b>
					// "+wiek+"</td></tr></table>");

				}

			}

			);

		}

	}

}

function fb_box(t, id) {

	if (t.className == 'zwin') {

		t.className = 'rozwin';

		document.getElementById('fb_box_' + id).style.display = 'none';

	}

	else if (t.className == 'rozwin') {

		t.className = 'zwin';

		document.getElementById('fb_box_' + id).style.display = 'block';

	}

}

function p3l_box(t, id) {

	if (t.className == 'zwin') {

		t.className = 'rozwin';

		document.getElementById('p3l_box_' + id).style.display = 'none';

	}

	else if (t.className == 'rozwin') {

		t.className = 'zwin';

		document.getElementById('p3l_box_' + id).style.display = 'block';

	}

}

function p3l_box2(t, id) {

	if (document.getElementById('p3l_box_' + id).style.display == ''
			|| document.getElementById('p3l_box_' + id).style.display == 'block') {

		t.innerHTML = 'Rozwiń wiadomość';

		document.getElementById('p3l_box_' + id).style.display = 'none';

	}

	else if (document.getElementById('p3l_box_' + id).style.display == 'none') {

		t.innerHTML = 'Zwiń wiadomoś';

		document.getElementById('p3l_box_' + id).style.display = 'block';

	}

}

function p4l_box(t, id) {

	if (t.className == 'zwin') {

		t.className = 'rozwin';

		document.getElementById('p4l_box_' + id).style.display = 'none';

	}

	else if (t.className == 'rozwin') {

		t.className = 'zwin';

		document.getElementById('p4l_box_' + id).style.display = 'block';

	}

}

function p5l_box(t, id) {

	if (t.className == 'zwin') {

		t.className = 'rozwin';

		document.getElementById('p5l_box_' + id).style.display = 'none';

	}

	else if (t.className == 'rozwin') {

		t.className = 'zwin';

		document.getElementById('p5l_box_' + id).style.display = 'block';

	}

}

function p6l_box(t, id) {

	if (t.className == 'zwin') {

		t.className = 'rozwin';

		document.getElementById('p6l_box_' + id).style.display = 'none';

	}

	else if (t.className == 'rozwin') {

		t.className = 'zwin';

		document.getElementById('p6l_box_' + id).style.display = 'block';

	}

}

function p7l_box(t, id) {

	if (t.className == 'zwin') {

		t.className = 'rozwin';

		document.getElementById('p7l_box_' + id).style.display = 'none';

	}

	else if (t.className == 'rozwin') {

		t.className = 'zwin';

		document.getElementById('p7l_box_' + id).style.display = 'block';

	}

}

function cennikPOP() {

	var winl = (screen.width - 699) / 2;

	var wint = (screen.height - 301) / 2;

	window
			.open(
					'http://www.randka.pl/cennik2.html',
					'Cennik',
					'width=699,height=301,directories=no,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no, left='
							+ winl + ', top=' + wint);

}

function funkcjePOP() {

	var winl = (screen.width - 713) / 2;

	var wint = (screen.height - 802) / 2;

	window
			.open(
					'http://www.randka.pl/funkcje2.html',
					'Funkcje',
					'width=730,height=850,directories=no,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no, left='
							+ winl + ', top=' + wint);

}

function smsPremiumPOP() {

	var winl = (screen.width - 155) / 2;

	var wint = (screen.height - 155) / 2;

	window
			.open(
					'http://www.randka.pl/smsPremium.html',
					'SMS Premium',
					'width=155,height=155,directories=no,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no, left='
							+ winl + ', top=' + wint);

}

function chmurka_header(e, v, text) {

	if (text) {

		var t = document.createElement("div");

		var chmurka_box;

		t.className = "chmurka";

		chmurka_box = '<table cellpadding="0" cellspacing="0">';

		chmurka_box += '<tr>';

		chmurka_box += '<td class="chmurka2_top"><div>&nbsp;</div></td>';

		chmurka_box += '<tr>';

		chmurka_box += '<td class="chmurka2_box"><div class="chmurka2_box"><div class="chmurka2_box_text"><div>' + text + '</div></div></div></td>';

		chmurka_box += '</tr>';

		chmurka_box += '</table>';

		t.innerHTML = chmurka_box;

		v.move = function(e) {

			e = e || event;

			t.style.left = e.clientX + document.body.scrollLeft + 0 + "px";

			t.style.top = e.clientY + 25 + document.body.scrollTop + "px";

		}

		v.move(e);

		document.body.appendChild(t);

		v.onmousemove = function(e) {
			v.move(e);
		}

		v.onmouseout = function(e) {

			document.body.removeChild(t);

		}

	}

}

function instrukcjaPOP() {

	var winl = (screen.width - 576) / 2;

	var wint = (screen.height - 480) / 2;

	window
			.open(
					'http://www.randka.pl/instrukcja_rejestracja2.html',
					'Instrukcja',
					'width=576,height=480,directories=no,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no, left='
							+ winl + ', top=' + wint);

}

function showHelp(id) {
	var div1 = document.getElementById(id)
	if (div1.style.display == 'none') {
		div1.style.display = 'block'
	} else {
		div1.style.display = 'none'
	}

	var div2 = document.getElementById(id + '_label');
	// div2.style.background = '#000000';
	if (div2.className == 'joinNoHelp') {
		div2.className = 'joinWigthHelp';
	} else if (div2.className == 'joinWigthHelp') {
		div2.className = 'joinNoHelp';
	}
}