browser= navigator.userAgent + '_' + navigator.appName + ', ' + navigator.appVersion + ':'  + navigator.platform + '_' + navigator.language;

function sColor(clr) {
color = clr;
setUrl();
}

function uColor() {
color = '';
setUrl();
}

function atg(ntN) {
	tag.push(ntN.firstChild.nodeValue);
	setUrl();
}

function rtg(otN) {
	ot = otN.firstChild.nodeValue;

 ttag = new Array();
 c =0;
 while(tag[c]) {
	if (tag[c] != ot) ttag.push(tag[c]);
	c++;
 }
 tag = ttag;
 setUrl();
}

function abrd(ntN) {
	brand.push(ntN.firstChild.nodeValue);
	setUrl();
}

function rbrd(otN) {
 ot = otN.firstChild.nodeValue;
 ttag = new Array();
 c =0;
 while(brand[c]) {
	if (brand[c] != ot) ttag.push(brand[c]);
	c++;
 }
 brand = ttag;
 setUrl();
}

function setUrl() {
 ziel= "";
 if (tag.length > 0) ziel += "?tag=" + tag.join(" @ ");
 if (brand.length > 0) {
	if (ziel == "") ziel +="?brand="  + brand.join(" @ ");
	else ziel +="&brand="  + brand.join(" @ ");
 }
 if (color && color.length > 0) {
	if (ziel == "") ziel +="?clr="  + color;
	else ziel +="&clr="  + color;
 }
 if (ziel == "") ziel = window.location.pathname;
 window.location.href= ziel;
}

function layout() {
	adAktionen();

 c=0;
 div = document.getElementsByTagName("div");
 hit =0;
 while(div[c]) {
	if (div[c].className== "d") {
		an = document.createElement("a");
		an.href="/produkte/co?d=" + d	+ "&l=" + trgt[hit++] + "&b=" + browser;
		an.title="...direkt zum Angebot!";
		an.target="_blank";
		an.className = "co";
		t1 = div[c].removeChild(div[c].firstChild);
		an.appendChild(t1);
		div[c].appendChild(an);
		spl = document.createElement("span");
		spl.appendChild(document.createTextNode("...zum Angebot >>"));
		spl.className = "ttop";
		an.appendChild(spl);
	}
	c++;
 }
 
 c=0;
 div = document.getElementsByTagName("span");
 while(div[c]) {
	if (div[c].className =="atg") {
		div[c].title = "nach Schlagwort suchen";
		div[c].setAttribute("onclick", "atg(this)");
	} else if (div[c].className =="rtg") {
		div[c].title = "Schlagwort entfernen";
		div[c].setAttribute("onclick", "rtg(this)");
	} else if (div[c].className =="abrd") {
		div[c].title = "nach Marke suchen";
		div[c].setAttribute("onclick", "abrd(this)");
	} else if (div[c].className =="rbrd") {
		div[c].title = "Marke entfernen";
		div[c].setAttribute("onclick", "rbrd(this)");
	}
	c++;
 }
	

}

function adAktionen() {
	div = document.getElementById("aktionen");
	aktionslink(div, "http://www.zanox-affiliate.de/ppc/?14448607C837124396T", "http://www.zanox-affiliate.de/ppv/?14448607C837124396", "");
	aktionslink(div, "http://www.zanox-affiliate.de/ppc/?14448857C55737470T", "http://www.zanox-affiliate.de/ppv/?14448857C55737470", "");
	aktionslink(div, "http://ad.zanox.com/ppc/?14448868C1151681984T", "http://ad.zanox.com/ppv/?14448868C1151681984", "");
}

function aktionslink(div, target, image, alt) {
	an = document.createElement("a");
	an.href=target;
	an.target="_blank";
	I = document.createElement("img");
	I.src= image;
	I.alt = alt;
	an.appendChild(I);
	div.appendChild(an);
}

function co(doc, time) {
	window.location.href= "/produkte/mode/clickout?doc=" + doc + "&t=" + time;
}
