var nwin = new Array(); 
function open_window(b,h,app,name){
	url = window.location.pathname;
	neu = url.replace(/\//g,"__");
	stop = neu.lastIndexOf(".") + 1;
	teilstr = neu.substr(0,stop);
	stop = teilstr.lastIndexOf(".");
   	datei =  teilstr.substr(0,stop); 
	if (app != ""){ 
		datei = datei + "_" + app;
	}
	if (name){
		win_name = name;
	}
	else{
		win_name="newwin";
	}
	nwin[win_name] = window.open("/atlas/java/legenden/legende.htm","" +  datei + "","width=" + b + ",height=" + h + ",screenX=150,screenY=120,resizable=yes,scrollbars=yes");
	nwin[win_name].focus();
	datei="";
}

function close_win(name) {
        if (nwin != null){
  	   if (name==null){
		name='newwin';
	   }
	   if (nwin[name] && !nwin[name].closed){
        	nwin[name].close();
           }
        }
	/*if (nwin != null) nwin.close();*/
}
function check_print() {
       /* if (version=='cdversion'){*/
                document.write("<A HREF=\"Javascript: print_layout()\"><img src=\"/atlas/bilder/drucken.gif\" width=\"120\" height=\"36\" border=\"0\"></a>");
        /*}*/
}

function check_gislink(gislink) {
        if (gislink!="" && gislink != undefined){
                document.write("&nbsp;<A HREF=\"" + gislink +"\"  target=\"_blank\"><img src=\"/atlas/bilder/button_gis.gif\" width=\"120\" height=\"36\" border=\"0\"></a>");
        }
}

function print_layout() {
        url = window.location.pathname;
        stop = url.lastIndexOf("/") + 1;
        teilstr = url.substr(stop,url.length);
        ende = teilstr.lastIndexOf(".");
        teilstr = url.substr(stop,ende);
        newurl = "/atlas/java/pdf/lay_" + teilstr + ".pdf";
        nw = window.open(newurl,"fenster","width=600,height=400,screenX=150,screenY=120,resizable=yes");
        nw.focus();
 
}

function searchformLegacy (){
        if (suchfunktion=='on'){
		document.writeln('<form method="put" name="SearchForm" action="/cgi-bin/ua_search.pl" target="haupt">');
	document.writeln('<font face="Verdana, Arial, Helvetica, sans-serif" size="2">'); 
	document.writeln('<input type="hidden" name="Range" value="All">');
        document.writeln('<input type="hidden" name="Format" value="Standard">')
        document.writeln('<input type="text" name="Terms" size="8">');
        document.writeln('<input type="image" border="0" name="imageField2" src="bilder/such.gif" width="60" height="20" align="top">');
        document.writeln('</font> </form>');
	}
}

function searchform (){
	if (suchfunktion=='on'){
		document.write('<div style="background-image:url(bilder/such-bgr.gif);">');
		document.write('<form style="display:inline; font-size:10px;" method="put" name="SearchForm" action="/cgi-bin/ua_search.pl" target="haupt">');
		document.write('<input type="hidden" name="Range" value="All">');
		document.write('<input type="hidden" name="Format" value="Standard">');
		document.write('<input type="text" name="Terms" size="9" ');
		document.write(' style="display:inline;height:12px;margin-left:4px;margin-right:3px;margin-top:3px;margin-bottom:3px;width:70px;border:0;font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;">');
		document.write('<input type="image" hspace="4" border="0" name="imageField2" ');
		document.write(' style="display:inline;"');
		document.write(' src="bilder/such-gray.gif" width="60" height="20" align="top">');
		document.write('</form>');
		document.write('</div>');
	} else {
		document.write('<div style="background:#cccccc; height:20px;"> &nbsp; ');
		document.write('<div>');
	}
}
