function colorSwitch(value_id, color, select_id, el) {
	// Farbwechsel
	if(value_id && select_id && el) {
		activeColor = color;
		
		var otherels = el.parentNode.getElementsByTagName('input');
		var otherels_count = otherels.length;
		for(var i = 0; i < otherels_count; i++) {
			otherels[i].className = 'colorswitcher';
		}
		el.className = 'colorswitcher active';
	
		document.getElementById(select_id).value = value_id;
		
		var images = document.getElementById('region_select_container').getElementsByTagName('li');
		var images_count = images.length;
		var regexp = new RegExp(color, 'i');
		for(var i = 0; i < images_count; i++) {
			if(regexp.test(images[i].id)) {
				images[i].style.visibility = 'visible';
			} else {
				images[i].style.visibility = 'hidden';
			}
		}
	}
	var images = document.getElementById('product-image-container').getElementsByTagName('img');
	var images_count = images.length;
	for(var i = 0; i < images_count; i++) {
		images[i].style.visibility = 'hidden';
	}
	document.getElementById('product_image_'+color+'_'+activeRegion).style.visibility = 'visible';
	
}

function regionSwitch(region) {
	activeRegion = region;
	colorSwitch(false, activeColor, false, false);
}
