var selfdir="/fileadmin/foto-just/"
function wst(){
window.status="JUST - PHOTOGRAPHY"  ;
window.setTimeout("wst()",10);
}
// wst();

//function clearClipboard() { 
//if (window.clipboardData.getData("Text") == null && window.clipboardData.getData("URL") == null) 
//window.clipboardData.clearData("Image"); 
//}
//window.setInterval(clearClipboard,250); 

function WinOpen(d,h,w)
{
window.open(d,'win','height='+h+',width='+w+',scrollbars=yes,resizable=yes');
}


function WinClose()
{
self.close();
}

/////Tooltip-Funktionen

function initTip() {
	if (nodyn) return;
	tooltip = (ns4)? document.tipDiv.document: (ie4)? document.all['tipDiv']: (ie5||ns5)? document.getElementById('tipDiv'): null;
	tipcss = (ns4)? document.tipDiv.document: tooltip.style;
	if (ie4||ie5||ns5) {	// ns4 would lose all this on rewrites
		tipcss.width = tipWidth+"px";
		tipcss.fontFamily = tipFontFamily;
		tipcss.fontSize = tipFontSize;
		tipcss.color = tipFontColor;
		tipcss.backgroundColor = tipBgColor;
		tipcss.borderColor = tipBorderColor;
		tipcss.borderWidth = tipBorderWidth+"px";
		tipcss.padding = tipPadding+"px";
		tipcss.borderStyle = tipBorderStyle;
	}
	if (tooltip&&tipFollowMouse) {
		if (ns4) document.captureEvents(Event.MOUSEMOVE);
		document.onmousemove = trackMouse;
	}
}

function doTooltip(evt,num) {
	if (!tooltip) return;
	if (t1) clearTimeout(t1);	if (t2) clearTimeout(t2);
	tipOn = true;
	// set colors if included in messages array
	if (messages[num][2])	var curBgColor = messages[num][2];
	else curBgColor = tipBgColor;
	if (messages[num][3])	var curFontColor = messages[num][3];
	else curFontColor = tipFontColor;
	if (ns4) {
		var tip = '<table bgcolor="' + tipBorderColor + '" width="' + tipWidth + '" cellspacing="0" cellpadding="' + tipBorderWidth + '" border="0"><tr><td><table bgcolor="' + curBgColor + '" width="100%" cellspacing="0" cellpadding="' + tipPadding + '" border="0"><tr><td>'+ startStr + messages[num][0] + midStr + '<span style="font-family:' + tipFontFamily + '; font-size:' + tipFontSize + '; color:' + curFontColor + ';">' + messages[num][1] + '</span>' + endStr + '</td></tr></table></td></tr></table>';
		tooltip.write(tip);
		tooltip.close();
	} else if (ie4||ie5||ns5) {
		var tip = startStr + messages[num][0] + midStr + '<span style="font-family:' + tipFontFamily + '; font-size:' + tipFontSize + '; color:' + curFontColor + ';">' + messages[num][1] + '</span>' + endStr;
		tipcss.backgroundColor = curBgColor;
	 	tooltip.innerHTML = tip;
	}
	if (!tipFollowMouse) positionTip(evt);
	else t1=setTimeout("tipcss.visibility='visible'",100);
}

function trackMouse(evt) {
	mouseX = (ns4||ns5)? evt.pageX: window.event.clientX + document.body.scrollLeft;
	mouseY = (ns4||ns5)? evt.pageY: window.event.clientY + document.body.scrollTop;
	if (tipOn) positionTip(evt);
}

