function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		aoc_04_over = newImage("images/aoc_04-over.jpg");
		aoc_05_over = newImage("images/aoc_05-over.jpg");
		aoc_06_over = newImage("images/aoc_06-over.jpg");
		aoc_07_over = newImage("images/aoc_07-over.jpg");
		preloadFlag = true;
	}
}


function PostitPopup(pid) {
	  var LeftPosition = (screen.width) ? (screen.width-600)/2 : 0;
	  var TopPosition = (screen.height) ? (screen.height-50)/2 : 0;
	  var popwin = window.open('/_misc/popup/postit.php?pid='+pid,'Postit','toolbar=no,width=600,height=50,top='+TopPosition+',left='+LeftPosition+',directories=no,status=no,statusbar=0,scrollbars=no,resizable=no,menubar=no');
      popwin.focus();
}

function closePostit(pid){
	//window.opener.location = url;
	window.opener.location = 'http://www.agent-orange-crew.de/index.php?pid='+pid;
	window.close();
}

function postcardPopup() {
	  var LeftPosition = (screen.width) ? (screen.width-750)/2 : 0;
	  var TopPosition = (screen.height) ? (screen.height-860)/2 : 0;
	  var popwin = window.open('/gallery/postcardviewer/index.html','Postcard','toolbar=no,width=900,height=800,top='+TopPosition+',left='+LeftPosition+',directories=no,status=no,statusbar=0,scrollbars=no,resizable=no,menubar=no');
      popwin.focus();
}

function simpleviewerPopup(id) {
	  var LeftPosition = (screen.width) ? (screen.width-950)/2 : 0;
	  var TopPosition = (screen.height) ? (screen.height-600)/2 : 0;
	  var popwin = window.open('/gallery/simpleviewer/'+id+'/index.html','Postcard','toolbar=no,width=950,height=600,top='+TopPosition+',left='+LeftPosition+',directories=no,status=no,statusbar=0,scrollbars=no,resizable=no,menubar=no');
      popwin.focus();
}


/*NAVI*/
var menuopen = "";
var aktivmenu = "";
var aktiv = "";
var oldclass = "";

function rollout(ebene) {
	window.clearTimeout(aktiv);
	if (menuopen != "") rollin(menuopen);
	menuopen = ebene;
	if (document.getElementById(ebene)) {
		document.getElementById(ebene).style.visibility = "visible";
	}
}

function checkrollstat(ebene) { 

	aktiv = window.setTimeout("rollin('"+ebene+"')",1000);
}

function rollin(ebene) {
	if (document.getElementById(ebene)) {
		document.getElementById(ebene).style.visibility = "hidden";
		//if (ebene != aktivmenu) document.getElementById(ebene+"link").className=oldclass;
	}
}
