//------------------------------------------------------------------
// globale variablen
//------------------------------------------------------------------
var js_init															= 0;
var gl_browser_height												= 0;
var gl_browser_width												= 0;
var ck_arr_resize													= new Array();
var arr_navi_line													= new Array();
arr_navi_line['punkte']												= new Array('think_aesculap','products','news','shopping_basket');
arr_navi_line['aktiv']												= '';
var gl_arr_hash														= new Array();
var arr_l															= new Array();
var arr_treffer														= new Array();
var str_kat_id														= '';
var str_medium														= '';
var a																= new Array();
var bool_suche														= false;
var arr_basket														= new Array();
var arr_material													= new Array();
var str_window_teil1												= '|';
var str_window_teil2												= '';
var merke_notes_i													= 0;
var win_counter														= 0;
var arr_cookie_basket												= new Array();
var arr_contact														= new Array();
var merke_filter_hash												= '';
var liste															= '1234567890-_abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ';
var win_extranet;
var merke_str_parent_parent											= '';
var merke_gif_parent_parent											= '';
var merke_str_filter												= '';
var bool_nato_basket												= 0;
var bool_nato														= 0;
var bool_wettbewerber												= 0;
var JS_modus														= '';
var wettbewerber_id													= '';
var wettbewerber_mat_nr												= '';
var anker_parent_iframe_ignore                                      = 0;

var merke_arr_filter_changed										= new Array();
merke_arr_filter_changed['author']									= 'INIT';
merke_arr_filter_changed['description']								= 'INIT';
merke_arr_filter_changed['details']									= 'INIT';
merke_arr_filter_changed['dimension']								= 'INIT';


var arr_filter_all													= Array();
arr_filter_all['author']											= new Array();
arr_filter_all['description']										= new Array();
arr_filter_all['details']											= new Array();
arr_filter_all['dimension']											= new Array();


var arr_produkt_bilder												= new Array();
arr_produkt_bilder['ap']											= 0;
arr_produkt_bilder['mp']											= 0;

arr_produkte														= new Array();
arr_produkte['filter']												= new Array();
arr_produkte['filter']['display']									= 'none';
arr_produkte['filter']['author']									= new Array();
arr_produkte['filter']['description']								= new Array();
arr_produkte['filter']['details']									= new Array();
arr_produkte['filter']['dimension']									= new Array();
arr_produkte['filter']['wert']										= '';

int_produkt_aktiv													= -1;
str_merke_hash_url													= '';

var arr_api_customer_data											= new Array();
var arr_api_items													= new Array();


//------------------------------------------------------------------
// Simple Browser Check
//------------------------------------------------------------------
var ns4 = (document.layers) ? 1 : 0;
var ie  = (document.all) ? 1 : 0;
var ns6 = (document.getElementById && !document.all) ? 1 : 0;


//------------------------------------------------------------------
// onload
//------------------------------------------------------------------
function init_js(ss_str_kat_id,ss_str_medium,ss_bool_nato,ss_bool_basket)
  {
  str_url															= document.location.href.replace(/\\/g,'/').replace('.html','');
  arr_url															= str_url.split('/');
  str_kat_id														= ss_str_kat_id;
  str_medium														= ss_str_medium;
  bool_nato															= ss_bool_nato;
  bool_nato_basket													= ss_bool_basket;

  if(str_url.indexOf('think_aesculap') > 0 || str_url.indexOf('products') > 0 || str_url.indexOf('news') > 0 || str_url.indexOf('shopping_basket') > 0)
    {
	ck_set_navi_line(arr_url);
	}
  else
    {
	document.getElementById('navi_line').style.visibility			= 'hidden';
	}
  js_init															= 1;
  set_to_top();
  init_basket();
  init_wettbewerber();
  }


//------------------------------------------------------------------
// warenkorb initialisieren
//------------------------------------------------------------------
function init_basket()
  {
  if(window.name != '')
    {
	w_teilen														= window.name.split('\n');
	if(w_teilen.length > 0)
	  {
	  // sonstiges
	  arr_window_teil1												= w_teilen[0].split('|');
	  str_window_teil1												= arr_window_teil1[0]+'|';
	  str_window_teil2												= '';
	  for(i=1;i<arr_window_teil1.length;i++)
	    {
		str_window_teil2											+= arr_window_teil1[i]+'|';
		}
	  }
	if(w_teilen.length > 1)
	  {
	  i_basket														= 0;
	  //MENGE|ARTNR|NAME|BESCH|DETAL|AUTHR|MEASU|MP|AP|LD|LINK|NOTES
	  for(i_teilen=1;i_teilen<w_teilen.length;i_teilen++)
	    {
		str_zeile													= w_teilen[i_teilen].split('|');

		if(str_zeile[1] != 'undefined' && str_zeile[1] != null && str_zeile[1].replace(/ /g,'') != '')
		  {

		// add to basket
		arr_basket[i_basket]										= new Array();
		arr_basket[i_basket]['qty']									= str_zeile[0];
		arr_basket[i_basket]['item']								= str_zeile[1];
		arr_basket[i_basket]['name']								= str_zeile[2];
		arr_basket[i_basket]['besch']								= str_zeile[3];
		arr_basket[i_basket]['detal']								= str_zeile[4];
		arr_basket[i_basket]['authr']								= str_zeile[5];
		arr_basket[i_basket]['measu']								= str_zeile[6];
		arr_basket[i_basket]['mp']									= str_zeile[7].replace(/ /g,'').split(',');
		arr_basket[i_basket]['ap']									= str_zeile[8].replace(/ /g,'').split(',');
		arr_basket[i_basket]['ld']									= str_zeile[9].replace(/ /g,'').split(',');
		arr_basket[i_basket]['link']								= str_zeile[10];
		arr_basket[i_basket]['notes']								= str_zeile[11];
		arr_basket[i_basket]['gb']									= str_zeile[12];
		arr_basket[i_basket]['gn']									= str_zeile[13];
		arr_basket[i_basket]['ge']									= str_zeile[14];
		i_basket++;
		  }
		}
	  }
	}
  ck_show_basket_anz('basket_anz');
  //alert(window.name);
  }


//------------------------------------------------------------------
// sprachdinge laden
//------------------------------------------------------------------
function gW(str)
  {
  str_return														= 'text unknown';
  if(arr_l[str] != 'undefined' && arr_l[str] != null)
    {
	str_return														= arr_l[str];
    }
  return str_return;
  }


//------------------------------------------------------------------
// linie zeichnen
//------------------------------------------------------------------
function ck_set_navi_line(arr_url)
  {
  int_laenge														= 0;
  bool_zeichnen														= false;
  str_aktiver_punkt													= '';

  for(il=0;il<arr_navi_line['punkte'].length;il++)
    {
	if(!bool_zeichnen)
	  {
	  int_laenge													+= parseInt(document.getElementById('navi_'+arr_navi_line['punkte'][il]).offsetWidth);
	  }
	if(arr_url[arr_url.length-1].indexOf(arr_navi_line['punkte'][il]) >= 0 || arr_url[arr_url.length-2].indexOf(arr_navi_line['punkte'][il]) >= 0)
	  {
	  bool_zeichnen													= true;
	  arr_dummy														= arr_navi_line['punkte'][il].split('/');
	  str_aktiver_punkt												= arr_dummy[0];
	  }
	}

  if(arr_navi_line['aktiv'] != '')
	{
	document.getElementById('navi_'+arr_navi_line['aktiv']).className	= 'left default';
    }

  if(bool_zeichnen)
    {
	document.getElementById('navi_line').style.width				= (int_laenge+parseInt(document.getElementById('navi_home').offsetWidth)-1)+'px';
	document.getElementById('navi_line').style.borderColor			= '#5B82A1';
	arr_navi_line['aktiv']											= str_aktiver_punkt;
	document.getElementById('navi_'+str_aktiver_punkt).className	= 'left selected';
	document.getElementById('navi_line').style.visibility			= 'visible';
	}
  else
    {
	document.getElementById('navi_line').style.width				= '0px';
	document.getElementById('navi_line').style.borderColor			= '#fff';
	document.getElementById('navi_line').style.visibility			= 'hidden';
	}
  }


//------------------------------------------------------------------
// formulardaten speichern
//------------------------------------------------------------------
function ck_set_c_data(str_index,str_wert)
  {
  if(str_index == 'f_contact_country')
    {
    str_wert														= arr_a[str_wert][3];
	}
  arr_contact[str_index]											= str_wert.replace(/\n/g,'<br>');
  ck_basket_to_session();
  }

//------------------------------------------------------------------
// formulardaten
//------------------------------------------------------------------
function get_ajax_post_string(formular,str_nicht,str_trenner1,str_trenner2)
  {
  str																= '';
  str_trenner														= '';
  str_nicht															= ' '+str_nicht;

  if(str_trenner2 == '')
    {
	str_trenner2													= '&';
	}
  if(str_trenner1 == '')
    {
	str_trenner1													= '=';
	}

  for(i=0;i<formular.elements.length;i++)
    {
	hinzufuegen														= true;
	if(formular.elements[i].name == '' || formular.elements[i].name == undefined)
	  {
	  hinzufuegen													= false;
	  }
	if((formular.elements[i].type == 'checkbox' || formular.elements[i].type == 'radio') && !formular.elements[i].checked)
	  {
	  hinzufuegen													= false;
	  }
	if(hinzufuegen && str_nicht.indexOf(formular.elements[i].name) > 0)
	  {
	  hinzufuegen													= false;
	  }

	if(hinzufuegen)
	  {
	  if(formular.elements[i].multiple)
	    {
		for(o=0;o<formular.elements[i].options.length;o++)
		  {
		  if(formular.elements[i].options[o].selected)
		    {
			str_feld_bez											= gW('mailtxt_'+formular.elements[i].name.replace('f_',''))+':';
		    str														+= str_trenner+(str_feld_bez+str_trenner1+escape(formular.elements[i].options[o].value));
		    str_trenner												= str_trenner2;
		    }
		  }
		}
	  else
	    {
		str_feld_bez												= gW('mailtxt_'+formular.elements[i].name.replace('f_',''))+':';
	    str															+= str_trenner+(str_feld_bez+str_trenner1+escape(formular.elements[i].value));
	    }
	  str_trenner													= str_trenner2;
	  }
	}

  return str;
  }


//------------------------------------------------------------------
// breite und hoehe des browserfensters bestimmen
//------------------------------------------------------------------
function init_browser_height_width()
  {
  if(ie && navigator.appVersion.indexOf("Linux") < 0)
    {
    gl_browser_width												= document.documentElement.clientWidth;
    gl_browser_height												= document.documentElement.clientHeight;
	//gl_browser_width												= document.body.clientWidth;
    //gl_browser_height												= document.body.clientHeight;
	}
  else
    {
	gl_browser_width												= innerWidth;
    gl_browser_height												= innerHeight;
    }

  //fuer linux
  if(navigator.appVersion.indexOf("Linux") >= 0)
    {
    gl_browser_height												= gl_browser_height-8;
    }
  }


//------------------------------------------------------------------
// bitte warten...
//------------------------------------------------------------------
function ck_show_ladevorgang(str)
  {
  init_browser_height_width();
  ck_show_schleier();
  str																= '<h1>'+gW('loading')+'...</h1>'+str;
  document.getElementById('ck_loading').innerHTML					= str;
  document.getElementById('ck_loading').style.display				= 'block';
  document.getElementById('ck_loading').style.top					= (document.body.scrollTop+parseInt(gl_browser_height/2)-parseInt(document.getElementById('ck_loading').offsetHeight/2))+'px';
  document.getElementById('ck_loading').style.left					= (parseInt(gl_browser_width/2)-parseInt(document.getElementById('ck_loading').offsetWidth/2))+'px';
  setTimeout('ck_container_mittig(\'ck_loading\',1)',100);
  }
function ck_hide_ladevorgang()
  {
  document.getElementById('ck_loading').style.display				= 'none';
  ck_hide_schleier();
  }
function ck_show_schleier()
  {
  ck_hide_selects(true);
  int_hoehe															= parseInt(document.getElementById('wrap').offsetHeight);
  if(int_hoehe < gl_browser_height)
    {
	int_hoehe														= gl_browser_height;
	}
  document.getElementById('ck_schleier').style.height				= int_hoehe+'px';
  document.getElementById('ck_schleier').style.display				= 'block';
  }
function ck_hide_schleier()
  {
  ck_hide_selects(false);
  document.getElementById('ck_schleier').style.display				= 'none';
  }
function ck_show_to_basket(str_item)
  {
  init_browser_height_width();
  ck_show_schleier();
  //str																= '<h1>'+gW('loading')+'...</h1>';
  //document.getElementById('ck_to_basket').innerHTML					= str;
  document.getElementById('ck_to_basket').style.display				= 'block';
  document.getElementById('ck_to_basket_item').innerHTML			= '\''+str_item+'\' ';
  document.getElementById('ck_to_basket').style.top					= (document.body.scrollTop+parseInt(gl_browser_height/2)-parseInt(document.getElementById('ck_to_basket').offsetHeight/2))+'px';
  document.getElementById('ck_to_basket').style.left				= (parseInt(gl_browser_width/2)-parseInt(document.getElementById('ck_to_basket').offsetWidth/2))+'px';
  document.getElementById('hide_to_basket_a').focus();
  }
function ck_hide_to_basket()
  {
  document.getElementById('ck_to_basket').style.display				= 'none';
  ck_hide_schleier();
  }
function ck_show_cookie_basket_container(str)
  {
  init_browser_height_width();
  ck_show_schleier();
  document.getElementById('ck_cookie_basket_table').innerHTML		= str;
  document.getElementById('ck_cookie_basket_container').style.display				= 'block';
  document.getElementById('ck_cookie_basket_container').style.top					= (document.body.scrollTop+parseInt(gl_browser_height/2)-parseInt(document.getElementById('ck_cookie_basket_container').offsetHeight/2))+'px';
  document.getElementById('ck_cookie_basket_container').style.left					= (parseInt(gl_browser_width/2)-parseInt(document.getElementById('ck_cookie_basket_container').offsetWidth/2))+'px';
  }
function ck_hide_cookie_basket_container()
  {
  document.getElementById('ck_cookie_basket_container').style.display	= 'none';
  ck_hide_schleier();
  }
function ck_show_import_basket_container()
  {
  init_browser_height_width();
  ck_show_schleier();
  document.getElementById('ck_import_basket_container').style.display				= 'block';
  document.getElementById('ck_import_basket_container').style.top					= (document.body.scrollTop+parseInt(gl_browser_height/2)-parseInt(document.getElementById('ck_import_basket_container').offsetHeight/2))+'px';
  document.getElementById('ck_import_basket_container').style.left					= (parseInt(gl_browser_width/2)-parseInt(document.getElementById('ck_import_basket_container').offsetWidth/2))+'px';
  }
function ck_hide_import_basket_container()
  {
  ck_hide_ladevorgang();
  document.getElementById('ck_import_basket_container').style.display	= 'none';
  ck_hide_schleier();
  }
function ck_show_notes(i_item)
  {
  merke_notes_i														= i_item;
  init_browser_height_width();
  ck_show_schleier();
  //str																= '<h1>'+gW('loading')+'...</h1>';
  document.getElementById('notes_item_no').innerHTML				= arr_basket[i_item]['item'];
  document.forms['notes_form'].elements['f_dummy_notes'].value		= arr_basket[i_item]['notes'].replace(/(\<br \/>)/g,'\n');
  document.getElementById('ck_notes_container').style.display		= 'block';
  document.getElementById('ck_notes_container').style.top			= (document.body.scrollTop+parseInt(gl_browser_height/2)-parseInt(document.getElementById('ck_notes_container').offsetHeight/2))+'px';
  document.getElementById('ck_notes_container').style.left			= (parseInt(gl_browser_width/2)-parseInt(document.getElementById('ck_notes_container').offsetWidth/2))+'px';
  //document.getElementById('hide_to_basket_a').focus();
  }
function ck_hide_notes()
  {
  document.getElementById('ck_notes_container').style.display		= 'none';
  ck_hide_schleier();
  }
//------------------------------------------------------------------
// bitte warten...
// soll immer mittig dargestellt werden
//------------------------------------------------------------------
function ck_container_mittig(str_div,bool_loop)
  {
  // nur ausfuehren, wenn sichtbar
  if(typeof(str_div) == 'string' && document.getElementById(str_div).style.display == 'block')
    {
	init_browser_height_width();
	document.getElementById(str_div).style.top						= (document.documentElement.scrollTop+parseInt(gl_browser_height/2)-parseInt(document.getElementById(str_div).offsetHeight/2))+'px';
    document.getElementById(str_div).style.left						= (parseInt(gl_browser_width/2)-parseInt(document.getElementById(str_div).offsetWidth/2))+'px';

	if(bool_loop)
	  {
	  setTimeout('ck_container_mittig(\''+str_div+'\','+bool_loop+')',100);
	  }
	}
  }

// For IE, hides any select-lists that are behind the calendar
function ck_hide_selects(Over)
  {
  if(navigator.appName == 'Microsoft Internet Explorer')
    {
	var FoundCalInput												= false;
    for(var j=0;j<document.forms.length;j++)
	  {
	  for(var i=0;i<document.forms[j].elements.length;i++)
	    {
        if(document.forms[j].elements[i].type != null && document.forms[j].elements[i].type.substr(0,6) == 'select' && !document.forms[j].elements[i].className.indexOf('sapperlot'))
		  {
          document.forms[j].elements[i].style.visibility = (Over) ? 'hidden' : 'visible';
		  }
        }
      }
    }
  }


