// Skrypty użyte w serwisie Foto-HALTER
// MM
<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
// -->
// MM End
<!--
// JK Pop up image viewer script- By JavaScriptKit.com
// Visit JavaScript Kit (http://javascriptkit.com)
// for free JavaScript tutorials and scripts
// This notice must stay intact for use

var popbackground="#999999" //specify backcolor or background image for pop window
var windowtitle="Studio Foto-HALTER"  //pop window title

function detectexist(obj){
return (typeof obj !="undefined")
}

function jkpopimage(imgpath, popwidth, popheight, textdescription){

function getpos(){
leftpos=5
//(detectexist(window.screenLeft))? screenLeft+document.body.clientWidth-popwidth : detectexist(window.screenX)? screenX+innerWidth/2-popwidth : 0
toppos=5
//(detectexist(window.screenTop))? screenTop+document.body.clientHeight/3-popheight/3 : detectexist(window.screenY)? screenY+innerHeight/3-popheight/3 : 0
if (window.opera){
leftpos-=screenLeft
toppos-=screenTop
}
}

getpos()
var winattributes='width='+popwidth+',height='+popheight+',resizable=yes,scrollbars=yes,left='+leftpos+',top='+toppos
var bodyattribute=(popbackground.indexOf(".")!=-1)? 'background="'+popbackground+'"' : 'bgcolor="'+popbackground+'"'
if (typeof jkpopwin=="undefined" || jkpopwin.closed) {
jkpopwin=window.open("","",winattributes)
 }else{
//getpos() //uncomment these 2 lines if you wish subsequent popups to be centered too
//jkpopwin.moveTo(leftpos, toppos)
jkpopwin.resizeTo(popwidth+40, popheight+50)
}
jkpopwin.document.open()
jkpopwin.document.write('<html><title>'+windowtitle+'</title><body '+bodyattribute+'><p>'+textdescription+'<br><img src="'+imgpath+'" style="margin-bottom: 0.5em; margin-top: 1em; border: 1px solid #666;" /></p></body></html>')
jkpopwin.document.close()
jkpopwin.focus()
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
//====================================================================
// Wykonywanie funkcji wyświetlającej okno.
function create_window(image, width, height) {

    // Zwiększenie o&nbsp;kilka pikseli szerokości i&nbsp;wysokości.
    width = width + 30;
    height = height + 50;
    
    // Jeśli okno jest już otwarte, wtedy zostanie zmieniona jego wielkość.
    if (window.popup_window && !window.popup_window.closed) {
        window.popup_window.resizeTo(width, height);
    } 
    
    // Ustawienie właściwości okna.
	var window_specs = "location=no, scrollbars=no, menubars=no, toolbars=no, resizable=no, left=0, top=0, width=" + width + ", height=" + height;
	
	// Określenie adresu URL.
	var url = "./j/image_window.php?image=" + image;
	
	// Utworzenie okna.
	popup_window = window.open(url, "PictureWindow", window_specs);
	popup_window.focus();
	
} // Koniec funkcji.

//================================================================================================
function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

// Copyright (c) May 2002 by Michał Nazarewicz (mina86@tlen.pl)
// Idea by Michał Jazłowiecki (michalj@prioris.mini.pw.edu.pl)
// This software is free; It's distributed under terms of GNU General Public License

var theDoc=document, theAll=(theDoc.all)?theDoc.all:null;
function ShowHideLayer(name, state) {
	if (theAll==null) return;
	if (arguments.length<2) state=theAll[name].style.display=="none";
	theAll[name].style.display=(state)?"block":"none";
}
function ButtonClick(but, name, desc1, desc2) {
	var state=but.value==desc1;
	but.value=(state)?desc2:desc1;
	ShowHideLayer(name,!state);
}
function addShowHideButton(name, desc1, desc2, state) {
	if (theAll==null) return;
	theDoc.write('<form><input type="button" value="'+(state?desc1:desc2)+
	'" onclick="ButtonClick(this, \''+name+'\',\''+desc1+'\',\''+desc2+'\');" /></form>');
}

//==================================================================================================
// focus on the first input in form
function fokus(AElementID) {
    var el = document.getElementById(AElementID);
    el.focus();
}
//==================================================
// toggle visibility 

function rozwin( targetId ){
  if (document.getElementById){
  		target = document.getElementById( targetId );
  			if (target.style.display == "none"){
  				target.style.display = "block";
  			} else {
  				target.style.display = "none";
  			}
  	}
}

function toggleDisplay(target) {
	if (document.getElementById){
		var togglin = document.getElementById( target );
		if(togglin.style.display == ""){
			togglin.style.display = "none";
		}else{
			togglin.style.display = "";
		}
	}
};

function toggleDiv(target) {
	if (document.getElementById){
		var togglout = document.getElementById( target );
		if(togglout.style.display == ""){
			togglout.style.display = "none";
		}else{
			togglout.style.display = "";
		}
	}
};

function toggleDisplayDivs(target) {
	if (document.getElementById){
		var togglin = document.getElementById( target );
		if(togglin.className == "ukryty"){
			togglin.className = "widoczny";
		}else{
			togglin.className = "ukryty";
		}
	}
};

function expandCollapseBoxes(){
	if(!document.getElementsByTagName) {return;}
	var divs = document.getElementsByTagName("div");
	for (var i=0; i< divs.length; i++) {
		if(divs[i].className == "ukryty") {
		divs[i].className = "widoczny";
		}
	}
};
//-->
