(function($)
{$(function()
{var scripts=new Array();$.code28.loadScripts(scripts,function()
{$("#parents-spot, #latest-news, #index .article .aside, #tv-spot").bind("click",function(e)
{e.preventDefault();location.href=$("a",this).attr("href");});$("#previous-spot, #kids").bind("click",function(e)
{e.preventDefault();window.open($("a",this).attr("href"),"_blank");});$("#made .back, #contact-us .back").bind("click",function(e)
{e.preventDefault();history.back(1);});$("#contact-us form").bind("submit",function(e)
{var $this=$(this);var correct=true;if(!$("#age input").attr("checked")){$("#age strong").css({visibility:"visible"});correct=false;}else{$("#age strong").css({visibility:"hidden"});}
if($("#name input").attr("value")==""){$("#name strong").css({visibility:"visible"});correct=false;}else{$("#name strong").css({visibility:"hidden"});}
var val=$("#email input").attr("value");if(val==""||(val.indexOf("@")==-1)||(val.indexOf(".")==-1)){$("#email strong").css({visibility:"visible"});correct=false;}else{$("#email strong").css({visibility:"hidden"});}
if(!correct){e.preventDefault();}});$(".video-player ul a").bind("click",function(e)
{e.preventDefault();$this=$(this);var href=$this.attr("href");var jpg=href.split("?")[1];jpg=jpg.split("=")[1];if($.browser.msie){__flash__addCallback($("#video").get(0),"loadVideo");}
$("#video").get(0).loadVideo(href,jpg);});$("#product-detail").each(function()
{var hash=location.hash.substr(1);if(hash.length>1){$selected=$("#body .selected");$selected.removeClass("selected");$("#"+hash).addClass("selected");}});$("#product-detail #body .prev").bind("click",function(e)
{e.preventDefault();$selected=$("#body .selected");$selected.removeClass("selected");$prev=$selected.prev(".article");if($prev.length==0){$prev=$("#body .article:last");}
$prev.addClass("selected");sIFR.replace(americanTypewriter,{selector:'h2, h3, #index #body h3',css:'.sIFR-root { color: #513366;font-weight: bold;}',wmode:'transparent'});location.hash="#"+$prev.attr("id");});$("#body .next").bind("click",function(e)
{e.preventDefault();$selected=$("#body .selected");$selected.removeClass("selected");$next=$selected.next();if($next.length==0){$next=$("#body .article:first");}
$next.addClass("selected");sIFR.replace(americanTypewriter,{selector:'h2, h3, #index #body h3',css:'.sIFR-root { color: #513366;font-weight: bold;}',wmode:'transparent'});location.hash="#"+$next.attr("id");});$("#index .article .aside").bind("mouseover",function(e)
{e.preventDefault();$(".header",this).css({backgroundImage:"url(/images/icons/small-purple-arrow.png)"});});$("#index .article .aside").bind("mouseout",function(e)
{e.preventDefault();$(".header",this).css({backgroundImage:"url(/images/icons/small-yellow-arrow.png)"});});$("#latest-news, #kids, #expert-advice .article .aside").bind("mouseover",function(e)
{e.preventDefault();$(".footer",this).css({backgroundImage:"url(/images/icons/purple-arrow.png)"});});$("#latest-news, #kids, #expert-advice .article .aside").bind("mouseout",function(e)
{e.preventDefault();$(".footer",this).css({backgroundImage:"url(/images/icons/yellow-arrow.png)"});});if($("body *").png24!=null){var h=$("#body .article").height()+60;$("body *").png24();$("#body").height(h);var initialHeight=$("#content").height();$(window).bind("resize",function()
{var h=Math.max($(window).height(),initialHeight);$("#content").css({height:h});}).trigger("resize");}});});})(jQuery.noConflict());