//------------------------------------------------------------------
// resize funktionen
//------------------------------------------------------------------
function ck_resize()
  {
  init_browser_height_width();

  for(ir=0;ir<ck_arr_resize.length;ir++)
    {
	obj_to_resize													= document.getElementById(ck_arr_resize[ir][0]);
	int_neue_hoehe													= (gl_browser_height-ck_arr_resize[ir][1]);

	for(ir2=0;ir2<5;ir2++)
	  {
	  if(document.getElementById(ck_arr_resize[ir][2][ir2]) != null && document.getElementById(ck_arr_resize[ir][2][ir2]).style.display != 'none')
	    {
		int_hoehe_obj = 0;
		try
		  {
		  int_neue_hoehe												= int_neue_hoehe-parseInt(document.getElementById(ck_arr_resize[ir][2][ir2]).offsetHeight);
		  }
		catch(e)
		  {
		  }
		}
	  }
	obj_to_resize.style.height										= int_neue_hoehe+'px';
	}

  /*
  if(parseInt(document.getElementById('wrap').offsetWidth) < 960)
    {
	document.getElementById('wrap').style.width						= '981px';
	}
  else
    {
	document.getElementById('wrap').style.width						= '100%';
	}
  */
  set_to_top();
  }


function set_to_top()
  {
  init_browser_height_width();
  //----------------------------------------------------------------
  // to_top setzen
  //----------------------------------------------------------------
  obj_content														= document.getElementById('content');

  if(parseInt(obj_content.offsetHeight) > (gl_browser_height-88))
    {
	document.getElementById('to_top').style.display					= 'block';
	}
  else
    {
	document.getElementById('to_top').style.display					= 'none';
	}
  }



//------------------------------------------------------------------
// hash_from_child
//------------------------------------------------------------------
function hash_from_child(str_hash)
  {
  if(anker_parent_iframe_ignore)
	{
	zeige_artikel_aus_querverweis_von_iframe();
	}
  else
	{
  if(js_init)
    {
  arr_dummy_hash													= str_hash.split('|');
  ck_hide_to_basket();

  if(str_hash == 'init')
    {
	gl_arr_hash														= new Array();
	ck_produkte_init();
    }
  else if(typeof(arr_dummy_hash) == 'object' && arr_dummy_hash.length > 1 && arr_dummy_hash[0] == 'wg2')
    {
	gl_arr_hash														= str_hash.split('|');
	ck_produkte_darstellen_wg2();
	}
  else if(typeof(arr_dummy_hash) == 'object' && arr_dummy_hash.length > 2 && arr_dummy_hash[0] == 'wg3' && gl_arr_hash[0] != 'wg3')
    {
	gl_arr_hash														= str_hash.split('|');
	ck_produkte_darstellen_wg3([]);
	}
  else if(typeof(arr_dummy_hash) == 'object' && arr_dummy_hash.length > 2 && arr_dummy_hash[0] == 'wg3' && gl_arr_hash[0] == 'wg3' && arr_dummy_hash.length == 3)
    {
	gl_arr_hash														= str_hash.split('|');
	ck_products_show_filter_result('0,0,0,0,');
	//ck_products_show_details(gl_arr_hash[2]);
	}
  else if(typeof(arr_dummy_hash) == 'object' && arr_dummy_hash.length > 2 && arr_dummy_hash[0] == 'wg3' && gl_arr_hash[0] == 'wg3' && arr_dummy_hash.length == 4)
    {
	gl_arr_hash														= str_hash.split('|');
	ck_products_show_filter_result(gl_arr_hash[3]);
	}
    }
  else
    {
	window.setTimeout('hash_from_child(\''+str_hash+'\')',500);
	}
	}
  }


//------------------------------------------------------------------
// anker setzen
//------------------------------------------------------------------
function ck_set_anker(str_url,str_hash)
  {
  str_merke_hash_url												= str_url;
  ck_iframe.location.href											= './hash/'+str_url+'?hash='+str_hash;
  }


//------------------------------------------------------------------
// suche initiieren
//------------------------------------------------------------------
function init_suche()
  {
  ck_show_ladevorgang(gW('artikel_werden_gesucht'));

  if(document.location.protocol.indexOf('file') >= 0 || str_medium == 'cdrom')
    {
	document.getElementById('ck_iframe').src						= '../ini/hash_init.html?hash=init';
	}
  else
    {
	//window.open(gW('url_http_data')+'?kt='+str_kat_id+'&ks='+gW('eigene_sprache')+document.location.search.replace('?','&')+'&f_ref='+document.location.href.replace('?','&'));
	document.getElementById('ck_iframe').src						= gW('url_http_data')+'?kt='+str_kat_id+'&kv='+vstr+'&ks='+gW('eigene_sprache')+document.location.search.replace('?','&').replace('ref=','kw=')+'&f_ref='+document.location.href.replace('?','&').replace('ref=','kw=');
	}
  }


//------------------------------------------------------------------
// arr_s from child
//------------------------------------------------------------------
function set_arr_s(ss_arr)
  {
  a																	= ss_arr;
  }



//------------------------------------------------------------------
// darstellung produkte
//------------------------------------------------------------------
function ck_produkte_init()
  {
  int_produkt_aktiv													= -1;

  //verstecken
  document.getElementById('produkte-block-0').style.display			= 'block';
  document.getElementById('produkte-block-1').style.display			= 'none';
  document.getElementById('produkte-block-2').style.display			= 'none';
  document.getElementById('filter_container').style.display			= 'none';

  obj_output														= document.getElementById('produkte-block-0');
  str_output														= '';
  str_output_treffer												= '';
  str_class															= '';


  //----------------------------------------------------------------
  // suche oder produkte
  //----------------------------------------------------------------
  if(window.location.search == '' || (window.location.search != '' && window.location.search.indexOf('item=') >= 0))
    {
	//--------------------------------------------------------------
    // produkte
    //--------------------------------------------------------------
    for(i_wg1=0;i_wg1<arr_p.length;i_wg1++)
      {
	  if(i_wg1 % 4 == 0)
	    {
	    str_class													= '';
	    }

	  //str_style_bg												= ' style="background-image: url(\'./images/wg/ac_ad.gif\')"';
	  str_style_bg													= '';
	  if(arr_p[i_wg1]['gif'] != '')
	    {
	    str_style_bg												= ' style="background-image: url(\'../images/common/'+arr_p[i_wg1]['gif']+'\')"';
	    }
	  str_img														= '../images/trans.gif';
	  if(arr_p[i_wg1]['def'] != '')
	    {
	    str_img														= '../images/common/'+arr_p[i_wg1]['def'];
	    }

	  str_output													+= '<dl class="produkte'+str_class+'" title="'+arr_p[i_wg1]['bez']+'" onclick="ck_set_anker(\'hash_'+arr_p[i_wg1]['id']+'.html\',\'wg2|'+(i_wg1)+'\')">';
	  str_output													+= '<dd'+str_style_bg+'><img src="'+str_img+'" alt="" width="128" height="94" /></dd>';
	  str_output													+= '<dt><a href="javascript://">'+arr_p[i_wg1]['bez']+'</a></dt>';
	  str_output													+= '</dl>';
	  str_class														= ' abstand';
	  }

    str_output														+= '<p class="clear">&nbsp;</p>';
    obj_output.innerHTML											= str_output;

    delete str_output;
    delete obj_output;
    }
  else
    {
	//--------------------------------------------------------------
    // suche
    //--------------------------------------------------------------
	str_output														+= '<div class="headline"><h1>'+gW('suche')+'</h1></div>';
	ck_show_ladevorgang(gW('artikel_werden_gesucht'));

	//--------------------------------------------------------------
    // query zerlegen
    //--------------------------------------------------------------
	arr_suche														= new Array();
	arr_dummy_suche													= window.location.search.replace('?','').split('&');
	str_suchart														= '';
	for(i_suche=0;i_suche<arr_dummy_suche.length;i_suche++)
	  {
	  arr_dummy_suche2												= arr_dummy_suche[i_suche].split('=');
	  arr_suche[arr_dummy_suche2[0]]								= (unescape(arr_dummy_suche[i_suche].replace(arr_dummy_suche2[0]+'=','').replace(/\+/g,' '))).split(' ');
	  str_suchart													+= ' ,'+arr_dummy_suche2[0]+',';

	  if(arr_dummy_suche2[0] == 'cpn')
	    {
		wettbewerber_id												= arr_dummy_suche2[1];
		}
	  }
	if(arr_suche['cp'] != undefined && wettbewerber_id != '')
	  {
	  wettbewerber_mat_nr											= arr_suche['cp'].join(' ');
	  }


	//--------------------------------------------------------------
	// suche links updaten
	//--------------------------------------------------------------
	document.getElementById('suche_kw').value						= gW('enter_keyword');
	//document.getElementById('suche_cp').options.selectedIndex		= 0;
	if(document.getElementById('suche_cpitem') != null)
	  {
	  document.getElementById('suche_cpitem').value					= gW('choose_competitor_no');
	  }

	if(str_suchart.indexOf(',kw,') > 0)
	  {
	  document.getElementById('suche_kw').value						= arr_suche['kw'].join(' ');
	  }
	if(str_suchart.indexOf(',cp,') > 0)
	  {
	  document.getElementById('suche_cpitem').value					= arr_suche['cp'].join(' ');
	  //arr_suche['cp']												= arr_suche['cp'].toLowerCase().replace(/[^0-9]/g,'');
	  }


	//--------------------------------------------------------------
	// artikel suchen
	//--------------------------------------------------------------
	arr_treffer														= new Array();
	i_treffer														= 0;

	if(str_suchart.indexOf(',kw,') > 0)
	  {
	  if(str_medium == 'cdrom')
	    {
		merke_artnr_gefunden										= ' ';
  	    //arr_treffer													= a;
	    for(t=0;t<a.length;t++)
	      {
		  //str_suche													= (' '+a[t]['id']+' '+a[t]['BESCH']+' '+a[t]['AUTHR']+' '+a[t]['DETAL']+' '+a[t]['MEASU']).toLowerCase();
		  str_suche													= (' '+a[t]['id']+' '+a[t]['s0']+' '+a[t]['s1']+' '+a[t]['s2']+' '+a[t]['s3']+' '+a[t]['s4']+' '+a[t]['s5']+' '+a[t]['parent']).toLowerCase();
		  if(bool_nato)
		    {
			//str_suche												= (' '+a[t]['id']+' '+a[t]['BESCH']+' '+a[t]['AUTHR']+' '+a[t]['DETAL']+' '+a[t]['n']+' '+a[t]['MEASU']).toLowerCase();
			str_suche												= (' '+a[t]['id']+' '+a[t]['s0']+' '+a[t]['s1']+' '+a[t]['s2']+' '+a[t]['s3']+' '+a[t]['s4']+' '+a[t]['s5']+' '+a[t]['parent']+' '+a[t]['n']).toLowerCase();
			}

		  // alle suchbegriffe durchgehen
		  as_treffer												= 0;
		  for(as=0;as<arr_suche['kw'].length;as++)
		    {
			if(str_suche.indexOf(arr_suche['kw'][as].toLowerCase()) >= 0)
			  {
			  as_treffer++;
			  }
			}

		  if(as_treffer == arr_suche['kw'].length && merke_artnr_gefunden.indexOf(','+a[t]['id']+',') <= 0)
		    {
			merke_artnr_gefunden									+= ','+a[t]['id']+',';
		    arr_treffer[i_treffer++]									= a[t];
		    }
		  }
	    }
	  else
	    {
		arr_treffer													= a;
		}
	  }
	else if(str_suchart.indexOf(',cp,') > 0 && arr_suche['cp'] != '')
	  {
	  if(str_medium == 'cdrom')
	    {
		str_qry_cp													= String(arr_suche['cp']);
		str_qry_cp                                                  = str_qry_cp.replace(/[ \-\._,]/g,'');

	    for(t=0;t<a.length;t++)
	      {
		  // ohne
		  //str_suche													= (' ,'+a[t]['w']+',').toLowerCase();

		  // einfach
		  str_suche													= (' ,'+unescape(a[t]['w'])+',').toLowerCase();

		  // kompliziert
		  //str_suche													= (' ,'+to_upper_case(a[t]['w'],0)+',').toLowerCase();
		  if(str_suche.indexOf(','+str_qry_cp+',') >= 0 && ist_wettbewerber_treffer(a[t]['id']))
		    {
		    arr_treffer[i_treffer++]								= a[t];
		    }

		  }
		}
	  else
	    {
		arr_treffer													= a;
		}
	  if(arr_treffer.length > 0)
	    {
		document.getElementById('suche_nach_cp').style.display		= 'block';
		}

	  if(document.location.search != '')
	    {
		dummy_qry													= unescape(document.location.search.replace('?cp=','')).replace('+',' ');
		if(document.getElementById('ck_iframe_comp').style.display == 'block' && dummy_qry != '')
		  {
		  ck_iframe_comp.set_item(dummy_qry);
		  }
		}
	  }


	//--------------------------------------------------------------
	// suche abgeschlossen
	//--------------------------------------------------------------
	ck_hide_ladevorgang();

	//obj_output.innerHTML											= str_output+str_output_treffer;

	ck_produkte_darstellen_wg3(arr_treffer);

	delete arr_dummy_suche;
	delete arr_dummy_suche2;
	delete str_output_treffer;
	delete str_output;
	}
  set_to_top();
  }


//------------------------------------------------------------------
// zweite ebene darstellen
//------------------------------------------------------------------
function ck_produkte_darstellen_wg2()
  {
  merke_filter_hash													= '';
  int_produkt_aktiv													= -1;
  document.getElementById('filter_container').style.display			= 'none';

  // alles loeschen
  document.getElementById('produkt_container_block_ueberlauf-0').style.display	= 'none';
  document.getElementById('produkt_container_block_ueberlauf-1').style.display	= 'none';

  document.getElementById('produkt_container_block_ueberlauf-0').innerHTML		= '';
  document.getElementById('produkt_container_block_ueberlauf-1').innerHTML		= '';

  for(i_wg2=0;i_wg2<=22;i_wg2++)
    {
	document.getElementById('produkt_container_block_'+i_wg2).innerHTML	= '&nbsp;';
	}

  z_hoehe0															= 0;
  z_hoehe1															= 0;

  //verstecken
  document.getElementById('produkte-block-0').style.display			= 'none';
  document.getElementById('produkte-block-1').style.display			= 'block';
  document.getElementById('produkte-block-2').style.display			= 'none';

  for(i_wg2=0;i_wg2<ck_iframe.arr_p.length;i_wg2++)
    {
	document.getElementById('produkt_container_block_'+i_wg2).innerHTML	= '<a href="javascript:void(ck_set_anker(\'hash_'+ck_iframe.arr_p[i_wg2]['id']+'.html\',\'wg3|'+(gl_arr_hash[1])+'|0\'))">'+ck_iframe.arr_p[i_wg2]['bez']+'</a>';

	if(i_wg2 <= 16)
	  {
	  z_hoehe0														+= ((parseInt(document.getElementById('produkt_container_block_'+i_wg2).offsetHeight)-22)/22);
	  }
	else
	  {
	  z_hoehe1														+= ((parseInt(document.getElementById('produkt_container_block_'+i_wg2).offsetHeight)-22)/22);
	  }
	if(i_wg2 == 21)
	  {
	  if(ck_iframe.arr_p.length-22 > 0)
	    {
		anz_neue_felder												= ck_iframe.arr_p.length-22;
		if(anz_neue_felder % 2 > 0)
		  {
		  anz_neue_felder++;
		  }

		// neue felder anhaengen
		str_output													= '';
		for(d=0;d<(anz_neue_felder/2);d++)
		  {
		  str_output												+= '<div id="produkt_container_block_'+(22+d+1)+'" class="produktlink">&nbsp;</div>';
		  }
		document.getElementById('produkt_container_block_ueberlauf-0').innerHTML	= str_output;
		document.getElementById('produkt_container_block_ueberlauf-0').style.display	= 'block';
		str_output													= '';
		for(d=(anz_neue_felder/2);d<(anz_neue_felder);d++)
		  {
		  str_output												+= '<div id="produkt_container_block_'+(22+d+1)+'" class="produktlink">&nbsp;</div>';
		  }
		document.getElementById('produkt_container_block_ueberlauf-1').innerHTML	= str_output;
		document.getElementById('produkt_container_block_ueberlauf-1').style.display	= 'block';
		}
	  }
    }



  // feldhoehen
  if(z_hoehe0 != z_hoehe1)
    {
	if(z_hoehe0 > z_hoehe1)
	  {
	  // links zu viel, rechts muss dazu
	  obj_zu_wenig													= document.getElementById('produkt_container_block_ueberlauf-1');
	  anz_zu_wenig													= z_hoehe0-z_hoehe1;
	  }
	else
	  {
	  // rechts zu viel, links muss dazu
	  obj_zu_wenig													= document.getElementById('produkt_container_block_ueberlauf-0');
	  anz_zu_wenig													= z_hoehe1-z_hoehe0;
	  }

	str_output														= '';
	for(i_zu_wenig=0;i_zu_wenig<anz_zu_wenig;i_zu_wenig++)
	  {
	  str_output													+= '<div class="produktlink" style="line-height: 21px">&nbsp;</div>';
	  }
	obj_zu_wenig.innerHTML											= obj_zu_wenig.innerHTML+str_output;
	obj_zu_wenig.style.display										= 'block';
	}



  // headline
  merke_gif_parent_parent											= arr_p[gl_arr_hash[1]]['gif']

  if(merke_gif_parent_parent == '')
    {
    document.getElementById('ck_produktgruppe_headline').innerHTML	= arr_p[gl_arr_hash[1]]['bez'];
    }
  else
    {
	document.getElementById('ck_produktgruppe_headline').innerHTML	= '<table border="0" cellspacing="0" cellpadding="0"><tr><td width="100%">'+arr_p[gl_arr_hash[1]]['bez']+'</td><td class="gif_gif"><img src="../images/common/'+merke_gif_parent_parent+'" border="0" alt="" title="" /></td></tr></table>';
    }
  merke_str_parent_parent											= arr_p[gl_arr_hash[1]]['bez'];

  // grosses bild
  str_img															= '../images/trans.gif';
  if(arr_p[gl_arr_hash[1]]['ext'] != '')
    {
    str_img															= '../images/common/'+arr_p[gl_arr_hash[1]]['ext'];
    }
  document.images['produkt_container_block_bild_bild'].src			= str_img;
  set_to_top();
  }


