/*******************************************************************************
	Filename		: lib.js

	Created			: 15 September 2006 (10:49:06)
	Created by		: Manfred Schneiderbauer, manfred.schneiderbauer@world-direct.at

	Last Updated	: 09 Feb 2009 (25:60:60)
	Updated by		: Manfred Schneiderbauer, manfred.schneiderbauer@world-direct.at

	Comments		:
*******************************************************************************/
/*
Version:      1.46
*/

window.onerror=function(){return true;}

// does something somewhere
function getMenuElements(){
	try{
	posX = (document.body.offsetWidth/2 + (770/2)) - d('table_nav_top').offsetWidth ;
	divs = document.getElementsByTagName("div");
	for (var i = 0; i < divs.length; i++){
		var id = divs[i].id;
		if (id.match(/^Menu/)) {
		 if(isIE7up) {
					divs[i].style.left = posX-18 + 'px';
			} else if (isIE5up) {
					divs[i].style.left = posX-29 + 'px';
      }	else {
				 divs[i].style.left = posX-18 + 'px';
			}
		}
	 }
	} catch (error){}
	window.setTimeout("getMenuElements();",500);
}
clib_onload("getMenuElements();");

// Create simple imagemap dynamics on start page
// (imagemap dynamics on Kontakt are generated inline in default_navigation.ts!)
function createImageMapHover(){
if(d('imCountriesStart')){
  var im=d('imCountriesStart');
  var map=d('mpWorld');
  im.onmouseout=function(){createImageMapHover_swapImage();}
  var areasArr=new Array(); areasArr=map.getElementsByTagName('area');
  for(var i=0;i<areasArr.length;i++)
    {
     areasArr[i].onmouseover=function(){createImageMapHover_swapImage(this.href);}
     areasArr[i].onmouseout=function(){createImageMapHover_swapImage();}
    }
}
}
function createImageMapHover_swapImage(continent){
 var im=d('imCountriesStart');
 if(continent)
  {
    im.src='fileadmin/dev/img/map/map_('+continent.substring(continent.length-2,continent.length-1)+').gif';
  }else{
    im.src='fileadmin/dev/img/map/map_world.gif';
  }
}
clib_onload("createImageMapHover();");

