// Remove from cart
function rC(id) {
	if (confirm('Dieser Artikel wird aus dem Warenkorb entfernt!')) {
		location.href = "index.php?l=83&rC="+id;
	}
}

// Product Description
function pD(id) {
	var width = 600;
	var height = 400;
	var center = 1;
	var xtra = '';
	if (center) {
		var xposition=0;
		var yposition=0;
		if ((parseInt(navigator.appVersion) >= 4 ) && (center)) {
			xposition = (screen.width - width) / 2;
			yposition = (screen.height - height) / 2;
		}
		xtra = ",screenx="+xposition+",screeny="+yposition+",left="+xposition+",top="+yposition;
	}
	var features = "width="+width+",height="+height+",location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no"+xtra;
	var w = window.open('index.php?l=82&popup=1&id='+id, 'artikelinfo'+id, features);
	w.focus();
}


function g(i) {
	var gallery_image = document.getElementById('gallery_image');
	gallery_image.src = i;
}
function closeZoom() {
	var z = MM_findObj('zoomer');
	z.style.visibility = 'hidden';
}
function zoomMe(i) {
	var z = MM_findObj('zoomer');
	z.innerHTML = '<a href="javascript:closeZoom();"><img src="'+i+'" border="0" /></a><div align="right" style="margin-top:5px;"><a href="javascript:closeZoom();">Schlie&szlig;en [x]</a></div>';
	z.style.left = (mousePos.x-200)+'px';
	z.style.top = (mousePos.y-150)+'px';
	z.style.visibility = 'visible';
}

function nil() {
	// This function is supposed to do nothing
}
function nxtPage() {
	cp++;
	if (cp>pjc) {
		cp = pjc;
	}
	goPage(cp);
}
function prvPage() {
	cp--;
	if (cp<0) {
		cp = 0;
	}
	goPage(cp);
}
function goPage(p) {
	cp = p;
	var blendColor = '#cccccc';
	var normalColor = '#509add';
	var prv_link = document.getElementById('prv');
	var nxt_link = document.getElementById('nxt');
	var c = document.getElementById('pContent');
	c.innerHTML = base64_decode(pjs[p]);
	for (var t=0; t<=pjc; t++) {
		if (document.getElementById('p'+t) != null) {
			document.getElementById('p'+t).className = '';
		}
	}
	if (document.getElementById('p'+p) != null) {
		document.getElementById('p'+p).className = 'naviselected';
	}
	/*
	if (p == 0) {
		prv_link.style.color = blendColor;
	} else {
		prv_link.style.color = normalColor;
	}
	if (p == pjc) {
		nxt_link.style.color = blendColor;
	} else {
		nxt_link.style.color = normalColor;
	}
	*/
}