//------------------------------------------------------------------
// ditte ebene darstellen
//------------------------------------------------------------------
function ck_produkte_darstellen_wg3(ss_arr)
  {
  int_produkt_aktiv													= -1;
  document.getElementById('produkte_global_container').style.display	= 'none';

  //verstecken
  document.getElementById('produkte-block-0').style.display			= 'none';
  document.getElementById('produkte-block-1').style.display			= 'none';
  document.getElementById('produkte-block-2').style.display			= 'block';

  // suche
  if(!(window.location.search == '' || (window.location.search != '' && window.location.search.indexOf('item=') >= 0)))
    {
	bool_suche														= true;

	arr_suchbegriff													= document.location.search.split('=');
	//arr_suchbegriff_dummy											= arr_suchbegriff[arr_suchbegriff.length-1].split('&');
	arr_suchbegriff_dummy											= arr_suchbegriff[1].split('&');

	//link-bez
    //document.getElementById('breadcrumb2').style.display			= 'none';
    document.getElementById('ck_produkt_headline').innerHTML		= gW('seach_results_found').replace('[KEYWORD]',unescape(arr_suchbegriff_dummy[0])).replace('[ANZAHL]',ss_arr.length).replace('+',' ');
	}
  else
    {
	bool_suche														= false;
	//document.getElementById('breadcrumb2').style.display			= 'block';
    if(merke_str_parent_parent == '')
	  {
	  document.getElementById('ck_produktgruppe_link').innerHTML	= ck_iframe.str_parent_parent;
      }
	else
	  {
	  document.getElementById('ck_produktgruppe_link').innerHTML	= merke_str_parent_parent;
      }

	if(merke_gif_parent_parent == '' && ck_iframe.gif_parent != '')
	  {
	  merke_gif_parent_parent										= ck_iframe.gif_parent;
	  }
	if(merke_gif_parent_parent == '')
	  {
	  document.getElementById('ck_produkt_headline').innerHTML		= ck_iframe.str_parent;
      }
	else
	  {
	  document.getElementById('ck_produkt_headline').innerHTML	= '<table border="0" cellspacing="0" cellpadding="0"><tr><td width="100%">'+ck_iframe.str_parent+'</td><td class="gif_gif"><img src="../images/common/'+merke_gif_parent_parent+'" border="0" alt="" title="" /></td></tr></table>';
	  }
	}

  str_output														= '<table border="0" cellspacing="0" cellpadding="0">';

  //----------------------------------------------------------------
  // filter reseten
  //----------------------------------------------------------------
  arr_produkte['filter']['author']									= new Array();
  arr_produkte['filter']['description']								= new Array();
  arr_produkte['filter']['details']									= new Array();
  arr_produkte['filter']['dimension']								= new Array();

  if(window.location.search == '' || (window.location.search != '' && window.location.search.indexOf('item=') >= 0))
    {
    arr_material													= ck_iframe.arr_m;
    }
  else
    {
	arr_material													= ss_arr;
	}


  //----------------------------------------------------------------
  // artikel vorhanden?
  //----------------------------------------------------------------
  if(arr_material.length > 0)
    {


  for(i_m=0;i_m<arr_material.length;i_m++)
    {
	str_bezeichnung													= arr_material[i_m]['BESCH'];
	str_item														= arr_material[i_m]['id'];
	str_author														= arr_material[i_m]['AUTHR'];
	str_details														= arr_material[i_m]['DETAL'];
	str_dimension													= arr_material[i_m]['MEASU'];

	/*
	str_output														+= '<div id="produkt_container_'+i_m+'">';
	str_output														+= '<div class="ck_item ck_table_data"><a href="javascript:void(ck_products_show_details('+i_m+',arr_produkte[\'filter\'][\'wert\']))" id="data_link_'+i_m+'">'+str_item+'</a></div>';
	str_output														+= '<div class="ck_author ck_table_data">'+str_author+'&nbsp;</div>';
	str_output														+= '<div class="ck_description ck_table_data">'+str_bezeichnung+'&nbsp;</div>';
	str_output														+= '<div class="ck_detailed ck_table_data">'+str_details+'&nbsp;</div>';
	str_output														+= '<div class="ck_dimension ck_table_data">'+str_dimension+'&nbsp;</div>';
	str_output														+= '<div class="ck_units ck_table_data"><input type="text" name="f_qty_'+i_m+'" class="qty" /><input type="button" value=" " class="add_to_basket" /></div>';
	str_output														+= '</div>';
	*/

	str_output														+= '<tr id="produkt_container_'+i_m+'">';
	if(window.location.search == '' || (window.location.search != '' && window.location.search.indexOf('item=') >= 0))
      {
	  // normaler modus
	  str_output													+= '<td class="ck_item ck_table_data" valign="top"><a href="javascript:void(ck_load_product_details(\''+str_merke_hash_url+'\',\'wg3|'+gl_arr_hash[1]+'|'+i_m+'\'))" id="data_link_'+i_m+'">'+str_item+'</a></td>';
	  }
	else
	  {
	  // suche
	  str_output													+= '<td class="ck_item ck_table_data" valign="top"><a href="javascript:void(ck_products_show_details('+i_m+'))" id="data_link_'+i_m+'">'+str_item+'</a></td>';
	  }
	if(bool_nato)
	  {
	  str_nato														= arr_material[i_m]['n'];
	  str_output													+= '<td class="ck_versorgungsnummer ck_table_data" id="produkt_filter_filter_nato_'+i_m+'" valign="top">'+str_nato+'&nbsp;</td>';
	  }
	str_output														+= '<td class="ck_author ck_table_data" id="produkt_filter_filter_author_'+i_m+'" valign="top">'+str_author+'&nbsp;</td>';
	str_output														+= '<td class="ck_description ck_table_data" id="produkt_filter_filter_bezeichnung_'+i_m+'" valign="top">'+str_bezeichnung+'&nbsp;</td>';
	str_output														+= '<td class="ck_detailed ck_table_data" id="produkt_filter_filter_details_'+i_m+'" valign="top">'+str_details+'&nbsp;</td>';
	str_output														+= '<td class="ck_dimension ck_table_data" id="produkt_filter_filter_dimension_'+i_m+'" valign="top">'+str_dimension+'&nbsp;</td>';

	if(bool_nato_basket)
	  {
	  str_output													+= '<td class="ck_units ck_table_data" valign="top"><input type="text" name="f_qty_'+i_m+'" class="qty" onkeypress="return handleEnter('+i_m+', event,\'produkte\')" /><input type="button" value=" " class="add_to_basket" onclick="ck_add_to_basket('+i_m+')" title="'+(gW('title_item_add_to_basket').replace('[item]','\''+str_item+'\''))+'" /></td>';
	  }
	str_output														+= '</tr>';

	ck_add_to_filter('author',str_author);
	ck_add_to_filter('description',str_bezeichnung);
	ck_add_to_filter('details',str_details);
	ck_add_to_filter('dimension',str_dimension);
	}
  str_output														+= '</table>';
  document.getElementById('produkt_table_body').innerHTML			= str_output;
  document.getElementById('produkt_table_body').scrollTop			= 0;

  //ck_products_show_details(gl_arr_hash[2]);
  ck_products_show_filter_result('0,0,0,0,');

  // filter anzeigen?
  ck_products_filter_show();
    document.getElementById('produkte_global_container').style.display	= 'block';
	}
  else
    {
	//--------------------------------------------------------------
	// keine artikel vorhanden
	// ausgeblendet bleiben
	//--------------------------------------------------------------
	}
  set_to_top();
//  if(merke_str_filter == '0,0,0,0,')
  //  {
	//alert('init');
	//}
  // kein basket
  if(!bool_nato_basket)
    {
	document.getElementById('th_basket_units').style.display		= 'none';
	}
  if(bool_nato)
    {
	document.getElementById('th_basket_versorgungsnummer').style.display = 'block';
	}


  if(wettbewerber_id != '')
	{
	ck_set_competitor(wettbewerber_id);
	}
  }


function ck_load_product_details(str1,str2)
  {
  ck_set_anker(str1,str2+merke_filter_hash);
  }


//------------------------------------------------------------------
// zu filter hinzufuegen
//------------------------------------------------------------------
function ck_products_show_details(int_i)
  {
  arr_produkt_bilder['ap']											= 0;
  arr_produkt_bilder['mp']											= 0;

  if(int_produkt_aktiv != int_i)
    {
    document.getElementById('data_link_'+int_i).className			= 'selected';
    if(int_produkt_aktiv >= 0)
      {
	  document.getElementById('data_link_'+int_produkt_aktiv).className	= '';
	  }
    int_produkt_aktiv												= int_i;

	//--------------------------------------------------------------
	// bilder und dokumente laden
	//--------------------------------------------------------------
	// main picture
	document.getElementById('produkt_bilder_und_co_bild_gross_footer').innerHTML		= '&nbsp;';
	if(arr_material[int_i]['mp'].length > 0 && arr_material[int_i]['mp'][0] != '')
	  {
	  document.getElementById('produkt_bilder_und_co_bild_gross').innerHTML	= '<table><tr><td rel="../images/common/'+arr_material[int_i]['mp'][0]+'"><img src="../images/common/'+arr_material[int_i]['mp'][0]+'" /></td></tr></table>';
	  if(arr_material[int_i]['mp'].length > 1)
	    {
		document.getElementById('produkt_bilder_und_co_bild_gross_footer').innerHTML	= '<a href="javascript:ck_products_show_image(\'mp\',-1)" class="arrow_left">&nbsp;</a><a href="javascript:ck_products_show_image(\'mp\',1)" class="arrow_right">&nbsp;</a>';
		}
	  }
	else
	  {
	  document.getElementById('produkt_bilder_und_co_bild_gross').innerHTML	= '&nbsp;';
	  }
	// neben picture
	document.getElementById('produkt_bilder_und_co_bild_klein_footer').innerHTML		= '&nbsp;';
	if(arr_material[int_i]['ap'].length > 0 && arr_material[int_i]['ap'][0] != '')
	  {
	  document.getElementById('produkt_bilder_und_co_bild_klein').innerHTML	= '<table><tr><td rel="../images/common/'+arr_material[int_i]['ap'][0]+'"><img src="../images/common/'+arr_material[int_i]['ap'][0]+'" /></td></tr></table>';
	  if(arr_material[int_i]['ap'].length > 1)
	    {
		document.getElementById('produkt_bilder_und_co_bild_klein_footer').innerHTML	= '<a href="javascript:ck_products_show_image(\'ap\',-1)" class="arrow_left">&nbsp;</a><a href="javascript:ck_products_show_image(\'ap\',1)" class="arrow_right">&nbsp;</a>';
		}
	  }
	else
	  {
	  document.getElementById('produkt_bilder_und_co_bild_klein').innerHTML	= '&nbsp;';
	  }
	// strichzeichnung
	str_produkt_bilder_und_co_bild_material							= '<div class="button button_button"><div class="arrow_right"><a href="javascript:void(ck_close_extranet());void(win_extranet=window.open(\''+gW('api_extranet')+arr_material[int_i]['id']+'\',\'chirkat_extranet\'))">'+gW('aufbereitung_gebrauchsanweisungen')+'</a></div></div>';
	if(arr_material[int_i]['ld'].length > 0 && arr_material[int_i]['ld'][0] != '')
	  {
	  document.getElementById('produkt_bilder_und_co_bild_material_drawing').innerHTML		= '<a href="javascript:void(ck_show_drawing(0))" class="arrow_right">'+gW('strichzeichnung')+'</a>';

	  /*
	  for(pbc=1;pbc<arr_material[int_i]['ld'].length;pbc++)
	    {
		if(arr_material[int_i]['ld'][pbc] != '')
		  {
		  str_produkt_bilder_und_co_bild_material					+= '<div class="button button_button"><a href="javascript:void(ck_show_drawing('+pbc+'))" class="arrow_right">'+gW('strichzeichnung')+'</a></div>';
		  }
		}
	  */
	  }
	else
	  {
	  document.getElementById('produkt_bilder_und_co_bild_material_drawing').innerHTML		= '&nbsp;';
	  }
	// arr_produkt_bilder_und_co_bild_material
	if(str_produkt_bilder_und_co_bild_material != '')
	  {
	  str_bucm														= '<table border="0" cellspacing="0" cellpadding="0"><tr><td valign="bottom">';
	  str_bucm														+= str_produkt_bilder_und_co_bild_material;
	  str_bucm														+= '</td></tr></table>';

	  document.getElementById('produkt_bilder_und_co_bild_material').innerHTML				= str_bucm;
	  }
	else
	  {
	  document.getElementById('produkt_bilder_und_co_bild_material').innerHTML				= '&nbsp;';
	  }

	if(!(window.location.search == '' || (window.location.search != '' && window.location.search.indexOf('item=') >= 0)))
      {
	  // suche
	  if(arr_material[int_i]['parent'] != '')
	    {
		str_parent_link												= arr_material[int_i]['link'];
		str_parent_link												= 'hash_'+str_parent_link.replace(/\|/g,';');
		str_parent_link												= str_parent_link.replace('hash_;','hash_');
		str_parent_link												= str_parent_link.replace(';',';hash;wg3');
		str_parent_link												= str_parent_link.replace(/,/g,';');

		str_parent_link												= str_parent_link.replace(/hash_hash_/g,'hash_');
		str_parent_link												= str_parent_link.replace(/wg3hash;/g,'');

		document.getElementById('produkt_suche_source').innerHTML	= '<strong>'+gW('source')+':</strong> '+arr_material[int_i]['parent']+' <a href="javascript:void(ck_basket_item_details(\''+str_parent_link+'\'))">'+gW('mehr')+' &gt;&gt;</a>';


  		if(getQuerystring('ref','') != '')
		  {
		  zeige_artikel_aus_querverweis(getQuerystring('ref',''));
		  }

		}
	  else
	    {
		document.getElementById('produkt_suche_source').innerHTML	= '&nbsp;';
		}
	  }
	}
  ck_hover_img('#produkte_global_container');
  }


//------------------------------------------------------------------
// extranet schliessen
//------------------------------------------------------------------
function ck_close_extranet()
  {
  try
    {
	win_extranet.close();
    }
  catch(e)
	{
	}
  }


//------------------------------------------------------------------
// strichzeizung zeigen
//------------------------------------------------------------------
function ck_show_drawing(int_i_drawing)
  {
  w																	= window.open('','drawing'+win_counter,'resizable=yes,scrollbars=yes,toolbar=no,menubar=no,width=517,height=608');
  win_counter++;
  var d																= w.document;

  str_pfad_to_css													= '';
  str_pfad_chirkat													= document.location.href.replace(/\\/g,'/');

  //zerlegen
  arr_dummy_pfad_chirkat											= str_pfad_chirkat.split('/');
  for(i=0;i<arr_dummy_pfad_chirkat.length-2;i++)
    {
	str_pfad_to_css													+= arr_dummy_pfad_chirkat[i]+'/';
	}

  str_print_output													= '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">';
  str_print_output													+= '\n<html lang="de" xml:lang="de" xmlns="http://www.w3.org/1999/xhtml">';
  str_print_output													+= '\n<head>';
  str_print_output													+= '\n<meta http-equiv="Content-type" content="text/html; CHARSET=ISO-8859-1" />';
  str_print_output													+= '\n<title>'+arr_material[int_produkt_aktiv]['id']+': '+gW('strichzeichnung')+'</title>';
  str_print_output													+= '\n<link type="text/css" rel="stylesheet" href="'+str_pfad_to_css+'ini/screen.css" media="all" />';
  str_print_output													+= '\n<link type="text/css" rel="stylesheet" href="'+str_pfad_to_css+'ini/print.css" media="all" />';
  //----------------------------------------------------------------
  // mehrere strichzeichnungen vorhanden?
  //----------------------------------------------------------------
  arr_popup_bilder													= new Array();
  i_popup_bilder													= 0;
  if(arr_material[int_produkt_aktiv]['ld'].length > 0 && arr_material[int_produkt_aktiv]['ld'][0] != '')
	{
  	for(pbc=0;pbc<arr_material[int_produkt_aktiv]['ld'].length;pbc++)
	  {
	  if(arr_material[int_produkt_aktiv]['ld'][pbc] != '')
		{
		arr_popup_bilder[i_popup_bilder++]							= arr_material[int_produkt_aktiv]['ld'][pbc];
		}
	  }
	}

  if(arr_popup_bilder.length > 0)
    {
	str_print_output												+= '\n<script type="text/javascript">';
	str_print_output												+= '\nvar apb = new Array(\''+arr_popup_bilder.join('\',\'')+'\');';
	str_print_output												+= '\nvar i_apb = 0;';
	str_print_output												+= '\nfunction apb_next(int_richtung)';
	str_print_output												+= '\n{';
	str_print_output												+= '\ni_apb = i_apb+int_richtung;';
	str_print_output												+= '\nif(i_apb < 0){ i_apb = apb.length-1; }else if(i_apb >= apb.length){ i_apb = 0; }';
	str_print_output												+= '\ndocument.images[\'drawing_container\'].src = \'../images/common/\'+apb[i_apb];';
	str_print_output												+= '\n}';
	str_print_output												+= '\n</script>';
	}


  str_print_output													+= '\n</head>';
  str_print_output													+= '\n<body id="popup">';
  str_print_output													+= '\n<h1>'+arr_material[int_produkt_aktiv]['id']+'</h1>';
  str_print_output													+= '\n<div id="wrap_popup">';
  str_print_output													+= '\n<img id="drawing_container" name="drawing_container" src="../images/common/'+arr_material[int_produkt_aktiv]['ld'][int_i_drawing]+'" border="0" onload="window.resizeTo(parseInt(document.getElementById(\'drawing_container\').offsetWidth)+67,parseInt(document.getElementById(\'drawing_container\').offsetHeight)+178)" />';

  if(arr_popup_bilder.length <= 1)
    {
    str_print_output												+= '\n<p class="fenster_schliessen"><a href="javascript:void(window.close())" class="close_right">'+gW('fenster_schliessen')+'</a></p>';
    }
  else
    {
	str_print_output												+= '\n<p class="fenster_schliessen"><table border="0" cellspacing="0" cellpadding="0"><tr><td width="50%">&nbsp;</td><td nowrap align="center"><a href="javascript:apb_next(-1)" class="arrow_left">&nbsp;</a><a href="javascript:apb_next(1)" class="arrow_right">&nbsp;</a></td><td nowrap width="50%"><a href="javascript:void(window.close())" class="close_right">'+gW('fenster_schliessen')+'</a></td></tr></table></p>';
    }
  str_print_output													+= '\n</div>';
  str_print_output													+= '\n</body>\n</html>';

  d.open();
  d.write(str_print_output);
  d.close();
  }