//
// MapArea BEGIN -----------------------------------------------------------------------------------------
// Author:  manfred.schneiderbauer@world-direct.at
// Date:    2006-08-03
// Version: 1.0
//
// Image map definitions (inner HTML of the MAP tag)
// Earth
var map_Global='<area shape=poly coords="239,48,239,50,241,51,241,53,244,55,245,55,246,55,248,53,249,52,251,52,252,54,254,55,255,55,255,53,255,52,255,51,256,50,260,49,260,47,258,46,255,46,254,45,251,45,249,45,248,46,247,46,245,46,241,47,239,47,239,48" href="#E"><area shape="poly" coords="194,81,198,81,205,80,207,81,207,84,205,85,202,86,199,87,196,86,194,85,193,82,194,81" href="#E"><area shape="poly" coords="272,133,283,132,282,129,288,129,288,125,285,121,287,118,286,116,285,111,290,110,295,100,300,100,301,95,302,84,309,79,308,74,305,72,299,72,302,74,302,76,294,76,289,77,286,80,283,80,281,82,278,79,284,79,286,76,290,75,288,72,278,76,274,77,259,70,246,75,240,82,231,88,231,94,233,98,235,98,236,100,236,104,233,106,227,110,226,108,223,102,221,96,219,96,216,98,216,102,212,104,212,107,210,108,211,109,217,110,219,114,220,115,222,118,221,121,214,122,212,126,212,131,215,133,218,134,272,133" href="#E"><area shape="poly" coords="372,214,373,211,378,210,381,208,383,204,390,200,392,201,394,199,399,199,400,202,406,205,407,203,408,197,409,197,411,201,412,202,415,208,422,216,423,224,420,228,418,233,416,235,414,235,414,236,416,240,416,243,413,242,412,240,412,239,414,238,412,236,408,235,403,232,400,230,394,225,388,227,383,229,376,230,374,230,372,221,372,215,372,214" href="#U"><area shape="poly" coords="440,246,445,241,447,238,449,238,449,236,449,232,448,229,451,232,454,233,455,234,454,236,452,239,450,240,447,244,446,245,443,248,441,248,440,247,440,246" href="#U"><area shape="poly" coords="203,159,202,154,206,147,211,143,211,138,216,136,222,135,230,134,234,132,238,133,238,137,246,140,249,142,251,139,258,139,263,141,268,141,268,144,265,144,271,155,276,163,279,165,282,168,289,168,289,167,288,173,276,185,274,190,276,199,276,202,281,204,288,198,289,204,285,215,281,216,280,213,280,209,281,206,276,204,270,208,271,212,268,216,267,218,263,222,257,229,249,229,248,228,246,222,239,204,241,197,239,189,235,185,235,177,233,178,227,174,225,175,221,177,214,177,206,173,204,168,201,166,201,160,203,159" href="#F"><area shape="poly" coords="312,55,308,56,302,57,296,60,290,68,294,70,296,72,299,73,299,71,296,67,298,63,306,59,310,57,313,56,313,55,312,55" href="#L"><area shape="poly" coords="310,75,314,76,312,70,316,64,320,67,325,65,330,63,336,62,336,59,349,56,354,54,347,49,341,44,347,41,354,43,355,47,360,48,363,51,362,53,372,56,373,59,370,62,382,64,387,62,393,64,396,68,406,66,403,60,402,55,422,58,422,61,414,63,422,67,446,71,456,68,464,67,465,74,475,80,471,86,462,86,455,92,441,96,437,105,421,112,413,109,415,124,408,139,391,144,386,144,385,159,391,168,396,176,406,181,415,185,425,187,427,192,425,201,415,198,413,195,402,194,393,189,391,194,386,196,310,75" href="#L"><area shape="poly" coords="366,194,388,196,310,74,305,81,301,83,300,94,297,99,293,103,289,109,285,114,284,118,285,125,283,129,279,132,273,132,268,141,282,163,294,163,308,150,318,161,325,175,334,170,336,165,346,179,356,191,364,193,366,194" href="#L"><area shape="poly" coords="139,262,144,259,150,255,148,254,145,255,144,257,137,260,134,256,140,249,139,247,146,237,152,234,152,231,164,219,165,215,174,213,176,201,182,193,172,183,165,183,157,176,148,169,140,166,129,166,125,169,122,170,121,175,120,180,116,185,118,193,124,202,132,209,127,236,126,246,124,252,126,260,131,262,136,264,139,262" href="#S"><area shape="poly" coords="104,163,110,166,115,172,118,173,122,171,117,169,116,165,117,161,112,158,119,156,123,158,135,159,141,159,137,156,126,152,124,145,122,139,129,132,129,128,137,121,143,123,149,116,157,119,157,116,154,110,153,103,169,94,175,83,181,81,185,78,196,73,197,70,195,66,199,64,200,56,202,49,209,43,208,40,201,39,197,39,195,35,183,35,174,35,165,35,155,38,146,38,140,36,134,35,108,38,98,45,92,46,81,49,75,50,70,54,65,54,64,59,61,63,58,70,50,72,43,72,27,69,18,68,10,74,104,163" href="#N"><area shape="poly" coords="33,95,22,102,10,107,10,99,16,97,10,94,6,95,6,88,7,86,5,78,9,76,14,77,30,93,33,95" href="#N"><area shape="poly" coords="60,122,66,135,76,147,84,157,91,161,100,163,106,165,98,155,67,126,59,121,60,122" href="#N">';
// Europe
var map_E='<area shape="poly" coords="201,235,199,232,206,229,206,226,216,225,220,225,223,228,225,229,221,234,216,237,211,235,206,237,205,235,201,235" href="#AT"><area alt="Serbien" title="Serbien" shape="poly" href="#RS" coords="233,248,233,239,238,238,240,244,248,250,246,256,238,260,233,250"><area alt="Bosnien Herzegovina" title="Bosnien Herzegovina" shape="poly" coords="219,243,229,243,232,245,233,250,229,257" href="#BA"><area shape="poly" coords="177,219,180,216,179,212,173,212,168,211,165,213,170,214,175,219,177,219" href="#BE"><area shape="poly" coords="258,263,250,262,246,257,248,249,254,253,261,251,264,248,268,250,268,253,266,259,264,258,259,262,258,263" href="#BG"><area shape="poly" coords="185,231,196,232,197,236,183,241,181,235,185,231" href="#CH"><area shape="poly" coords="205,217,214,213,215,213,226,217,230,220,226,225,221,227,213,225,211,226,206,220,204,218,205,217" href="#CZ"><area shape="poly" coords="185,232,193,232,200,231,205,228,206,221,206,215,213,212,215,211,213,205,211,203,212,198,209,196,208,194,203,196,199,196,197,194,191,192,188,190,188,195,193,195,194,198,189,199,183,199,184,203,182,207,181,209,181,215,182,221,186,224,186,230,185,234,190,233,185,232" href="#DE"><area shape="poly" coords="188,182,189,179,192,180,195,175,197,175,196,181,198,185,196,185,193,189,192,193,190,193,187,189,188,186,186,184,186,181,188,182" href="#DK"><area shape="poly" coords="131,288,135,284,144,284,148,282,150,280,153,274,166,273,167,270,156,267,159,263,165,260,165,257,158,257,150,253,144,250,128,251,121,249,116,251,114,255,116,261,124,260,129,262,128,269,126,281,125,283,128,285,129,289,131,288" href="#ES"><area shape="poly" coords="257,161,269,158,283,145,283,143,277,137,276,126,276,121,274,118,274,114,276,111,272,105,272,103,273,100,272,96,265,94,260,98,258,105,249,103,247,104,246,106,251,109,253,121,253,123,259,124,258,130,254,130,254,133,245,136,241,141,240,148,240,157,242,160,249,161,254,162,257,161" href="#FI"><area shape="poly" coords="167,254,175,251,177,254,179,255,180,252,183,249,182,242,180,235,182,232,185,225,184,221,177,219,166,215,160,212,159,217,153,220,147,219,145,223,144,224,132,225,134,230,141,233,148,237,149,242,148,247,147,251,151,253,156,257,159,262,163,261,165,256,165,254,167,254" href="#FR"><area shape="poly" coords="192,262,195,261,194,255,192,255,186,258,190,260,192,262" href="#FR"><area shape="poly" coords="133,218,144,214,158,213,158,209,161,206,160,201,157,200,145,182,147,172,141,173,141,167,129,170,127,173,125,180,128,186,127,187,125,191,125,198,130,197,136,192,138,195,134,199,133,204,133,209,130,217,133,218" href="#GB"><area shape="poly" coords="224,253,216,249,212,243,221,238,228,242,233,244,226,244,220,244,224,253" href="#HR"><area shape="poly" coords="232,230,243,227,246,228,243,235,236,238,233,242,228,243,222,238,218,235,223,231,232,230" href="#HU"><area shape="poly" coords="123,210,111,211,108,206,112,199,112,193,116,190,121,188,123,186,124,198,127,202,129,200,129,210,125,211,123,210" href="#IE"><area shape="poly" coords="186,250,191,248,194,250,199,255,205,260,212,265,219,272,217,276,211,279,205,277,206,280,210,283,213,285,215,280,218,278,221,275,223,268,226,268,228,265,223,261,212,254,206,246,205,242,207,240,205,238,199,237,189,241,182,241,183,248,186,250" href="#IT"><area shape="poly" coords="188,273,194,270,194,264,191,263,185,266,185,270,188,273" href="#IT"><area shape="poly" coords="173,204,178,202,179,199,182,201,182,211,178,215,173,215,168,211,168,209,173,204" href="#NL"><area shape="poly" coords="187,172,196,166,199,166,205,160,204,155,205,152,203,149,206,138,211,137,211,134,211,132,213,123,219,119,224,108,229,108,233,105,237,104,239,101,241,103,251,104,260,104,260,98,268,95,273,97,276,100,278,98,277,96,280,94,279,88,270,85,251,85,222,94,211,101,207,114,199,127,186,134,177,139,170,146,170,156,171,164,173,169,174,172,182,174,184,174,187,172" href="#NO"><area shape="poly" coords="249,220,253,209,251,197,245,196,236,196,230,193,226,192,223,192,217,196,213,196,212,206,216,213,223,213,228,221,231,221,237,221,244,221,249,220" href="#PL"><area shape="poly" coords="117,276,115,272,118,266,119,260,126,261,127,266,127,273,127,280,121,283,117,282,116,279,117,276" href="#PT"><area shape="poly" coords="269,235,264,227,255,231,245,227,243,236,238,236,239,240,246,247,253,251,259,250,263,247,267,250,270,248,271,245,270,242,269,235" href="#RO"><area shape="poly" coords="204,191,200,191,200,186,207,183,203,177,201,170,203,161,206,152,204,144,208,136,214,129,215,125,218,117,223,109,233,105,240,102,250,107,251,116,251,122,247,125,240,126,240,133,234,139,225,140,225,151,228,155,230,161,228,167,224,172,224,179,219,184,209,188,201,192,204,191" href="#SE"><area shape="poly" coords="216,242,218,239,216,236,211,237,212,241,214,241,216,242" href="#SI"><area shape="poly" coords="228,231,237,228,242,226,247,226,246,221,238,221,231,222,227,226,228,231" href="#SK"><area shape="poly" coords="243,284,239,278,238,272,240,267,243,265,247,264,251,263,255,262,254,265,249,267,247,269,249,272,252,276,254,278,260,290,261,294,253,296,246,292,243,287" href="#GR"><area shape="poly" coords="264,227,270,239,275,237,274,232,271,227,264,227,265,227" href="#MD"><area shape="poly" coords="273,265,279,264,287,259,297,260,306,263,312,265,318,264,322,261,332,265,333,273,336,281,328,283,316,283,305,284,300,288,295,284,292,287,286,287,280,283,276,287,271,285,266,288,266,282,261,278,263,272,260,268,258,262,265,258,273,264" href="#TR"><area shape="poly" coords="251,211,251,210,256,206,279,211,279,208,286,207,287,204,293,205,301,216,318,220,318,228,297,236,300,243,294,246,289,246,289,242,292,238,278,237,269,226,263,228,257,230,249,228,246,222,251,216" href="#UA">';
// North America
var map_N='<area shape="poly" coords="154,169,227,169,232,173,247,173,260,180,260,189,257,190,260,194,267,192,268,188,285,183,288,183,291,180,297,175,298,175,300,179,304,180,312,178,318,175,327,178,348,181,337,159,336,149,311,123,316,106,321,101,305,88,303,79,273,60,261,63,240,62,227,53,215,42,203,29,150,46,142,73,114,85,103,83,103,131,120,144,121,153,136,166,141,170,154,169" href="#CA"><area shape="poly" coords="275,52,285,36,300,27,315,18,319,14,296,6,239,15,220,23,209,27,207,30,223,50,236,63,261,63,271,58,275,52" href="#CA"><area shape="poly" coords="301,186,304,188,314,186,319,182,321,176,316,173,305,179,301,184,301,186" href="#CA"><area shape="poly" coords="232,277,233,269,236,267,238,265,246,262,250,260,249,250,235,251,231,258,224,252,222,243,213,237,206,229,203,233,194,223,189,224,179,224,172,222,166,221,163,232,177,249,189,252,197,261,212,269,228,274,232,277" href="#MX">';
// South America
var map_S='<area shape="poly" coords="243,38,258,32,264,47,276,42,283,42,289,42,292,37,298,50,311,55,319,59,317,63,333,61,339,64,341,65,349,69,354,74,356,79,354,93,348,95,341,103,340,118,337,132,331,138,325,142,313,146,305,155,304,164,297,175,292,177,291,182,285,188,278,181,272,174,274,167,283,157,281,148,274,140,266,138,267,128,266,121,263,116,258,113,256,106,245,100,238,96,235,89,228,93,219,93,217,90,207,87,205,76,213,68,223,63,217,47,231,43,239,48" href="#BR" /><area shape="poly" coords="280,4,278,7,282,8,288,7,282,2,281,2" href="#AW" /><area shape="poly" coords="267,17,274,18,271,12,267,16" href="#TT" /><area shape="poly" coords="222,95,224,107,221,114,223,119,222,122,225,128,222,133,227,142,237,139,241,141,246,139,250,140,249,129,254,129,264,129,264,121,258,113,254,106,246,101,236,94,233,92,222,96" href="#BO" /><area shape="poly" coords="194,102,187,90,180,80,176,74,177,66,183,69,188,65,192,62,200,55,205,57,211,61,217,60,220,61,208,71,207,84,212,90,219,93,222,97,223,110,222,119,220,124,212,119,204,115,194,105" href="#PE" /><area shape="poly" coords="178,64,180,61,177,57,180,53,179,48,182,46,192,48,201,52,204,55,193,60,187,64,178,66" href="#EC" /><area shape="poly" coords="185,45,189,40,192,35,190,29,189,21,195,17,199,9,208,7,207,15,210,22,217,25,222,26,228,27,230,37,230,42,219,45,220,59,211,60,198,52,191,48,186,46" href="#CO" /><area shape="poly" coords="209,7,212,5,213,16,216,7,220,7,223,7,227,10,232,9,239,11,244,8,251,8,255,9,253,16,264,20,263,20,262,24,261,24,263,24,260,27,257,29,257,32,249,34,243,37,242,41,241,47,234,45,230,42,228,30,227,26,216,25,208,19,207,8" href="#VE" />';
// Africa
var map_F='<area shape="poly" coords="239,273,239,269,244,268,245,270,250,269,250,254,254,254,256,262,259,259,262,260,262,256,270,256,277,253,284,246,290,244,295,245,298,253,298,257,294,260,294,264,298,264,298,269,294,271,291,278,288,279,286,276,288,271,283,270,280,273,281,275,284,278,287,278,288,279,278,289,270,293,251,296,240,288,243,282,238,276,238,274,239,273" href="#ZA"><area shape="poly" coords="271,29,271,71,315,71,310,57,307,47,308,31,285,30,285,32,271,27,271,29" href="#EG"><area shape="poly" coords="272,70,316,72,316,82,324,83,323,85,313,94,314,100,308,112,305,122,298,126,302,124,301,128,304,128,307,134,310,134,308,138,298,140,292,139,284,136,278,132,274,124,268,122,264,106,264,98,270,97,269,81,275,81,277,72" href="#SD"> <area  shape="poly" coords="318,99,329,99,327,96,324,96,323,87,318,92" href="#ER"> <area  shape="poly" coords="332,99,335,102,336,106,331,108" href="#DJ"> <area  shape="poly" coords="339,108,336,116,343,121,355,127,348,134,343,137,336,137,335,139,328,140,326,142,316,139,313,136,311,132,309,132,308,128,305,125,309,122,309,114,317,103,316,100,329,101,330,110" href="#ET"> <area  shape="poly" coords="332,142,333,144,330,151,333,158,332,161,330,165,329,168,324,171,325,173,307,160,308,154,310,146,308,140,312,138,321,142,329,144" href="#KE"> <area  shape="poly" coords="305,142,294,143,296,148,295,152,290,153,289,166,294,160,305,160,307,149,308,148,307,142" href="#UG"> <area  shape="poly" coords="341,110,347,116,353,116,355,113,362,112,368,110,368,121,364,127,351,145,345,150,340,150,335,159,334,147,336,144,336,140,346,138,352,134,358,125,346,121,339,115" href="#SO"> <area  shape="poly" coords="292,164,296,161,307,161,324,174,322,178,323,181,324,183,324,187,326,193,329,196,329,199,304,202,302,194,297,189,293,188,288,177,289,174,295,170" href="#TZ"> <area  shape="poly" coords="267,200,266,207,261,208,261,218,266,225,278,225,282,220,285,220,286,215,290,216,297,211,300,211,303,204,302,197,300,192,294,189,289,189,286,192,285,199,285,202,290,202,291,208,286,208,280,203,276,204,272,202,270,200" href="#ZM"> <area  shape="poly" coords="303,210,309,213,309,220,313,217,310,212,307,208,306,204,303,204" href="#MW"> <area  shape="poly" coords="299,255,310,250,309,238,307,232,313,229,320,223,324,221,325,217,329,217,330,212,328,209,330,199,308,203,308,207,315,216,312,221,308,221,306,214,302,213,295,214,292,216,302,222,302,232,301,239,296,244,297,248" href="#MZ"> <area  shape="poly" coords="261,224,222,222,221,209,230,198,230,194,226,193,228,189,224,182,224,181,238,180,240,188,248,188,253,185,258,186,259,198,263,201,266,202,264,206,259,206,259,218" href="#AO"> <area  shape="poly" coords="274,226,278,234,283,238,282,242,289,242,296,244,300,238,302,226,298,221,290,217,288,218,286,221,282,222,280,226" href="#ZW"> <area  shape="poly" coords="296,258,294,259,294,263,297,264,300,264,300,259" href="#SZ"> <area  shape="poly" coords="286,268,282,269,279,274,280,277,284,278,287,276,288,270" href="#LS"> <area  shape="poly" coords="255,226,271,226,275,233,280,238,282,243,286,243,277,251,272,256,264,255,259,261,254,260,254,254,251,253,252,247,256,241" href="#BW"> <area  shape="poly" coords="222,224,229,239,228,250,234,256,233,263,238,268,244,268,245,271,249,270,252,266,251,248,256,240,253,225" href="#NA">   <area shape="poly" coords="124,51,130,47,138,47,142,47,144,43,145,40,149,38,152,38,154,37,158,34,163,29,165,26,171,26,170,22,170,15,165,15,161,15,157,15,154,11,149,15,150,19,151,21,147,22,143,22,139,23,136,26,136,32,137,35,136,38,132,42,126,44" href="#MA" />';
// Asia
var map_L='<area shape="poly" coords="152,248,140,219,132,217,129,210,138,206,134,197,141,196,147,187,144,181,145,180,156,179,158,181,160,189,165,190,162,195,183,202,183,214,176,220,161,233,161,244,158,248,156,250,153,251,152,248" href="#IN"><area shape="poly" coords="315,150,323,153,320,159,314,159,314,166,311,179,297,184,290,188,287,194,281,191,280,185,281,180,286,177,296,174,301,168,305,161,305,155,307,152,310,150,315,150" href="#JP"><area shape="poly" coords="212,253,209,246,208,243,211,240,211,235,216,237,217,233,223,233,220,223,213,224,213,220,209,219,205,222,205,225,208,232,207,235,209,238,210,239,207,242,205,247,207,251,212,253" href="#TH"><area shape="poly" coords="86,201,88,204" href="#BA"><area alt="" shape="poly" coords="69,229,70,224,78,226,86,222,91,222,94,226,92,231,74,238,70,238,68,232" href="#YE"><area shape="poly" coords="100,206,104,209,111,211,111,214,106,220,103,224,99,228,94,227,91,221,97,220,99,216,99,210" href="#OM"><area alt="" shape="poly" coords="91,209,96,208,100,204,100,208,98,212,92,212" href="#AE"><area shape="poly" coords="77,195,82,192,82,198" href="#KW"><area shape="poly" coords="88,203,92,203,91,208,89,208,88,206" href="#QA"><area shape="poly" coords="49,194,55,193,55,188,62,186,75,195,82,198,88,206,92,211,99,212,97,220,90,222,84,222,79,226,71,224,68,228,64,222,60,216,59,210,51,201,49,197" href="#SA"><area shape="poly" coords="244,257,252,250,258,256,252,258,248,260,244,266,236,268,232,264,221,268,218,266,212,261,211,253,214,253,218,258,220,266,221,267,232,264,240,260" href="#MY">  <area shape="poly" coords="88,204,88,207,91,208,87,201" href="#BH"> <area shape="poly" coords="130,166,132,170,138,172,143,171,151,176,157,180,159,185,158,190,162,191,162,197,168,200,175,202,184,203,188,206,191,208,192,212,196,208,197,201,201,198,205,198,206,204,205,207,209,213,212,216,217,212,222,211,227,213,233,224,242,214,251,212,266,215,263,196,260,192,261,186,256,178,266,173,256,172,256,167,263,162,268,164,273,162,277,161,283,157,287,154,287,150,292,147,294,140,286,143,285,139,280,137,277,133,276,127,271,123,261,123,258,130,254,134,247,138,248,142,254,141,258,142,258,146,253,148,250,150,247,153,240,154,236,156,231,158,227,158,221,160,215,159,208,157,203,152,194,151,188,148,185,142,181,139,175,138,174,143,169,144,165,149,163,153,160,160,155,162,148,164,137,166,130,165" href="#CN"> <area alt="" shape="poly" coords="48,194,47,189,50,185,56,184,59,184,59,187,55,189,55,192,52,193,46,193" href="#JO"><area shape="poly" coords="197,255,202,261,207,271,213,280,219,283,231,288,250,289,262,293,273,294,277,292,295,291,308,291,312,291,311,276,312,271,303,266,294,261,288,255,285,252,280,248,274,248,266,250,262,254,257,261,254,260,251,260,248,264,244,268,237,269,232,269,225,272,224,279,227,284,219,271,214,265,210,263,205,258,202,255,197,255" href="#ID" /> <area  shape="poly" coords="69,162,72,168,81,167,81,160,75,162" href="#AM">';
// Australia
var map_U='<area shape="poly" coords="113,165,114,155,111,153,110,145,104,135,106,128,103,122,106,105,142,92,144,85,165,69,175,72,187,61,200,58,219,64,233,56,239,57,281,120,287,140,281,166,266,192,255,195,262,202,260,218,251,224,235,194,227,194,212,182,200,180,185,161,161,165,151,174,135,174,120,179,112,175,109,169,113,165" href="#AU"> <area shape="poly" coords="338,228,342,227,344,221,356,217,360,213,365,204,374,206,378,205,373,200,374,194,376,189,372,181,369,176,371,172,379,183,384,187,393,187,392,188,394,193,387,196,386,200,382,207,378,209,375,208,371,213,368,220,363,222,357,232,351,236,347,238,341,233,338,231" href="#NZ" />';