/*
function changeContactForm(loc, formtype) {
	var url = '/index.php?l='+loc+'&changeform=1&ftype='+formtype;
	var ajax = new Ajax.Updater('formhtml',url,{method:'get',evalScripts:true});
}
function joinMailinglist(type, msg, msg2){
	document.joinmailinglist.entry.value = type;
	if (type == 'join') {
		if (checkMailinglistMail(msg)) {
			//document.joinmailinglist.submit();
			// Show Extra Information DIV here
			var dO = MM_findObj('newsletterExtra');
			dO.style.top = '250px';
			dO.style.left = (document.documentElement.clientWidth/2-200)+'px';
			dO.style.visibility = 'visible';
		}
	} else if (type == 'unjoin') {
		if (confirm(msg2)) {
			if (checkMailinglistMail(msg)) {
				document.joinmailinglist.submit();
			}
		}
	}
}
function checkMailinglistMail(msg) {
	var returnval = true;
	var f = document.joinmailinglist;
	if (f.email.value.indexOf('@') == -1 || f.email.value.indexOf('.') == -1) {
		alert(msg);
		returnval = false;
	}
	return returnval;
}
function showMore(d,a,b) {
	var theDiv = MM_findObj(d);
	//var fulltext = window[d+'_full'];
	fulltext = MM_findObj(d+'_full');
	var visibility = window[d+'_visibility'];
	var backup = window[d+'_excerpt'];
	
	if (visibility == false) {
		window[d+'_excerpt'] = theDiv.innerHTML;
		theDiv.innerHTML = fulltext.innerHTML;
		window[d+'_visibility'] = true;
		MM_findObj(d+'_button').innerHTML = a;
	} else {
		var buffer = backup;
		window[d+'_excerpt'] = theDiv.innerHTML;
		theDiv.innerHTML = buffer;
		window[d+'_visibility'] = false;
		MM_findObj(d+'_button').innerHTML = b;
	}
}

function video () {
	openAWindow('/imagefilm/deutsch.html', 'ImageFilm', 400, 400, 1);
}
*/
// ============== 3rdparty below ==============
// http://kevin.vanzonneveld.net/techblog/article/javascript_equivalent_for_phps_abs/
function utf8_decode ( str_data ) {
    // http://kevin.vanzonneveld.net
    // +   original by: Webtoolkit.info (http://www.webtoolkit.info/)
    // +      input by: Aman Gupta
    // +   improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +   improved by: Norman "zEh" Fuchs 
    // *     example 1: utf8_decode('Kevin van Zonneveld');
    // *     returns 1: 'Kevin van Zonneveld'
 
    var tmp_arr = [], i = ac = c1 = c2 = c3 = 0;
 
    while ( i < str_data.length ) {
        c1 = str_data.charCodeAt(i);
        if (c1 < 128) {
            tmp_arr[ac++] = String.fromCharCode(c1); 
            i++;
        } else if ((c1 > 191) && (c1 < 224)) {
            c2 = str_data.charCodeAt(i+1);
            tmp_arr[ac++] = String.fromCharCode(((c1 & 31) << 6) | (c2 & 63));
            i += 2;
        } else {
            c2 = str_data.charCodeAt(i+1);
            c3 = str_data.charCodeAt(i+2);
            tmp_arr[ac++] = String.fromCharCode(((c1 & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
            i += 3;
        }
    }
    
    return tmp_arr.join('');
}
function base64_decode( data ) {
    // http://kevin.vanzonneveld.net
    // +   original by: Tyler Akins (http://rumkin.com)
    // +   improved by: Thunder.m
    // +      input by: Aman Gupta
    // +   improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)    
    // -    depends on: utf8_decode
    // *     example 1: base64_decode('S2V2aW4gdmFuIFpvbm5ldmVsZA==');
    // *     returns 1: 'Kevin van Zonneveld'
    
    // mozilla has this native 
    // - but breaks in 2.0.0.12!
    //if (typeof window['btoa'] == 'function') {
    //    return btoa(data);
    //}
    
    var b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
    var o1, o2, o3, h1, h2, h3, h4, bits, i = ac = 0, dec = "", tmp_arr = [];
 
    do {  // unpack four hexets into three octets using index points in b64
        h1 = b64.indexOf(data.charAt(i++));
        h2 = b64.indexOf(data.charAt(i++));
        h3 = b64.indexOf(data.charAt(i++));
        h4 = b64.indexOf(data.charAt(i++));
 
        bits = h1<<18 | h2<<12 | h3<<6 | h4;
 
        o1 = bits>>16 & 0xff;
        o2 = bits>>8 & 0xff;
        o3 = bits & 0xff;
 
        if (h3 == 64) {
            tmp_arr[ac++] = String.fromCharCode(o1);
        } else if (h4 == 64) {
            tmp_arr[ac++] = String.fromCharCode(o1, o2);
        } else {
            tmp_arr[ac++] = String.fromCharCode(o1, o2, o3);
        }
    } while (i < data.length);
    
    dec = tmp_arr.join('');
    dec = utf8_decode(dec);
    
    return dec;
}
function html_entity_decode( string ) {
    // http://kevin.vanzonneveld.net
    // +   original by: john (http://www.jd-tech.net)
    // +      input by: ger
    // +   improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +    revised by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // %          note: table from http://www.the-art-of-web.com/html/character-codes/
    // *     example 1: html_entity_decode('Kevin &amp; van Zonneveld');
    // *     returns 1: 'Kevin & van Zonneveld'
    
    var histogram = {}, histogram_r = {}, code = 0;
    var entity = chr = '';
    
    histogram['34'] = 'quot';
    histogram['38'] = 'amp';
    histogram['60'] = 'lt';
    histogram['62'] = 'gt';
    histogram['160'] = 'nbsp';
    histogram['161'] = 'iexcl';
    histogram['162'] = 'cent';
    histogram['163'] = 'pound';
    histogram['164'] = 'curren';
    histogram['165'] = 'yen';
    histogram['166'] = 'brvbar';
    histogram['167'] = 'sect';
    histogram['168'] = 'uml';
    histogram['169'] = 'copy';
    histogram['170'] = 'ordf';
    histogram['171'] = 'laquo';
    histogram['172'] = 'not';
    histogram['173'] = 'shy';
    histogram['174'] = 'reg';
    histogram['175'] = 'macr';
    histogram['176'] = 'deg';
    histogram['177'] = 'plusmn';
    histogram['178'] = 'sup2';
    histogram['179'] = 'sup3';
    histogram['180'] = 'acute';
    histogram['181'] = 'micro';
    histogram['182'] = 'para';
    histogram['183'] = 'middot';
    histogram['184'] = 'cedil';
    histogram['185'] = 'sup1';
    histogram['186'] = 'ordm';
    histogram['187'] = 'raquo';
    histogram['188'] = 'frac14';
    histogram['189'] = 'frac12';
    histogram['190'] = 'frac34';
    histogram['191'] = 'iquest';
    histogram['192'] = 'Agrave';
    histogram['193'] = 'Aacute';
    histogram['194'] = 'Acirc';
    histogram['195'] = 'Atilde';
    histogram['196'] = 'Auml';
    histogram['197'] = 'Aring';
    histogram['198'] = 'AElig';
    histogram['199'] = 'Ccedil';
    histogram['200'] = 'Egrave';
    histogram['201'] = 'Eacute';
    histogram['202'] = 'Ecirc';
    histogram['203'] = 'Euml';
    histogram['204'] = 'Igrave';
    histogram['205'] = 'Iacute';
    histogram['206'] = 'Icirc';
    histogram['207'] = 'Iuml';
    histogram['208'] = 'ETH';
    histogram['209'] = 'Ntilde';
    histogram['210'] = 'Ograve';
    histogram['211'] = 'Oacute';
    histogram['212'] = 'Ocirc';
    histogram['213'] = 'Otilde';
    histogram['214'] = 'Ouml';
    histogram['215'] = 'times';
    histogram['216'] = 'Oslash';
    histogram['217'] = 'Ugrave';
    histogram['218'] = 'Uacute';
    histogram['219'] = 'Ucirc';
    histogram['220'] = 'Uuml';
    histogram['221'] = 'Yacute';
    histogram['222'] = 'THORN';
    histogram['223'] = 'szlig';
    histogram['224'] = 'agrave';
    histogram['225'] = 'aacute';
    histogram['226'] = 'acirc';
    histogram['227'] = 'atilde';
    histogram['228'] = 'auml';
    histogram['229'] = 'aring';
    histogram['230'] = 'aelig';
    histogram['231'] = 'ccedil';
    histogram['232'] = 'egrave';
    histogram['233'] = 'eacute';
    histogram['234'] = 'ecirc';
    histogram['235'] = 'euml';
    histogram['236'] = 'igrave';
    histogram['237'] = 'iacute';
    histogram['238'] = 'icirc';
    histogram['239'] = 'iuml';
    histogram['240'] = 'eth';
    histogram['241'] = 'ntilde';
    histogram['242'] = 'ograve';
    histogram['243'] = 'oacute';
    histogram['244'] = 'ocirc';
    histogram['245'] = 'otilde';
    histogram['246'] = 'ouml';
    histogram['247'] = 'divide';
    histogram['248'] = 'oslash';
    histogram['249'] = 'ugrave';
    histogram['250'] = 'uacute';
    histogram['251'] = 'ucirc';
    histogram['252'] = 'uuml';
    histogram['253'] = 'yacute';
    histogram['254'] = 'thorn';
    histogram['255'] = 'yuml';
    
    // Reverse table. Cause for maintainability purposes, the histogram is 
    // identical to the one in htmlentities.
    for (code in histogram) {
        entity = histogram[code];
        histogram_r[entity] = code; 
    }
    
    return string.replace(/(\&([a-zA-Z]+)\;)/g, function(full, m1, m2){
        if (m2 in histogram_r) {
            return String.fromCharCode(histogram_r[m2]);
        } else {
            return m2;
        }
    });    
}
function MM_openBrWindow(theURL,winName,features) 
{ //v2.0
  window.open(theURL,winName,features);
}
function openAWindow( pageToLoad, winName, width, height, center) {
  xposition=0; yposition=0;
  if ((parseInt(navigator.appVersion) >= 4 ) &&(center)) {
   xposition = (screen.width - width) / 2;
   yposition = (screen.height - height) / 2;
  }
  args = "width=" + width + ","
  + "height=" + height + ","
  + "location=0,"
  + "menubar=0,"
  + "resizable=0,"
  + "scrollbars=1,"
  + "status=0,"
  + "titlebar=0,"
  + "toolbar=0,"
  + "hotkeys=0,"
  + "screenx=" + xposition + "," //NN Only
  + "screeny=" + yposition + "," //NN Only
  + "left=" + xposition + "," //IE Only
  + "top=" + yposition; //IE Only
  window.open( pageToLoad, winName, args );
}
function alertSize() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  //window.alert( 'Width = ' + myWidth );
  //window.alert( 'Height = ' + myHeight );
  return myWidth;
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}