(function($){function isRGBACapable(){var $script=$('script:first'),color=$script.css('color'),result=false;if(/^rgba/.test(color)){result=true;}else{try{result=(color!=$script.css('color','rgba(0, 0, 0, 0.5)').css('color'));$script.css('color',color);}catch(e){}}
return result;}
$.extend(true,$,{support:{'rgba':isRGBACapable()}});var properties=['color','backgroundColor','borderBottomColor','borderLeftColor','borderRightColor','borderTopColor','outlineColor'];$.each(properties,function(i,property){$.fx.step[property]=function(fx){if(!String(fx.end).match(/undefined/)){if(!fx.init){fx.begin=parseColor($(fx.elem).css(property))||parseColor('#ffffff');fx.end=parseColor(fx.end)||parseColor('#ffffff');fx.init=true;}
fx.elem.style[property]=calculateColor(fx.begin,fx.end,fx.pos);}}});$.fx.step.borderColor=function(fx){if(!fx.init){fx.end=parseColor(fx.end);}
var borders=properties.slice(2,6);$.each(borders,function(i,property){if(!fx.init){fx[property]={begin:parseColor($(fx.elem).css(property))};}
fx.elem.style[property]=calculateColor(fx[property].begin,fx.end,fx.pos);});fx.init=true;}
function calculateColor(begin,end,pos){var color='rgb'+($.support['rgba']?'a':'')+'('
+parseInt((begin[0]+pos*(end[0]-begin[0])),10)+','
+parseInt((begin[1]+pos*(end[1]-begin[1])),10)+','
+parseInt((begin[2]+pos*(end[2]-begin[2])),10);if($.support['rgba']){color+=','+(begin&&end?parseFloat(begin[3]+pos*(end[3]-begin[3])):1);}
color+=')';return color;}
function parseColor(color){var match,triplet;if(match=/#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})/.exec(color)){triplet=[parseInt(match[1],16),parseInt(match[2],16),parseInt(match[3],16),1];}else if(match=/#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])/.exec(color)){triplet=[parseInt(match[1],16)*17,parseInt(match[2],16)*17,parseInt(match[3],16)*17,1];}else if(match=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(color)){triplet=[parseInt(match[1]),parseInt(match[2]),parseInt(match[3]),1];}else if(match=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9\.]*)\s*\)/.exec(color)){triplet=[parseInt(match[1],10),parseInt(match[2],10),parseInt(match[3],10),parseFloat(match[4])];}
return triplet;}})(jQuery);(function($){var lastSize=0;var interval=null;var options;function trigger()
{var w=$(window).width();var done=false;for(var bp in options.breakpoints.sort(function(a,b){return(b-a)})){if(!done&&w>=options.breakpoints[bp]&&lastSize<options.breakpoints[bp]){if(options.distinct){for(var x in options.breakpoints.sort(function(a,b){return(b-a)})){if($('body').hasClass('breakpoint-'+options.breakpoints[x])){$('body').removeClass('breakpoint-'+options.breakpoints[x]);$(window).trigger('exitBreakpoint'+options.breakpoints[x]);}}
done=true;}
$('body').addClass('breakpoint-'+options.breakpoints[bp]);$(window).trigger('enterBreakpoint'+options.breakpoints[bp]);}
if(w<options.breakpoints[bp]&&lastSize>=options.breakpoints[bp]){$('body').removeClass('breakpoint-'+options.breakpoints[bp]);$(window).trigger('exitBreakpoint'+options.breakpoints[bp]);}
if(options.distinct&&w>=options.breakpoints[bp]&&w<options.breakpoints[bp-1]&&lastSize>w&&lastSize>0&&!$('body').hasClass('breakpoint-'+options.breakpoints[bp])){$('body').addClass('breakpoint-'+options.breakpoints[bp]);$(window).trigger('enterBreakpoint'+options.breakpoints[bp]);}}
if(lastSize!=w){lastSize=w;}}
$.fn.resetBreakpoints=function(){$(window).unbind('resize');if(interval){clearInterval(interval);}
lastSize=0;};$.fn.setBreakpoints=function(settings){options=jQuery.extend({distinct:true,breakpoints:new Array()},settings);interval=setInterval(trigger,250);};$.fn.triggerBreakpoints=function(){trigger();};})(jQuery);$(document).ready(function(){$('.article-list .read-more').click(function(e){$(this).parents('li').find('.article-full, .article-lead').toggle().toggleClass('hidden');e.preventDefault();});$('.text').click(function(){var el=$(this);el.next().toggle()});var heading_bar=$('#body-heading-bar');var heading_wrapper=$('#body-heading-wrapper');var heading=$('#body-heading-wrapper h1');var intro=$('#intro');if(intro.height()>heading.height()&&$(window).width()>960){heading.css({'line-height':intro.height()+'px'});}
if($.browser.msie&&$.browser.version<=7){if(heading.height()>heading_wrapper.height()){heading_bar.css({'height':heading.height()+50+'px'});heading_wrapper.css({'height':heading_bar.height()-10+'px'})}
if(heading.height()<100){heading.css({'top':(heading.parent().height()-heading.height())/4+'px'})}
intro.css({'top':(intro.parent().height()-intro.height())/4+'px'})}
if($('#showroom_iframe_wrapper')){showroom_viewer();$(window).bind("resize",showroom_viewer);}});function to_hex(val){var hex=''+val;var len=hex.length;var rest=6-len;hex=hex.replace('#','');if(rest>0){while(rest--){hex='0'+hex;}}
return'#'+hex;}
function transition(colorset,context){if(!context)context='body';for(var i in colorset){if($.browser.msie&&$.browser.version<=7){$('.'+i,context).css(colorset[i]);}else{$('.'+i,context).delay(colorset[i].delay||0).animate(colorset[i]);}}}
function showroom_viewer(){var showroom_wrapper=$('#showroom_iframe_wrapper');var url=showroom_wrapper.data('staticurl');if($(window).width()>960){url+=showroom_wrapper.data('screenurl');}else{url+=showroom_wrapper.data('mobileurl');}
showroom_wrapper.html('<iframe src="'+url+'" width="100%" height="550" frameborder="0"></iframe>');}
(function()
{var menu_items="#menu li:not(#logo), #footer li:not(:first):not(:last)";var lang_items="#topbar .languages li";var body=$("body");var site=$("#container");var header=null;var overlay=null;var overlay_clickarea=null;var overlay_width=260;var ani_speed=200;function closeOverlay()
{if(overlay){overlay_clickarea.hide();header.removeClass("overlay_visible");overlay.hide();site.css({height:"auto",overflow:"",paddingLeft:0});}}
function showOverlay()
{if(overlay){overlay_clickarea.show();overlay.show();header.addClass("overlay_visible");site.css({height:overlay.height()-header.outerHeight(),overflow:"hidden",paddingLeft:overlay.width()});}}
function toggleOverlay()
{if(!overlay){return false;}
if(overlay.is(":visible")){closeOverlay()}
else{showOverlay()}
return false;}
$(window).setBreakpoints({breakpoints:[100,768]});$(window).bind('enterBreakpoint100',function(){$("#header").hide();if(overlay){header.show();return false;}
header=$('<div id="mobile_header">    \
                        <a class="toggle" href="#">Menu</a> \
                        <a class="logo" href="/">Kaemingk</a>   \
                    </div>').prependTo(body);$("a.toggle",header).click(toggleOverlay);overlay=$('<div id="mobile_overlay"><ul>  \
                        <li class="nav"><h2>Navigation</h2></li>    \
                        <li class="lang"><h2>Languages</h2></li>    \
                    </ul></div>').hide().prependTo(body);overlay_clickarea=$('<div id="mobile_overlay_clickarea"></div>').hide().prependTo(body);overlay_clickarea.click(toggleOverlay);$(".nav",overlay).append($(menu_items).clone());$(".lang",overlay).append($(lang_items).clone());});$(window).bind('exitBreakpoint100',function(){closeOverlay();header.hide();$("#header").show();});$(window).triggerBreakpoints();})();function EightSlideshow(options)
{var options=$.extend({container:null,slides:null,interval:5000,swipeDirection:'horizontal',swipeElement:null,swipeMinLength:72,animationShow:{left:0},animationHidePrev:{left:"-300px"},animationHideNext:{left:"300px"},animationSpeed:300,onSlideShow:function(index,element){},onSlideHide:function(index,element){}},options);var _timer=null;var _current_index=0;options.container=$(options.container);options.slides=$(options.slides);options.container.css({position:'relative'});options.slides.hide().css({position:'absolute',zIndex:0});if(options.swipeDirection){touchSwipe();}
function indexExists(index){return(options.slides[index]!=null)}
function getCurrentIndex(){return _current_index;}
function getNextIndex(){var next;if(indexExists(next=getCurrentIndex()+1))
return next;else
return 0;}
function getPrevIndex(){var next;if(indexExists(next=getCurrentIndex()-1))
return next;else
return options.slides.size()-1;}
function getSlide(index){var slide=options.slides.get(index);if(slide)
return $(slide);else
return false;}
function showSlide(index,dir)
{if(!indexExists(index))
return false;var slide=getSlide(getCurrentIndex());if(slide.is(":animated"))
return false;if(!dir)
{dir='Next';if(index<getCurrentIndex()){dir='Prev';}}
dir=dir.charAt(0).toUpperCase()+dir.substr(1).toLowerCase();if(index!=getCurrentIndex())
{var slide=getSlide(getCurrentIndex());slide.stop().animate(options['animationHide'+(dir=='Prev'?'Next':'Prev')],options.animationSpeed).css({zIndex:0});if(options.onSlideHide.call(this,getCurrentIndex(),slide,index)===false)
{return false;}}
var slide=getSlide(index);if(getCurrentIndex()==index)
{slide.stop().css(options.animationShow).css({zIndex:1}).show();}
else
{slide.stop().css(options['animationHide'+dir]).show().css({zIndex:1}).animate(options.animationShow,options.animationSpeed);}
_current_index=index;options.onSlideShow.call(this,getCurrentIndex(),slide);setTimer();return slide;}
function setTimer(ms)
{if(_timer)
clearTimeout(_timer);_timer=setTimeout(function(){showSlide(getNextIndex(),'next');},options.interval);}
function start(){return showSlide(getCurrentIndex());}
function nextSlide(){return showSlide(getNextIndex(),'next');}
function prevSlide(){return showSlide(getPrevIndex(),'prev');}
function pause(){if(_timer)
clearTimeout(_timer);}
function touchSwipe()
{var startX=0;var startY=0;var curX=0;var curY=0;var fingerCount=0;function reset()
{fingerCount=startX=startY=curX=curY=0;}
function processSwipe(direction)
{var allowed={left:1,right:1,down:1,up:1};if(options.swipeDirection=='horizontal')
allowed={left:1,right:1};else if(options.swipeDirection=='vertical')
allowed={down:1,up:1};if(!(direction in allowed))
return false;switch(direction)
{case'left':case'up':nextSlide();break;case'right':case'down':prevSlide();break;}
return true;}
function calculateAngle()
{var x=startX-curX;var y=curY-startY;var r=Math.atan2(y,x);var swipeAngle=Math.round(r*180/Math.PI);if(swipeAngle<0)
{swipeAngle=360-Math.abs(swipeAngle);}
return swipeAngle;}
function getDirection(angle)
{if((angle<=45)&&(angle>=0))
return'left';else if((angle<=360)&&(angle>=315))
return'left';else if((angle>=135)&&(angle<=225))
return'right';else if((angle>45)&&(angle<135))
return'down';else
return'up';}
$(options.swipeElement||options.container).bind("touchstart touchmove touchend touchcancel",function(ev)
{var event=ev.originalEvent;switch(ev.type)
{case'touchstart':fingerCount=event.touches.length;if(fingerCount==1)
{startX=event.touches[0].pageX;startY=event.touches[0].pageY;}
else
{reset();}
break;case'touchend':ev.preventDefault();if(fingerCount==1&&curX!=0)
{var swipeLength=Math.round(Math.sqrt(Math.pow(curX-startX,2)+Math.pow(curY-startY,2)));if(swipeLength>=options.swipeMinLength)
{var angle=calculateAngle();var direction=getDirection(angle);processSwipe(direction);}}
reset();break;case'touchmove':if(event.touches.length==1)
{curX=event.touches[0].pageX;curY=event.touches[0].pageY;}
else
{reset();}
break;case'touchcancel':reset();break;}});}
return{currentIndex:getCurrentIndex,getSlide:getSlide,showSlide:showSlide,pause:pause,start:start,next:nextSlide,prev:prevSlide};}
function resize($img){var options={align:'center',valign:'center'};var ww=$("#slideshow").width(),wh=$("#slideshow").height(),iw=$img.width(),ih=$img.height(),rw=wh/ww,ri=ih/iw,newWidth,newHeight,newLeft,newTop,properties;if(rw>ri){newWidth=wh/ri;newHeight=wh;}else{newWidth=ww;newHeight=ww*ri;}
properties={'width':newWidth+'px','height':newHeight+'px','top':'auto','bottom':'auto','left':'auto','right':'auto'}
if(!isNaN(parseInt(options.valign))){properties['top']=(0-(newHeight-wh)/100*parseInt(options.valign))+'px';}else if(options.valign=='top'){properties['top']=0;}else if(options.valign=='bottom'){properties['bottom']=0;}else{properties['top']=(wh-newHeight)/2;}
if(!isNaN(parseInt(options.align))){properties['left']=(0-(newWidth-ww)/100*parseInt(options.align))+'px';}else if(options.align=='left'){properties['left']=0;}else if(options.align=='right'){properties['right']=0;}else{properties['left']=(ww-newWidth)/2;}
$img.css(properties);}
var slideshow;slideshow=new EightSlideshow({container:$("#slideshow > ul"),slides:$("#slideshow > ul > li"),swipeDirection:'horizontal',interval:10000,animationSpeed:600,animationShow:{left:'0%'},animationHidePrev:{left:'-100%'},animationHideNext:{left:'100%'},onSlideShow:function(index,element){var active_menu=$("nav li:eq("+index+")",element);active_menu.addClass("active");var bgColor1transparent=to_hex(element.data("bg-color1"));var bgColor2transparent=to_hex(element.data("bg-color2"));var bgColor3transparent=to_hex(element.data("bg-color3"));if(Modernizr.rgba){bgColor1transparent='rgba('+element.data("bg-color1-transparent")+')';bgColor2transparent='rgba('+element.data("bg-color2-transparent")+')';bgColor3transparent='rgba('+element.data("bg-color3-transparent")+')';}
var colors={'bg-color1':{'backgroundColor':to_hex(element.data("bg-color1"))},'bg-color2':{'backgroundColor':to_hex(element.data("bg-color2"))},'bg-color3':{'backgroundColor':to_hex(element.data("bg-color3"))},'text-color1':{'color':to_hex(element.data("text-color1"))},'text-color2':{'color':to_hex(element.data("text-color2"))},'text-color3':{'color':to_hex(element.data("text-color3"))},'bg-color1-transparent':{'backgroundColor':bgColor1transparent},'bg-color2-transparent':{'backgroundColor':bgColor2transparent},'bg-color3-transparent':{'backgroundColor':bgColor3transparent},'text-color4':{'color':to_hex(element.data("text-color4"))},'text-color2-contrast':{'color':to_hex(element.data("text-color2-contrast"))},'text-color3-contrast':{'color':to_hex(element.data("text-color3-contrast"))}};if(typeof color_preview!=='undefined'){colors={}}
transition(colors);}});slideshow.start();if(typeof color_preview!=='undefined'){slideshow.pause();}
$("#slideshow nav a").click(function(ev){var el=$(this);var li=el.parent();slideshow.showSlide(li.index());el.blur();ev.preventDefault();}).html("&bull;");$('.next-slide').click(function(e){var el=$(this);slideshow.next();e.preventDefault();})
$(document).bind("keydown",function(ev)
{switch(ev.keyCode)
{case 37:slideshow.prev();ev.preventDefault();break;case 39:slideshow.next();ev.preventDefault();break;}});$(window).bind("resize",function(){$("#slideshow").css("top",$("#header").height());$("#slideshow > ul > li").width($(window).width());$("#slideshow > ul img").each(function(){resize($(this));});$('#break').css({'marginTop':$("#slideshow").height()+'px'});resizeShowroom();}).trigger("resize");function fadeIn(delay){$('#slideshow .info').delay(delay[0]).css({'visibility':'visible'}).hide().fadeIn();$('#collections').delay(delay[1]).css({'visibility':'visible'}).hide().fadeIn();$('#showroom').delay(delay[2]).css({'visibility':'visible'}).hide().fadeIn();$('#event-list').delay(delay[3]).css({'visibility':'visible'}).hide().fadeIn();$('#countdown').delay(delay[4]).css({'visibility':'visible'}).hide().fadeIn();}
$(document).ready(function(){var delay=0;if($(document).width()>990){delay=1000;fadeIn([400,600,800,1000,1000]);}
if($(document).width()<990){fadeIn([0,0,0,0,0]);}
setTimeout(function(){var collections=$('#collections');var showroom=$('#showroom');var agenda=$('#agenda');if($(document).width()>990){if(agenda.height()<(collections.height()+45+38)){agenda.css({'bottom':collections.height()-agenda.height()+45+38+'px'})}}},delay);});$(window).ready(function(){resizeShowroom();})
function resizeShowroom(){if($(document).width()<990&&$(document).width()>480){$('#showroom').height($('#collections').height());}else{$('#showroom').height('auto');}}
