/**
* Standard JavaScript library Contwise 2
* Copyright General Solutions Steiner GmbH & F.Falkner
*
/******************************************************************
Original Code from
© 2001 Struppi
Mail: struebig@gmx.net
URL: http://home.arcor.de/struebig/computer/javascript
Modified 2004 by Florian Falkner
*/
var default_bgColor = '#EAEAEA';
var default_width = 400;
var default_height = 200;
var rahmen_w = 20;
var rahmen_h = 100;
//New Version start
function showBild(link, title, descr)
{
// Das Fenster öffnen
isLoad = false;
if(!showFenster || showFenster.closed) showFenster = popUp("", "NEW_WIN", default_width, default_height);
showFenster.document.open();
showFenster.document.write(getHTML(link,title,descr));
showFenster.document.close();
showFenster.focus();
return false;
}
function fitWin(i, win)
{
if(isLoad == true) return;
isLoad = true;
var w = i.width;
var h = i.height;
if(w < 100) w = 150;
if(h < 100) h = 100;
var size = getWinSize(win);
win.resizeBy((w - size.w + rahmen_w), (h - size.h + rahmen_h) );
win.focus();
}
function popUp(url, fname, w, h)
{
var tmp = new Array();
tmp[tmp.length] = 'resizable=yes';
tmp[tmp.length] = 'scrollbars=yes';
if(w) tmp[tmp.length] = 'width=' + w;
if(h) tmp[tmp.length] = 'height=' + h;
var string = tmp.join(",");
return window.open(url, fname, string);
}
function getHTML(src, title, descr) {
var body = (window.opera || document.layers) ? false : true;
if(!title) title = 'Bild / Picture';
var bgcolor = default_bgColor;
descr = descr || "";
var text ="";
text+= '\n'
+ '\n
\n'
+ '' + title + '\n'
+ '\n'
+ '\n'
+ ''
+ ''
+ '' + descr + '
'
+ '\n\n\n'
;
return text;
}
function getWinSize(win)
{
if(!win) win = window;
var pos = {w:0,h:0};
if(typeof win.innerWidth != 'undefined')
{
pos = { w: win.innerWidth, h: win.innerHeight};
}
else
{
var obj = checkIE(win);
pos.w = parseInt(obj.clientWidth);
pos.h = parseInt(obj.clientHeight);
}
return pos;
}
function checkIE(win)
{
if(!win) win = window;
return (win.document.compatMode && win.document.compatMode == "CSS1Compat") ?
win.document.documentElement : win.document.body;
}
var showFenster = null;
//end
/**
------------------------------------------------------------------------------------------------
Start of Standardlibrary copyrighted by G & S GmbH & F.Falkner
------------------------------------------------------------------------------------------------
**/
function oWin(path,name,height,width,posX,posY) {
var winName = name || "CONTWISE_OUT_WIN";
var winHeight = height || 487;
var winWidth = width || 480;
var left,top;
if (!posX && !posY) {
left = (screen.width) ? (screen.width-winHeight)/2 : 20;
top = (screen.height) ? (screen.height-winWidth)/2 : 20;
}
else {
left = posX;
top = posY;
}
var settings ='height='+winHeight+',width='+winWidth+',top='+top+',left='+left+',scrollbars=yes,resizable=yes'
win = window.open(path,name,settings)
win.focus();
return win;
}
var WARN_CATEGORY_NOT_FOUND = true;
var DEFAULT_PARENT_NAME = "diverses";
function writeParents(val,tree,link,style,sep) {
if (!tree) tree = catTree;
var curNode;
curNode = catTree.getNode(val,"ukatnr");
if (!curNode) {
if (WARN_CATEGORY_NOT_FOUND) {
alert("Node "+val+" not found!");
return;
}
else {
window.document.write(DEFAULT_PARENT_NAME);
}
}
// alert(curNode.userObject.name);
var catString = "";
if (!style) style = "cat-link";
if (!sep) sep = " / ";
while (curNode.parent) {
if (!curNode.userObject) continue;
var tmp = catString;
if (link)
catString=""+curNode.userObject.name+"";
else
catString=curNode.userObject.name;
if (tmp) catString = catString+sep+tmp;
curNode = curNode.parent;
}
window.document.write(catString);
}
function replaceForUrl (text) {
text = text.toLowerCase();
text=text.replace(/ /g, "_");
text=text.replace(/,/g, "");
text=text.replace(/\u00fc/g, "ue");
text=text.replace(/\u00f6/g, "oe");
text=text.replace(/\u00e4/g, "ae");
text=text.replace(/\u00df/g, "ss");
text=text.replace(/[^a-zA-Z 0-9_]+/g,'');
return text;
}
function searchFriendlyUrl (name, ukatnr, artnr) {
return replaceForUrl(name) + "," + ukatnr + (artnr ? "," + artnr : "") + ".html";
}
// JS function for uncrypting spam-protected emails:
// To Crypt, undo the right shift for each character by unicode character
function linkTo_UnCryptMailto(s) {
var n=0;
var r="";
for(var i=0; i < s.length; i++) {
n=s.charCodeAt(i);
if(s.charAt(i) == '^')
r+= '&';
else
r += String.fromCharCode(n-(1));
}
location.href='mailto:' + r;
}