/* archipool */

$(document).ready(function() {
	var stichwort = $('input#stichwort-original').val(); //language dependent default value
	$('input#stichwort').blur( function(){
		if(this.value == "") this.value = stichwort;
	});
	var search = $('input#search-original').val(); //language dependent default value
	$('input#search').blur( function(){
		if(this.value == "") this.value = search;
	});
	var login = $('input#login-original').val(); //language dependent default value
	$('input#login').blur( function(){
		if(this.value == "") this.value = login;
	});
	var password = $('input#password-original').val(); //language dependent default value
	$('input#password').blur( function(){
		if(this.value == "") this.value = password;
	});
	$('input#stichwort').focus( function(){
		if(this.value == stichwort) this.value = "";
	});
	$('input#search').focus( function(){
		if(this.value == search) this.value = "";
	});
	$('input#login').focus( function(){
		if(this.value == login) this.value = "";
	});
	$('input#password').focus( function(){
		if(this.value == password) this.value = "";
	});
	$('#medienpartner a').focus( function(){
		if(this.blur)this.blur();
	});
	$('#werbepartner a').focus( function(){
		if(this.blur)this.blur();
	});
	$('#einfach').click( function(){
		$(this).addClass('red');
		$('#erweitert').removeClass('red');
		$('#erweitert-1').slideUp(550);
		$('#erweitert-2').slideUp(550);
		$('#rubrik-group-2').slideUp(550);
		$('#rubrik-group-3').slideUp(550);
		$('#modus').val("einfach");
		return false;
	});
	$('#erweitert').click( function(){
		$(this).addClass('red');
		$('#einfach').removeClass('red');
		$('#erweitert-1').slideDown(550);
		$('#erweitert-2').slideDown(550);
		$('#modus').val("erweitert");
		if($('#rubrik').val() != "all") {
			$('#rubrik-group-2').slideDown(550);
			if($('#rubrik2').val() != "all") {
				$('#rubrik-group-3').slideDown(550);
			}
		}
		return false;
	});
	$('#rubrik').change( function(){
		if($('#modus').val() == "erweitert") {
			if($('#rubrik').val() == "all") {
				$('#rubrik-group-2').slideUp(400);
				$('#rubrik-group-3').slideUp(400);
			} else {
					$('#rubrik-group-2').slideDown(400);
			}
		} else {
			$('#rubrik2').val("all");
			$('#rubrik3').val("all");
		}
	});
	$('#rubrik2').change( function(){
		if($('#rubrik2').val() == "all") {
			$('#rubrik-group-3').slideUp(400);
		} else {
			if($('#modus').val() == "erweitert") {
				$('#rubrik-group-3').slideDown(400);
			}
		}
	});
});

function drucken() {
	window.print();
}

function submitFeedback() {
	if($("#feedback").val() == "") {
		$("#feedback-error").show();
		return false;
	} else {
		return true;
	}
}

function checksearchbox() {
	if($("#search").val() == $("#search-original").val()) document.getElementById('search').value = "";
}

function submitWarenkorb() {
	var bedingungen = $("input[@name='bedingungen']:checked").val();
	var allFieldsFilled = true;
	$('#warenkorb-form .eingabe').each( function(){
		if(this.value == "" || this.value == $(this).attr('prompt')) {
			allFieldsFilled = false;
			$(this).addClass("eingabe-error");
		} else {
			$(this).removeClass("eingabe-error");
		}
	});
	if(!allFieldsFilled) {
		$("#warenkorb-error-message").html(errorAllFields);
		$("#warenkorb-error").show();
		return false;
	} else if(bedingungen != 1) {
		$("#warenkorb-error-message").html(errorBedingungen);
		$("#warenkorb-error").show();
		return false;
	} else {
		return true;
	}
}

function refreshWarenkorb() {
	//dummy:
	document.location = document.location;
}

/* jquery plugins */

/* Copyright (c) 2007 Paul Bakaus (paul.bakaus@googlemail.com) and Brandon Aaron (brandon.aaron@gmail.com || http://brandonaaron.net)
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 *
 * $LastChangedDate: 2007-12-20 08:43:48 -0600 (Thu, 20 Dec 2007) $
 * $Rev: 4257 $
 *
 * Version: 1.2
 *
 * Requires: jQuery 1.2+
 */
