if($.browser.msie&&$.browser.versionNumber<7){DD_roundies.addRule("#logo");DD_roundies.addRule("#welcome-wrapper");DD_roundies.addRule("#welcome");DD_roundies.addRule("div#tl");DD_roundies.addRule("div#tr");DD_roundies.addRule("div#bl");DD_roundies.addRule("div#br")}$(document).ready(function(){a();$(window).resize(function(b){a()});if($.browser.msie&&$.browser.versionNumber<7){$("#tr").css("right","-1px");$("#bl").css("bottom","-1px");$("#br").css({right:"-1px",bottom:"-1px"})}$(".region a").hover(function(){$(this).animate({paddingLeft:"10px"},500)},function(){if($(this).attr("class")!="chosen"){$(this).animate({paddingLeft:"0px"},500)}}).click(function(f){var b=new Date();b.setTime(b.getTime()+(365*24*60*60*1000));f.preventDefault();$(".region a.chosen").removeClass("chosen").animate({paddingLeft:"0px"},500);var d=$(this);var c=$(this).attr("href").split("#");c=c[1].split("-");$.cookie("region_id",c[0],{path:"/",domain:".kidkraft.com",expires:b});$.cookie("region_code",c[1],{path:"/",domain:".kidkraft.com",expires:b});$.getJSON("/languages.php",{id:c[0],ajax:"true"},function(g){var e="";for(var h=0;h<g.length;h++){e+='<li id="language-'+g[h].lid+'" class="language"><a href="#'+g[h].lid+"-"+g[h].lang_code+'">'+g[h].lang+"</a></li>"}$("#regions-wrapper.active").removeClass("active");d.addClass("chosen");$("#languages-list").html(e);$("#languages-wrapper").addClass("active")})});$("#languages-list a").live("click",function(c){var b=new Date();b.setTime(b.getTime()+(365*24*60*60*1000));c.preventDefault();var d=$(this).attr("href").split("#");d=d[1].split("-");$.cookie("language_id",d[0],{path:"/",domain:".kidkraft.com",expires:b});$.cookie("language_code",d[1],{path:"/",domain:".kidkraft.com",expires:b});window.location="/"});$("#region-select").change(function(){var b=$(this);$.getJSON("/languages.php",{id:$(this).val(),ajax:"true"},function(d){var c='<option value="">Select Your Language</option>';for(var e=0;e<d.length;e++){c+='<option value="'+d[e].lid+'">'+d[e].lang+"</option>"}b.parents("label").siblings("#for-language-select").find("select").removeAttr("disabled").html(c)})});function a(){container=$("div#content");container_width=container.width();container_height=container.height();container_ratio=container_width/container_height;image_width=1221;image_height=976;image_ratio=image_width/image_height;new_image_width=container_width;new_image_height=(new_image_width/image_width)*image_height;width_diff=0;height_diff=-(new_image_height-container_height)/2;if(new_image_height<container_height){new_image_height=container_height;new_image_width=(new_image_height/image_height)*image_width;height_diff=0;width_diff=-(new_image_width-container_width)/2}niw=Math.ceil(new_image_width);nih=Math.ceil(new_image_height);slideshow_images=container.find("img");slideshow_images.each(function(){$(this).css({width:niw+"px",height:nih+"px",top:height_diff+"px",left:width_diff+"px"})})}});
