var propList = new Array();
propList[0] = "damp";

var valList = new Array();
valList[0] = "Dampfgarer";



function DH_setCookie(n,w) {
	document.cookie = n+"="+w+";";
}

function DH_getCookieByName(n) {
	a = document.cookie;
	res = '';	while(a != '') {
		pos1 = a.search('=');
		cookiename = a.substring(0,a.search('='));
		if (cookiename.substring(0,1) == " ") {
			cookiename = cookiename.substring(1,cookiename.length);
		}

		if (a.search(';')>pos1+1) {
			pos2 = a.search(';');
		} else {
			pos2 = a.length;
		}
		cookiewert = a.substring(pos1+1,pos2);
//		cookiewert = a.substring(a.search('=')+1,a.length);
		if(cookiewert == '') {
			cookiewert = a.substring(a.search('=')+1,a.length);
		}
// alert(n+"\n"+cookiename);
		if(n == cookiename){
			res = cookiewert;
		}
		i = a.search(';')+1;
		if(i == 0) {
			i = a.length
		}
		a = a.substring(i,a.length);
 	} 	return(res);
}

function DH_SetProductsHeader(n) {
// 's.hier1' SPLITTEN

}

function DH_SetSearchHeader() {	var what = getGETParameter('q');
	what = what.toLowerCase();
	for(var i = 0; i<propList.length; i++) {
		if (what.indexOf(propList[i])>-1) {
			DH_setCookie('DHCheck',valList[i]+";");
			DH_displayStage(DH_getCookieByName('DHCheck'));
			break;
		}
	}
}

function DH_displayStage(name) {
	headerContent = "";	switch (name) {
		case 'Dampfgarer':
			headerContent = '<embed name="header_swf" pluginspage="http://www.macromedia.com/go/getflashplayer" src="http://www.neff.de/Files/Neff/De/de/AdditionalFiles/Buehnen_Animationen/teaser_dampfgaren.swf" width="763" height="205" type="application/x-shockwave-flash" allowScriptAccess="sameDomain" bgcolor="#ffffff" quality="high" />';
		break;
	}
	if (headerContent != "") {
		document.getElementById('stageHeader').innerHTML = headerContent;
	}
}



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

