﻿function oeffneZoom( adatafile, anotefile, autor, xmlfiles) {
	if(parseInt(navigator.appVersion)>=4)
	{
		var breite = screen.width-5;
		var hoehe = screen.height-70;
	} else {		
		var breite = 970;
		var hoehe = 600;
	}
	var zoomurl = 'http://www.alphametrix.de/extras/phatozoom/pathozoom.php?value_x='+breite+'&value_y='+hoehe+'&datafile='+adatafile;
	if (anotefile != '' ) {
		zoomurl = zoomurl + '&notefile='+anotefile;
	}
	if (autor ) {
		zoomurl = zoomurl + '&autor=yes';
	} 
	if (xmlfiles ) {
		zoomurl = zoomurl + '&xmlfiles=yes';
	} 
	win = window.open( zoomurl, 'PathoZoom','left=0,top=0, width='+breite+', height='+hoehe+', menubar = no' );
	win.focus();
}

function str_replace(strsearch, strreplace, haystack)
{

	if ((haystack == null) || (strsearch == null))
	{
		return null;
	}
   	
   	if ((haystack.length == 0) || (strsearch.length == 0))
   	{
   		return haystack;
   	}

    if ((strreplace == null) || (strreplace.length == 0))
    { 
    	strreplace = "";
    }

    var len_strsearch = strsearch.length;
    var len_strreplace = strreplace.length;
    var Pos = haystack.indexOf(strsearch, 0);

    while (Pos >= 0)
    {
    	haystack = haystack.substring(0, Pos) + strreplace + haystack.substring(Pos + len_strsearch);
    	Pos = haystack.indexOf(strsearch, Pos + len_strreplace);
    }
    
  	//  alert(haystack);
    
    return haystack;
}


function bild_geladen(objekt,link,cssclass) 
{
		var acthtml = objekt.parentNode.innerHTML;
		var bigpic = objekt.src.substr(objekt.src.lastIndexOf("/"),objekt.src.length);
		var lupe = "<div class='"+cssclass+"'><a href='#none' onclick='zoom(\"../../images/contentpics/gross"+bigpic+"\", \"\");'></a></div>";
		acthtml = "<a href='#none' onclick='zoom(\"../../images/contentpics/gross"+bigpic+"\", \"\");'>"+acthtml+"</a>";
		objekt.parentNode.innerHTML = lupe+str_replace("bild_geladen", "leer", acthtml);
}




var akt_fensternummer=1; // wird um eins erh?ht wenn ein neues Fenster mit zoom_datei ge?fnet wird 


function zoom(pfad, text)
{


	neues_fenster = window.open('', "Window", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=50,height=50,screenX=50,screenY=50,top=50,left=50");
	neues_fenster.document.open();
	
	with(neues_fenster.document)
	{	
		writeln('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">');
		writeln('<html>');
		writeln('<head>');
			writeln('<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">');
	
			writeln('<style type="text/css" type="text/css" media="screen"><!--');
			writeln('.zoombild { border: solid 1px gray; background-color: white; padding: 7px }');
			writeln('--></style>');
			writeln('<title>Zoom</title>');
		
			writeln('<script language="javascript"><!--');
			writeln('function resize() {');
			writeln('var abstand_x = 50;');
			writeln('var abstand_y = 50;');
			
  			writeln('if (document.images[0]) window.resizeTo(document.images[0].width +abstand_x, document.images[0].height+abstand_y);');
 			writeln(' self.focus();');
			writeln('}');
			writeln('//--></script>');

		writeln('</head>');

		writeln('<body onload="resize();" bgcolor=#E6E6E6  leftmargin="0" marginheight="0" marginwidth="0" topmargin="5">');
		writeln('<div align="center"><a href="#" onclick="window.close();"><img class="zoombild" id="bild"  src="'+pfad+'" border="0" alt="" title=""></a></div>');		

		writeln('</body>');
		writeln('</html>');
	}
		
	neues_fenster.document.close();
	
}

function drucke(page,reiter){
//	alert('Inhalt kommt noch!');
	win = window.open('drucke.php?page='+page+'&reiter='+reiter,'name','width=540,height=600,scrollbars=yes' );
	win.focus();
}


function start() {
if(document.layers) { bewegung = document.moving;
} else if (document.all) { bewegung = moving.style; }
bewegdich()
}
function bewegdich() {
bewegung.left = parseInt(bewegung.left) - 3;
if (parseInt(bewegung.left) < 0 ) { bewegung.right = 640 }
setTimeout('bewegdich()',200);
}