(function($){$.dimensions={version:'1.2'};$.each(['Height','Width'],function(i,name){$.fn['inner'+name]=function(){if(!this[0])return;var torl=name=='Height'?'Top':'Left',borr=name=='Height'?'Bottom':'Right';return this.is(':visible')?this[0]['client'+name]:num(this,name.toLowerCase())+num(this,'padding'+torl)+num(this,'padding'+borr);};$.fn['outer'+name]=function(options){if(!this[0])return;var torl=name=='Height'?'Top':'Left',borr=name=='Height'?'Bottom':'Right';options=$.extend({margin:false},options||{});var val=this.is(':visible')?this[0]['offset'+name]:num(this,name.toLowerCase())+num(this,'border'+torl+'Width')+num(this,'border'+borr+'Width')+num(this,'padding'+torl)+num(this,'padding'+borr);return val+(options.margin?(num(this,'margin'+torl)+num(this,'margin'+borr)):0);};});$.each(['Left','Top'],function(i,name){$.fn['scroll'+name]=function(val){if(!this[0])return;return val!=undefined?this.each(function(){this==window||this==document?window.scrollTo(name=='Left'?val:$(window)['scrollLeft'](),name=='Top'?val:$(window)['scrollTop']()):this['scroll'+name]=val;}):this[0]==window||this[0]==document?self[(name=='Left'?'pageXOffset':'pageYOffset')]||$.boxModel&&document.documentElement['scroll'+name]||document.body['scroll'+name]:this[0]['scroll'+name];};});$.fn.extend({position:function(){var left=0,top=0,elem=this[0],offset,parentOffset,offsetParent,results;if(elem){offsetParent=this.offsetParent();offset=this.offset();parentOffset=offsetParent.offset();offset.top-=num(elem,'marginTop');offset.left-=num(elem,'marginLeft');parentOffset.top+=num(offsetParent,'borderTopWidth');parentOffset.left+=num(offsetParent,'borderLeftWidth');results={top:offset.top-parentOffset.top,left:offset.left-parentOffset.left};}return results;},offsetParent:function(){var offsetParent=this[0].offsetParent;while(offsetParent&&(!/^body|html$/i.test(offsetParent.tagName)&&$.css(offsetParent,'position')=='static'))offsetParent=offsetParent.offsetParent;return $(offsetParent);}});function num(el,prop){return parseInt($.curCSS(el.jquery?el[0]:el,prop,true))||0;};})(jQuery);

/**
* hoverIntent r5 // 2007.03.27 // jQuery 1.1.2+
* <http://cherne.net/brian/resources/jquery.hoverIntent.html>
* 
* @param  f  onMouseOver function || An object with configuration options
* @param  g  onMouseOut function  || Nothing (use configuration options object)
* @author    Brian Cherne <brian@cherne.net>
*/
(function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY;};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))<cfg.sensitivity){$(ob).unbind("mousemove",track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev]);}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev]);};var handleHover=function(e){var p=(e.type=="mouseover"?e.fromElement:e.toElement)||e.relatedTarget;while(p&&p!=this){try{p=p.parentNode;}catch(e){p=this;}}if(p==this){return false;}var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);}if(e.type=="mouseover"){pX=ev.pageX;pY=ev.pageY;$(ob).bind("mousemove",track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}}else{$(ob).unbind("mousemove",track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob);},cfg.timeout);}}};return this.mouseover(handleHover).mouseout(handleHover);};})(jQuery);

/*
 * jQuery clueTip plugin
 * Version 0.9.8  (05/22/2008)
 * @requires jQuery v1.1.4+
 * @requires Dimensions plugin (for jQuery versions < 1.2.5)
 *
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 *
 * Full list of options/settings can be found at the bottom of this file and at http://plugins.learningjquery.com/cluetip/
 */
