function suche(id,katid,pfad,select1,select2,select3,val1,val2,val3) { 
	var keywords, Jahr,URL;
	keywords=MyGetParam("keywords");
	Jahr=MyGetParam("Jahr");
	URL="advanced_search_result.php?categories_id="+id+
        "&inc_subcat=1&katid="+katid+
		"&select1_sel="+select1+
		"&select2_sel="+select2+
		"&select3_sel="+select3+
		"&select1="+val1+
		"&select2="+val2+
		"&select3="+val3+
		"&pfad="+pfad;

	window.location.href = URL;
}

function suche2(id,katid,form,pfad) {
	var keywords, Jahr,URL;
	keywords=MyGetParam("kw");
	Jahr=MyGetParam("ja");
	URL="advanced_search_result.php?categories_id="+id+
        "&inc_subcat=1&katid="+katid+"&pfad="+pfad+"&kw="+form.kw.value+"&ja="+form.ja.value;

	window.location.href = URL;
}


// Entertaste abfangen und Suche auslösen.
// Ohne diese Funktion wird das falsche Formular ausgelöst (die Suche nach Hersteller/Typ
// im linken Bereich
function kk(event,id,katid,form,pfad) {
	if(event.keyCode==13) {
		suche2(id,katid,form,pfad);
		return false;
	} 
	return true;
}



function ulin(target) {
	// var tmp;for (var i in target.style) { tmp=tmp+" "+i; }
	// document.debug.willi.value="xx";
	//document.debug.willi.value="("+target.position+")";
	// document.debug.willi.value="("+pos.x+":"+pos.y+")";
	target.style.backgroundColor="#cc071e";
	target.style.color="#ffffff";
}


function setPosition(x, y,obj)
{
  if (document.layers) {
    obj.objstyle.moveTo(x, y);
  } else { // IE and N6
    obj.objstyle.left = x + "px";
    obj.objstyle.top = y + "px";
  }
  obj.x = x;
  obj.y = y;
}


function getPosition(obj) {
  var pos = { x:0, y:0 };

  do {
    pos.x += obj.offsetLeft;
    pos.y += obj.offsetTop;
  } while (obj = obj.offsetParent);

  return pos;
}

function ulout(target) {
	target.style.backgroundColor="#dddddd";
	target.style.color="#000000";
}

function MyGetParam(param) {
	var url = String(window.location);
	if(window.location.search != "") {
		var undef = url.split("?");
		var args = undef[1].split("&");
		for(i = 0; i < args.length; i++) {
			var a = args[i].split("=");
			if(a[0] == param) {
				var ret=a[1].replace(/\+/g," ");
				ret=ret.replace(/%2B/g,"+");
				ret=ret.replace(/%20/g," ");
				return ret;
			}
		}
	}
	return "";
}