//------------------------------------------------------------------
// bild wechseln
//------------------------------------------------------------------
function ck_products_show_image(str_img,int_next)
  {
  arr_produkt_bilder[str_img]										+= int_next;
  if(arr_produkt_bilder[str_img] < 0)
    {
	arr_produkt_bilder[str_img]										= arr_material[int_produkt_aktiv][str_img].length-1;
	}
  else if(arr_produkt_bilder[str_img] > (arr_material[int_produkt_aktiv][str_img].length-1))
    {
	arr_produkt_bilder[str_img]										= 0;
	}

  str_div_name														= 'produkt_bilder_und_co_bild_gross';
  if(str_img == 'ap')
    {
	str_div_name													= 'produkt_bilder_und_co_bild_klein';
	}
  document.getElementById(str_div_name).innerHTML					= '<img src="../images/common/'+arr_material[int_produkt_aktiv][str_img][arr_produkt_bilder[str_img]]+'" />';
  }


//------------------------------------------------------------------
// zu filter hinzufuegen
//------------------------------------------------------------------
function ck_add_to_filter(str_index,str_wert)
  {
  bool_vorhanden													= false;
  //----------------------------------------------------------------
  // wert schon vorhanden?
  //----------------------------------------------------------------
  for(i_filter=0;i_filter<arr_produkte['filter'][str_index].length;i_filter++)
    {
	if(arr_produkte['filter'][str_index][i_filter] == str_wert)
	  {
	  bool_vorhanden												= true;
	  }
	}
  //----------------------------------------------------------------
  // noch nicht vorhanden?
  //----------------------------------------------------------------
  if(!bool_vorhanden)
    {
	arr_produkte['filter'][str_index][i_filter]						= html_entities(str_wert,0);
	}
  }


//------------------------------------------------------------------
// html entities
//------------------------------------------------------------------
function html_entities(str,bool_dir)
  {
/*
  if(!bool_dir)
    {
	str																= str.replace(/\&Auml;/g,'Ä');
	str																= str.replace(/\&Auml;/g,'ä');
	str																= str.replace(/\&Ouml;/g,'Ö');
	str																= str.replace(/\&ouml;/g,'ö');
	str																= str.replace(/\&Uuml;/g,'Ü');
	str																= str.replace(/\&uuml;/g,'ü');
	str																= str.replace(/\&quot;/g,'"');
	str																= str.replace(/\&szlig;/g,'ß');
	str																= str.replace(/\&quote;/g,'"');
	str																= str.replace(/\&Oslash;/g,'Ø');
	str																= str.replace(/\&deg;/g,'°');
	}
  else
    {
	str																= str.replace('Ä','&Auml;');
	str																= str.replace('ä','&auml;');
	str																= str.replace('Ö','&Ouml;');
	str																= str.replace('ö','&ouml;');
	str																= str.replace('Ü','&Uuml;');
	str																= str.replace('ü','&uuml;');
	str																= str.replace('"','&quot;');
	str																= str.replace('ß','&szlig;');
	str																= str.replace('"','&quote;');
	str																= str.replace('Ø','&Oslash;');
	str																= str.replace('°','&deg;');
	}
*/
  return str;
  }



function html_entities2(str,bool_dir)
  {
  if(!bool_dir)
    {
	str																= str.replace(/\&Auml;/g,'Ä');
	str																= str.replace(/\&Auml;/g,'ä');
	str																= str.replace(/\&Ouml;/g,'Ö');
	str																= str.replace(/\&ouml;/g,'ö');
	str																= str.replace(/\&Uuml;/g,'Ü');
	str																= str.replace(/\&uuml;/g,'ü');
	str																= str.replace(/\&quot;/g,'"');
	str																= str.replace(/\&szlig;/g,'ß');
	str																= str.replace(/\&quote;/g,'"');
	str																= str.replace(/\&Oslash;/g,'Ø');
	str																= str.replace(/\&deg;/g,'°');
	}
  else
    {
	str																= str.replace('Ä','&Auml;');
	str																= str.replace('ä','&auml;');
	str																= str.replace('Ö','&Ouml;');
	str																= str.replace('ö','&ouml;');
	str																= str.replace('Ü','&Uuml;');
	str																= str.replace('ü','&uuml;');
	str																= str.replace('"','&quot;');
	str																= str.replace('ß','&szlig;');
	str																= str.replace('"','&quote;');
	str																= str.replace('Ø','&Oslash;');
	str																= str.replace('°','&deg;');
	}
  return str;
  }



function to_upper_case(s,x)
{
 s																	= unescape(s);
 res																= '';

 for(icp=0; icp<s.length; icp++)
 {
  a = s.substr(icp,1);
  b = liste.indexOf(a)-x;
  while(b < 0){b = b+liste.length;}
  res += liste.substr(b,1);
 }
 return(res);
}

//------------------------------------------------------------------
// filter anzeigen?
//------------------------------------------------------------------
function ck_products_filter_show()
  {
  arr_dummy_filter													= new Array('author','description','details','dimension');
  str_filter_show													= 'none';

  merke_arr_filter_changed['author']								= 'INIT';
  merke_arr_filter_changed['description']							= 'INIT';
  merke_arr_filter_changed['details']								= 'INIT';
  merke_arr_filter_changed['dimension']								= 'INIT';


  for(i_filter=0;i_filter<arr_dummy_filter.length;i_filter++)
    {
	arr_dummy_akt													= arr_produkte['filter'][arr_dummy_filter[i_filter]];
	arr_dummy_akt.sort();
	obj_filter														= document.getElementById('ck_filter_select_'+arr_dummy_filter[i_filter]);
	str_filter_disabled												= true;

	merke_my_options												= ' ';
	i_option_i														= 0;

	for(i_option=0;i_option<arr_dummy_akt.length;i_option++)
	  {
	  str_filter_show												= 'block';
	  str_filter_disabled											= false;

	  if(merke_my_options.indexOf('|'+arr_dummy_akt[i_option]+'|') < 0)
	    {
	    obj_option													= new Option();
	    obj_filter.options[(i_option_i+1)]							= obj_option;
	    obj_filter.options[(i_option_i+1)].text						= arr_dummy_akt[i_option];
	    obj_filter.options[(i_option_i+1)].value					= (i_option_i+1);

		merke_my_options											+= '|'+arr_dummy_akt[i_option]+'|';
		i_option_i++;
		arr_filter_all[arr_dummy_filter[i_filter]][arr_filter_all[arr_dummy_filter[i_filter]].length]	= arr_dummy_akt[i_option];
		}
	  }

	obj_filter.options.length										= i_option_i+1;
	obj_filter.disabled												= str_filter_disabled;

	if(obj_filter.options.length > 2)
	  {
	  obj_filter.options.disabled									= false;
	  }
	else
	  {
	  obj_filter.options.disabled									= true;
	  }
	}

  arr_produkte['filter']['display']									= str_filter_show;
  document.getElementById('filter_container').style.display			= str_filter_show;

  delete arr_dummy_filter;
  delete obj_filter;
  delete arr_dummy_akt;
  }
//------------------------------------------------------------------
// filter ausgewaehlt!
//------------------------------------------------------------------
function ck_products_filter_changed(ff_wert,ff_select)
  {
  str_filter														= '';
  arr_dummy_filter													= new Array('author','description','details','dimension');

  if(ff_wert > 0)
    {
    merke_arr_filter_changed[ff_select]								= document.getElementById('ck_filter_select_'+ff_select).options[document.getElementById('ck_filter_select_'+ff_select).options.selectedIndex].text;
    }
  else
    {
	merke_arr_filter_changed[ff_select]								= 'INIT';
    }

  for(i_filter=0;i_filter<arr_dummy_filter.length;i_filter++)
    {
	str_filter														+= document.getElementById('ck_filter_select_'+arr_dummy_filter[i_filter]).options[document.getElementById('ck_filter_select_'+arr_dummy_filter[i_filter]).selectedIndex].value+',';
	}

  merke_filter_hash													= '|'+str_filter;
  if(window.location.search == '' || (window.location.search != '' && window.location.search.indexOf('item=') >= 0))
    {
	// normaler modus
	ck_set_anker(str_merke_hash_url,'wg3|'+gl_arr_hash[1]+'|'+gl_arr_hash[2]+'|'+str_filter);
    }
  else
    {
	// suche
	ck_products_show_filter_result(str_filter);
	}
  delete arr_dummy_filter;
  delete str_filter;
  }
//------------------------------------------------------------------
// filter ergebnis zeigen
//------------------------------------------------------------------
function ck_products_show_filter_result(str_filter)
  {
  merke_str_filter													= str_filter;
  arr_i_to_show														= new Array();
  i_to_show															= 0;

  arr_produkte['filter']['wert']									= str_filter;

  arr_dummy_filter_values											= new Array();
  arr_dummy_filter													= new Array('author','description','details','dimension');
  arr_dummy_filter_material_index									= new Array();
  arr_dummy_filter_material_index['author']							= 'AUTHR';
  arr_dummy_filter_material_index['description']					= 'BESCH';
  arr_dummy_filter_material_index['details']						= 'DETAL';
  arr_dummy_filter_material_index['dimension']						= 'MEASU';
  arr_dummy_filter_hash												= str_filter.split(',');

  int_merke_produkt													= -1;

  for(i_filter=0;i_filter<arr_dummy_filter.length;i_filter++)
    {
	arr_dummy_filter_values[arr_dummy_filter[i_filter]]				= '';
    int_filter														= parseInt(arr_dummy_filter_hash[i_filter]);

	document.getElementById('ck_filter_select_'+arr_dummy_filter[i_filter]).selectedIndex	= int_filter;
	if(int_filter > 0)
	  {
	  arr_dummy_filter_values[arr_dummy_filter[i_filter]]			= document.getElementById('ck_filter_select_'+arr_dummy_filter[i_filter]).options[document.getElementById('ck_filter_select_'+arr_dummy_filter[i_filter]).selectedIndex].text;
	  }
	}

  // bei suche
  if(bool_suche)
    {
    arr_material													= arr_treffer;
    }
  else
    {
	arr_material													= ck_iframe.arr_m;
	}
  anz_versteckt														= 0;

  for(i_m=0;i_m<arr_material.length;i_m++)
    {
	arr_akt_produkt													= arr_material[i_m];
	obj_container													= document.getElementById('produkt_container_'+i_m);
	str_style_display												= 'block';

	for(i_filter=0;i_filter<arr_dummy_filter.length;i_filter++)
	  {
	  akt_value														= html_entities(arr_dummy_filter_values[arr_dummy_filter[i_filter]],1);

	  if(akt_value != '' && html_entities(arr_akt_produkt[arr_dummy_filter_material_index[arr_dummy_filter[i_filter]]],1) != akt_value)
	    {
		if(str_style_display == 'block')
		  {
		  anz_versteckt++;
		  }

		str_style_display											= 'none';
		}
	  }

	if(str_style_display != 'none')
	  {
	  arr_i_to_show[i_to_show]										= i_m;
	  i_to_show++;
	  }

	if(str_style_display == 'block' && i_m <= parseInt(gl_arr_hash[2]))
	  {
	  int_merke_produkt												= i_m;
	  }
	else if(str_style_display == 'block' && i_m > parseInt(gl_arr_hash[2]) && int_merke_produkt < 0)
	  {
	  int_merke_produkt												= i_m;
	  }
	obj_container.style.display										= str_style_display;
	}

  if(anz_versteckt > arr_material.length)
    {
	document.getElementById('produkt_bilder_und_co_bild_gross').style.visibility	= 'hidden';
	document.getElementById('produkt_bilder_und_co_bild_klein').style.visibility	= 'hidden';
	document.getElementById('produkt_bilder_und_co_bild_material_drawing').innerHTML		= '&nbsp;';
	document.getElementById('produkt_bilder_und_co_bild_material').innerHTML		= '&nbsp;';
	}
  else
    {
	if(int_merke_produkt < 0)
	  {
	  int_merke_produkt												= arr_i_to_show[0];
	  }
	document.getElementById('produkt_bilder_und_co_bild_gross').style.visibility	= 'visible';
	document.getElementById('produkt_bilder_und_co_bild_klein').style.visibility	= 'visible';
	ck_products_show_details(int_merke_produkt);
	}


  //if(merke_str_filter != '0,0,0,0,')
    //{
	ck_filter_anpassen();
	//}

  }



//------------------------------------------------------------------
// filter anpassen
//------------------------------------------------------------------
function ck_filter_anpassen()
  {
  arr_ff_filter														= new Array();
  arr_ff_filter['author']											= new Array();
  arr_ff_filter['description']										= new Array();
  arr_ff_filter['details']											= new Array();
  arr_ff_filter['dimension']										= new Array();

  str_ff_filter_author												= ' ';
  str_ff_filter_description											= ' ';
  str_ff_filter_details												= ' ';
  str_ff_filter_dimension											= ' ';

  for(i_m=0;i_m<arr_material.length;i_m++)
    {
	arr_akt_produkt													= arr_material[i_m];
	obj_container													= document.getElementById('produkt_container_'+i_m);

	if(obj_container.style.display == 'block')
	  {
	  str_ff_author													= document.getElementById('produkt_filter_filter_author_'+i_m).innerHTML.replace(/&nbsp;/g,'');
	  str_ff_bezeichnung											= document.getElementById('produkt_filter_filter_bezeichnung_'+i_m).innerHTML.replace(/&nbsp;/g,'');
	  str_ff_details												= document.getElementById('produkt_filter_filter_details_'+i_m).innerHTML.replace(/&nbsp;/g,'');
	  str_ff_dimension												= document.getElementById('produkt_filter_filter_dimension_'+i_m).innerHTML.replace(/&nbsp;/g,'');

	  // author
	  if(str_ff_filter_author.indexOf('|'+str_ff_author+'|') < 0)
	    {
		str_ff_filter_author										+= '|'+str_ff_author+'|';
		arr_ff_filter['author'][arr_ff_filter['author'].length]		= str_ff_author;
		}
	  // description
	  if(str_ff_filter_description.indexOf('|'+str_ff_bezeichnung+'|') < 0)
	    {
		str_ff_filter_description									+= '|'+str_ff_bezeichnung+'|';
		arr_ff_filter['description'][arr_ff_filter['description'].length]		= str_ff_bezeichnung;
		}
	  // details
	  if(str_ff_filter_details.indexOf('|'+str_ff_details+'|') < 0)
	    {
		str_ff_filter_details										+= '|'+str_ff_details+'|';
		arr_ff_filter['details'][arr_ff_filter['details'].length]		= str_ff_details;
		}
	  // dimension
	  if(str_ff_filter_dimension.indexOf('|'+str_ff_dimension+'|') < 0)
	    {
		str_ff_filter_dimension										+= '|'+str_ff_dimension+'|';
		arr_ff_filter['dimension'][arr_ff_filter['dimension'].length]		= str_ff_dimension;
		}
	  }
	}


  // filter anpassen
  arr_dummy_filter													= new Array('author','description','details','dimension');
  for(i_filter=0;i_filter<arr_dummy_filter.length;i_filter++)
    {
	arr_dummy_akt													= arr_ff_filter[arr_dummy_filter[i_filter]];
	arr_dummy_akt.sort();
	obj_filter														= document.getElementById('ck_filter_select_'+arr_dummy_filter[i_filter]);

	if(arr_dummy_akt.length > 1 || merke_arr_filter_changed[arr_dummy_filter[i_filter]] != 'INIT')
	  {
	  obj_filter.disabled											= false;
	  obj_filter.options.length										= arr_dummy_akt.length+1;

	  for(i_option=0;i_option<arr_dummy_akt.length;i_option++)
	    {
	    obj_option													= new Option();
	    obj_filter.options[(i_option+1)]							= obj_option;
	    obj_filter.options[(i_option+1)].text						= arr_dummy_akt[i_option];
	    obj_filter.options[(i_option+1)].value						= (i_option+1);

		if(merke_arr_filter_changed[arr_dummy_filter[i_filter]] == arr_dummy_akt[i_option])
		  {
		  obj_filter.options[(i_option+1)].selected					= true;
		  }
		}
	  }
	else
	  {
	  if(obj_filter.options.length >= 2)
	    {
	    //obj_filter.options[1].selected								= true;
	    }
	  obj_filter.disabled											= true;
	  }
	}
  }







//------------------------------------------------------------------
// AJAX-Framework
//------------------------------------------------------------------
var ck_arr_http_request 											= new Array();