function MapArea(){
try{
var allDivs=d('tbCountriesmenu').getElementsByTagName('div');
var html=''; var thisDiv=''; var thisDivSels=''; var i=0; var ii=0; var thisSelText='none';
// create selects
for(i=0;i<allDivs.length;i++)
        {
         if(allDivs[i].title=='sselect')
          {
           allDivs[i].id='sselect';
           html='<select onchange="if(this.options[this.selectedIndex].value!=\'\'){top.location.href=this.options[this.selectedIndex].value;}" id="mapSelects">';
           html+='<option value="" onmouseover="this.parentNode.disabled=true;" onmouseout="this.parentNode.disabled=false;">Bitte w?hlen</option>';
           thisDiv=allDivs[i];
           thisDivSels=thisDiv.getElementsByTagName('div');
           for(ii=0;ii<thisDivSels.length;ii++)
            {
             if(thisDivSels[ii].getElementsByTagName('a')[0].name=='countries2cur')
              {
               thisSelText=thisDivSels[ii].getElementsByTagName('a')[0].text;
               if(!thisSelText)
                {thisSelText=thisDivSels[ii].getElementsByTagName('a')[0].innerHTML;}
              }
             html+= '<option value="'+thisDivSels[ii].getElementsByTagName('a')[0].href+'">'+thisDivSels[ii].getElementsByTagName('a')[0].innerHTML+'</option>';
            }
            html+='</select>';
            d('sselect').innerHTML=html;
            d('sselect').id='';
          }
        }
// eliminate selects not needed
var allAs=d('tbCountriesmenu').getElementsByTagName('a');
var thisA='';
for(i=0;i<allAs.length;i++)
          {
           if(allAs[i].name=='countries1no' &&allAs[i].parentNode.nextSibling&&allAs[i].parentNode.nextSibling.getElementsByTagName('select').length!=0)
            {
              allAs[i].parentNode.nextSibling.innerHTML='';
              allAs[i].parentNode.nextSibling.style.display='none';
            }
          }
// select currently chosen country
if(thisSelText!='none')
          {
          var allOpts=d('tbCountriesmenu').getElementsByTagName('select')[0].options;
          for(i=0;i<allOpts.length;i++)
            {
            if (thisSelText==allOpts[i].text)
              {
              allOpts[i].selected=true;
              }
            }
          }
try{var thisOpts=d('tbCountriesmenu').getElementsByTagName('select')[0].options;}catch(error){}
// set 'please choose' text
var chooseText='Please select!'; // English
if(d('tbCountriesmenu').innerHTML.indexOf('Europa')!=-1)
          { // German (see if Europe is named 'Europa')
            chooseText=unescape('Bitte ausw%E4hlen!');
          }
try{d('tbCountriesmenu').getElementsByTagName('option')[0].text=chooseText;}catch(error){}
// display matching map
var thisMap='fileadmin/dev/img/map/map_world.gif'; var thisMapBg=false;
var thisMapShortcut='';
var redirect=false;
d('mpWorld').innerHTML=map_Global;
// see if this page's title contains a continent or country code
var hasCode=false;
var thisPage=d('dvBreadcrumbs').getElementsByTagName('span')[d('dvBreadcrumbs').getElementsByTagName('span').length-1].innerHTML;
if(thisPage.indexOf('(')!=-1)
  {
   hasCode=true;
   var thisCode=thisPage.substring(thisPage.indexOf('('),thisPage.indexOf(')')+1);
  }

// see if we came from the start page's imagemap, if so, set redir flag
if(hasCode&&location.search.toLowerCase().indexOf(thisCode.toLowerCase())!=-1)
  {
  redirect=thisCode;
  }
if(hasCode)
  {
  if(d('dvBreadcrumbs').innerHTML.toLowerCase().indexOf(thisCode.toLowerCase())!=-1)
    {
    thisMap='fileadmin/dev/img/map/map_'+thisCode+'_detail.gif';
    thisMapBg='fileadmin/dev/img/map/map_'+thisCode+'_detail_all.gif';
    thisMapShortcut=thisCode.replace('(','').replace(')','');
    }
  }

if(thisMapShortcut.length==2) // if country, find and assign matching continent
  {
  var thisContinent=d('dvBreadcrumbs').getElementsByTagName('span')[d('dvBreadcrumbs').getElementsByTagName('span').length-2].getElementsByTagName('a')[0].innerHTML;
  thisContinent=thisContinent.substring(thisContinent.indexOf('('),thisContinent.indexOf(')')+1).replace('(','').replace(')','');
  thisMap=thisMap.replace('.gif','').replace(thisMapShortcut,thisContinent)+'_('+thisMapShortcut+').gif';
  thisMapBg='fileadmin/dev/img/map/map_('+thisContinent+')_detail_all.gif';
  }

window.thisMap=thisMap; window.thisMapBg=thisMapBg;
var imCountries=d('imCountries');
showMap(false);
imCountries.src=thisMap;
if(thisMapBg) // if we are on continent or country level, create bg image and opacity
  {
  try{imCountries.style.filter='progid:DXImageTransform.Microsoft.Alpha(opacity=90)';}catch(error){}
  try{imCountries.style.opacity=.9;}catch(error){}
  try{imCountries.style.MozOpacity=.9;}catch(error){}
  try{imCountries.style.KhtmlOpacity=.9;}catch(error){}
  imCountries.parentNode.style.backgroundImage='url("'+thisMapBg+'")';
  }
//assign links to imagemap (match menu link text with area href and replace the latter)
var iii=0; var allAreas=new Array();
// set according image map

if(!thisContinent&&thisMapShortcut)
  {d('mpWorld').innerHTML=eval('map_'+thisMapShortcut);}
if(thisContinent)
  {d('mpWorld').innerHTML=eval('map_'+thisContinent);}
allAreas=d('mpWorld').getElementsByTagName('area');
var thisLinkCode='';
if(!thisOpts) // if we are on continent level...
{
for(i=0;i<allAs.length;i++)
  {
  thisLinkCode=allAs[i].innerHTML.substring(allAs[i].innerHTML.indexOf('(')+1,allAs[i].innerHTML.indexOf(')'));
  for(iii=0;iii<allAreas.length;iii++)
    {
    if(allAreas[iii].href.indexOf('#'+thisLinkCode)!=-1)
      {
      allAreas[iii].id='('+thisLinkCode+')';
      allAreas[iii].title=allAs[i].innerHTML;
      allAreas[iii].href=allAs[i].href;
      // if redir flag is set and target is the current link, then jump now
      if(redirect==thisLinkCode)
        {
        top.location.replace(allAs[i].href);
        }
      allAreas[iii].onmouseover = function(){try{changeMapContinent(this.title);changeMapImage(this.id);}catch(error){}}
      allAreas[iii].onmouseout = function(){changeMapContinent();d('imCountries').src=thisMap;}
      allAreas[iii].onclick=function(){this.onmouseout=null;}
      }
    }
  }
}
if(thisOpts) // if we are at countries level...
{
for(i=1;i<thisOpts.length;i++)
  {
 thisLinkCode=thisOpts[i].innerHTML.substring(thisOpts[i].innerHTML.indexOf('(')+1,thisOpts[i].innerHTML.indexOf(')'));
  for(iii=0;iii<allAreas.length;iii++)
    {
    if(allAreas[iii].href.indexOf('#'+thisLinkCode)!=-1)
      {
      if(!thisContinent){thisContinent=thisMapShortcut;}
      allAreas[iii].id='('+thisLinkCode+')_('+thisContinent+')';
      allAreas[iii].href=thisOpts[i].value;
      allAreas[iii].title=thisOpts[i].innerHTML;
      allAreas[iii].onmouseover= function(){try{changeMapImage(this.id);changeMapSelect(this.title);}catch(error){}}
      allAreas[iii].onclick=function(){this.onmouseout=null;}
      allAreas[iii].onmouseout=function(){changeMapSelect(d('content_left').getElementsByTagName('div')[0].innerHTML);d('imCountries').src=thisMap;}
      }
    }
  }
}
// finally, remove shortcuts from menu and breadcrumbs
var bc=d('dvBreadcrumbs');
var lastSp=bc.getElementsByTagName('span').length-1;
var preLastSp=bc.getElementsByTagName('span').length-2;
if(bc.getElementsByTagName('span')[lastSp].innerHTML.indexOf('(')!=-1)
  {
  bc.getElementsByTagName('span')[lastSp].innerHTML=bc.getElementsByTagName('span')[lastSp].innerHTML.substring(0,bc.getElementsByTagName('span')[lastSp].innerHTML.indexOf('('));
  } // remove ISO codes from breadcrumbs
if(bc.getElementsByTagName('span')[preLastSp].getElementsByTagName('a')[0].innerHTML.indexOf('(')!=-1)
  {
 bc.getElementsByTagName('span')[preLastSp].getElementsByTagName('a')[0].innerHTML=bc.getElementsByTagName('span')[preLastSp].getElementsByTagName('a')[0].innerHTML.substring(0,bc.getElementsByTagName('span')[preLastSp].getElementsByTagName('a')[0].innerHTML.indexOf('('));
  }
bc=getElementByClass('td','dv_countries-left');
var bcAs=bc.getElementsByTagName('a'); // remove ISO continent codes from menu
for(i=0;i<bcAs.length;i++)
  {bcAs[i].innerHTML=bcAs[i].innerHTML.substring(0,bcAs[i].innerHTML.indexOf('('));}
bcAs=bc.getElementsByTagName('option'); // remove ISO country codes from menu
for(i=1;i<bcAs.length;i++)
  {bcAs[i].innerHTML=bcAs[i].innerHTML.substring(0,bcAs[i].innerHTML.indexOf('('));}
bc=d('mpWorld').getElementsByTagName('area');
for(i=0;i<bc.length;i++)
  {
   // CSS-'unlink' areas which are defined but have no valid link
   if(bc[i].href.indexOf('#')!=-1){bc[i].shape='';bc[i].coords='0,0,0,0';bc[i].href='';}
   if(bc[i].title.indexOf('(')!=-1)
    {
     // remove ISO codes from imagemap
     bc[i].title=bc[i].title.substring(0,bc[i].title.indexOf('('));
     bc[i].alt=bc[i].title;
    }
  }
// remove ISO code from content page title
d('content_left').getElementsByTagName('div')[0].innerHTML=d('content_left').getElementsByTagName('div')[0].innerHTML.substring(0,d('content_left').getElementsByTagName('div')[0].innerHTML.indexOf('('));

// make it visible
d('tbCountriesmenu').style.visibility='visible';
showMap(true);

}catch(error){window.setTimeout("MapArea();",500);}
}
clib_onload("MapArea()");