function positionTip(evt) {
	if (!tipFollowMouse) {
		mouseX = (ns4||ns5)? evt.pageX: window.event.clientX + document.body.scrollLeft;
		mouseY = (ns4||ns5)? evt.pageY: window.event.clientY + document.body.scrollTop;
	}
	
	// tooltip width and height
	var tpWd = (ns4)? tooltip.width: (ie4||ie5)? tooltip.clientWidth: tooltip.offsetWidth;
	var tpHt = (ns4)? tooltip.height: (ie4||ie5)? tooltip.clientHeight: tooltip.offsetHeight;
	// document area in view (subtract scrollbar width for ns)
	var winWd = (ns4||ns5)? window.innerWidth-20+window.pageXOffset: document.body.clientWidth+document.body.scrollLeft;
	var winHt = (ns4||ns5)? window.innerHeight-20+window.pageYOffset: document.body.clientHeight+document.body.scrollTop;
	// check mouse position against tip and window dimensions
	// and position the tooltip 
var korrX = (ns4||ns5)? (window.innerWidth-20-styleWidth)/2: (document.body.clientWidth-styleWidth)/2;
if (korrX <0) korrX=0;
	if ((mouseX+offX+tpWd)>winWd) 
		tipcss.left = (ns4)? mouseX-(tpWd+offX): mouseX-(tpWd+offX)+"px";
	else tipcss.left = (ns4)? mouseX+offX-korrX: mouseX+offX-korrX+"px";
	if ((mouseY+offY+tpHt)>winHt) 
		tipcss.top = (ns4)? winHt-(tpHt+offY): winHt-(tpHt+offY)+"px";
	else tipcss.top = (ns4)? mouseY+offY: mouseY+offY+"px";
	if (!tipFollowMouse) t1=setTimeout("tipcss.visibility='visible'",100);
}

function hideTip() {
	if (!tooltip) return;
	t2=setTimeout("tipcss.visibility='hidden'",100);
	tipOn = false;
}




/// Bildwechsel

function AddImageToImageList(name, Default, MouseOver, MouseDown)
{
	ImageList[imgCounter] = new Array(nMaxItem);
	ImageList[imgCounter][NameIndex] = name;
	ImageList[imgCounter][DefaultState] = new Image();
	ImageList[imgCounter][DefaultState].src = Default;
	if (MouseOver != "") {
		ImageList[imgCounter][MouseOverState] = new Image();
		ImageList[imgCounter][MouseOverState].src = MouseOver;
	}
	if (MouseDown != "") {
		ImageList[imgCounter][MouseDownState] = new Image();
		ImageList[imgCounter][MouseDownState].src = MouseDown;
	}

	imgCounter++;
}

function ReplaceImage(name, state)
{
	for (i = 0; i < imgCounter; i++) {
		if (document.images[ImageList[i][NameIndex]] != null) {
			if ((name == ImageList[i][NameIndex]) && (ImageList[i][state] != null))
				document.images[name].src = ImageList[i][state].src;
		}
	}
}



/// gleichzeitiger Framewechsel /links

function ZweiFrames(URL1,F1,URL2,F2)
{  
    parent.frames[F1].location.href=URL1;
    parent.frames[F2].location.href=URL2;   
}





function Diashow(Datei)
{
	showfenster=window.open(Datei,"showfenster","width=" + screen.width + ",height=" + screen.height + ",menubar=no,locationbar=no,toolbar=no,status=no");
	showfenster.moveTo(screen.width-screen.width,screen.height-screen.height);
}



/// Grossbildanzeige



