/* Work Force Network, Inc. Website Javascript */
(function(a){a.fn.hoverIntent=function(j,k){var b={sensitivity:7,interval:100,timeout:0};b=a.extend(b,k?{over:j,out:k}:j);var d,e,f,g,c=function(a){d=a.pageX;e=a.pageY},i=function(j,h){h.hoverIntent_t=clearTimeout(h.hoverIntent_t);if(Math.abs(f-d)+Math.abs(g-e)<b.sensitivity){a(h).unbind("mousemove",c);h.hoverIntent_s=1;return b.over.apply(h,[j])}else{f=d;g=e;h.hoverIntent_t=setTimeout(function(){i(j,h)},b.interval)}},l=function(c,a){a.hoverIntent_t=clearTimeout(a.hoverIntent_t);a.hoverIntent_s=0;return b.out.apply(a,[c])},h=function(h){var e=jQuery.extend({},h),d=this;if(d.hoverIntent_t)d.hoverIntent_t=clearTimeout(d.hoverIntent_t);if(h.type=="mouseenter"){f=e.pageX;g=e.pageY;a(d).bind("mousemove",c);if(d.hoverIntent_s!=1)d.hoverIntent_t=setTimeout(function(){i(e,d)},b.interval)}else{a(d).unbind("mousemove",c);if(d.hoverIntent_s==1)d.hoverIntent_t=setTimeout(function(){l(e,d)},b.timeout)}};return this.bind("mouseenter",h).bind("mouseleave",h)}})(jQuery);(function(a){a.fn.equalHeights=function(c,b){tallest=c?c:0;this.each(function(){a(this).height("auto")});this.each(function(){if(a(this).height()>tallest)tallest=a(this).height()});if(b&&tallest>b)tallest=b;return this.each(function(){a(this).height(tallest)})}})(jQuery);var wfniUtils={postResumeWindow:null,init:function(){$("html").removeClass("no-js").addClass("js");wfniUtils.initGoogMap();$("body").hasClass("home")&&this.theaterSlides();wfniUtils.setupEqualHeightElements();$("body").hasClass("about")&&this.setupImgHover();$("#postResume").bind("click",this.openResumeUpload);$(".applyBtn").bind("click",this.openResumeUpload)},theaterSlides:function(){var c=$("#theater .open"),a=function(a){a.stop(false,true).animate({width:182}).addClass("open").find("img").stop(false,true).animate({left:0});a.find(".slideImg").stop(false,true).animate({width:178});a.find(".overLabel").stop(false,true).animate({bottom:0});a.find(".slideLabel").stop(false,true).animate({top:-27,height:0})},b=function(a){a.siblings().each(function(){var a=$(this);if(a.width()!==100){a.stop(false,true).animate({width:106}).removeClass("open").find("img").each(function(){$(this).stop(false,true).animate({left:$(this).data("xPos")})});a.find(".slideImg").stop(false,true).animate({width:102});a.find(".overLabel").stop(false,true).animate({bottom:-80});a.find(".slideLabel").stop(false,true).animate({top:0,height:74})}})};$("#theater .slide").find(".slideImg").find("img").each(function(){$(this).data("xPos",$(this).css("left"))});$("#theater .slideImg").each(function(){$(this).append($('<p class="overLabel"></p>').html($(this).siblings(".slideLabel").html()))});a(c);c.find("img").data("xPos","-34px");$("#theater .slide").hoverIntent(function(){var c=$(this);if(!c.hasClass("open")){a(c);b(c)}},function(){});$("#theater .slide").click(function(){var c=$(this);if(!c.hasClass("open")){a(c);b(c)}})},setupEqualHeightElements:function(){$(".infoBox").length&&$(".infoBox").equalHeights();if($(".calloutHighlight, .callout").length)!$("body").hasClass("news")&&$(".calloutHighlight, .callout").equalHeights();if($("#applyOnline, .calloutHighlight").length)!$("body").hasClass("services")&&$("#applyOnline, .calloutHighlight").equalHeights();$("body").hasClass("contact")&&$(".cols").length>1&&$(".cols").equalHeights()},setupImgHover:function(){$(".ovals").hover(function(){$(this).next("span").show()},function(){$(this).next("span").hide()})},openResumeUpload:function(a){a.preventDefault();if(wfniUtils.postResumeWindow==null||wfniUtils.postResumeWindow.closed)wfniUtils.postResumeWindow=window.open("ResumeUpload.html","postResume","height=670,width=520,resizable=yes,menubar=no,toolbar=no,status=no,scrollbars=no");else wfniUtils.postResumeWindow.focus()},initGoogMap:function(){function b(){var d=new google.maps.LatLng(42.26479,-83.473556),c={zoom:9,center:d,disableDefaultUI:true,zoomControl:true,mapTypeId:google.maps.MapTypeId.ROADMAP},e=new google.maps.Map(document.getElementById("map_canvas"),c),b=new google.maps.LatLng(42.26479,-83.473556);marker=new google.maps.Marker({map:e,draggable:false,animation:google.maps.Animation.DROP,position:b});google.maps.event.addListener(marker,"click",a)}function a(){window.open("http://maps.google.com/maps?q=5751+South+Sheldon+Road+Canton,+MI+48188&amp;daddr=5751+S+Sheldon+Rd,+Canton,+MI+48188&amp;vpsrc=0&amp;ie=UTF8&amp;ll=42.26479,-83.473556&amp;spn=0.006295,0.008507&z=11","directions","")}typeof google==="object"&&b()}};$(function(){wfniUtils.init()})