// hover change the map image
function changeMapImage(id){
var img=d('imCountries');
var newFn='';
if(id.indexOf('_')==-1)
  {
  if(img.src.indexOf('detail')==-1)
    {
    img.src='fileadmin/dev/img/map/map_'+id+'.gif';
    } else {
    img.src='fileadmin/dev/img/map/map_'+id+'_detail.gif';
    }
  } else {
  newFn='fileadmin/dev/img/map/map_'+ id.split('_')[1].replace('_','')+ '_detail_'+ id.split('_')[0].replace('_','')+'.gif';
  img.src=newFn;
  }
}

// hover change the select
function changeMapSelect(linktext){
var allOpts=d('mapSelects').options;
if(linktext)
  {
  for(var i=0;i<allOpts.length;i++)
    { // reset
    allOpts[i].selected=false;
    if(i==0){allOpts[i].selected=true;}
    }
  }
for(i=0;i<allOpts.length;i++)
  {
    if(allOpts[i].innerHTML==linktext)
      {d('mapSelects').options[i].selected=true;} // set onmouseovered
  }
}

// hover mark the continent
function changeMapContinent(linktext){
var allAs=getElementsByClass('a','a-countries');
for(var i=0;i<allAs.length;i++)
  { // reset
  allAs[i].style.backgroundColor=''; // reset
  }
for(i=0;i<allAs.length;i++)
  {
    if(allAs[i].innerHTML==linktext)
      {allAs[i].style.backgroundColor='#f0f0f0'} // set onmouseovered
  }
}

// hide/show map
function showMap(mode){
var tdCountries=d('imCountries').parentNode;
if(!mode)
  {
   try{tdCountries.style.filter='progid:DXImageTransform.Microsoft.Alpha(opacity=0)';}catch(error){}
   try{tdCountries.style.opacity=0;}catch(error){}
   try{tdCountries.style.MozOpacity=0;}catch(error){}
   try{tdCountries.style.KhtmlOpacity=0;}catch(error){}
  } else {
  if(d('imCountries').offsetWidth!=0)
    {
    fadeMap(0);
    }else{
    window.setTimeout("showMap(true);",250);
    }
  }
}
function fadeMap(count){
var tdCountries=d('imCountries').parentNode;
try{tdCountries.style.filter='progid:DXImageTransform.Microsoft.Alpha(opacity='+count+')';}catch(error){}
try{tdCountries.style.opacity=count/10;}catch(error){}
try{tdCountries.style.MozOpacity=count/10;}catch(error){}
try{tdCountries.style.KhtmlOpacity=count/10;}catch(error){}
if(isIE5up){count=count+5;}else{count=count+.5;}
if(count<100){window.setTimeout("fadeMap("+count+");",1);}
}

//
// MapArea END -------------------------------------------------------------------------------------------
//

// duplicate form fields
function addNewFormBlock(){
var container=d('spDuplicateBlock');
var sourceHTML=d('spSourceElements').innerHTML;
if(!window.formCount||window.formCount==undefined)
  {
   window.formCount=1;
  }
while(sourceHTML.indexOf('_0')!=-1)
  {
    sourceHTML=sourceHTML.replace('_0','_'+window.formCount);
  }
sourceHTML='<br><br>'+sourceHTML.replace('<strong>Part 1</strong>','<strong>Part '+Number(window.formCount+1)+'</strong>').replace('<STRONG>Part 1</STRONG>','<strong>Part '+Number(window.formCount+1)+'</strong>');
window.formCount++;
var newBlock=document.createElement('span');
newBlock.id='spNewBlock';
newBlock.style.visibility='hidden';
newBlock.innerHTML=sourceHTML;
container.appendChild(newBlock);

newTable=d('spNewBlock').getElementsByTagName('table')[0];

for(var v=0;v<newTable.getElementsByTagName('input').length;v++)
  {
   newTable.getElementsByTagName('input')[v].value='';
  }

if(isIE5up)
  {
  newTable.style.position='relative';
  newTable.style.filter='progid:DXImageTransform.Microsoft.Alpha(opacity=0)';
  } else {
  newTable.style.MozOpacity=0;
  newTable.style.KhtmlOpacity=0;
  newTable.style.opacity=0;
  }
addNewFormBlock_trans();
}
function addNewFormBlock_trans(count){
if(!count||count==undefined){count=10;}
var tobj=d('spNewBlock').getElementsByTagName('table')[0];
if(isIE5up)
  {
  tobj.style.filter='progid:DXImageTransform.Microsoft.Alpha(opacity='+count+')';
  } else {
  tobj.style.MozOpacity=count/100;
  tobj.style.KhtmlOpacity=count/100;
  tobj.style.opacity=count/100;
  }
window.scrollBy(0,8);
d('spNewBlock').style.visibility='visible';
count=count+2;
if(count<=100)
  {
  window.setTimeout("addNewFormBlock_trans("+count+");",1);
  } else {
  if(isIE5up)
    {
    tobj.style.filter='';
    } else {
    tobj.style.MozOpacity='';
    tobj.style.KhtmlOpacity='';
    tobj.style.opacity='';
    }
  d('spNewBlock').id='';
  }
}