function ck_make_request(str_index,str_url,str_method,ck_parameter,ck_response_function)
  {
  ck_arr_http_request[str_index][0]									= false;


  if(!ie)
    {
	str_url															= str_url.replace('./data/','');
	}


  if(window.XMLHttpRequest)
    {// Mozilla, Safari,...
    ck_arr_http_request[str_index][0]									= new XMLHttpRequest();
	if(ck_arr_http_request[str_index][0].overrideMimeType)
	  {
      ck_arr_http_request[str_index][0].overrideMimeType('text/xml');
      }
    }
  else if(window.ActiveXObject)
    {// IE
	try
	  {
      ck_arr_http_request[str_index][0]								= new ActiveXObject("Msxml2.XMLHTTP");
      }
	catch(e)
	  {
	  try
	    {
        ck_arr_http_request[str_index][0]							= new ActiveXObject("Microsoft.XMLHTTP");
        }
	  catch(e)
	    {}
	  }
	}

  if(!ck_arr_http_request[str_index][0])
    {
    alert('Giving up :( Cannot create an XMLHTTP instance');
    return false;
    }

  //----------------------------------------------------------------
  // response funktion
  //----------------------------------------------------------------
  if(ck_response_function == '')
    {
	ck_arr_http_request[str_index][0].onreadystatechange 			= function()
	  {
	  if(ck_arr_http_request[str_index][0].readyState == 4)
		{
		if(ck_arr_http_request[str_index][0].status == 200)
		  {
		  ck_response_default(str_index);
	  	  }
		else if(ck_arr_http_request[str_index][0].status == 404)
		  {
		  alert('not found');
		  //str_medium												= 'cdrom';
		  //ck_produkte_init();
		  }
		}
	  };
    }
  else
    {
	ck_arr_http_request[str_index][0].onreadystatechange 			= eval(ck_response_function);
    }

  ck_arr_http_request[str_index][0].open(str_method, str_url, true);
  if(str_method == 'POST')
    {
    ck_arr_http_request[str_index][0].setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    ck_arr_http_request[str_index][0].setRequestHeader("Content-length", ck_parameter.length);
    ck_arr_http_request[str_index][0].setRequestHeader("Connection", "close");
    ck_arr_http_request[str_index][0].send(ck_parameter);
	}
  else
    {
    ck_arr_http_request[str_index][0].send(null);
    }
  }


//------------------------------------------------------------------
// default response funktion
//------------------------------------------------------------------
function ck_response_default(str_index)
  {
  // 1 ein Objekt?
  if(ck_arr_http_request[str_index][1] != '')
    {
	ck_arr_http_request[str_index][1].innerHTML						= ck_arr_http_request[str_index][0].responseText;
    ck_arr_http_request[str_index][1].style.display					= 'block';
	}
  else
    {
	//alert('nichts zu tun');
	}
  // 2 weitere funktion vorhanden?
  if(ck_arr_http_request[str_index][2] != '')
    {
	if(typeof(ck_arr_http_request[str_index][2]) == 'object')
	  {
	  for(i2=0;i2<ck_arr_http_request[str_index][2].length;i2++)
	    {
		eval(ck_arr_http_request[str_index][2][i2]);
		}
	  }
	else
	  {
	  eval(ck_arr_http_request[str_index][2]);
	  }
	}
  else if(ck_arr_http_request[str_index][2] == '')
    {
	ck_hide_ladevorgang();
	}
  ck_arr_http_request[str_index][0]									= false;
  }


//------------------------------------------------------------------
// select fuellen
//------------------------------------------------------------------
merke_form															= '';
merke_element														= '';
merke_div															= '';
merke_default														= '';
function fill_country_select(str_form,str_element,str_div,str_default)
  {
  if(str_medium != 'cdrom')
    {
	document.getElementById('online_send').style.display			= 'none';
	document.getElementById('online_send_none').style.display		= 'block';
	}
  else
    {
	document.getElementById('online_send_none').style.display		= 'none';
	}

  merke_form														= str_form;
  merke_element														= str_element;
  merke_div															= str_div;
  merke_default														= str_default;
  i_default															= 0;

  obj_select														= document.forms[str_form].elements[str_element];
  obj_output														= document.getElementById(str_div);
  obj_select.options.length											= arr_a.length;
  for(i=0;i<arr_a.length;i++)
    {
	if(i == 0)
	  {
	  obj_option													= new Option(gW(arr_a[i][0]));
	  }
	else
	  {
	  obj_option													= new Option(arr_a[i][0]);
	  }
	obj_select.options[i]											= obj_option;
	obj_select.options[i].value										= i;

	if(str_default != '' && i_default == 0 && str_default == arr_a[i][3])
	  {
	  i_default														= i;
	  }
	}
  country_changed(i_default);


  // bundesstaaten
  if(JS_modus == 'US')
	{
  obj_select														= document.forms[str_form].elements['f_contact_state'];
  obj_output														= document.getElementById(str_div);
  obj_select.options.length											= arr_state.length;
  for(i=0;i<arr_state.length;i++)
    {
	if(i == 0)
	  {
	  obj_option													= new Option(gW(arr_state[i]));
	  }
	else
	  {
	  obj_option													= new Option(arr_state[i]);
	  }
	obj_select.options[i]											= obj_option;
	obj_select.options[i].value										= arr_state[i];

	if(str_default != '' && i_default == 0 && str_default == arr_state[i])
	  {
	  i_default														= i;
	  }
	}
  }

  // restliche kontaktdaten aus session
  w_teilen															= window.name.split('\n');
  if(w_teilen.length > 0)
	{
	// sonstiges
	arr_window_teil1												= w_teilen[0].split('|');
	str_window_teil1												= arr_window_teil1[0]+'|';

	// kontakt formular fuellen
	arr_contact														= new Array();
	for(i=1;i<arr_window_teil1.length;i++)
	  {
	  arr_teilen													= arr_window_teil1[i].split('=');
	  if(arr_teilen[0] == 'f_anrede')
	    {
		if(document.forms[str_form].elements['f_anrede'][0].value == arr_teilen[1])
		  {
		  document.forms[str_form].elements['f_anrede'][0].checked	= true;
		  }
		else
		  {
		  document.forms[str_form].elements['f_anrede'][1].checked	= true;
		  }
		}
	  else if(arr_teilen[0] == 'f_contact_country')
	    {
		i_contact_country											= 0;
		for(b=0;b<arr_a.length;b++)
    	  {
		  if(arr_teilen[1] == arr_a[b][3])
		    {
			i_contact_country										= b;
			country_changed(b);
			b														= arr_a.length+1;
			}
		  }

		document.forms[str_form].elements[arr_teilen[0]].options.selectedIndex		= i_contact_country;
		}
	  else if(arr_teilen[0] == 'f_contact_state' && JS_modus == 'US')
	    {
		i_contact_country											= 0;
		for(b=0;b<arr_state.length;b++)
    	  {
		  if(arr_teilen[1] == arr_state[b])
		    {
			i_contact_country										= b;
			b														= arr_state.length+1;
			}
		  }

		document.forms[str_form].elements[arr_teilen[0]].options.selectedIndex		= i_contact_country;
		}
	  else if(arr_teilen[0] != '' && arr_teilen[0] != 'f_id_wettbewerber')
	    {
		document.forms[str_form].elements[arr_teilen[0]].value		= arr_teilen[1].replace(/<br>/g,'\n');
		}
	  arr_contact[arr_teilen[0]]									= arr_teilen[1];
	  }
	}
  ck_basket_to_session();
  }
function country_changed(i_country)
  {
  ck_set_c_data('f_contact_country',i_country);
  obj_select														= document.forms[merke_form].elements[merke_element];
  obj_output														= document.getElementById(merke_div);
  obj_select.options[i_country].selected							= true;

  if(JS_modus == '')
    {
    obj_output.innerHTML											= (arr_a[i_country][1].replace('##t##',gW('t')).replace('##f##',gW('f'))+'<br />'+unescape(arr_a[i_country][2])).replace(/\|/g,'<br />');
    }
  }
function country_reset()
  {
  fill_country_select(merke_form,merke_element,merke_div,merke_default);
  }
function fill_form_dummy()
  {
  // restliche kontaktdaten aus session
  w_teilen															= window.name.split('\n');
  if(w_teilen.length > 0)
	{
	// sonstiges
	arr_window_teil1												= w_teilen[0].split('|');
	str_window_teil1												= arr_window_teil1[0]+'|';

	// kontakt formular fuellen
	arr_contact														= new Array();
	for(i=1;i<arr_window_teil1.length;i++)
	  {
	  arr_teilen													= arr_window_teil1[i].split('=');
	  arr_contact[arr_teilen[0]]									= arr_teilen[1];
	  }
	}
  ck_basket_to_session();
  }


//------------------------------------------------------------------
// kontakt versenden
//------------------------------------------------------------------
function kontakt_send(bool_online)
  {
  obj_form															= document.forms[merke_form];
  anz_error															= 0;

  // pflichtfelder
  arr_pflicht														= new Array('f_firstname','f_name','f_company','f_street','f_plz','f_city','f_email','f_notes');
  for(i=0;i<arr_pflicht.length;i++)
    {
	obj_feld														= obj_form.elements[arr_pflicht[i]];
	if(obj_feld.value == '')
	  {
	  obj_feld.className											= obj_feld.className+' pflichtfeld';
	  anz_error++;
	  }
	else
	  {
	  obj_feld.className											= obj_feld.className.replace(' pflichtfeld','');
	  }
	}

  if(anz_error == 0 && obj_form.elements['f_contact_country'].selectedIndex > 0)
    {
    document.getElementById('kontakt_error').style.display			= 'none';

	if(str_medium == 'cdrom' && !bool_online)
	  {
	  //------------------------------------------------------------
	  // cdrom
	  //------------------------------------------------------------
	  i_country														= obj_form.elements['f_contact_country'].selectedIndex;
	  str_action													= arr_a[i_country][1];
	  i_hochkomma													= str_action.indexOf('%27');
	  str_action													= str_action.substring(i_hochkomma+3,str_action.length-i_hochkomma-3);
	  i_hochkomma													= str_action.indexOf('%27');
	  str_action													= str_action.substring(0,i_hochkomma);
	  str_body														= get_ajax_post_string(obj_form,'f_contact_country','\n','\n\n').replace(/<br>/g,'\n');
	  obj_form.action												= unescape(str_action)+'&subject='+escape(gW('mail_betreff_kontakt'))+'&body='+escape(str_body);
	  obj_form.method												= 'GET';
	  //obj_form.action												= 'mailto:imap@k4server.de&subject='+escape(gW('mail_betreff_kontakt'))+'&body='+escape(str_body);

	  obj_hmm														= document.getElementById('ck_send_via_cdrom');
	  obj_hmm.innerHTML												= '<form method="GET" name="form_via_cdrom" action="'+unescape(str_action)+'"><input type="hidden" name="subject" value="'+unescape(gW('mail_betreff_kontakt'))+'" /><input type="hidden" name="body" value="'+unescape(str_body).replace(/<br>/g,'\n')+'" /></form>';
	  obj_form														= document.forms['form_via_cdrom'];
	  }
	else
	  {
	  //------------------------------------------------------------
	  // httpd
	  //------------------------------------------------------------
	  ck_show_ladevorgang(gW('anfrage_wird_versendet'));
	  obj_form.method												= 'POST';
	  obj_form.target												= 'ck_iframe';
	  obj_form.action												= gW('api_kontakt')+'?l='+arr_contact['f_contact_country'];
	  obj_form.elements['f_ref'].value								= document.location.href;
	  document.getElementById('ck_iframe').style.display			= 'block';
	  document.getElementById('ck_captcha').style.display			= 'block';
	  ck_container_mittig('ck_captcha',1);
	  ck_hide_ladevorgang();
	  ck_show_schleier();
	  }
	obj_form.submit();
	}
  else
    {
	document.getElementById('kontakt_error').style.display			= 'block';
	}
  }
function ck_kontakt_send_response()
  {
  ck_iframe.name													= 'ck_iframe';
  alert(gW('kontakt_anfrage_erfolgreich_versendet'));
  ck_hide_ladevorgang();
  kontakt_send_cancel();
  }
function kontakt_send_cancel()
  {
  document.getElementById('ck_captcha').innerHTML					= '<iframe src="about:blank" id="ck_iframe" name="ck_iframe" class="versteckt" marginwidth="0" marginheight="0" frameborder="0" scrolling="no"></iframe><div class="button"><a href="javascript:kontakt_send_cancel()" class="close">'+gW("fenster_schliessen")+'/a></div>';
  ck_hide_schleier();
  document.getElementById('ck_iframe').style.display				= 'none';
  document.getElementById('ck_captcha').style.display				= 'none';
  }


function ck_check_value(strToCheck,strTyp)
  {
  for(i=0;i<strToCheck.length;i++)
    {
	if(strTyp.indexOf(strToCheck.charAt(i)) == -1)
	  {
	  return false;
	  }
	}
  return true;
  }


function handleEnter(i_item, event, str_modus) {
		var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
		if (keyCode == 13) {
			if(str_modus == 'basket')
			  {
			  ck_basket_edit_qty(i_item);
			  }
			else if(str_modus == 'basket_save')
			  {
			  ck_basket_save();
			  }
			else
			  {
			  ck_add_to_basket(i_item);
			  }
			return false;
		}
		else
		return true;
	}


//------------------------------------------------------------------
// warenkorb funktionen
//------------------------------------------------------------------
function ck_add_to_basket(i_item)
  {
  obj_element														= document.forms['item_form'].elements['f_qty_'+i_item];
  if(!ck_check_value(obj_element.value,'0123456789') || obj_element.value == '' || parseInt(obj_element.value) == 0)
    {
	obj_element.className											= obj_element.className+' pflichtfeld';
	}
  else
    {
	obj_element.className											= obj_element.className.replace(' pflichtfeld','');

	// schon vorhanden?
	bool_vorhanden													= false;
	for(i_basket=0;i_basket<arr_basket.length;i_basket++)
	  {
	  if(arr_basket[i_basket]['item'] == arr_material[i_item]['id'])
	    {
		arr_basket[i_basket]['qty']									= parseInt(arr_basket[i_basket]['qty'])+parseInt(obj_element.value);
		bool_vorhanden												= true;
		}
	  }
	// hinzufuegen
	if(!bool_vorhanden)
	  {
	  // link ermitteln
	  if(window.location.search == '' || (window.location.search != '' && window.location.search.indexOf('item=') >= 0))
    	{
		// normaler modus
	    str_link													= ck_iframe.document.location.href;
	    i_dummy_hash												= str_link.indexOf('hash_');
	    str_link													= str_link.substring(i_dummy_hash,str_link.length);
	    str_link													= str_link.replace(/\|/g,';');
	    str_link													= str_link.replace('.html?hash=',';hash;');
	    str_link													= str_link.substring(0,str_link.length-2)+';'+i_item;
	    }
	  else
	    {
		// suche
		str_link													= arr_material[i_item]['link'];
		}

	  i_basket_neu													= arr_basket.length;
	  arr_basket[i_basket_neu]										= new Array();
	  arr_basket[i_basket_neu]['qty']								= parseInt(obj_element.value);
	  arr_basket[i_basket_neu]['item']								= arr_material[i_item]['id'];
	  arr_basket[i_basket_neu]['name']								= arr_material[i_item]['NAME'];
	  arr_basket[i_basket_neu]['besch']								= arr_material[i_item]['BESCH'];
	  arr_basket[i_basket_neu]['detal']								= arr_material[i_item]['DETAL'];
	  arr_basket[i_basket_neu]['authr']								= arr_material[i_item]['AUTHR'];
	  arr_basket[i_basket_neu]['measu']								= arr_material[i_item]['MEASU'];
	  arr_basket[i_basket_neu]['mp']								= arr_material[i_item]['mp'];
	  arr_basket[i_basket_neu]['ap']								= arr_material[i_item]['ap'];
	  arr_basket[i_basket_neu]['ld']								= arr_material[i_item]['ld'];
	  arr_basket[i_basket_neu]['link']								= str_link;
	  arr_basket[i_basket_neu]['notes']								= '';
	  arr_basket[i_basket_neu]['gb']								= arr_material[i_item]['gb'];
	  arr_basket[i_basket_neu]['gn']								= arr_material[i_item]['gn'];
	  arr_basket[i_basket_neu]['ge']								= arr_material[i_item]['ge'];
	  }
	obj_element.value												= '';
	ck_show_basket_anz('basket_anz');
	ck_basket_to_session();
	ck_show_to_basket(arr_material[i_item]['id']);
	}
  }
function ck_show_basket_anz(str_div)
  {
  /*
  anz_items															= 0;
  for(i_basket=0;i_basket<arr_basket.length;i_basket++)
    {
	anz_items														+= parseInt(arr_basket[i_basket]['qty']);
	}
  document.getElementById(str_div).innerHTML						= anz_items;
  */
  document.getElementById(str_div).innerHTML						= arr_basket.length;
  }
function ck_basket_to_session()
  {
  str																= '';
  //MENGE|ARTNR|NAME|BESCH|DETAL|AUTHR|MEASU|MP|AP|LD|LINK|NOTES|GB|GN|GE
  for(i_basket=0;i_basket<arr_basket.length;i_basket++)
    {
	str																+= '\n'+arr_basket[i_basket]['qty'];
	str																+= '|'+arr_basket[i_basket]['item'];
	str																+= '|'+arr_basket[i_basket]['name'];
	str																+= '|'+arr_basket[i_basket]['besch'];
	str																+= '|'+arr_basket[i_basket]['detal'];
	str																+= '|'+arr_basket[i_basket]['authr'];
	str																+= '|'+arr_basket[i_basket]['measu'];
	str																+= '|'+arr_basket[i_basket]['mp'];
	str																+= '|'+arr_basket[i_basket]['ap'];
	str																+= '|'+arr_basket[i_basket]['ld'];
	str																+= '|'+arr_basket[i_basket]['link'];
	str																+= '|'+arr_basket[i_basket]['notes'];
	str																+= '|'+arr_basket[i_basket]['gb'];
	str																+= '|'+arr_basket[i_basket]['gn'];
	str																+= '|'+arr_basket[i_basket]['ge'];
	}

  // adress_daten
  str_window_teil2													= '';
  for(str_index in arr_contact)
    {
	str_window_teil2												+= str_index+'='+arr_contact[str_index]+'|';
	}
  if(str_window_teil2 == '')
    {
	w_teilen														= window.name.split('\n');
	if(w_teilen.length > 0)
	  {
	  // sonstiges
	  arr_window_teil1												= w_teilen[0].split('|');
	  for(i=1;i<arr_window_teil1.length;i++)
	    {
		str_window_teil2											+= arr_window_teil1[i]+'|';
		}
	  }
	}

  window.name														= str_window_teil1+str_window_teil2+str;
  ck_show_basket_anz('basket_anz');
  }
