function accordion(g,f,d,c){$("#"+g+"").accordion({header:"h3",active:f,clearStyle:d,autoheight:false});var b=$("#"+g+"");var a=location.search;a.match(/(?:^|\?|&)CAT=cat_((\d{1}))(?:$|&)/i);a=RegExp.$1;if(c!=""){a=c.substring(4,c.length)}if(document.getElementById("cat_"+a)){$("#"+g+"").activate("h3#cat_"+a+":first")}}function setView(a){document.cookie="view="+a;location.reload()}function getView(){view=document.cookie.substr(0,document.cookie.search("="));view=document.cookie.substr(document.cookie.search("=")+1,document.cookie.search(";"));if(view==""){view=document.cookie.substr(document.cookie.search("=")+1,document.cookie.length)}if(view==""){view="Flash"}return view}function changeImg(b,a){b.firstChild.src=a}var textNewWindow="";function titleAdjustment(a){if(a.getAttribute){textAlt=a.getAttribute("title");if(textAlt&&textAlt.indexOf(textNewWindow)==-1){a.setAttribute("title",textAlt+" "+textNewWindow)}}}function productList(a){$("#productList a[href]").each(function(){$(this).hover(function(c){var g=c.pageX+20;var f=c.pageY+10;var b=0;var d=0;$("#productThumb").remove();imageId=$(this).attr("id");if(imageId.indexOf("ti_")>-1){imageId=imageId.substring(3,imageId.length)}if(imageId.indexOf("-")>-1){b=imageId.split("-")[1];d=imageId.split("-")[2];imageId=imageId.split("-")[0]}$.get(a+"include/productThumbnail.jsp",{imageId:imageId,iWidth:b,iHeight:d,posX:g,posY:f},function(e){$("#productThumb").remove();$("body").append(e)})},function(){$("#productThumb").remove()})});$("body").mouseover(function(){$("#productThumb").remove()})}function productCatClaims(c,d,b){var a="";if(c==""){a=location.search;a.match(/(?:^|\?|&)CAT=cat_((\d{1}))(?:$|&)/i);a=RegExp.$1}else{a=c}$("#productList").find("h3").each(function(){$(this).click(function(){categoryId=$(this).attr("id").substring(4,$(this).attr("id").length);currentId=$("#productCatClaim").attr("class").substring(9,$("#productCatClaim").attr("class").length);if(categoryId!=currentId){}})});if(a!=""){if(a.indexOf("cat_")>-1){$("h3#"+a).trigger("click")}else{$("h3#cat_"+a).trigger("click")}}accordion("productList",false,false,a)}function gallery(g,e,f,c,d,a,b){if(g=="product"){if($("#Detailansicht").length==0){$("#productInfo").prepend(e)}else{if($("#cat_5").length!=0){$("#cat_5").before(e)}else{$("#productInfo").append(e)}}galleryNavigation();accordion("productInfo","h3:first",true,"")}else{if(g=="project"){$("#projectInfo").empty();$("#projectInfo").append(e);galleryNavigation()}}}function galleryNavigation(){var b=1;var a=0;$("#slider").find("img").each(function(){a++});a=Math.ceil(a/2);$("#next").click(function(){if(b<a){b++;$("li#panel_"+b).trigger("click")}});$("#previous").click(function(){if(b>1){b--;$("li#panel_"+b).trigger("click")}});$("#galleryNav").find("li").each(function(){if($(this).attr("id")!="previous"&&$(this).attr("id")!="next"){$(this).click(function(){$(this).addClass("current").parent().parent().find("li").not($(this)).removeClass("current");var d=Number($(this).attr("id").substring(6,$(this).attr("id").length));b=d;var c=((d-1)*-640);$("#slider").stop().animate({left:c+"px"},"slow");if(d==a){$("#next").addClass("off")}else{$("#next").removeClass("off")}if(d==1){$("#previous").addClass("off")}else{$("#previous").removeClass("off")}})}});$("body").find("div.loading").remove()}function openMail(a,b){top.location.href="mailto:"+a+"@"+b};