if ( isForm == '1' &&  isPopup == '1' && formReturn == false ) {
	nLocation = document.location.href.replace ( dbPath , formPath ) ; 
	nLocation = nLocation.replace ( '/preview/' , '/root/' ) ; 
	window.location.replace ( nLocation ) ; 
}
function load_form () { 
	if ( redirectURL != '' ) { // && preview == '' ) {
		if ( redirectURL.indexOf ('http://') > -1 )  window.open (redirectURL) ; 
		else { 
			if ( redirectURL.indexOf('javascript') > -1 ) eval ( redirectURL ) ;
			else document.location.replace ( redirectURL )
			return ;
		}
	}
	if ( agenturDirekt ) {
		document.cookie = 'agentur-direkt=' + agenturDirekt
	}
//	if ( isForm == '1' &&  isPopup == '1' && formReturn == false ) {
//		document.location.replace ( document.location.href.replace ( dbPath , formPath ) ) ; 
//		return ; 
//	}
	if ( printMode == 1 ) {
		if ( isForm == '1' ) {
			thisForm = document.forms[0] ; 
			openerForm = window.opener.document.forms['Response'] ; 
			for ( i = 0 ; i < thisForm.elements.length ; i++ ) {
				cElement = thisForm.elements[i] ; 
				oElement = openerForm.elements[i] ;
				switch (cElement.type) {
					case "text" : case "textarea" : case "hidden" : 
						cElement.value = oElement.value ;
						break ; 
					case "radio" : case "checkbox" : 
						cElement.checked = oElement.checked ; 
						break ; 
					case "select-one" : case "select-multiple" : case "select" :  	
						for ( o = 0 ; o < cElement.length ; o++ ) { 
							cElement.options[o].selected = oElement.options[o].selected 
						}
						break ; 
					default: 
						break ; 
				} 
			}
		}
		return window.print();
	}
}
function go_back () {
	if ( isPopup == '1'  && history.length == 0 ) window.close () ;
	else history.go(-1)
}
function open_popup ( id , w , h ) {
	if ( isPopup == 1 ) return open_popup (id) ;
	url = reloadURL + dbPath + '/' + view + '/' + id ; // + '?Open' ;
	if ( newWindow && newWindow == 1 ) return window.open ( url ) ;
	document.location.href=url
return;
	if ( id.indexOf ('/') > -1 )  url = reloadURL + id ;
	else url = reloadURL + dbPath + '/' + view + '/' + id + '?Open&sourcecat=' + docCat + '&popup=1' ;
	if ( agenturName != '' ) url += '&agtmail=' + agenturMail + '&agtname=' + agenturName ; 
	width = ( w ) ? w : 650 ; 
	width = 810 ; 
	height = ( h ) ? h : 600 ; 
	if ( isPopup == '1' ) document.location.href = url ;
	else window.open ('http://www.basler.de' + url,'','width='+width+',height='+height+',top=30,left=30,scrollbars=yes,status=yes,toolbar=no,resizable=yes') ;
}
function open_popupImage ( imgSrc ) {
	url = '/website6/dehg722.nsf/vwImagePopup/' + imgSrc ; 
	width = 650 ; 
	height = 600 ; 
	window.open (url,'','width='+width+',height='+height+',scrollbars=yes,status=yes,toolbar=no,resizable=yes') ;
}
function open_popupExt ( arg1 , arg2 , arg3 ) {
	window.open ( arg1 , arg2 , arg3 ) ; 
}
function do_search() {
	searchForm = document.forms['SearchForm'] ;
	searchStr = trim ( searchForm.SearchString.value ) ;
	if ( searchStr == '' ) return ;
	searchStr = searchStr + '*' ; 
	searchRel = 'AND' ; 
	searchDb = 'home' ; 
	searchDb = 'home,download' ; 
	searchStr = replace_subString ( searchStr , ' ' , ',' ) ;
	document.location.href = ( ( dbPath == '/website6/dehg727.nsf' ) ? homePath : dbPath ) + '/root/suche?Open&search=' + searchStr + '&rel=' + searchRel + '&db=' + searchDb ; 
	searchForm.SearchString.value = '' ; 
}
function do_searchAgentur ( sType ) {
	sForm = document.forms['AgenturSuche'] ; 
	agt = trim ( sForm.AgenturName.value ); 
	plz = trim ( sForm.PLZ.value ) ; 
	plz = replace_subString ( plz , '*' , '' ) ;
	ort = trim ( sForm.Ort.value ) ;
	for ( i = 0 ; i < sForm.Umkreis.length ; i ++ ) {
		if ( sForm.Umkreis[i].checked ) umkreis = sForm.Umkreis[i].value ; 
	}
	if ( agt + plz + ort == '' ) {
		alert ( 'Wählen Sie bitte mindestens ein Suchkriterium aus.   ' ) ; 
		return ;
	}
	document.location.href = dbPath + '/root/' + sType + '?Open&agt=' + agt + '&plz=' + plz + '&ort=' + ort + '&umkreis=' + umkreis ; 
}
function open_lexicon ( id , w , h ) {
	if ( id.indexOf ('/') > -1 )  url = reloadURL + id ;
	else url = reloadURL + lexiconPath + '/root/' + id + '?Open&popup=1' ;
	width = ( w ) ? w : 550 ; 
	height = ( h ) ? h : 400 ; 
	window.open (url,'','width='+width+',height='+height+',top=30,left=30,scrollbars=yes,status=yes,toolbar=no,resizable=yes') ;
}
function open_doc ( id , reloadNavi , newWindow ) {
//	if ( id.indexOf ( 'http://' ) > -1 ) window.open (id) ; 
//	return () ;
	if ( isPopup == 1 ) return open_popup (id) ;
	url =  ( ( dbPath == '/website6/dehg727.nsf' ) ? homePath : dbPath ) + '/' + view + '/' + id ; // + '?Open' ;
	if ( newWindow && newWindow == 1 ) return window.open ( url ) ;
//	if ( reloadNavi && reloadNavi == 1 ) url += '&reloadnavi=1' ; 
	document.location.href=url
}
function open_app ( url ) {
	if ( isExtranet ) document.location.href =  url  ; 
	else document.location.href = reloadURL + url ;
}
function open_window ( url , args ) {
	window_args = ( args ) ? args : 'width=600,height=600,top=30,left=30,scrollbars=yes,status=yes,toolbar=no,resizable=yes'
	newwin=window.open( reloadURL + url,'',window_args);
	newwin.focus()
}
function scroll_to ( id ) {
	url = dbPath + '/'+view+'/' + docID +'#' + id;
	document.location.href=url
}
function do_vote () {
	resp = '' ;
	voteForm = document.forms['VoteResults'] ;
	if ( voteForm.ResponseValue[0]) {
		for ( i = 0 ; i < voteForm.ResponseValue.length ; i ++ ) {
			if ( voteForm.ResponseValue[i].checked ) resp = voteForm.ResponseValue[i].value ;
		}
	}
	else if ( voteForm.ResponseValue.checked ) resp = voteForm.ResponseValue.value ;
	if ( resp == '' ) alert ( 'Wählen Sie bitte eine Antwort aus !      ' ) 	
	else {
		document.forms['VoteResults'].ReturnURL.value = document.location.href ; 
		document.forms['VoteResults'].submit ()
	}
}
function open_results () {
	rID = document.forms['VoteResults'].VoteID.value ;
	document.location.href = '/' + top.appPath['voting'] + '/vwVoteResultsWeb/' + rID + '?OpenDocument&back=' + document.location.href  ;
}
function do_print () {
	if ( isPopup == 1 ) window.print() ; 
	else {
		printURL = '?Open&print=1' ;  
//		url = dbPath + '/root/' + docID + '?Open&print=1' ; 		// Probleme bei Agentur-Seiten ;
		url = printURL ;
		window.open(url , '' , 'toolbar=yes,locationbar=no,menubar=yes,scrollbars=yes,status=no,toolbar=yes,resizable=yes,width=810,height='+(screen.height-200)+',top=20,left=50');	
	}
}
function trim ( txt ) {				// @Trim ( txt )
	returnTxt = '' ; 
	lastChar = '' ;
	for ( t = 0 ; t < txt.length ; t ++ ) {
		currChar = txt.charAt (t) ; 
		if ( currChar == ' ' ) {
			if ( lastChar != '' && lastChar != ' ' ) returnTxt += currChar ; 
		}
		else returnTxt += currChar ; 
		lastChar = currChar ; 
	}
	if ( lastChar == ' ' ) returnTxt = returnTxt.substring ( 0 , returnTxt.length-1 )  ;
	return returnTxt ;
}
function replace_subString ( txt1 , txt2 , txt3 ) {	 	// @ReplaceSubstring ( txt1 ; txt2 ; txt3 )
	indOf = txt1.indexOf ( txt2 )
	tmp_txt = '' ;
	while ( indOf > -1 ) {
		tmp_txt += txt1.substr ( 0 , indOf ) + txt3 ;
		tmp_len = txt1.length
		txt1 = txt1.substring ( indOf + txt2.length , tmp_len )
		indOf = txt1.indexOf ( txt2 )
	}
	tmp_txt += txt1;
	return tmp_txt;
}
function open_copyright ( cType ) {
	id = '' ;
	id = cType ; 
	if ( id == '' ) return ;
	url = dbPath + '/root/' + id + '?Open&popup=1' ;
	window.open (url,'','width=650,height=600,top=30,left=30,scrollbars=yes,status=yes,toolbar=no,resizable=yes') ;
}
function open_job (id) {
	url = dbPath + '/vwEmbJobsInternet/' + id + '?Open&popup=1' ;
	window.open (url,'','width=800,height=600,top=30,left=30,scrollbars=yes,status=yes,toolbar=no,resizable=yes') ;
}
function set_agenturCookie ( agenturAdr ,agenturName ) {
	if ( navigator.cookieEnabled == false ) {
		alert ( 'Sie haben keine Cookies aktiviert.   \nDie Agentur kann nicht gemerkt werden.    ' ) ; 
		return ;
	}
	timeInterval = (1000 * 60 * 60 * 24 * 365) ;
	var nowValue = new Date () ;
	var expireDate = new Date ( new Date().getTime() + timeInterval);
  	
	document.cookie = 'agentur-favorit=' + agenturAdr + '; expires=' + expireDate.toGMTString() + ';' ; 
	alert ( 'Die Agentur \"' + agenturName + '\" wurde gemerkt.    ' ) ;
}
function open_agenturAnfahrt () {
//	url = 'http://www.yellowmap.de/Filialfinder/Html/Map.aspx?Partner=BaslerSecuritas&SecurityID=R6FWvqaOgB5XUiERibW%2Fbg%3D%&MapAddresses=' ; 
	url = 'http://wwws.yellowmap.de/Filialfinder/Html/Map.aspx?Partner=BaslerSecuritas&SecurityID=R6FWvqaOgB5XUiERibW%2Fbg%3D%&MapAddresses=' ; // D|76227|Karlsruhe||G%C3%B6llnitzer%20Str.%201
	agenturAdr = encodeURI(agenturAdr) ; 
	agenturAdr = replace_subString ( agenturAdr , '%7C' , '|' ) ;
	// alert ( agenturAdr )
	window.open (url + agenturAdr ,'','width=830,height=600,top=30,left=30,scrollbars=yes,status=yes,toolbar=no,resizable=yes') ;
}
function open_agenturKontakt () {
	url = 'https://www.basler.de/website6/dehg727.nsf/root/agtkontaktform?Open&popup=1&agtmail=' + agenturMail + '&agtname=' + agenturName ; 
	//window.open (url ,'','width=810,height=600,top=30,left=30,scrollbars=yes,status=yes,toolbar=no,resizable=yes') ;
	document.location.href = url ;
} 
function open_agenturSite ( agenturAdr ) {
	document.location.href = dbPath + '/root/agtsuche?Open&popup=' +isPopup+ '&agtid=' + agenturAdr ; 
} 
function open_agenturSubpage ( agenturAdr , subpageAdr ) {
	document.location.href = dbPath + '/root/agtsuche?Open&popup=' +isPopup+ '&agtid=' + agenturID + '&s=' + agenturAdr ; 
} 
function show_subentry (id) {
	linkObj = document.getElementById ('a_' + id) ;
	divObj = document.getElementById ('div_' + id) ;
	if ( divObj && linkObj ) {
		if ( divObj.style.display == '' ) {
			divStyle = 'None' ; 	
			linkClass='dpath' ;
		}
		else {
			divStyle = '' ; 	
			linkClass='dpathBottom' ;
		}
		divObj.style.display = divStyle ; 
		linkObj.className = linkClass ; 
	}
}
function open_regSite ( agenturAdr ) {
	document.location.href = dbPath + '/root/agtsuche?Open&popup=' +isPopup+ '&agtid=' + agenturAdr + '&regnr' ; 
} 
