// check, ci je setnute blade_root_path - ak nie, setneme na /
if(!window.blade_root_path)
  blade_root_path = "/";

// otvorenie obrazku v novom okne - picture_show.php
function show_picture(source) {
  window.open(blade_root_path + "blade/picture_show.php?source=" + source, "", "toolbar=no,menubar=no,location=no,directories=no,scrollbars=no,resizable=no,status=no");
}

// otvorenie nahladu na tlac
function print_preview(params) {
  window.open(blade_root_path + 'blade/print.php?' + params, '', 'toolbar=no,menubar=no,location=no,directories=no,scrollbars=yes,resizable=no,status=no,height=600,width=750')	
}

// funkcie pre fotkovy tooltip
function doTooltip2(prvy, druhy) {
  if(window.doTooltip)
    doTooltip(prvy, druhy);
}

function hideTip2() {
  if(window.hideTip)
	hideTip();
}

// tooltip settings

// move tip when mouse moves over link
var tipFollowMouse = true;	
// set tipWidth wide enough for widest image
var tipWidth = 455;
// how far from mouse to show tip
var offX = 20;	
var offY = 12;
// text font properties
var tipFontFamily = "Verdana, arial, helvetica, sans-serif";
var tipFontSize= "11px";
var tipFontColor = "#000000";
// tip block settings
var tipBgColor = "#ddecff"; 
var tipBorderColor = "#6ba7d9";
var tipBorderWidth = 1;
var tipBorderStyle = "solid";
var tipPadding = 4;



function showDiv(ID,ID2,CountDivs) {
	var reg = /_clicked/;
	var searchString = document.getElementById("linkID"+ID+ID2).className;

	//sicher stellen das "_clicked" nicht im ClassName vorkommt
	if (!reg.exec(searchString)) {	
		//schaltet die Divs erst mal alle aus
		hideAllDivs(CountDivs, ID2, document.getElementById("linkID"+ID+ID2).className, document.getElementById("tdID"+ID+ID2).className, document.getElementById("tdLeftID"+ID+ID2).className, document.getElementById("tdRightID"+ID+ID2).className);

		//Div anschalten
		document.getElementById("divID"+ID+ID2).style.display='block';

		//Link Class wechseln
		document.getElementById("linkID"+ID+ID2).className = document.getElementById("linkID"+ID+ID2).className+'_clicked';

		//TD BackGround wechseln
		document.getElementById("tdID"+ID+ID2).className = document.getElementById("tdID"+ID+ID2).className+'_clicked';
		document.getElementById("tdLeftID"+ID+ID2).className = document.getElementById("tdLeftID"+ID+ID2).className+'_clicked';
		document.getElementById("tdRightID"+ID+ID2).className = document.getElementById("tdRightID"+ID+ID2).className+'_clicked';
	}
}

function hideAllDivs(value, value2, classNameAnker, classNameTD, classNameTDLeft, classNameTDRight) {

	for(i=1;i<=value;i++) {
		//Divs ausschalten
		document.getElementById("divID"+i+value2).style.display='none';

		//Link Class auf Standard wechseln
		document.getElementById("linkID"+i+value2).className = classNameAnker;

		//Link Class auf Standard wechseln
		document.getElementById("tdID"+i+value2).className = classNameTD;
		document.getElementById("tdLeftID"+i+value2).className = classNameTDLeft;
		document.getElementById("tdRightID"+i+value2).className = classNameTDRight;
	}
}

function showImage(value) {
	var oElement = document.getElementById(value);

	var oldString = oElement.src;

	var newString = oldString.replace("_lo.","_hi.");

	oElement.src = newString;
}

function hideImage(value) {
	var oElement = document.getElementById(value);

	var oldString = oElement.src;

	var newString = oldString.replace("_hi.","_lo.");

	oElement.src = newString;
}