// JUKOWNS DIV VIEWER - By Bodtrade.com - By Juraj Bodnar BOD_POP
var BP_objct2;
var y_posun = 0;
var mousee_y = 0;

function BP_ChangeText(objct, txt){
document.getElementById(objct).innerHTML=txt;
}

function BP_hide(objct){
if (document.getElementById(objct)){
document.getElementById(objct).style.display="none";
}
}

function BP_show(objct, width){
y_posun = 0;
BP_objct2 = objct;
if (document.getElementById(objct)){
if (width == 0){
document.getElementById(objct).style.display="block";
document.getElementById(objct).style.width="auto";
} else {
document.getElementById(objct).style.display="block";
document.getElementById(objct).style.width=width;
}
}
}

function BP2_show(objct, width, height){
BP_objct2 = objct;
if (document.getElementById(objct)){

var screencor = ScreenSize();
//y_posun = centercor[1] + "px";

if ((mousee_y + height) > screencor[1]) {
y_posun = -height;
} else {
y_posun = 0;
}


if (width == 0){
document.getElementById(objct).style.display="block";
document.getElementById(objct).style.width="auto";
} else {
document.getElementById(objct).style.display="block";
document.getElementById(objct).style.width=width;
}
}
}

function BP_MouseXY(e){
if (document.getElementById(BP_objct2)){
if (typeof(e)=="undefined")e=event;

if (e.pageX || e.pageY) {
var coord = "("+e.pageX+", "+e.pageY+")";
document.getElementById(BP_objct2).style.left = e.pageX+10+"px";
document.getElementById(BP_objct2).style.top = e.pageY+10+y_posun+"px";
mousee_y = e.pageY;
} else if (e.clientX || e.clientY) 	{
var coord = "("+e.pageX+", "+e.pageY+")";
document.getElementById(BP_objct2).style.left = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft + 10 + "px";
document.getElementById(BP_objct2).style.top = e.clientY + document.body.scrollTop + document.documentElement.scrollTop + 10 + y_posun + "px";
mousee_y = e.clientY + document.body.scrollTop + document.documentElement.scrollTop;
}
}
if(typeof(txtCoord)!="undefined"){
txtCoord.removeChild(txtCoord.firstChild);
txtCoord.appendChild(document.createTextNode(coord));
}
}
if (typeof(document.attachEvent)!="undefined"){
document.attachEvent("onmousemove",BP_MouseXY);
} else if (typeof(document.addEventListener)!="undefined") {
document.addEventListener("mousemove",BP_MouseXY,true);
}


function ScreenSize() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = (window.innerWidth);
    myHeight = ((window.innerHeight)) + document.documentElement.scrollTop;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = (document.documentElement.clientWidth);
    myHeight = ((document.documentElement.clientHeight)) + document.documentElement.scrollTop;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = (document.body.clientWidth);
    myHeight = ((document.body.clientHeight)) + document.body.scrollTop;
  }
 
  return [myWidth,myHeight];
}





// END - JUKOWNS PHOTO VIEWER - By Bodtrade.com