//
// MapArea For Uebersichtsplan-------------------------------------------------------------------------------------------
//



preloadImages();

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
preloadImages();
try{

	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {

			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
} catch (e){ }
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		gesamt_p_01_ImageMap_01_over = newImage("fileadmin/uploads_loan/plan_map/gesamt_p_01-ImageMap_01_ove.gif");
		gesamt_p_01_ImageMap_03_over = newImage("fileadmin/uploads_loan/plan_map/gesamt_p_01-ImageMap_03_ove.gif");
		gesamt_p_01_ImageMap_04_over = newImage("fileadmin/uploads_loan/plan_map/gesamt_p_01-ImageMap_04_ove.gif");
		gesamt_p_01_ImageMap_05_over = newImage("fileadmin/uploads_loan/plan_map/gesamt_p_01-ImageMap_05_ove.gif");
		gesamt_p_01_ImageMap_06_over = newImage("fileadmin/uploads_loan/plan_map/gesamt_p_01-ImageMap_06_ove.gif");
		gesamt_p_01_ImageMap_07_over = newImage("fileadmin/uploads_loan/plan_map/gesamt_p_01-ImageMap_07_ove.gif");
		gesamt_p_01_ImageMap_08_over = newImage("fileadmin/uploads_loan/plan_map/gesamt_p_01-ImageMap_08_ove.gif");
		gesamt_p_01_ImageMap_09_over = newImage("fileadmin/uploads_loan/plan_map/gesamt_p_01-ImageMap_09_ove.gif");
		gesamt_p_01_ImageMap_10_over = newImage("fileadmin/uploads_loan/plan_map/gesamt_p_01-ImageMap_10_ove.gif");
		gesamt_p_01_ImageMap_11_over = newImage("fileadmin/uploads_loan/plan_map/gesamt_p_01-ImageMap_11_ove.gif");
		gesamt_p_01_ImageMap_12_over = newImage("fileadmin/uploads_loan/plan_map/gesamt_p_01-ImageMap_12_ove.gif");
		gesamt_p_01_ImageMap_13_over = newImage("fileadmin/uploads_loan/plan_map/gesamt_p_01-ImageMap_13_ove.gif");
		gesamt_p_01_ImageMap_14_over = newImage("fileadmin/uploads_loan/plan_map/gesamt_p_01-ImageMap_14_ove.gif");
		gesamt_p_01_ImageMap_15_over = newImage("fileadmin/uploads_loan/plan_map/gesamt_p_01-ImageMap_15_ove.gif");
		gesamt_p_01_ImageMap_17_over = newImage("fileadmin/uploads_loan/plan_map/gesamt_p_01-ImageMap_17_ove.gif");
		gesamt_p_01_ImageMap_16_over = newImage("fileadmin/uploads_loan/plan_map/gesamt_p_01-ImageMap_16_ove.gif");
		gesamt_p_02_ImageMap_14_over = newImage("fileadmin/uploads_loan/plan_map/gesamt_p_02-ImageMap_14_ove.gif");


preloadFlag = true;
	}
}


// form validation
function validation_Init(){
if(document.getElementsByTagName('form').length>0)
  {
  for(var i=0;i<document.getElementsByTagName('form').length;i++)
    {
    if(document.getElementsByTagName('form')[i].name=='wamail')
      {
      d('Send').onclick=validation_Perform;
      }
    }
  }
}
clib_onload("validation_Init()");
function validation_Perform(){
var waForm=''; var retCode=true;
var allForms=document.getElementsByTagName('form');
for(var i=0;i<allForms.length;i++)
  {
   if(allForms[i].name=='wamail'){waForm=allForms[i];}
  }
var allInputs=waForm.getElementsByTagName('input');
for(i=0;i<allInputs.length;i++)
  {
  if(isIE5up&&allInputs[i].parentNode.previousSibling)
    {
    if(allInputs[i].parentNode.previousSibling.innerHTML)
      {
      if(allInputs[i].parentNode.previousSibling.innerHTML.indexOf('*')!=-1&&allInputs[i].value=='')
        {
        allInputs[i].style.backgroundColor='#ffe0e0';
        retCode=false;
        }else{
        allInputs[i].style.backgroundColor='white';
        }
      }
     }else if(!isIE5up&&allInputs[i].parentNode.previousSibling.previousSibling){
    if(allInputs[i].parentNode.previousSibling.previousSibling.innerHTML)
      {
      if(allInputs[i].parentNode.previousSibling.previousSibling.innerHTML.indexOf('*')!=-1&&allInputs[i].value=='')
        {
        allInputs[i].style.backgroundColor='#ffe0e0';
        retCode=false;
        }else{
        allInputs[i].style.backgroundColor='white';
        }
      }
    }
  }
if(!retCode)
  {
  clib_dwin.open('<div style="color:#808080;font-size:10px;line-height:12px;padding:10px;">Please fill-in the <b>mandatory fields</b> marked with a <div style="background-color:#ffe0e0;border:1px solid black;padding:2px;">light-red background</div> and then <b>re-submit the form</b>!</div>','Field values missing','scrollbars=no,titlebar=yes,buttons=yes,width=200,height=100,htmlmode=yes');
  if(isGecko)
    {
    d('elMessageElement').style.top=window.pageYOffset+'px';
    d('elMessageElement').style.left=document.body.offsetWidth/2-100+'px';
    }
  }
return retCode; //retCode;
}

// create forum iframe
function createForumIframe(){
document.write('<iframe id="ifForum" src="/forum/index.php" height="0" width="100%" style="border:0;padding:0;margin:0;" frameborder="0"></iframe>');
}

// restyle radios / cbs
function valignAllTds(){
  var allEls=document.getElementsByTagName('input');
  for(var i=0;i<allEls.length;i++)
    {
     if(allEls[i].type=='radio'||allEls[i].type=='checkbox')
      {
      allEls[i].style.border='';
      allEls[i].style.backgroundColor='transparent';
      }
    }
if(allEls.length==0){window.setTimeout("valignAllTds()",2500);};
}
clib_onload("valignAllTds()");

// toggle company and private fields in /fileadmin/uploads/formularvorlagen/kontakt_xx.tmpl
function toggleCompanyField(delayed){
if(delayed)
  {
    if(d('cbCompany').checked)
      {
       d('txCompany').value='Privat';
       d('txCompany').style.height=0; d('txCompany').style.width=0;
       d('txCompany').style.borderColor='#ffffff';
      }else{
       d('txCompany').value='';
       d('txCompany').style.height='auto'; d('txCompany').style.width='200px';
       d('txCompany').style.borderColor='#7b7b7b';
      }
  }else{
   window.setTimeout("toggleCompanyField(true);",250);
  }
}

// ????
function nextBigGal(current,sum){
alert('current' + current + ' - ' + sum + ' -');
}

// used in XML forms (EXT mailorderform)
function modifyAmount(dir,id,step){
var val=Number(d(id).value); step=Number(step);
if(!dir){if(String(val-step).indexOf('-')==-1){val=val-step;}}else{val=val+step;}
d(id).value=val;
d('subtotal_'+id).innerHTML=Number(d('price_'+id).innerHTML)*val;

var cropbufferFirst=''; var cropbufferLast=''; var thisItems='';

// main logic, concatenation of the order string

// if already in the order string, replace the old order

if(d('tx_orderdetails').value.indexOf(d('h1Titletext_'+id).innerHTML.toUpperCase())!=-1)
 {
   // get order string part before old order
   cropbufferFirst = d('tx_orderdetails').value.substring(0, d('tx_orderdetails').value.indexOf(d('h1Titletext_'+id).innerHTML.toUpperCase())-3);
   // get order string part after old order
   cropbuffer=d('tx_orderdetails').value.replace(cropbufferFirst,'');
   // write order string back without the old order
   cropbuffer=cropbuffer.substring(cropbuffer.indexOf('<hr>')+4,cropbuffer.length);
   d('tx_orderdetails').value=cropbufferFirst+cropbuffer;
 }
// add the new order
if(d('subtotal_'+id).innerHTML!="0")
  {
  // get item list
  var itemList=d('itemlist_'+id).getElementsByTagName('li');
  for(var i=0;i<itemList.length;i++)
    {
    thisItems+='<li>'+itemList[i].innerHTML;
    }
  // concat order string
  var m1=''; var m2=''; var m3=''; var s='s';
  if(Number(d(id).value)/Number(d('bundleStep_'+id).value)>1){m1=s;}
  if(d(id).value>1){m2=s;}
  if(itemList.length>1){m3=s;}

  d('tx_orderdetails').value+='<b>'+d('h1Titletext_'+id).innerHTML.toUpperCase()+'</b>: <br>Ordered amount <b> '+Number(d(id).value)/Number(d('bundleStep_'+id).value)+'</b> pack'+m1+'<br>Each pack containing <b>'+d(id).value+'</b> package'+m2+' per pack<br>Each package containing the following item'+m3+':<ul>'+thisItems+'</ul>Subtotal price: <b>'+window.currency+' '+d('subtotal_'+id).innerHTML+'</b><hr>';
  }
var allSp=document.getElementsByTagName('span'); var total=0;
for(var i=0;i!=allSp.length;i++){if(allSp[i].title==window.subTotalText){total+=Number(allSp[i].innerHTML);}}
d('spTotal').innerHTML=total;
d('tx_ordersum').value=total+' '+window.currency;
}

// remove not used hidden fields in the "Mailorderform Alt" to avoid having them displayed in the e-mail
function removeNotUsedHiddenFields(mode){
if(!mode||mode=='undefined')
  {
  getElementsByClass('input','csc-mailform-submit')[0].onclick=function(){removeNotUsedHiddenFields(true);};
  }else{
    var allTds=document.getElementsByTagName('td');
    for(var t=0;t<allTds.length;t++){if(allTds[t].style.display=='hidden'){allTds[t].style.display='';}}
    var allProdCells=getElementsByClass('td','title'); var inEls=''; var buffer=''; var c=0;
    for(var i=0;i<allProdCells.length;i++)
      {
       buffer=''; inEls=allProdCells[i].parentNode.getElementsByTagName('input');
       for(c=0;c<inEls.length;c++)
        {
         if(inEls[c].type=='text')
          {
            buffer+=inEls[c].value;
          }
        }
       if(buffer=='')
        {
        for(c=0;c<inEls.length;c++)
          {
            if(inEls[c].type=='hidden')
              {
              inEls[c].value='';
              }
          }
        }
      }
  }
}