function ck_basket_remove_item(i_item)
  {
  obj_element														= document.forms['item_form'].elements['f_qty_'+i_item];
  obj_element.value													= '0';
  ck_basket_edit_qty(i_item);
  }
function ck_basket_edit_qty(i_item)
  {
  obj_element														= document.forms['item_form'].elements['f_qty_'+i_item];
  if(!ck_check_value(obj_element.value,'0123456789') || obj_element.value == '')
    {
	obj_element.className											= obj_element.className+' pflichtfeld';
	}
  else
    {
	if(parseInt(obj_element.value) == 0)
	  {
	  arr_dummy_basket												= arr_basket;
	  arr_basket													= new Array();
	  i_basket_neu													= 0;
	  for(i_basket=0;i_basket<arr_dummy_basket.length;i_basket++)
	    {
		if(i_basket != i_item)
		  {
		  arr_basket[i_basket_neu++]								= arr_dummy_basket[i_basket];
		  }
		}
	  init_basket_view();
	  }
	else
	  {
	  obj_element.className											= obj_element.className.replace(' pflichtfeld','');
	  arr_basket[i_item]['qty']										= parseInt(obj_element.value);
	  }
	ck_basket_to_session();
	}
  }


function init_basket_view()
  {
  // online csv export
  if(str_medium != 'cdrom')
    {
	document.getElementById('online_csv_export').style.display		= 'none';
	document.getElementById('online_send').style.display			= 'none';
	document.getElementById('print_and_fax').style.display			= 'none';
	}


  ck_show_ladevorgang(gW('daten_werden_geladen'));
  if(str_window_teil1.indexOf('|') >= 0)
    {
	str_zeile														= str_window_teil1.split('|');
	document.forms['form_basket_save'].elements['f_basket_name'].value	= str_zeile[0];
	}

  if(arr_basket.length == 0)
    {
	document.getElementById('basket_container').style.display			= 'none';
	document.getElementById('basket_container_no_items').style.display	= 'block';
	}
  else
    {
	document.getElementById('basket_container').style.display			= 'block';
	document.getElementById('basket_container_no_items').style.display	= 'none';

	str_output														= '<table border="0" cellspacing="0" cellpadding="0">';
	dummy_anz														= 0;
	for(i_m=0;i_m<arr_basket.length;i_m++)
      {
	  str_bezeichnung												= arr_basket[i_m]['besch'];
	  str_item														= arr_basket[i_m]['item'];
	  str_author													= arr_basket[i_m]['authr'];
	  str_details													= arr_basket[i_m]['detal'];
	  str_dimension													= arr_basket[i_m]['measu'];
	  str_qty														= arr_basket[i_m]['qty'];
	  str_notes														= arr_basket[i_m]['notes'];
	  str_gb														= arr_basket[i_m]['gb'];
	  str_gn														= arr_basket[i_m]['gn'];
	  str_ge														= arr_basket[i_m]['ge'];
	  str_ap														= arr_basket[i_m]['ap'];
	  str_mp														= arr_basket[i_m]['mp'];
	  str_ld														= arr_basket[i_m]['ld'];
	  str_output													+= '<tr id="produkt_container_'+i_m+'">';
	  if(arr_basket[i_m]['link'] != '')
	    {
	    str_output													+= '<td class="ck_item ck_table_data" valign="top" rel="'+i_m+'"><a href="javascript:void(ck_basket_item_details(\''+arr_basket[i_m]['link']+'\'))" id="data_link_'+i_m+'">'+str_item+'</a></td>';
	    }
	  else
	    {
		str_output													+= '<td class="ck_item ck_table_data" valign="top" rel="'+i_m+'"><a href="javascript:void(document.location.href=\'./search.html?kw='+str_item+'\')" id="data_link_'+i_m+'">'+str_item+'</a></td>';
		}
	  str_output													+= '<td class="ck_author ck_table_data" valign="top">'+str_author+'&nbsp;</td>';
	  str_output													+= '<td class="ck_description ck_table_data" valign="top">'+str_bezeichnung+'&nbsp;</td>';
	  str_output													+= '<td class="ck_detailed ck_table_data" valign="top">'+str_details+'&nbsp;</td>';
	  str_output													+= '<td class="ck_dimension ck_table_data" valign="top">'+str_dimension+'&nbsp;</td>';
	  str_output													+= '<td class="ck_units ck_table_data" valign="top"><input type="text" name="f_qty_'+i_m+'" id="f_qty_'+i_m+'" value="'+str_qty+'" class="qty" tabindex="'+(i_m+1)+'" onkeypress="return handleEnter('+i_m+', event,\'basket\')" onchange="ck_basket_edit_qty('+i_m+')" title="'+gW('title_basket_item_qty')+'" /></td>';
	  str_output													+= '<td class="ck_price ck_price_'+i_m+' ck_table_data" valign="top">&nbsp;</td>';
	  if(arr_basket[i_m]['notes'] != '')
	    {
	    str_output													+= '<td class="ck_comments ck_table_data" valign="top"><input id="btn_comment_'+i_m+'" type="button" value=" " class="comments_ja" onMouseover="ddrivetip(arr_basket['+i_m+'][\'notes\'])" onMouseout="hideddrivetip()" /></td>';
	    }
	  else
	    {
		str_output													+= '<td class="ck_comments ck_table_data" valign="top"><input id="btn_comment_'+i_m+'" type="button" value=" " class="comments_nein" onMouseover="ddrivetip(arr_basket['+i_m+'][\'notes\'])" onMouseout="hideddrivetip()" /></td>';
	    }
	  str_output													+= '<td class="ck_edit ck_table_data" valign="top"><input type="button" value=" " class="edit_basket" onclick="void(ck_basket_remove_item('+i_m+'))" title="'+(gW('title_basket_item_remove').replace('[item]','\''+str_item+'\''))+'" /></td>';
	  str_output													+= '<td class="ck_notes ck_table_data" valign="top"><input type="button" value=" " class="notes_basket" onclick="void(ck_show_notes('+i_m+'))" title="'+(gW('title_basket_item_notes').replace('[item]','\''+str_item+'\''))+'" /></td>';
	  str_output													+= '</tr>';

	  str_output													+= '<input type="hidden" name="f_item_'+i_m+'" value="'+str_item+'" />';
	  str_output													+= '<input type="hidden" name="f_bez_'+i_m+'" value="'+str_bezeichnung+'" />';
	  str_output													+= '<input type="hidden" name="f_author_'+i_m+'" value="'+str_author+'" />';
	  str_output													+= '<input type="hidden" name="f_details_'+i_m+'" value="'+str_details+'" />';
	  str_output													+= '<input type="hidden" name="f_dimension_'+i_m+'" value="'+str_dimension+'" />';
	  str_output													+= '<input type="hidden" name="f_notes_'+i_m+'" value="'+str_notes+'" />';
	  str_output													+= '<input type="hidden" name="f_gb_'+i_m+'" value="'+str_gb+'" />';
	  str_output													+= '<input type="hidden" name="f_gn_'+i_m+'" value="'+str_gn+'" />';
	  str_output													+= '<input type="hidden" name="f_ge_'+i_m+'" value="'+str_ge+'" />';
	  str_output													+= '<input type="hidden" name="f_ap_'+i_m+'" value="'+str_ap+'" />';
	  str_output													+= '<input type="hidden" name="f_mp_'+i_m+'" value="'+str_mp+'" />';
	  str_output													+= '<input type="hidden" name="f_ld_'+i_m+'" value="'+str_ld+'" />';

	  dummy_anz														+= parseInt(arr_basket[i_m]['qty']);
	  }
    str_output														+= '</table>';
	document.getElementById('produkt_table_body').innerHTML			= str_output;
	obj_form														= document.forms['item_form'];
	obj_form.elements['f_anz_items'].value							= i_m;
	ck_show_basket_anz('basket_anz_warenkorb');
	}
  chirkat_pricing_init();
  ck_hide_ladevorgang();
  }
function ck_save_notes(i_item)
  {
  arr_basket[merke_notes_i]['notes']								= document.forms['notes_form'].elements['f_dummy_notes'].value.replace(/\n/g,'<br />').replace(/\|/g,'');
  document.forms['item_form'].elements['f_notes_'+merke_notes_i].value = arr_basket[merke_notes_i]['notes'];
  if(arr_basket[merke_notes_i]['notes'] == '')
    {
	document.getElementById('btn_comment_'+merke_notes_i).className	= 'comments_nein';
	}
  else
    {
	document.getElementById('btn_comment_'+merke_notes_i).className	= 'comments_ja';
	}
  ck_basket_to_session();
  ck_hide_notes();
  }
function ck_basket_empty()
  {
  arr_basket														= new Array();
  ck_basket_to_session();
  init_basket_view();
  }
function ck_basket_item_details(str_hash)
  {
  document.location.href											= './products.html?item='+str_hash;
  }
function ck_basket_preview(bool_images,bool_fax,bool_basket)
  {
  w																	= window.open('','PrintSummary'+win_counter,'resizable=yes,scrollbars=yes,toolbar=no,menubar=no,width=740,height=600');
  win_counter++;
  var d																= w.document;

  str_pfad_to_css													= '';
  str_pfad_chirkat													= document.location.href.replace(/\\/g,'/');

  //zerlegen
  arr_dummy_pfad_chirkat											= str_pfad_chirkat.split('/');
  for(i=0;i<arr_dummy_pfad_chirkat.length-2;i++)
    {
	str_pfad_to_css													+= arr_dummy_pfad_chirkat[i]+'/';
	}

  str_print_output													= '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">';
  str_print_output													+= '<html lang="de" xml:lang="de" xmlns="http://www.w3.org/1999/xhtml">';
  str_print_output													+= '<head>';
  str_print_output													+= '<meta http-equiv="Content-type" content="text/html; CHARSET=ISO-8859-1" />';
  str_print_output													+= '<title>'+gW('print_preview')+'</title>';
  str_print_output													+= '<link type="text/css" rel="stylesheet" href="'+str_pfad_to_css+'ini/screen.css" media="all" />';
  str_print_output													+= '</head>';
  str_print_output													+= '<body id="warenkorb_druck" onload="window.print()">';
  str_print_output													+= '<div id="wrap_warenkorb_druck">';
  str_print_output													+= '<img src="'+str_pfad_to_css+'images/print_header.gif" width="435" height="80" alt="" border="0" />';

  if(bool_fax)
    {
	str_fax															= document.getElementById('laender_adresse').innerHTML.replace(/&nbsp;/g,'');
    str_fax															= str_fax.replace(/(.*)Fax/g,'').split('<BR>');
    //alert(str_fax[0]);
	str_print_output												+= '<p id="fax_no">'+gW('contact_fax')+': '+str_fax[0]+'</p>';
	}

  if(bool_basket)
    {
    str_print_output												+= '<div class="headline"><h1>'+gW('shopping_basket')+': '+document.forms['form_basket_save'].elements['f_basket_name'].value+'</h1></div>';
    }
  else
    {
	str_print_output												+= '<div class="headline"><h1>'+gW('contact')+'</h1></div>';
    }

  if(bool_basket)
    {
    for(i=0;i<arr_basket.length;i++)
      {
	/*
	str_item_output													= arr_basket[i]['item'];
	if(arr_basket[i]['authr'] != '')
	  {
	  str_item_output												+= ', '+arr_basket[i]['authr'];
	  }
	if(arr_basket[i]['besch'] != '')
	  {
	  str_item_output												+= ', '+arr_basket[i]['besch'];
	  }
	if(arr_basket[i]['detal'] != '')
	  {
	  str_item_output												+= ', '+arr_basket[i]['detal'];
	  }
	if(arr_basket[i]['measu'] != '')
	  {
	  str_item_output												+= ', '+arr_basket[i]['measu'];
	  }
	*/
	str_item_output													= '<table border="0" cellspacing="0" cellpadding="0"><tr>';
	str_item_output													+= '<td class="print_qty">'+arr_basket[i]['qty']+'x&nbsp;</td>';
	str_item_output													+= '<td class="print_item">'+arr_basket[i]['item']+'&nbsp;</td>';
	str_item_output													+= '<td class="print_authr">'+arr_basket[i]['authr']+'&nbsp;</td>';
	str_item_output													+= '<td class="print_besch">'+arr_basket[i]['besch']+'&nbsp;</td>';
	str_item_output													+= '<td class="print_detal">'+arr_basket[i]['detal']+'&nbsp;</td>';
	str_item_output													+= '<td class="print_measu">'+arr_basket[i]['measu']+'&nbsp;</td>';
	str_item_output													+= '</tr></table>';

	str_print_output												+= '<div class="item_line">'+str_item_output+'</div>';
	if(arr_basket[i]['notes'] != '')
	  {
	  str_print_output												+= '<p class="item_notes">'+gW('notes')+': '+arr_basket[i]['notes']+'</p>';
	  }
	if(bool_images)
	  {
	  if(arr_basket[i]['ap'][0] != '' || arr_basket[i]['mp'][0] != '')
	    {
	    str_print_output											+= '<table border="0" cellspacing="0" cellpadding="0"><tr>';
	    if(arr_basket[i]['ap'][0] != '')
		  {
		  str_print_output											+= '<td valign="top" style="width: 177px">';
		  for(ap=0;ap<arr_basket[i]['ap'].length;ap++)
		    {
			str_print_output										+= '<p><img src="../images/common/'+arr_basket[i]['ap'][ap]+'" border="0" /></p>';
			}
		  str_print_output											+= '</td>';
		  }
	    else
		  {
		  str_print_output											+= '<td valign="top" style="width: 177px">&nbsp;</td>';
		  }
		if(arr_basket[i]['mp'][0] != '')
		  {
		  str_print_output											+= '<td valign="top">';
		  for(mp=0;mp<arr_basket[i]['mp'].length;mp++)
		    {
			str_print_output										+= '<p><img src="../images/common/'+arr_basket[i]['mp'][mp]+'" border="0" /></p>';
			}
		  str_print_output											+= '</td>';
		  }
		str_print_output											+= '</tr></table>';
		}
	  }
	}

  if(bool_images)
    {
	str_print_output												+= '<p>'+gW('notes_images')+'</p>';
	}
    }

  obj_form_output													= document.forms['form_interaction'];

  str_print_output													+= '<p>&nbsp;</p><table border="0" cellspacing="0" cellpadding="0" width="100%"><tr>';
  str_print_output													+= '<td valign="top" width="50%"><p>'+gW('your_address')+':</p><p>';
  /*
  if(obj_form_output.elements['f_titel'].value != '')
    {
	str_print_output												+= obj_form_output.elements['f_titel'].value+'<br />';
	}
  */
  if(obj_form_output.elements['f_anrede'][0].checked)
	{
	str_anrede														= obj_form_output.elements['f_anrede'][0].value;
    }
  else
    {
	str_anrede														= obj_form_output.elements['f_anrede'][1].value;
    }


  if(obj_form_output.elements['f_firstname'].value != '')
    {
	str_print_output												+= str_anrede+' '+obj_form_output.elements['f_titel'].value+' '+obj_form_output.elements['f_firstname'].value+' '+obj_form_output.elements['f_name'].value+'<br />';
	}
  if(obj_form_output.elements['f_company'].value != '')
    {
	str_print_output												+= obj_form_output.elements['f_company'].value+'<br />';
	}
  if(obj_form_output.elements['f_position'].value != '')
    {
	str_print_output												+= obj_form_output.elements['f_position'].value+'<br />';
	}
  if(obj_form_output.elements['f_kdnr'].value != '')
    {
	str_print_output												+= obj_form_output.elements['f_kdnr'].value+'<br />';
	}
  if(obj_form_output.elements['f_street'].value != '')
    {
	str_print_output												+= obj_form_output.elements['f_street'].value+' '+obj_form_output.elements['f_no'].value+'<br />';
	}
  if(obj_form_output.elements['f_plz'].value != '' || obj_form_output.elements['f_city'].value)
    {
	str_print_output												+= obj_form_output.elements['f_plz'].value+' '+obj_form_output.elements['f_city'].value+'<br />';
	}
  str_print_output													+= obj_form_output.elements['f_contact_country'].options[obj_form_output.elements['f_contact_country'].options.selectedIndex].text+'<br />';

  if(obj_form_output.elements['f_phone'].value != '')
    {
	str_print_output												+= obj_form_output.elements['f_phone'].value+'<br />';
	}
  if(obj_form_output.elements['f_fax'].value != '')
    {
	str_print_output												+= obj_form_output.elements['f_fax'].value+'<br />';
	}
  if(obj_form_output.elements['f_email'].value != '')
    {
	str_print_output												+= obj_form_output.elements['f_email'].value+'<br />';
	}
  str_print_output													+= '</p></td>';
  str_print_output													+= '<td valign="top" width="50%"><p>'+gW('basket_contact_address')+':</p>';
  str_print_output													+= '<p>'+document.getElementById('laender_adresse').innerHTML+'</p>';
  str_print_output													+= '<p>'+gW('notes_your')+':<br />'+obj_form_output.elements['f_notes'].value.replace(/\n/g,'<br />')+'</p>';
  str_print_output													+= '</td>';
  str_print_output													+= '</tr></table>';

  str_print_output													+= '</div>';
  str_print_output													+= '</body></html>';

  d.open();
  d.write(str_print_output);
  d.close();
  }
