function Cookie_ueberpruefen() {
    document.cookie='TEST=[DAS|IST|NUR|EIN|TEST]';
    index = document.cookie.indexOf('TEST');
	//alert(index);
    if (index < 0)  { // Cookies nicht erlaubt
			//alert('ohne Cookies');
			return 0;
    }
	//alert('mit Cookies');
	return 1;
}

function SendenSuche(was) {

if (document.forms[was].suche.value.length < 3) {
		alert('Bitte mindestens 3 Buchstaben angeben.');
		document.forms[was].suche.select();
		return false;
}
//alert(document.forms[was].suche.value);
//document.forms[was].suche.value = document.forms[was].suche.value.replace(/(.*)(')(.*)/, \"$1xrsquo;$3\");
//alert(document.forms[was].suche.value);


if (!Cookie_ueberpruefen()) {	// ohne Cookies
		document.forms[was].submit();
}
else {							// mit Cookies
		// mit Cookies übergeben, wird die Returntaste verwendet, so geht es automatisch mit submit ohne cookies
		Verfall = 2000; // 2 sec in ms
		jetzt = new Date();
		auszeit = new Date(jetzt.getTime() + Verfall);
		document.cookie='suche='+ document.forms[was].suche.value + '; expires=' + auszeit.toGMTString() + '; path=/'; 


		//document.location.href = 'suche1.php?suche='+document.forms[was].suche.value+'".$tmp_rtyp."';";
		//document.location.href = 'suche.html?kat1_id=11&kat2_id=1212".$tmp_rtyp."&suche='+document.forms[was].suche.value;";
		
		//document.location.href = 'suche1.php?suche='+document.forms[was].suche.value;
		
		
		// echo "Suche im gesamten Webkatalog nach: <a class=ref_link2 href=\"suche-".$teil."-st0se1to0.html\"  TITLE=\"".$teil."\">".$teil."</a><br>";
		document.location.href = 'suche-'+document.forms[was].suche.value + '-st0se1to0.html';
}
}

