/* Allgemeine Funktionen */ var pageinfoarray = new Array(); function sucheexist() { if(typeof(SuchMaskenWerte) != "undefined" && SuchMaskenWerte) { return true; } return false; } function searchControllerexist() { if (typeof(searchController)!= "undefined" && searchController) { return true } return false; } function markerhandlerexist() { if (typeof(markerhandler) != "undefined" && markerhandler) { return true; } return false; } function getparams(param,item) { var idpos; var suchpattern = ""; if (param) { var suchmuster = "--"+item+"-"; idpos = param.indexOf(suchmuster); if (idpos > -1) { idpos += suchmuster.length; // ab der Werte // Ende ?? suchpattern = param.substr(idpos); idpos= suchpattern.indexOf("--"); if (idpos == -1) { // Nichtsgefunden idpos = suchpattern.indexOf(".html"); } if (idpos > -1) { // Ende gefunden return suchpattern.substring(0,idpos) } else { return suchpattern.substring(0) } } } return ""; } function getlfdnraufruf() { var docid = getdocidaushref(); if (docid) { return getlfdnr(docid); } return 0; } function getdocidaushref(sAufruf) { var aufruf; if(typeof(sAufruf) != "undefined" && sAufruf) { aufruf = sAufruf; } else { aufruf = unescape(window.location.href); } var docid=""; var idpos = aufruf.indexOf("id="); if (idpos > -1) { aufruf = aufruf.substr(idpos); idpos = aufruf.indexOf("&"); if (idpos < 0) { idpos = aufruf.indexOf("#"); } if(idpos > -1) { docid = aufruf.substring(3,idpos); } else { docid = aufruf.substr(3); } } else { idpos = aufruf.indexOf(".html"); if (idpos > 7 && typeof(global_site_name) != "undefined") { docid = global_site_name + ":"+ aufruf.substr(idpos-8,8); } } return docid; } function gettitelaushref(sAufruf) { var aufruf; var titver = ""; if(typeof(sAufruf) != "undefined" && sAufruf) { aufruf = sAufruf; } else { aufruf = unescape(window.location.href); } var titel idpos = aufruf.indexOf(".html"); if (idpos > 7) { var tit = aufruf.substr(0,idpos-9); var ii = 0; for ( var i = 1; i < tit.length ; i++) { ii++; if(tit.substr(tit.length-i,1) != "/") { titver = tit.substr(tit.length-i,1) + titver; } else { break; } } } return titver; } function makeparam(lfdnr) { var plusparam; if(global_rewrite_on) { plusparam = "&p="; } else { plusparam = "&p="; } // plusparam = "&p="; if (lfdnr) { plusparam+= "--lfdnr-"+lfdnr; } if (sucheexist()) { plusparam += makesucheparams(); } else if (markerhandlerexist()) { plusparam += makemarkerparams(); } if(global_anchor && global_anchor!="#") { plusparam += "--ank-"+ global_anchor; } plusparam+="--nix-" return plusparam; } function pageInfo() { this.docid=""; this.url =""; this.lfdnr=""; this.titel=""; this.anchor=""; this.suchtext =""; this.selected_text=""; this.selected_feld=""; this.check_field= new Array(); this.postop = ""; this.posleft = ""; this.excerps = ""; this.suche_exps = 0; this.treffer_page = ""; this.current_marker = 0; this.current_query =""; } function writePageInfo(param,url,titel,doctype,woher) { global_current_content_index = pageinfoarray.length pageinfoarray[global_current_content_index] = new pageInfo(); pageinfoarray[global_current_content_index].docid = global_docid; pageinfoarray[global_current_content_index].url = url; pageinfoarray[global_current_content_index].titel = titel; pageinfoarray[global_current_content_index].anchor = global_anchor; pageinfoarray[global_current_content_index].suchtext = getparams(param,"sc"); pageinfoarray[global_current_content_index].selected_text = getparams(param,"st"); pageinfoarray[global_current_content_index].check_field = getparams(param,"cf").split("-"); pageinfoarray[global_current_content_index].postop = getparams(param,"pt"); pageinfoarray[global_current_content_index].posleft = getparams(param,"pl"); pageinfoarray[global_current_content_index].excerps = getparams(param,"ausz"); pageinfoarray[global_current_content_index].suche_exps = parseInt(getparams(param,"exps")); pageinfoarray[global_current_content_index].treffer_page = getparams(param,"pc"); pageinfoarray[global_current_content_index].current_marker = getparams(param,"mc"); if (typeof(searchController)!= "undefined" && searchController.getLastQuery(2) != "" && woher!="toc") { pageinfoarray[global_current_content_index].current_query = searchController.getLastQuery(2); } /* Jetzt evtl selecteintrag korrigieren - hinzufügen */ var docobj = document.seitenform.seitenformauswahl; if(docobj) { var newobj = new Option(titel, ""+global_current_content_index, false, true); docobj.options[docobj.length] = newobj; } if(global_current_content_index > global_max_pages) { /* Obergrenze erreicht */ pageinfoarray.shift(); global_current_content_index = pageinfoarray.length-1; if(docobj) { var innerhtml=""; for (var i=0 ; i < pageinfoarray.length; i++) { innerhtml += ""; } docobj.innerHTML = innerhtml; docobj.selectedIndex = global_current_content_index; } } } function anzeigeDocument(doctype,lfdnr,url,docid,params,titel,sAnchor,eintragHistory,woher,funktiom) { // TYP DOCUMENT ..... // lfdn im TOC // evtl. url hppt//..... // evtl d0cid A0000123 // // url holen 1 url Argument 2 Documenten Id 3 lfd nr var docurl=url; /* Wenn eptoc included ist */ if (!docurl) { alert("Keine URL vorhanden") } if (docurl) { var pa = makeparam(lfdnr); docurl += pa; if (typeof(searchController)!= "undefined" && searchController.getLastQuery(2) != "" && woher!="toc") { if (sucheexist() && searchController.getLastQuery(2) != SuchMaskenWerte.voll_text_suche) { docurl += ("&q=" + searchController.getLastQuery(2)); } // docurl += ("--q-" + searchController.getLastQuery(2)); // params += "#" + anchor; } global_docid=docid; global_anchor=sAnchor; docurl += params; if (global_load_content) { alert("hier nicht") if(eintragHistory) { writePageInfo(pa,docurl+defaulthtml,titel,doctype,woher); } var funktion = "initpage('"+woher+"','')"; loadTemplate(docurl+defaulthtml,"","",doctype,funktion); } else { window.location.href = docurl; } } else { alert("Inhaltsverzeichnis nicht geladen"); } } function unSelectItem() { $j(".NavTextSelected").removeClass("NavTextSelected").addClass("NavText"); $j(".htocSelected").removeClass("htocSelected").addClass("htocNotSelected"); } function jstocUnmarkSelected() { $j(".NavTextSelected").removeClass("NavTextSelected").addClass("NavText"); } function jstocUnmarkSubtoc() { $j(".htocSelected").removeClass("htocSelected").addClass("htocNotSelected"); } function makeUrl(docid,url,titel) { var sTarget; if(!global_rewrite_on) { sTarget = "http://www.regalfuchs.de/epublix1/gw?s=rfshop-backend&f=document&epsessid_=db99c061-99ef-4f7c-a818-c24cc10619d5&id=" + docid; } else { var t = titel.replace(/ /g,"-"); t = t.replace(/\+/g,"-und-"); t = t.replace(/ä/g,"ae"); t = t.replace(/Ä/g,"AE"); t = t.replace(/ö/g,"oe"); t = t.replace(/Ö/g,"OE"); t = t.replace(/ü/g,"ue"); t = t.replace(/Ü/g,"UE"); t = t.replace(/ß/g,"ss"); var id = docid.substr(docid.length-8); if(id != "d0000549" && id != "d0000550" && id != "d0000551" && id != "d0000552" && id != "d0000553") { sTarget = "http://www.regalfuchs.de/" +t+"-"+id; } else { sTarget = "http://www.regalfuchs.de/" +t; } if (sTarget.indexOf(".html") < 0) { sTarget+=".html"; } sTarget += "?epsessid_=db99c061-99ef-4f7c-a818-c24cc10619d5&docfrom=rfshop-backend:d0000060"; } return sTarget; } function initpage(woher,arg2) { var params = makeparam_ausinfo(); global_docid = getparams(params,"did"); global_anchor = getparams(params,"ank"); if (typeof(createhitzeile) != "undefined" && searchController.getLastQuery(2) && woher!="toc") { init_hits(params); } else { if(typeof(global_hits) != "undefined") { global_hits = getHits(); } } } function makeparam_ausinfo() { var plusparam=""; if(global_current_content_index && pageinfoarray.length >= global_current_content_index+1 && pageinfoarray.length) { var index = global_current_content_index; plusparam = "&p="; if(pageinfoarray[index].lfdnr) { plusparam+= "--lfdnr-"+pageinfoarray[index].lfdnr; } if(pageinfoarray[index].suchtext) { plusparam += "--se-"+pageinfoarray[index].suchtext; } if (pageinfoarray[index].selected_text) { plusparam += "--st-"+pageinfoarray[index].selected_text; } if(pageinfoarray[index].selected_feld) { plusparam += "--sf-"+pageinfoarray[index].selected_feld; } if(pageinfoarray[index].check_field.length) { plusparam += "--cf-"+pageinfoarray[index].check_field.join("-"); } if(pageinfoarray[index].postop) { plusparam += "--pt-"+pageinfoarray[index].postop; } if(pageinfoarray[index].posleft) { plusparam += "--pl-"+pageinfoarray[index].posleft; } if (pageinfoarray[index].excerps) { plusparam += "--ausz-" + pageinfoarray[index].excerps; } if (parseInt(pageinfoarray[index].suche_exps)) { plusparam += "--exps-"+parseInt(pageinfoarray[index].suche_exps); } if(pageinfoarray[index].treffer_page) { plusparam += "--pc-" + pageinfoarray[index].treffer_page; } if (pageinfoarray[index].current_marker) { plusparam += "--mc-"+ (pageinfoarray[index].current_marker); } if(pageinfoarray[index].anchor) { plusparam += "--ank-"+ pageinfoarray[index].anchor; } if(pageinfoarray[index].docid) { plusparam += "--did-"+ pageinfoarray[index].docid; } } return plusparam; } function seitenwechsel(richtung,selobj) { var x; if (pageinfoarray.length) { if(richtung == "prev") { if(global_current_content_index) { global_current_content_index -= 1; x = document.seitenform.seitenformauswahl; if(x) { x.selectedIndex=global_current_content_index; } anzeige_old_doc(global_current_content_index); } } else if(richtung == "next") { if(global_current_content_index < pageinfoarray.length -1 ) { global_current_content_index += 1; x = document.seitenform.seitenformauswahl; if(x) { x.selectedIndex=global_current_content_index; } anzeige_old_doc(global_current_content_index); } } else if(typeof(selobj)=="object") { /* Aus auswahlliste */ global_current_content_index = selobj.selectedIndex; anzeige_old_doc(global_current_content_index); } } } function markiere_toc(docid,anchor,lfdnr) { if(!global_expand_toc) { markiere_toc_xsl(lfdnr,docid); } else { JSTOCSynchronize(docid); } } function ScrollNeueSeiteInView(docid,anchor,lfdnr) { markiere_anchor(docid,anchor); JSTOCScrollSelectedToVisible(); } function anzeige_old_doc(index) { if (typeof(searchController)!= "undefined") { searchController.saveQuickSearch(pageinfoarray[index].current_query,""); } markiere_toc(pageinfoarray[index].docid,pageinfoarray[index].anchor,pageinfoarray[index].lfdnr); anzeigeDocument("content",0,pageinfoarray[index].url,pageinfoarray[index].docid,"",pageinfoarray[index].titel,pageinfoarray[index].anchor,0,""); // global_docid wird in anzeigeDocument gesetzt ScrollNeueSeiteInView(global_docid,global_anchor,pageinfoarray[index].lfdnr); } function markiere_anchor(docid,anchor) { if(anchor && anchor != "#") { ScrollToAnchor(anchor); JSTOCSetSelected(docid+":"+anchor,true); //JSTOCSetSelected(docid+":"+anchor,null); } else if(global_hits && !global_hits.length) { Documentscrolltop(global_content_container); /* An Dokumentenanfang */ } } function linkaction(obj) { var docid; var titel; if(obj) { var aufruf = obj.getAttribute("href"); docid = getdocidaushref(aufruf); titel = gettitelaushref(aufruf); if(docid) { var sTarget = makeUrl(docid,"",titel); markiere_toc(docid,"",0); anzeigeDocument(global_content,0,sTarget,docid,'',titel,'',global_load_content,"",""); Documentscrolltop(global_content_container); // alert("muß da sein"); } } else { alert ("Fehler"); } return false; } var global_cookie_enabled = true; function setCookie(cname, cvalue, exdays) { if(global_cookie_enabled) { var d = new Date(); d.setTime(d.getTime() + (exdays*24*60*60*1000)); var expires = "expires="+d.toUTCString(); document.cookie = cname + "=" + cvalue + "; " + expires; return true; } return false; } function getCookie(cname) { if(global_cookie_enabled) { var name = cname + "="; var ca = document.cookie.split(';'); for(var i=0; i