// style the shop main category page
function shop_styleMainCatPage(){if(getElementsByClass('div','dvCatitem').length>0){
// show cat view
getElementsByClass('div','dvCatViewDisplay')[0].style.display='block';

// center sub category links
var allCatitems=getElementsByClass('div','dvCatitem'); var links=new Array(); var tc0=''; var tc1=''; var tc2='';
var cats=allCatitems.length;

// collect links
for(var c=0;c<cats;c++)
  {
    links[c]=allCatitems[c].getElementsByTagName('a')[0];
  }
var borderstyle='1px dashed #d9dcdf';

// enable onclick on images
for(var i=0;i<cats;i++)
  {
  // put cat links onto images
  links[i].parentNode.parentNode.getElementsByTagName('img')[0].onclick=function(){try{location.href=this.parentNode.parentNode.getElementsByTagName('a')[0].href;}catch(error){}}
  }

// style cells
for(var i=0;i<cats;i=i+3)
  {
  tc0=links[i].parentNode.parentNode;
  try{tc1=links[i+1].parentNode.parentNode;}catch(error){tc1=false;}
  try{tc2=links[i+2].parentNode.parentNode;}catch(error){tc2=false;}

  if(i==0)
    {// style top cells
     tc0.style.borderRight=borderstyle;tc0.style.borderBottom=borderstyle;
     if(tc1){tc1.style.borderBottom=borderstyle;}
     if(tc2){tc2.style.borderLeft=borderstyle;tc2.style.borderBottom=borderstyle;}
    }else{// all further cells
     tc0.style.borderRight=borderstyle;tc0.style.borderBottom=borderstyle; tc0.pos='l';
     if(tc1){tc1.style.borderBottom=borderstyle;tc1.pos='m';}
     if(tc2){tc2.style.borderLeft=borderstyle;tc2.style.borderBottom=borderstyle;tc2.pos='r';}
    }
  }

// style bottom cells
var lastCell=links[cats-1].parentNode.parentNode.pos;
if(lastCell=='r')
  {
   links[cats-1].parentNode.parentNode.style.border=0;
   links[cats-2].parentNode.parentNode.style.border=0;
   links[cats-2].parentNode.parentNode.style.borderRight=borderstyle;
   links[cats-3].parentNode.parentNode.style.border=0;
   links[cats-3].parentNode.parentNode.style.borderRight=borderstyle;
  }
if(lastCell=='m')
  {
   links[cats-1].parentNode.parentNode.style.border=0;
   links[cats-1].parentNode.parentNode.style.borderRight=borderstyle;
   links[cats-2].parentNode.parentNode.style.border=0;
   links[cats-2].parentNode.parentNode.style.borderRight=borderstyle;
  }
if(lastCell=='l')
  {
   links[cats-1].parentNode.parentNode.style.border=0;
   links[cats-1].parentNode.parentNode.style.borderRight=borderstyle;
  }

// pad and size main container
//getElementsByClass('div','tx-commerce-pi1')[0].style.marginLeft='150px';
getElementsByClass('div','tx-commerce-pi1')[0].style.width='580px';
getElementsByClass('div','dvCatViewDisplay')[0].getElementsByTagName('div')[0].style.display='none';
getElementsByClass('div','dvCatViewDisplay')[0].style.backgroundColor='white';

}}

// act/deact pickup comment field in basket (CURRENTLY NOT USED)
function shop_togglePickup(){
  var delSel=d('tdDelSel').getElementsByTagName('select')[0];
  var delSelVal=delSel.options[delSel.selectedIndex].value;
  var aNext=d('dvBasketNext').getElementsByTagName('a')[0];
  var delMess=d('dvPickup'); var delMessCont='';
  if(delSelVal==5)
    {
      delMess.style.visibility='visible';
    if(isIE55up){delMessCont=d('txPickup').innerHTML;}else{delMessCont=d('txPickup').value;}
      aNext.href='shop_checkout.html?pickupmessage='+encodeURI(delMessCont);

    }else{
      delMess.style.visibility='hidden';
      aNext.href='shop_checkout.html';
    }
  window.setTimeout("shop_togglePickup();",250);
}

// show confirmation message in top frame (when basket called in iframe from product list)
function shop_showTopCartConfirmation(){try{
if(location.href.indexOf('artAddUid')!=-1)
  {
  parent.window.cL_dw_messageBorderColor='#e0e0e0';
  parent.window.cL_dw_modalDisablerOpacity=0;
  parent.clib_dwin.open('<div class="dvShopConfirmMess"><b>Thank you!</b><br>The item has been added<br>to the <a href="shop_cart.html">shopping cart</a>.</div>','Item added successfully','htmlmode=yes,scrollbars=no,titlebar=no,buttons=no,width=210,height=60,left=400','');
  //parent.window.setTimeout("clib_dwin.close();parent.location.reload();",2000);
  parent.window.setTimeout("clib_dwin.close();",2000);
  parent.shop_basketLiveView();
  }
}catch(error){}}

// modifiy targets of basket forms to enable that hidden addition
function shop_modifyFormTargets(){try{
 var allF=document.getElementsByTagName('form');
 for(var i=0;i<allF.length;i++)
  {
   // make it so in all basked related forms, that the target is the invisible basket iframe and that the GET method is used instead of POST which will trigger the confirmation message script
   if(allF[i].name.indexOf('basket')!=-1)
    {
     allF[i].target='ifshoppingcart'; allF[i].method='get';
    }
  }
}catch(error){}}

// prepare the final submission
function shop_prepareLastStep(){
// get text data for delivery box
var delH=d('dvCheckoutDeliveryboxHeadline').innerHTML;
var delCS=d('dvCheckoutDeliveryboxSelfpickup').innerHTML;
var delCM=d('dvCheckoutDeliveryboxMaildelivery').innerHTML;

shop_releaseLastStep();
try{
var selfpick=d('dvShippingmethod').innerHTML.toLowerCase().indexOf('pickup')!=-1;
if(selfpick)
  {
  d('dvListingCommentLabel').innerHTML=delH+delCS;
  d('dvListingCommentTextarea').getElementsByTagName('textarea')[0].innerHTML='Date / Time / ASM\n\nComment';
  }else{
  d('dvListingCommentLabel').innerHTML=delH+delCM;
  }
}catch(error){window.setTimeout("shop_prepareLastStep();",1000);}
}

// remove delete buttons in edit address form when value is empty
function shop_removeEmptyDeleteButtons(){try{
 var allButts=document.getElementsByTagName('input');
 for(var i=0;i<allButts.length;i++)
  {
   if(allButts[i].type=='button'&&allButts[i].value==''){allButts[i].style.display='none';}
  }
}catch(error){}}

// link input type=button elements on IE
function shop_linkButtonsOnIE(){try{
  if(getElementsByClass('div','tx-commerce-pi1')[0]||getElementsByClass('div','tx-commerce-pi1')[0]||getElementsByClass('div','tx-commerce-pi2')[0]||getElementsByClass('div','tx-commerce-pi3')[0]||getElementsByClass('div','tx-commerce-pi4')[0])
    {
      var allInp=document.getElementsByTagName('input');
      for(var i=0;i<allInp.length;i++)
        {
         allInp[i].style.visibility='visible';
         if(allInp[i].type=='button'&&allInp[i].parentNode.tagName.toLowerCase()=='a')
          {
           allInp[i].onclick=function(){location.href=this.parentNode.href;}
          }
        }
    }
window.setTimeout("shop_linkButtonsOnIE();",1000);
}catch(error){}}
if(isIE5up){clib_onload("shop_linkButtonsOnIE()");}

// create basket live-view on product page
function shop_basketLiveView(){
  var baskets=getElementsByClass('span','spArticleBasket'); var thisAmount=''; var thisButt='';
  for(var i=0;i<baskets.length;i++)
    {
      thisAmount=baskets[i].getElementsByTagName('input')[0];
      thisButt=baskets[i].getElementsByTagName('input')[1];

      if(thisAmount.value>0)
        {
         thisAmount.disabled=true;
         thisButt.style.backgroundColor='#a7a7a7'; thisButt.style.color='#ffffff'; thisButt.style.width='120px'; thisAmount.style.borderColor='#ffffff';
         thisButt.value='View shopping cart';
         thisButt.onclick=function(){location.href='shop_cart.html';return true;}
         thisButt.onmouseover=null; thisButt.onmouseout=null;
         thisButt.parentNode.parentNode.action='';
        }else{
         thisAmount.disabled=false;
         thisButt.onclick=null;

         //thisButt.parentNode.parentNode.onsubmit=function(){if(this.getElementsByTagName('input')[2].value==0||this.getElementsByTagName('input')[2].value==''){this.getElementsByTagName('input')[2].value=1;}}

         thisButt.onclick=function(){if(this.parentNode.getElementsByTagName('input')[0].value==0||this.parentNode.getElementsByTagName('input')[0].value==''){this.parentNode.getElementsByTagName('input')[0].value=1;}}

         thisButt.parentNode.parentNode.action='shop_cart.html';
         thisButt.style.backgroundColor='#ffffff'; thisButt.style.color='#7b7b7b'; thisButt.style.width='120px';
         thisButt.value='Add to shopping cart';
        }

    }
}

// release last checkout step only when terms confirmed
function shop_releaseLastStep(){try{
var terms=getElementsByClass('div','chkout_list_terms')[0].getElementsByTagName('input')[0];
var contButt=getElementsByClass('div','chkout_list_form_submit')[0].getElementsByTagName('input')[0];
contButt.style.width='150px';
if(!terms.checked)
  {
  contButt.style.color='#d0d0d0'; contButt.style.borderColor='#d0d0d0';
  contButt.disabled=true;
  }else{
  contButt.style.color='#7b7b7b'; contButt.style.borderColor='#7b7b7b';
  contButt.disabled=false;
  }
}catch(error){}
window.setTimeout("shop_releaseLastStep();",500);
}

