var Category="";var MainSiteUrl="http://www.kareldonk.com";function Main(){DetermineCategory();var a=["#SoftwareButton","#PhotographyButton","#DesignButton","#AboutButton"];var x=0;for(x=0;x<a.length;x++){var b=$(a[x]);if(!b.hasClass("MainMenuButtonSelected")){b.hover(function(){$(".background",this).css("visibility","visible");$(".background",this).stop().animate({opacity:1})},function(){$(".background",this).stop().animate({opacity:0},1500,function(){$(this).css("visibility","hidden")})});b.click(function(){window.location.href=$("a",this).attr("href")})}}var c=["#FBButton","#LIButton","#BlogButton"];for(x=0;x<c.length;x++){var b=$(c[x]);b.animate({opacity:0.5});$("h3",b).animate({opacity:0.5});b.hover(function(){$(this).stop().animate({opacity:1})},function(){$(this).stop().animate({opacity:0.5})});b.click(function(){window.location.href=$("a",this).attr("href")})}var d=["#ContactButton","#FooterText","#SubMenuItemsContainer"];for(x=0;x<d.length;x++){var b=$(d[x]);b.animate({opacity:0.5});b.hover(function(){$(this).stop().animate({opacity:1})},function(){$(this).stop().animate({opacity:0.5})})}var e=$("#SubMenuItemsContainer");var f=$("a",e);for(x=0;x<f.length;x++){var g=$(f[x]).attr("href");if(g=="/"){if(window.location.href.substr(-1).toLowerCase()=="/"||window.location.href.substr(-9).toLowerCase()=="index.php"){$(f[x]).addClass("Selected");$(f[x]).removeAttr("href")}}if(window.location.href.substr(-g.length).toLowerCase()==g.toLowerCase()){$(f[x]).addClass("Selected");$(f[x]).removeAttr("href")}else{$(f[x]).hover(function(){$(this).stop().animate({borderTopColor:'#ff9100',borderLeftColor:'#ff9100',borderRightColor:'#ff9100',borderBottomColor:'#ff9100',backgroundColor:'#a55e00',color:'#fff'})},function(){$(this).stop().animate({borderTopColor:'#000',borderLeftColor:'#000',borderRightColor:'#000',borderBottomColor:'#000',backgroundColor:'#000',color:'#FFF'})})}}ServicesTable();PageLinks()}function DetermineCategory(){if(window.location.href.search(new RegExp("/software.","i"))!=-1)Category="Software";else if(window.location.href.search(new RegExp("/photography.","i"))!=-1)Category="Photography";else if(window.location.href.search(new RegExp("/design.","i"))!=-1)Category="Design";else if(window.location.href.search(new RegExp("/about.","i"))!=-1)Category="About";else Category="Home";if(Category=="Software"){$("#SoftwareButton").addClass("MainMenuButtonSelected");$("#ContentSubContainer").css("backgroundImage","url("+MainSiteUrl+"/images/softwareback.jpg)");$("a",$("#SoftwareButton")).removeAttr("href")}else if(Category=="Design"){$("#DesignButton").addClass("MainMenuButtonSelected");$("#ContentSubContainer").css("backgroundImage","url("+MainSiteUrl+"/images/designback.jpg)");$("a",$("#DesignButton")).removeAttr("href")}else if(Category=="Photography"){$("#PhotographyButton").addClass("MainMenuButtonSelected");$("#ContentSubContainer").css("backgroundImage","url("+MainSiteUrl+"/images/photoback.jpg)");$("a",$("#PhotographyButton")).removeAttr("href")}else if(Category=="About"){$("#AboutButton").addClass("MainMenuButtonSelected");$("#ContentSubContainer").css("backgroundImage","url("+MainSiteUrl+"/images/aboutback.jpg)");$("a",$("#AboutButton")).removeAttr("href")}else if(Category=="Home"){$("#LogoImage").attr("src","images/logohome.png");$("#HeaderBottom").css("background-image","url(images/headbottomhome.png)");$("#HeaderBottom").css("background-color","transparent")}}function ResumeItems(){var b=$(".ResumeItemWrap");var x=0;for(x=0;x<b.length;x++){$(b[x]).hover(function(){$(this).stop().animate({borderTopColor:'#ff9100',borderLeftColor:'#ff9100',borderRightColor:'#ff9100',borderBottomColor:'#ff9100'})},function(){$(this).stop().animate({borderTopColor:'#3a3a3a',borderLeftColor:'#3a3a3a',borderRightColor:'#3a3a3a',borderBottomColor:'#3a3a3a'})})}var c=$(".ResumeItem");for(x=0;x<c.length;x++){$(".DescriptionText",c[x]).attr("max-height",$(".DescriptionText",c[x]).height())}for(x=0;x<c.length;x++){$(".Name",c[x]).css("backgroundImage","url("+MainSiteUrl+"/images/expand.png)");$(".DescriptionText",c[x]).stop().animate({height:'0px',opacity:0});$(c[x]).click(function(a){elem=a.target||a.srcElement;if(elem.tagName.toLowerCase()!="a"){if($(".DescriptionText",this).height()!=0){$(".DescriptionText",this).stop().animate({height:'0px',opacity:0});$(".Name",this).css("backgroundImage","url("+MainSiteUrl+"/images/expand.png)")}else{$(".DescriptionText",this).stop().animate({height:$(".DescriptionText",this).attr("max-height"),opacity:1});$(".Name",this).css("backgroundImage","url("+MainSiteUrl+"/images/collapse.png)")}}})}}function Testimonials(){var b=$(".TestimonialOuterContainer");var x=0;for(x=0;x<b.length;x++){$(b[x]).hover(function(){$(this).stop().animate({borderTopColor:'#ff9100',borderLeftColor:'#ff9100',borderRightColor:'#ff9100',borderBottomColor:'#ff9100'});$("div",$(".OpenQuote",$(this).parents(".Testimonials"))).stop().animate({opacity:1});$("div",$(".CloseQuote",$(this).parents(".Testimonials"))).stop().animate({opacity:1})},function(){$(this).stop().animate({borderTopColor:'#3a3a3a',borderLeftColor:'#3a3a3a',borderRightColor:'#3a3a3a',borderBottomColor:'#3a3a3a'});if($(".TestimonialTextContainer",this).height()!=$(".TestimonialTextContainer",this).attr("max-height")){$("div",$(".OpenQuote",$(this).parents(".Testimonials"))).stop().animate({opacity:0});$("div",$(".CloseQuote",$(this).parents(".Testimonials"))).stop().animate({opacity:0})}})}for(x=0;x<b.length;x++){$(".TestimonialTextContainer",b[x]).attr("max-height",$(".TestimonialTextContainer",b[x]).height())}for(x=0;x<b.length;x++){$(".TestimonialExcerpt",b[x]).css("backgroundImage","url("+MainSiteUrl+"/images/expand.png)");$(".TestimonialTextContainer",b[x]).stop().animate({height:'1px',opacity:0});$("div",$(".OpenQuote",$(b[x]).parents(".Testimonials"))).stop().animate({opacity:0});$("div",$(".CloseQuote",$(b[x]).parents(".Testimonials"))).stop().animate({opacity:0});$(b[x]).click(function(a){elem=a.target||a.srcElement;if(elem.tagName.toLowerCase()!="a"){if($(".TestimonialTextContainer",this).height()!=1){$(".TestimonialTextContainer",this).stop().animate({height:'1px',opacity:0});$(".TestimonialExcerpt",this).css("backgroundImage","url("+MainSiteUrl+"/images/expand.png)")}else{$(".TestimonialTextContainer",this).stop().animate({height:$(".TestimonialTextContainer",this).attr("max-height"),opacity:1},500,function(){$("div",$(".OpenQuote",$(this).parents(".Testimonials"))).stop().animate({opacity:1});$("div",$(".CloseQuote",$(this).parents(".Testimonials"))).stop().animate({opacity:1})});$(".TestimonialExcerpt",this).css("backgroundImage","url("+MainSiteUrl+"/images/collapse.png)")}}})}}function PageLinks(){var a=$("#PageContainer");var b=$("a",a);var x=0;for(x=0;x<b.length;x++){$(b[x]).hover(function(){$(this).stop().animate({borderTopColor:'#ff9100',borderLeftColor:'#ff9100',borderRightColor:'#ff9100',borderBottomColor:'#ff9100',backgroundColor:'#a55e00',color:'#fff'})},function(){$(this).stop().animate({borderTopColor:'#343434',borderLeftColor:'#343434',borderRightColor:'#343434',borderBottomColor:'#343434',backgroundColor:'#343434',color:'#ff9100'})})}}function ServicesTable(){var a=$(".ServiceListing");var x=0;for(x=0;x<a.length;x++){$(a[x]).css("height",$(a[x]).parent().height())}}
