var mxpos = 0;
var mypos = 0;

var b_title;
var b_pohlavi;
var b_datum;
var b_home;
var b_height;
var b_eyes;
var b_ethnicity;
var b_movies;
var	b_obrazek;
var	b_txt;
var b_url;

function getMousePos2(e) {
	if (document.body) {
		var evnt = e;
		if (typeof e == 'undefined') e = window.event;
		if (typeof e.layerX == 'undefined') e.layerX = e.offsetX;
		if (typeof e.layerY == 'undefined') e.layerY = e.offsetY;

		if (document.documentElement.scrollTop) {
			var scrollT = document.documentElement.scrollTop;
		} else {
			var scrollT = document.body.scrollTop;
		}
		mxpos = e.clientX;
		mypos = e.clientY+scrollT;
	}
}
document.onmousemove = getMousePos2;

/* bubbles */
var pp = null; // active popup

var hidetimer = null;
var showtimer = null;

function bubble_over2(el, title, pohlavi, obrazek, datum, home, height, eyes, ethnicity, movies, txt, url) {
	b_title = title;
	b_pohlavi = pohlavi;
	b_obrazek = obrazek;
	b_datum = datum;
	b_home = home;
	b_height = height;
	b_eyes = eyes;
	b_ethnicity = ethnicity;
	b_movies = movies;
	b_txt = txt;
	b_url = url;
	clearTimeout(showtimer);
	showtimer = window.setTimeout(function () { bubble_show2(el); }, 150);
}

function bubble_on2() {
    clearTimeout(showtimer);
    clearTimeout(hidetimer);
}

function bubble_out2(el) {
	b_title = b_pohlavi = b_obrazek = b_datum = b_home = b_height = b_eyes = b_ethnicity = b_movies = b_txt = b_url = '';
	clearTimeout(showtimer);
	if (pp != null)
		hidetimer = window.setTimeout(function() { bubble_hide2(); }, 150);
}

function bubble_show2(el) {
	var app = null;
	var im = null;
	var d = el.getElementsByTagName('span');
	var i = 0;
	var id = 0;
	var input;

	var s = "";

	while (i<d.length) { 
		if (d.item(i).className && 
			(d.item(i).className == "popup off" || d.item(i).className == "kregion off" ) ) {
			app = d.item(i);
		} else
		if (d.item(i).className && d.item(i).className == "img") {
			im = d.item(i)
		}
		i++; 
	}

	if (app != null) {
		if (pp != null && pp != app) { b_hide(); }

		if (pp == null || app != pp) {
			app.style.left = (mxpos - 220) + "px";
			app.style.top = (mypos + 6) + "px";
		}
		app.onmouseover = function() {
			clearTimeout(hidetimer);
		}
		app.onmouseout = function() {
			hidetimer = window.setTimeout(function() { bubble_hide(); }, 150);
		}
		app.style.visibility='visible';
		pp=app;
	}
	if(b_obrazek !='')
	{
	input = '<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"2\" style=\"FONT-SIZE: 11px; VERTICAL-ALIGN: top; COLOR: #5f0113; FONT-FAMILY: Tahoma; line-height: 14px;\">';
	input += '<tr><td colspan=\"2\" align=\"center\" style=\"background-image: url(../../img/bg_title.gif); background-repeat: repeat-x; font-weight: bold; font-family: Verdana; font-size: 12px;color: #6F1C08; \">';
	if(b_pohlavi == 'actresses')
		{
		input += '<img src=\"../../img/female.gif\" alt=\"\" width=\"17\" height=\"14\" border=\"0\" align=\"absmiddle\"> ';
		}
	else
		{
		input += '<img src=\"../../img/male.gif\" alt=\"\" width=\"17\" height=\"14\" border=\"0\" align=\"absmiddle\"> ';
		}
	input += b_title;
	input +='</td></tr>';
	input += '<tr>';
	input += '<td rowspan=\"7\"><a href=\"'+b_url+'\"><img hspace=\"2\" src=\"'+b_obrazek+'\" alt=\"Click to show all movies with '+b_title+'\" title=\"Click to show all movies with '+b_title+'\" vspace=\"4\" width=\"100\" height=\"140\" onmouseover=\"mo2(this);\" onmouseout=\"mx2(this);\" class=\"stateoff2\"></a></td>';
	input += '<td><b>Date Of Birth:</b> '+b_datum+'</td></tr>';
	input += '<tr><td><b>Home:</b> '+b_home+'</td></tr>';
	input += '<tr><td><b>Height:</b> '+b_height+'</td></tr>';
	input += '<tr><td><b>Eyes:</b> '+b_eyes+'</td></tr>';
	input += '<tr><td><b>Ethnicity:</b> '+b_ethnicity+'</td></tr>';
	input += '<tr><td><b>Movies:</b> <a href=\"'+b_url+'\" title=\"Click to show all movies with '+b_title+'\">'+b_movies+'</a></td></tr>';
	input += '<tr><td><img src=\"../../img/1x1.gif\" width=\"210\" height=\"1\" border=\"0\"></td></tr>';
	input += '<tr><td colspan=\"2\" align=\"center\"><img src=\"../../img/cara.gif\" alt=\"\" width=\"380\" height=\"2\" border=\"0\"><br><b>movies</b><br><img src=\"../../img/cara.gif\" alt=\"\" width=\"380\" height=\"2\" border=\"0\"></td></tr>';
	input += '<tr><td colspan=\"2\" align=\"center\" bgcolor=\"#F6DABB\" style=\"border-top: 1px solid #FFFFFF;\">'+b_txt+'</td></tr>';
	input += '</table>';
	}
	else
	{
	input = '<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"2\" style=\"FONT-SIZE: 11px; VERTICAL-ALIGN: top; COLOR: #5f0113; FONT-FAMILY: Tahoma; line-height: 14px;\">';
	input += '<tr><td colspan=\"2\" align=\"center\" style=\"background-image: url(../../img/bg_title.gif); background-repeat: repeat-x; font-weight: bold; font-family: Verdana; font-size: 12px;color: #6F1C08; \">';
	if(b_pohlavi == 'actresses')
		{
		input += '<img src=\"../../img/female.gif\" alt=\"\" width=\"17\" height=\"14\" border=\"0\" align=\"absmiddle\"> ';
		}
	else
		{
		input += '<img src=\"../../img/male.gif\" alt=\"\" width=\"17\" height=\"14\" border=\"0\" align=\"absmiddle\"> ';
		}
	input += b_title;
	input += '<tr><td align=\"center\" style=\"border-top: 1px solid #EB933A;\"><b>Movies:</b> <a href=\"'+b_url+'\" title=\"Click to show all movies with '+b_title+'\" class=\"url\">'+b_movies+'</a></td></tr>';
	input += '<tr><td align=\"center\" bgcolor=\"#EFC397\" style=\"border-top: 1px solid #FFFFFF;\">'+b_txt+'</td></tr>';
	input += '</table>';
	}
	app.innerHTML = input;
	return true;
}

function bubble_hide2() {
	if (pp != null) {
		pp.style.visibility = "hidden";
		pp = null;
	}
}