// transmit basket quantities to product list
function shop_transmitBasketQty(){try{
 if(parent&&self!=parent)
  {
   // collect items in the basket
   // structure: item[x] = ref to quantity input field
   //            item[x].value = its value
   //            item[x].uid = its article uid
   var allInpBasket=document.getElementsByTagName('input'); var allQtyBasket=new Array(); var c=0;
   for(var i=0;i<allInpBasket.length;i++)
    {
      if(allInpBasket[i].id&&allInpBasket[i].id.indexOf('articleqty')!=-1)
        {
          allQtyBasket[c]=allInpBasket[i];
          allQtyBasket[c].uid=allQtyBasket[c].id.substring(allQtyBasket[c].id.indexOf('_')+1,allQtyBasket[c].id.length);
          c++;
        }
    }
    // transfer values to product list page
    var allInpList=parent.getElementsByClass('input','qtyInput'); var thisUid='';
    for(i=0;i<allInpList.length;i++)
      {
       // get this article's uid
       thisUid=allInpList[i].name;
       thisUid=thisUid.substring(27,thisUid.length);
       thisUid=thisUid.substring(0,thisUid.indexOf(']'));
       for(c=0;c<allQtyBasket.length;c++) // go thru all basket uids
        {
         if(thisUid==allQtyBasket[c].uid) // if the uid is the same...
          {
           allInpList[i].value=allQtyBasket[c].value; // ...transfer the value
          }
        }
      }
  // show confirm message, if necessary
  shop_showTopCartConfirmation();
  parent.shop_basketLiveView();
  }
}catch(error){}}

// fit product list view height in Gecko
function shop_geckoFitProdListHeight(){if(!isIE55up){
  var allBasks=getElementsByClass('div','dvCatitemsListviewBasket'); var thisArts=''; var a=0; var h=0;

  for(var i=0;i<allBasks.length;i++)
    {
     h=0;
     thisArts=document.getElementsByTagName('div');
     for(a=0;a<thisArts.length;a++)
      {
        if(thisArts[a].className=='dvArticle'){h=Number(h);h+=thisArts[a].offsetHeight;}
      }
     allBasks[i].style.height=Number(h+10)+'px';
     if(Number(h+20)<60){allBasks[i].style.height='60px';}
    }
}}

// create article images slide show
function shop_ArtImgSS(){try{
var allCatImgContainers=getElementsByClass('div','dvCatitemsListview2Img'); var artImgs=''; var slideCont='';
for(var i=0;i<allCatImgContainers.length;i++) // loop thru containers
  {
   artImgs=allCatImgContainers[i].getElementsByTagName('img');
   if(artImgs.length>1) // if more than one images, create slide show, but wait til clib_onload fires
    {
      if(!window.shop_ArtImgSSWasFired||window.shop_ArtImgSSWasFired=='undefined')
        {
          window.shop_ArtImgSSWasFired=true; clib_onload("shop_ArtImgSS()");
        }else{
          allCatImgContainers[i].style.display='none';
          slideCont=allCatImgContainers[i].parentNode.getElementsByTagName('div')[3];
          slideCont.className=allCatImgContainers[i].className;
          slideCont.style.display='block'; slideCont.style.visibility='visible';
          slideCont.getElementsByTagName('img')[0].src=artImgs[0].src;
          slideCont.getElementsByTagName('a')[0].onclick=function(){shop_ArtImgSS_zoom(this);return false;};
          slideCont.getElementsByTagName('div')[0].innerHTML='1'+'/'+artImgs.length;
          if(slideCont.getElementsByTagName('div')[2].innerHTML!='')
            {
              try{
              slideCont.getElementsByTagName('div')[1].innerHTML=slideCont.getElementsByTagName('div')[2].innerHTML.split(';')[0];
            }catch(error){
              slideCont.getElementsByTagName('div')[1].innerHTML=slideCont.getElementsByTagName('div')[2].innerHTML;}
            }
        }
    }else{ // if only 1 image, simply make it visible
      allCatImgContainers[i].style.visibility='visible';
    }
  }
}catch(error){window.setTimeout("shop_ArtImgSS();",1000);}}
// slide show
function shop_ArtImgSS_slide(obj,mode){
  // get currently act and inact img
  var img1=obj.parentNode.getElementsByTagName('img')[0];
  var img2=obj.parentNode.getElementsByTagName('img')[1];
  var actImg=img1; var inactImg=img2;
  if(img2.style.display=='inline'){actImg=img2;inactImg=img1;}
  // get (or set) counter
  if(!obj.parentNode.imgCounter){obj.parentNode.imgCounter=0;}
  var ic=obj.parentNode.imgCounter;
  var allImgs=obj.parentNode.parentNode.getElementsByTagName('div')[2].getElementsByTagName('img');
  var il=allImgs.length-1;
  // inc/dec counter
  if(mode){ic++;if(ic>il){ic=0;}}else{ic=ic-1;if(ic<0){ic=il;}} obj.parentNode.imgCounter=ic;
  obj.parentNode.getElementsByTagName('div')[0].innerHTML=ic+1+'/'+Number(il+1);
  if(obj.parentNode.getElementsByTagName('div')[2].innerHTML!='')
    {
      try{ // get xth dev from subtitle
      obj.parentNode.getElementsByTagName('div')[1].innerHTML=obj.parentNode.getElementsByTagName('div')[2].innerHTML.split(';')[ic];
      }catch(error){ // if for this one no text, make desc empty
      obj.parentNode.getElementsByTagName('div')[1].innerHTML='';
      }
    }
  actImg.src=allImgs[ic].src; actImg.style.display='inline'; inactImg.style.display='none';
}
// img swap animation
function shop_ArtImgSS_slide_exec(actImg,inactImg){
// TO BE WRITTEN LATER
}
// img zoom
function shop_ArtImgSS_zoom(obj){
 var ic=obj.parentNode.imgCounter;
 if(!ic){ic=0;}
 var zoomURL=obj.parentNode.parentNode.getElementsByTagName('a')[ic].href;
 openPic(zoomURL); return false;
}

// transfer current product to breadcrumbs
function shop_transferCurrProdToBC(){try{
  var thisProductName=getElementsByClass('div','dvCatViewTitle')[0].getElementsByTagName('h2')[0].innerHTML;
  var bc=d('dvBreadcrumbs');
  if(bc.innerHTML.indexOf(thisProductName)==-1)
    {
    // deactivate and link last bc
    var lastBc=bc.getElementsByTagName('span')[bc.getElementsByTagName('span').length-1];
    lastBc.className='breadcrumb';
    lastBc.innerHTML='<a href="shop_products.html">'+lastBc.innerHTML+'</a>';
    bc.innerHTML=bc.innerHTML+'&#160;<img border="0" alt="" src="fileadmin/dev/img/breadcrumbs_arrow.gif">&#160;<span class="breadcrumb_cur">'+thisProductName+'</a>';
    }
}catch(error){window.setTimeout("shop_transferCurrProdToBC();",1000);}}

// in basket, deactivate other quantity input fields if one is changed
function shop_basketDeactivateOtherQtys(){
var allInp=document.getElementsByTagName('input');
for(var i=0;i<allInp.length;i++)
	{
	if(allInp[i].id.indexOf('articleqty_')!=-1)
		{
		allInp[i].onchange=function(){shop_basketDeactivateOtherQtys_exec(this);};
		}
	}
}
function shop_basketDeactivateOtherQtys_exec(obj){
var inNr=1; if(isIE55up){inNr=3;};
var allInp=document.getElementsByTagName('input');
for(var i=0;i<allInp.length;i++)
	{
	if(allInp[i].id!=obj.id&&allInp[i].id.indexOf('articleqty_')!=-1)
		{
		allInp[i].style.border='1px solid white';allInp[i].disabled=true; allInp[i].style.backgroundColor='transparent';
		allInp[i].parentNode.parentNode.getElementsByTagName('input')[inNr].style.visibility='hidden';
		allInp[i].parentNode.parentNode.getElementsByTagName('img')[0].style.visibility='hidden';
		}
	}
}

// hover effect for all shop buttons
function shop_buttonsHover(){try{
var allInp=document.getElementsByTagName('input'); var b='';
for(var i=0;i<allInp.length;i++)
	{
	b=allInp[i];
	if((b.type=='submit'||b.type=='button'||b.type=='reset'))
		{
		b.onmouseover=function(){this.style.backgroundColor='#e0e0e0';this.style.color='#202020';}
		b.onmouseout=function(){this.style.backgroundColor='';this.style.color='';}
		}
	}
if(allInp.length==0){window.setTimeout("shop_buttonsHover();",1000);}
}catch(error){window.setTimeout("shop_buttonsHover();",1000);}}
if(location.href.indexOf('shop_')!=-1){clib_onload("shop_buttonsHover()");}

// regulate billing and delivery addresses; max 1 billing and 5 delivery addresses
function shop_regulateAddresses(mode,arg){try{

if(mode=='checkout')
  {
    var maxlength=0;
    if(arg.toLowerCase().indexOf('delivery')!=-1){maxlength=5;}
    if(d('olAddressItems').getElementsByTagName('li').length<maxlength+1){try{d('dvNewAddress').style.display='block';}catch(error){};}
  }
if(mode=='address')
  {
    if(d('olAddressItemsBilling').getElementsByTagName('li').length<1){d('dvNewAddressBilling').style.display='inline';}
    if(d('olAddressItemsDelivery').getElementsByTagName('li').length<5){d('dvNewAddressDelivery').style.display='inline';}
    //d('olAddressItemsDelivery').getElementsByTagName('input')[0].style.display='none';
    //d('olAddressItemsDelivery').getElementsByTagName('input')[1].style.display='none';
    d('olAddressItemsDelivery').getElementsByTagName('input')[1].value='Delete';
    d('olAddressItemsDelivery').getElementsByTagName('input')[1].style.display='inline';
  d('olAddressItemsDelivery').getElementsByTagName('input')[1].onclick = function()
    {
      top.location.href=this.parentNode.getElementsByTagName('a')[0].href.replace('edit','delete');
    };
    if(!isIE55up)
      {
      //d('olAddressItemsDelivery').getElementsByTagName('li')[0].style.opacity='.5';
      d('olAddressItemsBilling').getElementsByTagName('li')[0].style.opacity='.5';
      }else{
      d('olAddressItemsDelivery').getElementsByTagName('li')[0].style.width='360px';
      d('olAddressItemsBilling').getElementsByTagName('li')[0].style.width='360px';
      //d('olAddressItemsDelivery').getElementsByTagName('li')[0].style.filter='alpha(opacity=50)';
      d('olAddressItemsBilling').getElementsByTagName('li')[0].style.filter='alpha(opacity=50)';
      }
  }

if(getElementsByClass('div','chkout_address_title')[0]&&getElementsByClass('div','chkout_address_title')[0].innerHTML.toLowerCase().indexOf('billing')!=-1)
  {
   d('olAddressItems').getElementsByTagName('input')[0].style.visibility='hidden';
   // quirk due to an IE bug: IE can't hide this radio using visibility, so we make it fully opaque
   if(isIE55up){d('olAddressItems').getElementsByTagName('input')[0].style.filter='alpha(opacity=0)';}
   d('olAddressItems').getElementsByTagName('li')[0].style.listStyleType='none';
   getElementsByClass('div','chkout_address_fields')[0].getElementsByTagName('input')[1].style.display='none';
  }

}catch(error){window.setTimeout("shop_regulateAddresses('"+mode+"','"+arg+"');",250);}}

