pageWidth = 780;


/* ----- start:detailWindow ----- */

function findPos(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft;
		curtop = obj.offsetTop;
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft;
			curtop += obj.offsetTop;
		}
	}
	browW = (bw.ie) ? document.body.clientWidth : window.innerWidth;
	curleft = curleft - Math.floor((browW-pageWidth)/2);
	return [curleft,curtop];
}

function hint(img,text,obj){
  var position = findPos(obj);
  posX = position[0];
  posY = position[1];

  img = (img=='') ? catimg : img;
  
  document.hintPic.src = img;
  GetObj('hintText').innerHTML = text;
  GetObj('detailWindow').className = "hint2";
  GetObj('detailWindow').style.top = posY + 20 + "px";
  GetObj('detailWindow').style.left = posX + "px";
  //GetObj("message").innerHTML = text;
}

function hideFnc(){  GetObj('detailWindow').className = "hiddenObject";	}

function inpChange(inObj,outObj){  GetObj(outObj).innerHTML = inObj.value;	}

/* ----- end: detailWindow ----- */


/* ----- start: textWindow ----- */

hintPadd = 20;
hintMarg = 100;

function htext(img,header,text,url,obj){
  var position = findPos(obj);
  posX = position[0];
  posY = position[1];

  if(header!=undefined && header!=""){	GetObj('h6').innerHTML = '<h6>'+header+'</h6>';
  } else {				GetObj('h6').style.display = "none";  }
  
  if(img!=undefined && img!=""){	GetObj('img').innerHTML = '<img src="'+img+'" title="'+img+'" />';
  } else {				GetObj('img').style.display = "none";  }

  if(text!=undefined && text!=""){	GetObj('text').innerHTML = text;
  } else {				GetObj('text').style.display = "none";  }

  if(url!=undefined && url!=""){	GetObj('url').innerHTML = '<a href="'+url+'" alt="'+url+'">'+url+'</a>';
  } else {				GetObj('url').style.display = "none";  }

  corHW = 5;

  GetObj('hintArea').style.height = hintPadd + "px";
  GetObj('hintArea').style.width = obj.offsetWidth + corHW + "px";
  GetObj('textWindow').style.padding = hintMarg + "px";
  GetObj('textWindow').className = "displayObject";
  GetObj('textWindow').style.top = posY + 20 - hintPadd - hintMarg + "px";
  GetObj('textWindow').style.left = posX - hintMarg + "px";
}

function ovH(){	hiddHint = false;	}
function ouH(){	hiddHint = true;	}

function hideTW(){  /*GetObj('textWindow').className = "hiddenObject";*/	}
function hideTWO(hH){	if(hiddHint || hH)GetObj('textWindow').className = "hiddenObject";	}

/* ----- in HTML

<span onmouseover="htext('inzert_img.jpg','inzert header','inzert text','inzert url',this);"  onmouseout="hideTW();">xxx</span>

<div id="textWindow" class="hiddenObject">
	<div class="bord"><div class="TL">&nbsp;</div><div class="TR">&nbsp;</div></div>
	<div class="content">
	                    	<div id="textHint">
			<div id="h6"><h6>Nadpis</h6></div>
			<div id="img">obrazek</div>
			<div id="text">text</div>
			<div id="url">url</div>		
		</div>
	</div>
	<div class="bord"><div class="BL">&nbsp;</div><div class="BR">&nbsp;</div></div>
</div>

----- */


/* ----- end: textWindow ----- */