//------------------------------------------------------------------
// warenkorb speichern
//------------------------------------------------------------------
function ck_basket_save(bool_online_csv_export)
  {
  str_error															= '';
  if(str_medium == 'cdrom' && !bool_online_csv_export)
    {
	// pruefen, ob cookies erlaubt?
    if(!navigator.cookieEnabled)
	  {
	  str_error														= gW('error_cookies_aktivieren');
	  }
	}

  if(str_error == '')
    {
	str_basket_name													= document.forms['form_basket_save'].elements['f_basket_name'].value;
	str_basket_name													= str_basket_name.replace(/[^0-9a-zA-Z\.\-_]/g,'_');
	while(str_basket_name.indexOf('__') >= 0)
	  {
	  str_basket_name												= str_basket_name.replace(/__/g,'_');
	  }
	if(str_basket_name.substring(0,1) == '_')
	  {
	  str_basket_name												= str_basket_name.substring(1,str_basket_name.length);
	  }
	if(str_basket_name.substring(str_basket_name.length-1,str_basket_name.length) == '_')
	  {
	  str_basket_name												= str_basket_name.substring(0,str_basket_name.length-1);
	  }

	// name da?
	if(str_basket_name == '')
	  {
	  document.getElementById('basket_save_error').className		= 'error';
	  document.getElementById('basket_save_error').innerHTML		= gW('error_basket_save_no_name');
	  document.forms['form_basket_save'].elements['f_basket_name'].className	= 'pflichtfeld';
	  document.forms['form_basket_save'].elements['f_basket_name'].focus();
	  }
	else
	  {
	  document.getElementById('basket_save_error').className		= '';
	  document.forms['form_basket_save'].elements['f_basket_name'].className	= '';
	  document.forms['form_basket_save'].elements['f_basket_name'].value		= str_basket_name;

	  // jetzt speichern
	  if(str_medium == 'cdrom' && !bool_online_csv_export)
	    {
		str_cookie_to_save											= gW('cookie_name')+'|'+str_basket_name+'|';
		//warenkorb durchgehen
		str_trenner													= '';
		for(i_m=0;i_m<arr_basket.length;i_m++)
		  {
		  //arr_basket[i_m]['item']									= 'm;i|r=a';
		  str_bezeichnung											= escape(arr_basket[i_m]['besch'].replace(/\|=/g,''));
	  	  str_item													= escape(arr_basket[i_m]['item'].replace(/\|=/g,''));
	  	  str_author												= escape(arr_basket[i_m]['authr'].replace(/\|=/g,''));
	  	  str_details												= escape(arr_basket[i_m]['detal'].replace(/\|=/g,''));
	  	  str_dimension												= escape(arr_basket[i_m]['measu'].replace(/\|=/g,''));
		  str_qty													= arr_basket[i_m]['qty'];
		  str_notes													= escape(arr_basket[i_m]['notes'].replace(/\|=/g,''));
		  str_gb													= escape(arr_basket[i_m]['gb'].replace(/\|=/g,''));
		  str_gn													= escape(arr_basket[i_m]['gn'].replace(/\|=/g,''));
		  str_ge													= escape(arr_basket[i_m]['ge'].replace(/\|=/g,''));
		  str_ap													= escape(arr_basket[i_m]['ap'].join(',').replace(/\|=/g,''));
		  str_mp													= escape(arr_basket[i_m]['mp'].join(',').replace(/\|=/g,''));
		  str_ld													= escape(arr_basket[i_m]['ld'].join(',').replace(/\|=/g,''));

		  str_cookie_to_save										+= str_trenner+'CKI'
		  str_cookie_to_save										+= '='+str_qty;
		  str_cookie_to_save										+= '='+str_item;
		  str_cookie_to_save										+= '='+str_bezeichnung;
		  str_cookie_to_save										+= '='+str_author;
		  str_cookie_to_save										+= '='+str_details;
		  str_cookie_to_save										+= '='+str_dimension;
		  str_cookie_to_save										+= '='+str_notes;
		  str_cookie_to_save										+= '='+str_gb;
		  str_cookie_to_save										+= '='+str_gn;
		  str_cookie_to_save										+= '='+str_ge;
		  str_cookie_to_save										+= '='+str_ap;
		  str_cookie_to_save										+= '='+str_mp;
		  str_cookie_to_save										+= '='+str_ld;
		  str_trenner												= '';
		  }
		str_cookie_to_save											+= '|';
		obj_form													= document.forms['form_interaction'];
		if(obj_form.elements['f_anrede'][0].checked)
		  {
		  str_cookie_to_save										+= escape(obj_form.elements['f_anrede'][0].value);
		  }
		else
		  {
		  str_cookie_to_save										+= escape(obj_form.elements['f_anrede'][1].value);
		  }

		//str_cookie_to_save											+= '='+escape(obj_form.elements['f_titel'].value);
		str_cookie_to_save											+= '=KEINTITEL';
		str_cookie_to_save											+= '='+escape(obj_form.elements['f_firstname'].value);
		str_cookie_to_save											+= '='+escape(obj_form.elements['f_name'].value);
		str_cookie_to_save											+= '='+escape(obj_form.elements['f_company'].value);
		str_cookie_to_save											+= '='+escape(obj_form.elements['f_position'].value);
		str_cookie_to_save											+= '='+escape(obj_form.elements['f_kdnr'].value);
		str_cookie_to_save											+= '='+escape(obj_form.elements['f_street'].value);
		str_cookie_to_save											+= '='+escape(obj_form.elements['f_no'].value);
		str_cookie_to_save											+= '='+escape(obj_form.elements['f_plz'].value);
		str_cookie_to_save											+= '='+escape(obj_form.elements['f_city'].value);
		str_cookie_to_save											+= '='+escape(obj_form.elements['f_phone'].value);
		str_cookie_to_save											+= '='+escape(obj_form.elements['f_fax'].value);
		str_cookie_to_save											+= '='+escape(obj_form.elements['f_email'].value);
		str_cookie_to_save											+= '='+escape(obj_form.elements['f_notes'].value);
		str_cookie_to_save											+= '='+escape(arr_a[obj_form.elements['f_contact_country'].options[obj_form.elements['f_contact_country'].options.selectedIndex].value][3]);
		/*
		if(document.cookie)
		  {
		  str_cookie_to_save										= str_cookie_to_save;
		  }
		*/
		var ablauf													= new Date();
		var infuenfTagen											= ablauf.getTime()+(365*24*60*60*1000*100);
		ablauf.setTime(infuenfTagen);
		document.cookie												= str_cookie_to_save+'; expires='+ablauf.toGMTString(infuenfTagen);
		//document.cookie												= str_cookie_to_save;

		document.getElementById('basket_save_error').innerHTML		= '';
		document.getElementById('basket_cookie_save_msg').innerHTML	= gW('basket_saved_cookie').replace('[NAME]','\''+str_basket_name+'\'').replace('[DD]',ablauf.getDay()).replace('[MM]',ablauf.getMonth()).replace('[YYYY]',ablauf.getYear());
		document.getElementById('basket_cookie_save_msg').style.display	= 'block';
		}
	  else
	    {
		//----------------------------------------------------------
		// http-speichern
		//----------------------------------------------------------
		str_basket_name												= document.forms['form_basket_save'].elements['f_basket_name'].value;
		obj_form													= document.forms['item_form'];
		str_api_url													= gW('api_basket_save');
		for(str_index in arr_contact)
	      {
		  if(str_index != '' && str_index != 'f_anrede' && str_index != 'f_id_wettbewerber')
		    {
		    obj_form.elements[str_index+'_dummy'].value				= arr_contact[str_index];
		    }
		  else if(str_index == 'f_anrede' && document.forms['form_interaction'].elements['f_anrede'][0].checked)
		    {
			obj_form.elements[str_index+'_dummy'].value				= document.forms['form_interaction'].elements['f_anrede'][0].value;
		    }
		  else if(str_index == 'f_anrede')
		    {
			obj_form.elements[str_index+'_dummy'].value				= document.forms['form_interaction'].elements['f_anrede'][1].value;
		    }
		  }
		//obj_form.elements['f_basket_name'].value					= str_window_teil1.replace(/\|/g,'');
		obj_form.elements['f_basket_name'].value					= str_basket_name;
		obj_form.elements['f_ref'].value							= document.location.href;
		obj_form.action												= str_api_url;
		obj_form.submit();

		document.getElementById('basket_save_error').innerHTML		= gW('basket_saved').replace('[NAME]','\''+str_basket_name+'\'');
		}

	  str_window_teil1												= str_basket_name+'|';
	  ck_basket_to_session();
	  }
	}

  if(str_error != '')
    {
	alert(str_error);
	}
  }
function ck_basket_load()
  {
  str_error															= '';
  if(str_medium == 'cdrom')
    {
	// pruefen, ob cookies erlaubt?
    if(!navigator.cookieEnabled)
	  {
	  str_error														= gW('error_cookies_aktivieren');
	  }
	else
	  {
	  arr_cookie_dummy												= document.cookie.split(';');
	  arr_cookie_basket												= new Array();
	  i_cookie_basket												= 0;
	  str_output													= '<table border="0" cellspacing="0" cellpadding="0">';

	  for(i=0;i<arr_cookie_dummy.length;i++)
	    {
		if(arr_cookie_dummy[i].indexOf(gW('cookie_name')+'|') >= 0)
		  {
		  arr_cookie_basket[i_cookie_basket]						= arr_cookie_dummy[i].split('|');
		  str_output												+= '<tr><td class="ck_table_data ck_cookie_basket_th_no">'+(i_cookie_basket+1)+'</td><td class="ck_table_data ck_cookie_basket_th_bez"><a href="javascript:void(ck_basket_cookie_import('+i_cookie_basket+'))">'+arr_cookie_basket[i_cookie_basket][1]+'</a></td></tr>';
		  i_cookie_basket++;
		  }
		}
	  str_output													+= '</table>';

	  if(arr_cookie_basket.length == 0)
	    {
		// keine vorhanden
		str_error													= gW('error_cookies_basket_no');
		}
	  else
	    {
		// vorhandene anzeigen
		ck_show_cookie_basket_container(str_output);
		}
	  }
	}
  else
    {
	ck_show_import_basket_container();
	}

  if(str_error != '')
    {
	alert(str_error);
	}
  }
function ck_basket_cookie_import(i_cb)
  {
  ck_basket_empty();
  str_window_teil1													= arr_cookie_basket[i_cb][1]+'|';
  arr_cookie_basket_dummy											= arr_cookie_basket[i_cb][2].split('CKI');
  // erstes element ueberspringen
  i_basket															= 0;
  for(i=1;i<arr_cookie_basket_dummy.length;i++)
    {
	str_zeile														= arr_cookie_basket_dummy[i].split('=');

	// add to basket
	arr_basket[i_basket]											= new Array();
	arr_basket[i_basket]['qty']										= parseInt(str_zeile[1]);
	arr_basket[i_basket]['item']									= unescape(str_zeile[2]);
	//arr_basket[i_basket]['name']									= unescape(str_zeile[3]);
	arr_basket[i_basket]['besch']									= unescape(str_zeile[3]);
	arr_basket[i_basket]['detal']									= unescape(str_zeile[5]);
	arr_basket[i_basket]['authr']									= unescape(str_zeile[4]);
	arr_basket[i_basket]['measu']									= unescape(str_zeile[6]);
	arr_basket[i_basket]['mp']										= '';
	arr_basket[i_basket]['ap']										= '';
	arr_basket[i_basket]['ld']										= '';
	arr_basket[i_basket]['link']									= '';
	arr_basket[i_basket]['notes']									= unescape(str_zeile[7]);
	arr_basket[i_basket]['gb']										= unescape(str_zeile[8]);
	arr_basket[i_basket]['gn']										= unescape(str_zeile[9]);
	arr_basket[i_basket]['ge']										= unescape(str_zeile[10]);
	arr_basket[i_basket]['ap']										= unescape(str_zeile[11]).replace(/ /g,'').split(',');
	arr_basket[i_basket]['mp']										= unescape(str_zeile[12]).replace(/ /g,'').split(',');
	arr_basket[i_basket]['ld']										= unescape(str_zeile[13]).replace(/ /g,'').split(',');
	i_basket++;
	}

  document.forms['form_basket_save'].elements['f_basket_name'].value	= arr_cookie_basket[i_cb][1];

  obj_form															= document.forms['form_interaction'];
  str_zeile															= arr_cookie_basket[i_cb][3].split('=')

  if(obj_form.elements['f_anrede'][0].value == str_zeile[0])
	{
	obj_form.elements['f_anrede'][0].checked						= true;
	}
  else
	{
	obj_form.elements['f_anrede'][1].checked						= true;
	}

  //obj_form.elements['f_titel'].value								= unescape(str_zeile[1]);
  obj_form.elements['f_firstname'].value							= unescape(str_zeile[2]);
  obj_form.elements['f_name'].value									= unescape(str_zeile[3]);
  obj_form.elements['f_company'].value								= unescape(str_zeile[4]);
  obj_form.elements['f_position'].value								= unescape(str_zeile[5]);
  obj_form.elements['f_kdnr'].value									= unescape(str_zeile[6]);
  obj_form.elements['f_street'].value								= unescape(str_zeile[7]);
  obj_form.elements['f_no'].value									= unescape(str_zeile[8]);
  obj_form.elements['f_plz'].value									= unescape(str_zeile[9]);
  obj_form.elements['f_city'].value									= unescape(str_zeile[10]);
  obj_form.elements['f_phone'].value								= unescape(str_zeile[11]);
  obj_form.elements['f_fax'].value									= unescape(str_zeile[12]);
  obj_form.elements['f_email'].value								= unescape(str_zeile[13]);
  obj_form.elements['f_notes'].value								= unescape(str_zeile[14]).replace(/<br>/g,'\n');

  arr_contact['f_anrede']											= unescape(str_zeile[0]);
  //arr_contact['f_titel']											= unescape(str_zeile[1]);
  arr_contact['f_firstname']										= unescape(str_zeile[2]);
  arr_contact['f_name']												= unescape(str_zeile[3]);
  arr_contact['f_company']											= unescape(str_zeile[4]);
  arr_contact['f_position']											= unescape(str_zeile[5]);
  arr_contact['f_kdnr']												= unescape(str_zeile[6]);
  arr_contact['f_street']											= unescape(str_zeile[7]);
  arr_contact['f_no']												= unescape(str_zeile[8]);
  arr_contact['f_plz']												= unescape(str_zeile[9]);
  arr_contact['f_city']												= unescape(str_zeile[10]);
  arr_contact['f_phone']											= unescape(str_zeile[11]);
  arr_contact['f_fax']												= unescape(str_zeile[12]);
  arr_contact['f_email']											= unescape(str_zeile[13]);
  arr_contact['f_notes']											= unescape(str_zeile[14]).replace(/<br>/g,'\n');

  for(i=0;i<arr_a.length;i++)
    {
	if(arr_a[i][3] == unescape(str_zeile[15]))
	  {
	  obj_form.elements['f_contact_country'].options.selectedIndex	= i;
	  arr_contact['f_contact_country']								= arr_a[i][3];
	  i																= arr_a.length+1;
	  }
	}

  ck_basket_to_session();
  init_basket_view();
  ck_hide_cookie_basket_container();
  }
//------------------------------------------------------------------
// import csv
//------------------------------------------------------------------
function ck_import_basket()
  {
  obj_form															= document.forms['import_form'];
  str_file															= obj_form.elements['f_import_file'].value;
  str_error															= '';

  if(str_file.replace(/ /g,'') == '')
    {
	str_error														= gW('error_import_no_file');
	}
  else if(str_file.substring(str_file.length-4,str_file.length) != '.csv')
    {
	str_error														= gW('error_import_no_csv');
	}

  if(str_error == '')
    {
	ck_hide_import_basket_container();
	ck_show_ladevorgang(gW('import_daten_werden_importiert'));
	document.getElementById('ck_import_basket_container_error').style.display	= 'none';
	obj_form.elements['f_ref'].value								= document.location.href;
	obj_form.action													= gW('api_basket_import');
	obj_form.submit();
	}
  else
    {
	document.getElementById('ck_import_basket_container_error').style.display	= 'block';
	document.getElementById('ck_import_basket_container_error').innerHTML	= str_error;
	}
  }
function ck_import_import(str_import)
  {
  ck_iframe.document.location.href									= 'about:blank';
  arr_import														= str_import.split('\n');

  if(arr_import.length == 3)
    {
	str_window_teil1												= arr_import[0]+'|';
	document.forms['form_basket_save'].elements['f_basket_name'].value	= arr_import[0];

	arr_basket_dummy												= arr_import[1].split('|');
	arr_basket														= new Array();
	i_basket														= 0;

	// items
	for(i=0;i<arr_basket_dummy.length;i++)
	  {
	  str_zeile														= arr_basket_dummy[i].split('=');
	  arr_basket[i_basket]											= new Array();
	  arr_basket[i_basket]['qty']									= parseInt(str_zeile[5]);
	  arr_basket[i_basket]['item']									= unescape(str_zeile[0]);
	  arr_basket[i_basket]['besch']									= unescape(str_zeile[2]);
	  arr_basket[i_basket]['detal']									= unescape(str_zeile[4]);
	  arr_basket[i_basket]['authr']									= unescape(str_zeile[1]);
	  arr_basket[i_basket]['measu']									= unescape(str_zeile[3]);
	  arr_basket[i_basket]['ap']									= unescape(str_zeile[10]).replace(/ /g,'').split(',');
	  arr_basket[i_basket]['mp']									= unescape(str_zeile[11]).replace(/ /g,'').split(',');
	  arr_basket[i_basket]['ld']									= unescape(str_zeile[12]).replace(/ /g,'').split(',');
	  arr_basket[i_basket]['link']									= '';
	  arr_basket[i_basket]['notes']									= unescape(str_zeile[6]);
	  arr_basket[i_basket]['gb']									= unescape(str_zeile[7]);
	  arr_basket[i_basket]['gn']									= unescape(str_zeile[8]);
	  arr_basket[i_basket]['ge']									= unescape(str_zeile[9]);
	  i_basket++;
	  }

	// ck_set_c_data
	arr_contact														= new Array();
	arr_contact_import												= arr_import[2].split('|');
	obj_form														= document.forms['form_interaction'];

	for(i=0;i<arr_contact_import.length;i++)
	  {
	  str_zeile														= arr_contact_import[i].split('=');
	  if(str_zeile[0] == 'f_anrede')
	    {
		if(obj_form.elements['f_anrede'][0].value == str_zeile[1])
		  {
		  obj_form.elements['f_anrede'][0].checked					= true;
		  }
		else
		  {
		  obj_form.elements['f_anrede'][1].checked					= true;
		  }
		}
	  else if(str_zeile[0] == 'f_contact_country')
	    {
		i_contact_country											= 0;
		for(b=0;b<arr_a.length;b++)
    	  {
		  if(str_zeile[1] == arr_a[b][3])
		    {
			i_contact_country										= b;
			country_changed(b);
			b														= arr_a.length+1;
			}
		  }

		obj_form.elements[str_zeile[0]].options.selectedIndex		= i_contact_country;
		}
	  else if(arr_contact_import[i] != '')
	    {
		obj_form.elements[str_zeile[0]].value						= unescape(str_zeile[1]).replace(/\<br \/>/g,'\n');
		}
	  arr_contact[str_zeile[0]]										= str_zeile[1].replace(/\<br \/>/g,'\n');
	  }

    ck_basket_to_session();
    init_basket_view();
    ck_hide_ladevorgang();
	}
  else
    {
	//ck_show_import_basket_container();
	alert(gW(str_import));
	ck_hide_ladevorgang();
	}
  }