function Anzeige(Bild, Frmat, Titel)
{
	var dateiname=Bild.split(".");
	var fvorl="fileadmin/foto-just/c.css";
	var copyright="";
	var DBlang ="deutsch";
	var Datenbank = "Datenbank";
	var lang="d";
	var txt= " << schliessen >>";
	
	

	if(gal=="Galerie")
		{
		
		}
	
	if(gal=="Gallery")
		{
		var lang="e";
		var txt= " << close >>";
		var Datenbank = "database";
		var DBlang ="english";
		}
      if(gal=="Galeries")
		{
		var lang="f";
		var txt= " << fermer >>";
		var Datenbank = "base de données";
		var DBlang ="french";
		}


	if(gal=="Fotofreunde")
		{
		var fvorl="http://www.photofreunde.de/photofreunde.css";
		}
	
	var code= Datenbank + "-ID: <a href=\"http://www.naturmotiv.de/details.php?image_id="+dateiname[0]+"&l="+DBlang+"\" target=\"_blank\">"+dateiname[0]+"</a>";	
	var Verzeichnis="";	
	var Verzeichnis=Verzeichnis + verz;	

	var lng=screen.height;
	
	if (screen.height >= 900)
		{
			var lng= 800;
			var fak= 0.95;
		}

	
	if (screen.height < 900)
		{
			var lng=screen.height;
			var fak= 0.70;
		}	
	

	if (Frmat=="h")
		{	var lng=lng*fak;
			var breit=lng/1.5;
			var hggif="loading_h"+lang+".gif";
		}
	
	if (Frmat=="q")
		{
			var lng=lng*1.0;
			var breit=lng;
			var hggif="loading_q"+lang+".gif";
		}
	var legbreit = breit+30;

///	bildfenster=window.open("","bildfenster","width=" + screen.width + ",height=" + screen.height + ",menubar=no,locationbar=no,toolbar=no,status=no");
///	bildfenster.moveTo(screen.width-screen.width,screen.height-screen.height);
	document.open();
	document.writeln("<html>");
	document.writeln("<head>");
	document.writeln("<title>Grossdarstellung</title>");
	document.writeln("<meta http-equiv=\"imagetoolbar\" content=\"no\">");
	document.writeln("<script type=\"text/javascript\">");
//document.writeln("window.setInterval(\"window.clipboardData.setData('Text','The clipboard is temporarily disabled!')\",20);");
	document.writeln("</script>");
	document.writeln("<link rel=\"StyleSheet\" href=\"" + fvorl + "\" type=\"text/css\">");
	document.writeln("</head>");
    document.writeln("<body OnKeyDown=\"javascript:window.history.back()\" OnDragstart=\"return false\" OnLectStart=\"return false\" OnContextMenu=\"return false\">");
///	document.writeln("<body>");
	document.writeln("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" height=\"100%\">");
	document.writeln("<tr>");
	document.writeln("<td valign=\"middle\" align=\"center\">");
	document.writeln("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" >");
	document.writeln("<tr>");
	document.writeln("<td valign=\"middle\" align=\"center\">");
	document.writeln("<table width=\"0%\" height=\"0%\" cellpadding=\"0\" cellspacing=\"0\" class=\"Loading\" >");
	document.writeln("<tr>");
	document.writeln("<td colspan=\"3\" align=\"center\">");
	document.writeln("<a href=\"javascript:window.history.back()\"> ");
	document.writeln("<img src=\"" + Verzeichnis + Bild + "\" border=\"0\" hspace=\"15\" vspace=\"15\" width=\"" + breit + "\" alt=\"" + txt + "\" >");
	document.writeln("</a>");
	document.writeln("</td>");
	document.writeln("</tr>");
	document.writeln("<tr>");
	document.writeln("<td align=\"left\" width=\"12%\"><font class=\"bildcode\">&nbsp;"+code+"</font></td>");
	document.writeln("<td align=\"middle\" width=\"76%\"><font class=\"bildtitel\">"+Titel+"</font></td>");
	document.writeln("<td align=\"right\" width=\"12%\"><a href=\"javascript:window.history.back()\"><img src=\""+selfdir+"close_"+lang+".gif\" alt=\"" + txt + "\" border=\"0\"></a></td>");
	document.writeln("</tr>");
///	document.writeln("<tr>");
///	document.writeln("<td align=\"left\" width=\"12%\">&nbsp;</td>");
///	document.writeln("<td align=\"middle\" width=\"76%\"></td>");
///	document.writeln("<td align=\"right\" width=\"12%\"></td>");
///	document.writeln("</tr>");
	document.writeln("</table>");
	document.writeln("</center>");
	document.writeln("</div>");
	document.writeln("</td>");
	document.writeln("</tr>");
	document.writeln("</table>");
	document.writeln("</td>  </tr>");
	document.writeln("</table>");
	document.writeln("</body>");
	document.writeln("</html>");
	document.close();
	focus();
	status="Lade Bild"
}	