// transfer categories into top menu
function shop_transferCatsToTopMenu(){try{
var cats=d('dvCategoriesForMenu').getElementsByTagName('a');
// html and init for menu block
var topmenu_html_open='<div id="Menutopnav1x1" style="z-index:9999;position:absolute;left:736px;top:96px;visibility:hidden;"><table class="nav_sub" cellpadding="0" cellspacing="3" border="0"><tr>';
var topmenu_html_colopen='<td valign="top">';
var topmenu_html_item='<div style="position:absolute;visibility:hidden;"></div><div style="width:100%;height:100%;"><span class="sub_menu"><a href="###LINKURL###" target="_top" onmouseover="GL_hideAll(\'topnav2x\');" onmouseout="GL_resetAll(\'topnav2x\');">###LINKTEXT###</a></span></div>';
var topmenu_html_colclose='</td>';
var topmenu_html_close='</tr></table></div>';
var topmenu_html=''; var colcount=1;
// construct code
topmenu_html+=topmenu_html_open;
for(var i=0;i<cats.length;i++)
  {
    if(colcount==1){topmenu_html+=topmenu_html_colopen;} // cell opening
    topmenu_html+=topmenu_html_item.replace('###LINKURL###',cats[i].href).replace('###LINKTEXT###',cats[i].innerHTML);
    if(colcount==4){topmenu_html+=topmenu_html_colclose;} // cell closing
    colcount++; if(colcount==5){colcount=1;}
  }
if(colcount==4){topmenu_html+=topmenu_html_colclose;} // if last cell had under 4 items, add cell closing
topmenu_html+=topmenu_html_close;
window.topmenu_html=topmenu_html;
clib_onload("shop_transferCatsToTopMenu_execute()");
}catch(error){window.setTimeout("shop_transferCatsToTopMenu();",500);}}
function shop_transferCatsToTopMenu_execute(){
 var topArtMenu=document.createElement('div');
 topArtMenu.innerHTML=window.topmenu_html;
 topArtMenu.id='dvTopArtMenu';
 document.body.appendChild(topArtMenu);
 d('nav_top').getElementsByTagName('a')[0].onmouseover=function(){GL_doTop('topnav1x', 'Menutopnav1x1');};
 d('nav_top').getElementsByTagName('a')[0].onmouseout=function(){GL_stopMove('topnav1x');};

 if(parent!=self)
  {
  try{
    topArtMenu=parent.d('dvTopArtMenu');
    topArtMenu.innerHTML=window.topmenu_html;
    }catch(error){}
  }
}

// set .tbAddressItems width to 730px on IE7 and Gecko; setting via CSS just did not work.
function reformatTbAddressItemsOnIE7(){
  try{getElementsByClass('table','tbAddressItems')[0].style.width='730px';}catch(error){}
}
if(isIE7up||isGecko){clib_onload("reformatTbAddressItemsOnIE7()");}

// remove first link from shop breadcrumbs
function shop_removeFirstBreadcrumb(){
  try{
  d('dvBreadcrumbs').getElementsByTagName('a')[0].style.display='none';
  d('dvBreadcrumbs').getElementsByTagName('img')[0].style.display='none';
  }catch(error){}
  window.setTimeout("shop_removeFirstBreadcrumb();",2500);
}
if(location.href.indexOf('shop_')!=-1){clib_onload("shop_removeFirstBreadcrumb()");}

// deactivate distant quantity entry fields in pi2 shoppingcart
function shop_pi1_deactivateDistantQtyFields(obj){
var allInp=getElementsByClass('input','qtyInput');
for(var i=0;i<allInp.length;i++)
  {
    if(allInp[i]!=obj)
      {
       allInp[i].style.border='1px solid #ffffff';
       allInp[i].disabled=true;
       if(allInp[i].parentNode.getElementsByTagName('input')[1].value.toLowerCase().indexOf('view')==-1)
        {
        allInp[i].parentNode.getElementsByTagName('input')[1].style.visibility='hidden';
        }
      }
  }
}
function shop_pi1_deactivateDistantQtyFields_init(){
var allInp=getElementsByClass('input','qtyInput');
//for(var i=0;i<allInp.length;i++){allInp[i].onchange=function(){shop_pi1_deactivateDistantQtyFields(this);};}
}

// in a given element, see if of the therein contained radio buttons one is checked; if not, check the first one
function selectFirstIfNoneSelected($id){
  var el=d($id); var radios=new Array(); var radioC=0;
  var allInp=el.getElementsByTagName('input');
  // remove non-radio elements
  for(var i=0;i<allInp.length;i++) // filter radios
    {
      if(allInp[i].type=='radio')
        {
         radios[radioC]=allInp[i]; radioC++;
        }
    }
  var oneIsChecked=false;
  for(i=0;i<radios.length;i++) // see if one is checked
    {
     if(radios[i].checked)
      {
       oneIsChecked=true;
      }
    }
  if(!oneIsChecked){radios[0].checked=true;} // if none was checked, check the first one
}


// special treatment for print link on order confirmation page (standard print page can't be used as a reload destroys the page)
function printWithoutReload(){
// find print image
var allImgs=document.getElementsByTagName('img'); var printImg='';
for(var i=0;i<allImgs.length;i++)
  {
   if(allImgs[i].src.toLowerCase().indexOf('print')!=-1)
    {
     printImg=allImgs[i];
    }
  }
 printImg.parentNode.href='#';
 printImg.parentNode.onclick=function(){window.print();return false;};
// display additional print link
document.write('<a href="#" onclick="window.print();return false;">Print this content</a>');
}

// open address edit window
function openAddressWindow() {
 window.open('shop_addresses.html');
}
// try to reload opener while address editing
l=location.href;
// refresh opener, if we are in the address editor
//if(location.href.indexOf('shop_addresses.html')!=-1){try{opener.location.reload();}catch(error){};};
// close window, if we are on the index page coming from the address editor

if(opener)
  {
  if(opener.location.href!=location.href)
    {
    if(l.substring(l.length-1,l.length)=='/'&&document.referrer.indexOf('shop_addresses.html')!=-1)
      {
      opener.location.reload();
      try{opener=self;}catch(error){};
      window.close();
      }
    }
  }else{
  if(l.substring(l.length-1,l.length)=='/'&&document.referrer.indexOf('shop_addresses.html')!=-1)
    {
    location.replace('shop.html');
    }
  }

// shop: transfer texts on checkout page
function shop_transferDeliveryTexts(){
// transfer texts
getElementsByClass('div','dvBasketDeliverySelector_content_left')[0].innerHTML=getElementsByClass('div','dvBasketDeliverySelector_content_left')[0].innerHTML.replace('###DELIVERYTEXT_LEFT###',d('dvBasketDeliverySourceLeft').innerHTML);
getElementsByClass('div','dvBasketDeliverySelector_content_right')[0].innerHTML=getElementsByClass('div','dvBasketDeliverySelector_content_right')[0].innerHTML.replace('###DELIVERYTEXT_RIGHT###',d('dvBasketDeliverySourceRight').innerHTML);
getElementsByClass('div','dvBasketDeliverySelector_content_headline')[0].innerHTML=getElementsByClass('div','dvBasketDeliverySelector_content_headline')[0].innerHTML.replace('###DELIVERYTEXT_HEADLINE###',d('dvBasketDeliverySourceHeadline').innerHTML);
// set radio
var sel=d('tdDelSel').getElementsByTagName('select')[0];

d('rdDeliveryLeft').onclick=function(){shop_transferDeliveryTexts_changeMode(this);};
var leftDelImg=getElementsByClass('div','dvBasketDeliverySelector_content_left')[0].getElementsByTagName('img')[0];
leftDelImg.onclick=function(){if(!d('rdDeliveryLeft').checked){d('rdDeliveryLeft').checked=true;};shop_transferDeliveryTexts_changeMode(d('rdDeliveryLeft'));};
if(isIE55up){leftDelImg.style.cursor='hand';}else{leftDelImg.style.cursor='pointer';};

d('rdDeliveryRight').onclick=function(){shop_transferDeliveryTexts_changeMode(this);};
var rightDelImg=getElementsByClass('div','dvBasketDeliverySelector_content_right')[0].getElementsByTagName('img')[0];
rightDelImg.onclick=function(){if(!d('rdDeliveryRight').checked){d('rdDeliveryRight').checked=true;};shop_transferDeliveryTexts_changeMode(d('rdDeliveryRight'));};
if(isIE55up){rightDelImg.style.cursor='hand';}else{rightDelImg.style.cursor='pointer';};

// possible values: 5=Self pickup, 6=Mail delivery
var val=sel.options[sel.selectedIndex].value;
if(val==6){d('rdDeliveryLeft').checked=true;d('rdDeliveryRight').checked=false;}
if(val==5){d('rdDeliveryLeft').checked=false;d('rdDeliveryRight').checked=true;}
}
function shop_transferDeliveryTexts_changeMode(obj){
if(obj.checked&&obj.id=='rdDeliveryLeft'){shop_transferDeliveryTexts_setFormValue(6);}
if(obj.checked&&obj.id=='rdDeliveryRight'){shop_transferDeliveryTexts_setFormValue(5);}
}
function shop_transferDeliveryTexts_setFormValue(val){
var sel=d('tdDelSel').getElementsByTagName('select')[0];
for(var i=0;i<sel.options.length;i++)
  {
   if(sel.options[i].value==val)
    {
     sel.options[i].selected=true;
    }
  }
document.forms.basket.submit();
}