(function($){var $cluetip,$cluetipInner,$cluetipOuter,$cluetipTitle,$cluetipArrows,$dropShadow,imgCount;$.fn.cluetip=function(js,options){if(typeof js=="object"){options=js;js=null}return this.each(function(index){var $this=$(this);var opts=$.extend(false,{},$.fn.cluetip.defaults,options||{},$.metadata?$this.metadata():$.meta?$this.data():{});var cluetipContents=false;var cluezIndex=parseInt(opts.cluezIndex,10)-1;var isActive=false,closeOnDelay=0;if(!$("#cluetip").length){$cluetipInner=$('<div id="cluetip-inner"></div>');$cluetipTitle=$('<h3 id="cluetip-title"></h3>');$cluetipOuter=$('<div id="cluetip-outer"></div>').append($cluetipInner).prepend($cluetipTitle);$cluetip=$('<div id="cluetip"></div>').css({zIndex:opts.cluezIndex}).append($cluetipOuter).append('<div id="cluetip-extra"></div>')[insertionType](insertionElement).hide();$('<div id="cluetip-waitimage"></div>').css({position:"absolute",zIndex:cluezIndex-1}).insertBefore("#cluetip").hide();$cluetip.css({position:"absolute",zIndex:cluezIndex});$cluetipOuter.css({position:"relative",zIndex:cluezIndex+1});$cluetipArrows=$('<div id="cluetip-arrows" class="cluetip-arrows"></div>').css({zIndex:cluezIndex+1}).appendTo("#cluetip")}var dropShadowSteps=(opts.dropShadow)?+opts.dropShadowSteps:0;if(!$dropShadow){$dropShadow=$([]);for(var i=0;i<dropShadowSteps;i++){$dropShadow=$dropShadow.add($("<div></div>").css({zIndex:cluezIndex-i-1,opacity:0.1,top:1+i,left:1+i}))}$dropShadow.css({position:"absolute",backgroundColor:"#000"}).prependTo($cluetip)}var tipAttribute=$this.attr(opts.attribute),ctClass=opts.cluetipClass;if(!tipAttribute&&!opts.splitTitle&&!js){return true}if(opts.local&&opts.hideLocal){$(tipAttribute+":first").hide()}var tOffset=parseInt(opts.topOffset,10),lOffset=parseInt(opts.leftOffset,10);var tipHeight,wHeight;var defHeight=isNaN(parseInt(opts.height,10))?"auto":(/\D/g).test(opts.height)?opts.height:opts.height+"px";var sTop,linkTop,posY,tipY,mouseY,baseline;var tipInnerWidth=isNaN(parseInt(opts.width,10))?275:parseInt(opts.width,10);var tipWidth=tipInnerWidth+(parseInt($cluetip.css("paddingLeft"))||0)+(parseInt($cluetip.css("paddingRight"))||0)+dropShadowSteps;var linkWidth=this.offsetWidth;var linkLeft,posX,tipX,mouseX,winWidth;var tipParts;var tipTitle=(opts.attribute!="title")?$this.attr(opts.titleAttribute):"";if(opts.splitTitle){if(tipTitle==undefined){tipTitle=""}tipParts=tipTitle.split(opts.splitTitle);tipTitle=tipParts.shift()}var localContent;var activate=function(event){if(!opts.onActivate($this)){return false}isActive=true;$cluetip.removeClass().css({width:tipInnerWidth});if(tipAttribute==$this.attr("href")){$this.css("cursor",opts.cursor)}$this.attr("title","");if(opts.hoverClass){$this.addClass(opts.hoverClass)}linkTop=posY=$this.offset().top;linkLeft=$this.offset().left;mouseX=event.pageX;mouseY=event.pageY;if($this[0].tagName.toLowerCase()!="area"){sTop=$(document).scrollTop();winWidth=$(window).width()}if(opts.positionBy=="fixed"){posX=linkWidth+linkLeft+lOffset;$cluetip.css({left:posX})}else{posX=(linkWidth>linkLeft&&linkLeft>tipWidth)||linkLeft+linkWidth+tipWidth+lOffset>winWidth?linkLeft-tipWidth-lOffset:linkWidth+linkLeft+lOffset;if($this[0].tagName.toLowerCase()=="area"||opts.positionBy=="mouse"||linkWidth+tipWidth>winWidth){if(mouseX+20+tipWidth>winWidth){$cluetip.addClass(" cluetip-"+ctClass);posX=(mouseX-tipWidth-lOffset)>=0?mouseX-tipWidth-lOffset-parseInt($cluetip.css("marginLeft"),10)+parseInt($cluetipInner.css("marginRight"),10):mouseX-(tipWidth/2)}else{posX=mouseX+lOffset}}var pY=posX<0?event.pageY+tOffset:event.pageY;$cluetip.css({left:(posX>0&&opts.positionBy!="bottomTop")?posX:(mouseX+(tipWidth/2)>winWidth)?winWidth/2-tipWidth/2:Math.max(mouseX-(tipWidth/2),0)})}wHeight=$(window).height();if(js){$cluetipInner.html(js);cluetipShow(pY)}else{if(tipParts){var tpl=tipParts.length;for(var i=0;i<tpl;i++){if(i==0){$cluetipInner.html(tipParts[i])}else{$cluetipInner.append('<div class="split-body">'+tipParts[i]+"</div>")}}cluetipShow(pY)}else{if(!opts.local&&tipAttribute.indexOf("#")!=0){if(cluetipContents&&opts.ajaxCache){$cluetipInner.html(cluetipContents);cluetipShow(pY)}else{var ajaxSettings=opts.ajaxSettings;ajaxSettings.url=tipAttribute;ajaxSettings.beforeSend=function(){$cluetipOuter.children().empty();if(opts.waitImage){$("#cluetip-waitimage").css({top:mouseY+20,left:mouseX+20}).show()}};ajaxSettings.error=function(){if(isActive){$cluetipInner.html("<i>sorry, the contents could not be loaded</i>")}};ajaxSettings.success=function(data){cluetipContents=opts.ajaxProcess(data);if(isActive){$cluetipInner.html(cluetipContents)}};ajaxSettings.complete=function(){imgCount=$("#cluetip-inner img").length;if(imgCount&&!$.browser.opera){$("#cluetip-inner img").load(function(){imgCount--;if(imgCount<1){$("#cluetip-waitimage").hide();if(isActive){cluetipShow(pY)}}})}else{$("#cluetip-waitimage").hide();if(isActive){cluetipShow(pY)}}};$.ajax(ajaxSettings)}}else{if(opts.local){var $localContent=$(tipAttribute+":first");var localCluetip=$.fn.wrapInner?$localContent.wrapInner("<div></div>").children().clone(true):$localContent.html();$.fn.wrapInner?$cluetipInner.empty().append(localCluetip):$cluetipInner.html(localCluetip);cluetipShow(pY)}}}}};var cluetipShow=function(bpY){$cluetip.addClass("cluetip-"+ctClass);if(opts.truncate){var $truncloaded=$cluetipInner.text().slice(0,opts.truncate)+"...";$cluetipInner.html($truncloaded)}function doNothing(){}tipTitle?$cluetipTitle.show().html(tipTitle):(opts.showTitle)?$cluetipTitle.show().html("&nbsp;"):$cluetipTitle.hide();if(opts.sticky){var $closeLink=$('<div id="cluetip-close"><a href="#">'+opts.closeText+"</a></div>");(opts.closePosition=="bottom")?$closeLink.appendTo($cluetipInner):(opts.closePosition=="title")?$closeLink.prependTo($cluetipTitle):$closeLink.prependTo($cluetipInner);$closeLink.click(function(){cluetipClose();return false});if(opts.mouseOutClose){if($.fn.hoverIntent&&opts.hoverIntent){$cluetip.hoverIntent({over:doNothing,timeout:opts.hoverIntent.timeout,out:function(){$closeLink.trigger("click")}})}else{$cluetip.hover(doNothing,function(){$closeLink.trigger("click")})}}else{$cluetip.unbind("mouseout")}}var direction="";$cluetipOuter.css({overflow:defHeight=="auto"?"visible":"auto",height:defHeight});tipHeight=defHeight=="auto"?Math.max($cluetip.outerHeight(),$cluetip.height()):parseInt(defHeight,10);tipY=posY;baseline=sTop+wHeight;if(opts.positionBy=="fixed"){tipY=posY-opts.dropShadowSteps+tOffset}else{if((posX<mouseX&&Math.max(posX,0)+tipWidth>mouseX)||opts.positionBy=="bottomTop"){if(posY+tipHeight+tOffset>baseline&&mouseY-sTop>tipHeight+tOffset){tipY=mouseY-tipHeight-tOffset;direction="top"}else{tipY=mouseY+tOffset;direction="bottom"}}else{if(posY+tipHeight+tOffset>baseline){tipY=(tipHeight>=wHeight)?sTop:baseline-tipHeight-tOffset}else{if($this.css("display")=="block"||$this[0].tagName.toLowerCase()=="area"||opts.positionBy=="mouse"){tipY=bpY-tOffset}else{tipY=posY-opts.dropShadowSteps}}}}if(direction==""){posX<linkLeft?direction="left":direction="right"}$cluetip.css({top:tipY+"px"}).removeClass().addClass("clue-"+direction+"-"+ctClass).addClass(" cluetip-"+ctClass);if(opts.arrows){var bgY=(posY-tipY-opts.dropShadowSteps);$cluetipArrows.css({top:(/(left|right)/.test(direction)&&posX>=0&&bgY>0)?bgY+"px":/(left|right)/.test(direction)?0:""}).show()}else{$cluetipArrows.hide()}$dropShadow.hide();$cluetip.hide()[opts.fx.open](opts.fx.open!="show"&&opts.fx.openSpeed);if(opts.dropShadow){$dropShadow.css({height:tipHeight,width:tipInnerWidth}).show()}if($.fn.bgiframe){$cluetip.bgiframe()}if(opts.delayedClose>0){closeOnDelay=setTimeout(cluetipClose,opts.delayedClose)}opts.onShow($cluetip,$cluetipInner)};var inactivate=function(){isActive=false;$("#cluetip-waitimage").hide();if(!opts.sticky||(/click|toggle/).test(opts.activation)){cluetipClose();clearTimeout(closeOnDelay)}if(opts.hoverClass){$this.removeClass(opts.hoverClass)}$(".cluetip-clicked").removeClass("cluetip-clicked")};var cluetipClose=function(){$cluetipOuter.parent().hide().removeClass().end().children().empty();if(tipTitle){$this.attr(opts.titleAttribute,tipTitle)}$this.css("cursor","");if(opts.arrows){$cluetipArrows.css({top:""})}};if((/click|toggle/).test(opts.activation)){$this.click(function(event){if($cluetip.is(":hidden")||!$this.is(".cluetip-clicked")){activate(event);$(".cluetip-clicked").removeClass("cluetip-clicked");$this.addClass("cluetip-clicked")}else{inactivate(event)}this.blur();return false})}else{if(opts.activation=="focus"){$this.focus(function(event){activate(event)});$this.blur(function(event){inactivate(event)})}else{$this.click(function(){if($this.attr("href")&&$this.attr("href")==tipAttribute&&!opts.clickThrough){return false}});var mouseTracks=function(evt){if(opts.tracking==true){var trackX=posX-evt.pageX;var trackY=tipY?tipY-evt.pageY:posY-evt.pageY;$this.mousemove(function(evt){$cluetip.css({left:evt.pageX+trackX,top:evt.pageY+trackY})})}};if($.fn.hoverIntent&&opts.hoverIntent){$this.mouseover(function(){$this.attr("title","")}).hoverIntent({sensitivity:opts.hoverIntent.sensitivity,interval:opts.hoverIntent.interval,over:function(event){activate(event);mouseTracks(event)},timeout:opts.hoverIntent.timeout,out:function(event){inactivate(event);$this.unbind("mousemove")}})}else{$this.hover(function(event){activate(event);mouseTracks(event)},function(event){inactivate(event);$this.unbind("mousemove")})}}}})};$.fn.cluetip.defaults={width:275,height:"auto",cluezIndex:97,positionBy:"auto",topOffset:15,leftOffset:15,local:false,hideLocal:true,attribute:"rel",titleAttribute:"title",splitTitle:"",showTitle:true,cluetipClass:"default",hoverClass:"",waitImage:true,cursor:"help",arrows:false,dropShadow:true,dropShadowSteps:6,sticky:false,mouseOutClose:false,activation:"hover",clickThrough:false,tracking:false,delayedClose:0,closePosition:"top",closeText:"Close",truncate:0,fx:{open:"show",openSpeed:""},hoverIntent:{sensitivity:3,interval:50,timeout:0},onActivate:function(e){return true},onShow:function(ct,c){},ajaxCache:true,ajaxProcess:function(data){data=data.replace(/<s(cript|tyle)(.|\s)*?\/s(cript|tyle)>/g,"").replace(/<(link|title)(.|\s)*?\/(link|title)>/g,"");return data},ajaxSettings:{dataType:"html"},debug:false};var insertionType="appendTo",insertionElement="body";$.cluetip={};$.cluetip.setup=function(options){if(options&&options.insertionType&&(options.insertionType).match(/appendTo|prependTo|insertBefore|insertAfter/)){insertionType=options.insertionType}if(options&&options.insertionElement){insertionElement=options.insertionElement}}})(jQuery);