//------------------------------------------------------------------
// send
//------------------------------------------------------------------
function ck_basket_send(bool_online_send)
  {
  obj_form															= document.forms[merke_form];
  anz_error															= 0;

  // pflichtfelder
  arr_pflicht														= new Array('f_firstname','f_name','f_company','f_street','f_plz','f_city','f_email');
  for(i=0;i<arr_pflicht.length;i++)
    {
	obj_feld														= obj_form.elements[arr_pflicht[i]];
	if(obj_feld.value == '')
	  {
	  obj_feld.className											= obj_feld.className+' pflichtfeld';
	  anz_error++;
	  }
	else
	  {
	  obj_feld.className											= obj_feld.className.replace(' pflichtfeld','');
	  }
	}

  if(anz_error == 0 && obj_form.elements['f_contact_country'].selectedIndex > 0)
    {
	obj_form														= document.forms['form_item'];
    document.getElementById('warenkorb_error').style.display		= 'none';
	if(str_medium == 'cdrom' && !bool_online_send)
      {
	  //------------------------------------------------------------
	  // cdrom
	  //------------------------------------------------------------
	  obj_form														= document.forms['form_interaction'];
	  str_basket													= '';

	  for(i_m=0;i_m<arr_basket.length;i_m++)
        {
	    str_bezeichnung												= arr_basket[i_m]['besch'];
	    str_item													= arr_basket[i_m]['item'];
	    str_author													= arr_basket[i_m]['authr'];
	    str_details													= arr_basket[i_m]['detal'];
	    str_dimension												= arr_basket[i_m]['measu'];
	    str_qty														= arr_basket[i_m]['qty'];
	    str_notes													= arr_basket[i_m]['notes'];
	    str_gb														= arr_basket[i_m]['gb'];
	    str_gn														= arr_basket[i_m]['gn'];
	    str_ge														= arr_basket[i_m]['ge'];
	    str_ap														= arr_basket[i_m]['ap'];
	    str_mp														= arr_basket[i_m]['mp'];
	    str_ld														= arr_basket[i_m]['ld'];

		str_basket													+= str_qty+'x '+str_item+' - '+str_bezeichnung+'\n';
		}

	  i_country														= obj_form.elements['f_contact_country'].selectedIndex;
	  str_action													= arr_a[i_country][2];
	  i_hochkomma													= str_action.indexOf('%27');
	  str_action													= str_action.substring(i_hochkomma+3,str_action.length-i_hochkomma-3);
	  i_hochkomma													= str_action.indexOf('%27');
	  str_action													= str_action.substring(0,i_hochkomma);
	  str_body														= str_basket+'\n'+get_ajax_post_string(obj_form,'f_contact_country','\n','\n\n');
	  //obj_form.action												= unescape(str_action)+'&subject='+escape(gW('mail_betreff_kontakt'))+'&body='+escape(str_body);
	  obj_form.method												= 'GET';
	  //obj_form.action												= 'mailto:imap@k4server.de&subject='+escape(gW('mail_betreff_kontakt'))+'&body='+escape(str_body);

	  obj_hmm														= document.getElementById('ck_send_via_cdrom');
	  obj_hmm.innerHTML												= '<form method="GET" name="form_via_cdrom" action="'+unescape(str_action)+'"><input type="hidden" name="subject" value="'+unescape(gW('mail_betreff_kontakt'))+'" /><input type="hidden" name="body" value="'+unescape(str_body).replace(/<br>/g,'\n')+'" /></form>';
	  obj_form														= document.forms['form_via_cdrom'];
	  }
	else
	  {
	  //------------------------------------------------------------
	  // httpd
	  //------------------------------------------------------------
	  obj_form														= document.forms['item_form'];
	  ck_show_ladevorgang(gW('anfrage_wird_versendet'));
	  obj_form.method												= 'POST';
	  obj_form.target												= 'ck_iframe';
	  obj_form.action												= gW('api_order')+'?l='+arr_contact['f_contact_country'];

	  obj_form.elements['f_basket_name'].value						= str_window_teil1.replace(/\|/g,'');
	  obj_form.elements['f_ref'].value								= document.location.href;

	  for(str_index in arr_contact)
        {
	    if(str_index != '' && str_index != 'f_anrede')
	      {
	      obj_form.elements[str_index+'_dummy'].value				= arr_contact[str_index];
	      }
	  	else if(str_index == 'f_anrede' && document.forms['form_interaction'].elements['f_anrede'][0].checked)
	      {
		  obj_form.elements[str_index+'_dummy'].value				= document.forms['form_interaction'].elements['f_anrede'][0].value;
	      }
	  	else if(str_index == 'f_anrede')
	      {
		  obj_form.elements[str_index+'_dummy'].value				= document.forms['form_interaction'].elements['f_anrede'][1].value;
	      }
	    }


	  document.getElementById('ck_iframe').style.display			= 'block';
	  document.getElementById('ck_captcha').style.display			= 'block';
	  ck_container_mittig('ck_captcha',1);
	  ck_hide_ladevorgang();
	  ck_show_schleier();
	  }
	obj_form.submit();
	}
  else
    {
	document.getElementById('warenkorb_error').style.display		= 'block';
	}
  }
function ck_basket_send_response()
  {
  ck_iframe.name													= 'ck_iframe';
  ck_iframe.location.href											= 'about:blank';
  alert(gW('anfrage_erfolgreich_versendet'));
  ck_hide_ladevorgang();
  }
function ck_basket_send_cancel()
  {
  document.getElementById('ck_captcha').innerHTML					= '<iframe src="about:blank" id="ck_iframe" name="ck_iframe" class="versteckt" marginwidth="0" marginheight="0" frameborder="0" scrolling="no"></iframe><div class="button"><a href="javascript:ck_basket_send_cancel()" class="close">'+gW("fenster_schliessen")+'</a></div>';
  ck_hide_schleier();
  document.getElementById('ck_iframe').style.display				= 'none';
  document.getElementById('ck_captcha').style.display				= 'none';
  }


//------------------------------------------------------------------
// wettbewerber
//------------------------------------------------------------------
function ck_set_competitor(str_competitor)
  {
  str_competitor													= str_competitor.replace('US','');
  wettbewerber_id													= str_competitor;

  /*
  if(str_competitor == '')
    {
	// zuruecksetzen
    document.getElementById('suche_cp_no').style.display			= 'none';
	document.getElementById('suche_cpitem').style.display			= 'inline';
    document.getElementById('suche_cpitem_btn').style.display		= 'inline';
	ck_hide_ladevorgang();
	}
  else
    {
	document.getElementById('suche_cpitem').style.display			= 'none';
    document.getElementById('suche_cpitem_btn').style.display		= 'none';
	setTimeout('ck_iframe_comp.document.location.href = \'../ini/comp/c'+str_competitor.replace('US','')+'.html\'',100);
	}
  */
  ck_show_ladevorgang(gW('daten_werden_geladen'));

  if(str_competitor == '')
    {
	document.getElementById('suche_cpitem').style.display			= 'inline';
    document.getElementById('suche_cpitem_btn').style.display		= 'inline';
	document.getElementById('ck_iframe_comp').style.display			= 'none';
	document.forms['cp_form'].elements['cpn'].value					= '';
	ck_hide_ladevorgang();
	}
  else
    {
	document.getElementById('suche_cpitem').style.display			= 'none';
    document.getElementById('suche_cpitem_btn').style.display		= 'none';
	ck_iframe_comp.location.href									= '../ini/comp/cp'+str_competitor.replace('US','')+'.html';
	document.forms['cp_form'].elements['cpn'].value					= str_competitor;
	document.getElementById('ck_iframe_comp').style.display	= 'block';
	}

  fill_form_dummy();
  ck_set_c_data('f_id_wettbewerber',str_competitor);
  }
function ck_competitor_loaded(ss_arr_w)
  {
  obj_select														= document.forms['cp_form'].elements['cp_no'];
  document.getElementById('suche_cp_no').style.display				= 'block';
  for(i=0;i<ss_arr_w.length;i++)
    {
	//obj_option														= new Option(to_upper_case(ss_arr_w[i][0],i));
	obj_option														= new Option(unescape(ss_arr_w[i][0]));
	obj_select.options[i+1]											= obj_option;
	//obj_select.options[i+1].value									= to_upper_case(ss_arr_w[i][1],i);
	obj_select.options[i+1].value									= unescape(ss_arr_w[i][1]);
	}
  obj_select.options.length											= (ss_arr_w.length+1);
  ck_hide_ladevorgang();
  }
function ck_set_competitor_no(str_item)
  {
  //str_item															= unescape(str_item).replace('\'+\'','');
  document.forms['cp_form'].elements['cp'].value					= str_item;
  document.forms['cp_form'].submit();
  /*
  if(str_item != '')
    {
    document.location.href											='../search.html?kw='+str_item;
    }
  */
  }
function init_wettbewerber()
  {
  if(bool_wettbewerber)
    {
	if(window.name.indexOf('f_id_wettbewerber') >= 0)
	  {
	  dummy1														= window.name.substring(window.name.indexOf('f_id_wettbewerber'),window.name.length);
	  dummy2														= dummy1.substring(0,dummy1.indexOf('|'));
	  str_wettbewerber												= dummy2.replace('f_id_wettbewerber=','');
	  wettbewerber_found											= false;

	  if(str_wettbewerber != '' && str_wettbewerber != '0')
	    {
		obj_select													= document.forms['form_dummy_cp'].elements['suche_cp'];
		for(i=0;i<obj_select.options.length;i++)
		  {
		  if(obj_select.options[i].value == str_wettbewerber && !wettbewerber_found)
		    {
			obj_select.options[i].selected							= true;
			document.getElementById('suche_cpitem').style.display	= 'none';
			document.getElementById('suche_cpitem_btn').style.display	= 'none';
			document.getElementById('ck_iframe_comp').style.display	= 'block';
			ck_iframe_comp.location.href							= '../ini/comp/cp'+str_wettbewerber+'.html';
			wettbewerber_found										= true;
			}
		  }
		}
	  }
	}
  }

function cp_select_geladen()
  {
  if(wettbewerber_id != '')
    {
	// aktuellen wettbewerber auswaehlen
	for(w=0;w<document.forms['form_dummy_cp'].elements['suche_cp'].options.length;w++)
	  {
	  if(document.forms['form_dummy_cp'].elements['suche_cp'].options[w].value.replace(/[^0-9]/g,'') == wettbewerber_id)
	    {
		document.forms['form_dummy_cp'].elements['suche_cp'].options[w].selected	= true;
		break;
		}
	  }
	}

  if(wettbewerber_mat_nr != '')
    {
	ck_iframe_comp.set_item(wettbewerber_mat_nr);
	}
  ck_hide_ladevorgang();
  }


function ist_wettbewerber_treffer(artnr)
  {
  return true;
  }


/* jquery
------------------------------------------------------------------*/

$(function()
  {
  });


function chirkat_pricing_init()
  {
  /* pricing
  ----------------------------------------------------------------*/
  if($('body').attr('id') == 'shopping_basket')
    {
	chirkat_pricing_logged_in('');
	}
  }


function chirkat_pricing_logged_in(str)
  {
  $.get('../api.php','cont=logged_or_not'+str,function(data)
	{
	arr_data														= data.split('|');
	$('#chirkat_login_container').html(arr_data[1]);
	$('#chirkat_login_container').show();

	if(arr_data[0] == '1')
	  {
	  // eingeloggt
	  $('body').removeClass('chirkat-pricing-not-logged');
	  $('body').addClass('chirkat-pricing-logged');
	  $('#chirkat_login_container_address').show();
  	  $('#chirkat_login_container_login').hide();
	  chirkat_pricing_get_customer_data();
	  chirkat_pricing_get_prices();
	  }
	else
	  {
	  // nicht eingeloggt
	  $('body').removeClass('chirkat-pricing-logged');
	  $('body').removeClass('chirkat-pricing-not-logged');
	  $('body').addClass('chirkat-pricing-not-logged');

	  if(str != '')
	    {
		for(str_index in arr_api_customer_data)
	  	  {
		  $('#f_'+str_index).val('');
	  	  }
		$('#f_contact_country').val('0');
		$('#f_contact_state').val('bitte_waehlen');
		}
	  }
	});

  }


function chirkat_pricing_show_login()
  {
  $('#chirkat_login_container_address').toggle();
  $('#chirkat_login_container_login').toggle();
  $('#warenkorb_error_login').hide();
  }

function chirkat_pricing_login()
  {
  $('#warenkorb_error').hide();
  $('#warenkorb_error_login').hide();
  $.post('../api.php',$('#form_login').serialize(),function(data)
    {
	arr_data														= data.split('|');

	if(arr_data[0] == '1')
	  {
	  chirkat_pricing_logged_in('');
	  }
	else
	  {
	  $('#warenkorb_error_login').html(arr_data[1]);
	  $('#warenkorb_error_login').show();
	  }
	});

  return false;
  }


function chirkat_pricing_get_customer_data()
  {
  $.getScript('../api.php?cont=get_data',function()
    {
	obj_form														= document.forms['form_interaction'];
    for(str_index in arr_api_customer_data)
	  {
	  str_index
	  if($('#f_'+str_index).val() == '' || $('#f_'+str_index).val() == '0' || $('#f_'+str_index).val() == 'bitte_waehlen')
	    {
		if(str_index == 'anrede')
		  {
		  $('#f_anrede_'+arr_api_customer_data[str_index].toLowerCase()).attr('checked','checked');
		  }
		else
		  {
		  $('#f_'+str_index).val(arr_api_customer_data[str_index]);
		  }
		}
	  }
	});
  }


function chirkat_pricing_get_prices()
  {
  arr_api_items														= new Array();
  str																= '';
  trenner															= '';
  for(i=0;i<$('#produkt_table_body .ck_item').length;i++)
    {
	i_m																= $('#produkt_table_body .ck_item:eq('+i+')').attr('rel');
	arr_api_items[i]												= [i_m,$('#produkt_table_body .ck_item:eq('+i+') a').html(),0];
	str																+= trenner+'chirkat_item[]='+$('#produkt_table_body .ck_item:eq('+i+') a').html();
	trenner															= '&';
	str																+= trenner+'chirkat_item_menge[]='+$('#f_qty_'+i_m).val();
	}

  $.post('../api.php?cont=get_prices',str,function(data)
    {
	arr_data														= data.split('|');

	if(arr_data[0] == '1')
	  {
	  for(i=1;i<arr_data.length;i++)
	    {
		$('.ck_price_'+(i-1)).html(arr_data[i]+' $&nbsp;&nbsp;');
		}
	  }
	});
  }


function ck_show_bild_hover(pfad)
  {
  }


function cx_hide_bild_hover()
  {
  //$('#img_hover').hide();
  }

function ck_hover_img(str_div)
  {
  $(str_div+' td[rel][rel!=\'\']').mousemove(function(e,obj)
	{
    $('#img_hover').html('<img src="'+$(this).attr('rel').replace('/common/','/common/originals/')+'" border="0" />');
    $('#img_hover').show();
	$('#img_hover').css('left',(e.pageX+10)+'px');
	$('#img_hover').css('top',(e.pageY+10)+'px');
	});

  $(str_div+' td[rel][rel!=\'\']').mouseout(function(e,obj)
	{
	$('#img_hover').hide();
	});
  //
  }



function getQuerystring(key, default_)
{
  if (default_==null) default_="";
  key = key.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regex = new RegExp("[\\?&]"+key+"=([^&#]*)");
  var qs = regex.exec(window.location.href);
  if(qs == null)
    return default_;
  else
    return qs[1];
}

function zeige_artikel_aus_querverweis(artnr)
  {
  arr_url                                                           = str_url.split('?');
  str_url_ref                                                       = arr_url[0].replace('search','');
  str_link                                                          = str_url_ref+'products.html';
  
  if(arr_treffer[0]['link'] != '')
	{
	arr_dummy                                                       = arr_treffer[0]['link'].split(';');
	anker_parent_iframe_ignore                                      = 1;
	document.getElementById('ck_iframe').src						= str_url_ref+'hash/'+arr_dummy[0]+'.html';
	}

  //window.open(str_link+'?item='+arr_treffer[0]['link']);
  }


function zeige_artikel_aus_querverweis_von_iframe()
  {
  str_parent_parent                                                 = ck_iframe.str_parent_parent;
  id_parent_parent                                                  = 0;
  i_parent                                                          = 0;

  // suchen
  for(i=0;i<arr_p.length;i++)
	{
	str_vergleich                                                   = arr_p[i]['bez'];

	if(str_vergleich == html_entities2(str_parent_parent,1))
	  {
	  id_parent_parent                                              = arr_p[i]['id'];
	  i_parent                                                      = i;
	  }
	}

  anker_parent_iframe_ignore                                      	= 0;

  if(id_parent_parent)
	{
	document.location.href                                          = '../products.html?item=hash_'+id_parent_parent+';hash;wg2;'+i_parent+';0';
	}
  }
