Array.prototype.contains=function(b){for(var a=0;a<this.length;a++){if(this[a]==b){return true}}return false};var FW=FW||{};FW.startups=FW.startups||{};FW.Registry=(function(){return new function a(){this.keys=new Array(),this.values=new Array(),this.add=function(b,c){if(!this.keys.contains(b)){this.keys.push(b);this.values[b]=new Array()}this.values[b].push(c)},this.set=function(b,c){if(!this.keys.contains(b)){this.keys.push(b);this.values[b]=c}this.values[b]=c},this.has=function(b){if(this.values[b]!==undefined){return true}return false},this.get=function(b){if(this.values[b]!==undefined){return this.values[b]}return new Array()},this.remove=function(b){if(this.values[b]!==undefined){delete this.values[b];delete this.keys[b]}},this.clear=function(){$.each(this.keys,function(b,c){if(c.split(".")[1]=="startups"&&c!="FW.startups.run"){delete FW.Registry.keys[FW.Registry.keys.indexOf(c)];delete FW.Registry.values[c]}})}}})();(function(a){a.fn.defaultValue=function(e){var b=this;var c=this.prev("label");var d=c.text();if(b.val()>""){c.css({opacity:"0"});c.hide()}a(b).focus(function(){if(a(this).val()>""){c.css({opacity:"0"});c.hide()}else{if(a(this).val()==d){a(this).val()==""}else{c.animate({opacity:"0.3"},"slow");c.show()}}}).blur(function(){if(a(this).val()==""){a(this).val()==d;c.animate({opacity:"1"},"slow");c.show()}});a(b).keyup(function(){if(a(this).val()>""){c.css({opacity:"0"});c.hide()}else{c.animate({opacity:"0.3"},"slow");c.show()}})}})(jQuery);FW.startups.tabs=function(){var a={selected:0};$.each(FW.Registry.get("FW.startups.tabs"),function(b,c){$("#"+c.id).tabs($.merge(a,c.options));FW.Registry.add("FW.tabs.instance."+c.id,$("#"+c.id))})};FW.Registry.add("FW.startups.run",FW.startups.tabs);FW.startups.slider=function(){var a={content:".sliderContent",children:"div",transition:"horizontal",animationSpeed:500,autoplay:true,autoplaySpeed:5000,pauseOnHover:true,bullets:false,arrows:true,arrowsHide:false,prev:"prev",next:"next",animationStart:function(){},animationComplete:function(){},onPrev:function(){},onNext:function(){}};$.each(FW.Registry.get("FW.startups.slider"),function(b,d){var c=$("#"+d.id).mobilyslider($.extend({},a,d.options));FW.Registry.add("FW.slider.instance."+d.id,c)})};FW.Registry.add("FW.startups.run",FW.startups.slider);jQuery.fn.stopSliderVideos=function(a){$(a.selector+" > .sliderContent > .ytvideo").each(function(d,c){var e=document.getElementById(this.children[0].id);if(typeof e.getPlayerState!="undefined"&&e.getPlayerState()==1){e.pauseVideo()}})};function onYouTubePlayerReady(a){ytplayer=document.getElementById(a);ytplayer.addEventListener("onStateChange","onytplayerStateChange")}FW.startups.readmore=function(){$.each(FW.Registry.get("FW.startups.readmore"),function(b,c){if($(c.selector+" span.readmore").length){var a=$(c.selector+" span.readmore")}else{var a=$(c.selector+" span.suffix")}$(a).bind("click",function(d){if($(c.selector+" span.readmore").length){$(c.selector+" span.readmore").hide()}$(c.selector+" span.suffix").hide();$(c.selector+" span.fulltext").show()})})};FW.Registry.add("FW.startups.run",FW.startups.readmore);jQuery.fn.linkTo=function(b,a,c){b.preventDefault();location.href=a};jQuery.fn.countMinimumCharacters=function(b,a,d){var c=b.val().length;if(c>=d){a.parent().hide()}else{a.parent().show()}a.html(d-c)};jQuery.fn.closeTooltip=function(a,b){a.parents(".tooltip_parent").find(".tooltip_child").removeClass("has_open_tooltip");clearTimeout(FW.Registry.get("FW.tooltip.timer"));$("#tooltip_"+b).slideUp()};jQuery.fn.openTooltip=function(d,e,c,b){if($(d.target).hasClass("has_open_tooltip")){$(this).closeTooltip($(d.target),e);return}$(d.target).parents(".tooltip_parent").find(".tooltip_child").removeClass("has_open_tooltip");$(d.target).addClass("has_open_tooltip");if(typeof b!="undefined"){var b=time}else{var b=15000}$("#tooltip_"+e+" td.content").html(FW.Registry.get("FW.tooltip."+c));var a=$(d.target).position();a.top=(a.top-$("#tooltip_"+e).height())+$(d.target).height();if($("#tooltip_"+e+" td.left-bottom").length>0){a.left=a.left-($(d.target).width()/2)}if($("#tooltip_"+e+" td.right-bottom").length>0){a.left=(a.left-$("#tooltip_"+e).width())+$(d.target).width()+($(d.target).width()/2)}$("#tooltip_"+e).unbind("mouseleave");$("#tooltip_"+e).mouseleave(function(f){$(this).closeTooltip($(f.target),e)});$("#tooltip_"+e).css("top",a.top);$("#tooltip_"+e).css("left",a.left);$("#tooltip_"+e).slideDown();clearTimeout(FW.Registry.get("FW.tooltip.timer"));timer=setTimeout(function(){$(this).closeTooltip($(d.target),e)},b);FW.Registry.set("FW.tooltip.timer",timer)};FW.startups.layer=function(){$.each(FW.Registry.get("FW.startups.layer"),function(g,a){var i=$("#"+a);$("body").append(i);var f=i.find(".layerBackground");f.css("height",$("body").height()+"px");f.css("width",$("body").width()+"px");var b=i.find(".layerContent");var d=$(window).height()+$(window).scrollTop();var h=$(window).width()+$(window).scrollLeft();var c=((h/2)-(b.width()/2));var e=((d/2)-(b.height()/2));if((e-250)>0){e=e-250}b.css("left",c+"px");b.css("top",e+"px");i.find(".closeLayerIcon, .closeLayerButton").click(function(j){j.preventDefault();i.css("display","none");i.trigger("layer_closed")})})};FW.Registry.add("FW.startups.run",FW.startups.layer);FW.startups.facebook=function(){$.each(FW.Registry.get("FW.startups.facebook"),function(b,a){(function(){var c=document.createElement("script");c.src=document.location.protocol+"//connect.facebook.net/"+a.culture+"/all.js";c.async=true;document.getElementById("fb-root").appendChild(c)}());window.fbAsyncInit=function(){FB.init({appId:a.appId,status:true,cookie:true,xfbml:true});FB.Canvas.setAutoResize();fbApiInit=true}})};FW.Registry.add("FW.startups.run",FW.startups.facebook);facebookInitComplete=function(a){if(!window.fbApiInit){setTimeout(function(){facebookInitComplete(a)},100)}else{if(a){a()}}};jQuery.fn.fb_userLikesUrl=function(a,b){FB.api("/me",function(c){if(!c.id){b(0);return false}var d=c.id;FB.api("/?ids="+a,function(f){if(!f[a]||!f[a].id){b(0);return false}var e=f[a].id;FB.api({method:"fql.query",query:"SELECT target_id FROM connection WHERE source_id = "+d+" AND target_id = "+e},function(g){if(g.length){b(1);return true}b(0);return false})})})};FW.startups.mainNaviSearch=function(){if(!$("#naviSearchField").length){return}$("#naviSearchField").bind("click",function(a){a.preventDefault();if($("#naviSearchField").val()==FW.Registry.get("FW.mainNaviSearch.search.lng")){$("#naviSearchField").val("")}$("#naviSearchField").unbind("click")});$("#naviSearchField").keypress(function(a){if(a.which==13){a.preventDefault();location.href=$("#naviSearchSelect").val()+"?search[query]="+$("#naviSearchField").val()}});$("#naviSearchSelectBox").jqTransform()};FW.Registry.add("FW.startups.run",FW.startups.mainNaviSearch);FW.startups.mainNaviLinks=function(){$("#mainNavigationList li a.navLink").bind("mouseover",function(a){a.preventDefault();$("#mainNavigationList li a.navLink").each(function(b,c){if($(c).hasClass("activeLink")){FW.Registry.set("FW.mainNavigation.active.link",$(c));$(c).removeClass("activeLink")}})});$("#mainNavigationList li a.navLink").bind("mouseout",function(a){a.preventDefault();$("#mainNavigationList li a.navLink").each(function(b,c){$(c).removeClass("activeLink")});if(FW.Registry.get("FW.mainNavigation.active.link").length){FW.Registry.get("FW.mainNavigation.active.link").addClass("activeLink")}});$("#mainNavigationList li a.navLink").bind("click",function(a){$("#mainNavigationList li a.navLink").each(function(b,c){if($(a.currentTarget).attr("id")==$(c).attr("id")){FW.Registry.set("FW.mainNavigation.active.link",$(c));$(c).addClass("activeLink")}else{$(c).removeClass("activeLink")}})})};FW.Registry.add("FW.startups.run",FW.startups.mainNaviLinks);if(!Array.indexOf){Array.prototype.indexOf=function(b){for(var a=0;a<this.length;a++){if(this[a]==b){return a}}return -1}}FW.startups.googleplus1=function(){$.each(FW.Registry.get("FW.startups.googleplus1"),function(a){(function(){var c=document.createElement("script");c.src="https://apis.google.com/js/plusone.js";c.async=true;var b=document.createTextNode("{lang: '"+a.lang+"'}");c.appendChild(b);document.getElementById("fb-root").appendChild(c)}())})};FW.Registry.add("FW.startups.run",FW.startups.googleplus1);FW.startups.timeago=function(){$.each(FW.Registry.get("FW.startups.timeago"),function(b,a){timeago_func(a)})};FW.Registry.add("FW.startups.run",FW.startups.timeago);var timeago_func=function(b){var g=Math.round((new Date()).getTime()/1000);var e=b.ts;var f=$("#"+b.id);var d=g-e;if(d<=60){f.text(FW.Registry.get("FW.timeago.lng.0"))}else{if(d<=3600){var c=Math.floor(d/60);f.text(FW.Registry.get("FW.timeago.lng.1").replace(/%minutes%/,c))}else{if(d<=7200){f.text(FW.Registry.get("FW.timeago.lng.2"))}else{if(d<=86400){var a=Math.floor(d/60/60);f.text(FW.Registry.get("FW.timeago.lng.3").replace(/%hours%/,a))}else{if(d<=172800){f.text(FW.Registry.get("FW.timeago.lng.4"))}else{var h=Math.floor(d/60/60/24);f.text(FW.Registry.get("FW.timeago.lng.5").replace(/%days%/,h))}}}}}window.setTimeout(function(){timeago_func(b)},60000)};FW.startups.citySelection=function(){$("#locationTargetingBoxChangeCity").click(function(a){a.preventDefault();if(!$("#cityselector").length){$.ajax({url:FW.Registry.get("FW.cityselector.url1"),type:"get",dataType:"html",cache:false,data:[],beforeSend:function(d,c){var e=document.createTextNode(FW.Registry.get("FW.cityselector.lng1"));var b=document.createElement("span");b.id="locationTargetingBoxLoadText";b.appendChild(e);$("#locationTargetingBoxChangeCity").hide();document.getElementById("locationTargetingBox").appendChild(b)},success:function(b){$("#locationTargetingBox").append(b);if($("#locationTargetingBoxLoadText").length){$("#locationTargetingBoxLoadText").remove()}$("#locationTargetingBoxChangeCity").show();$("#cityselector_close").click(function(){$("#cityselector").css("display","none")});$("#cityselector_regionList > li").click(function(d){d.preventDefault();$("#cityselector_regionList > li").each(function(e,f){$(f).removeClass("selected")});$(d.target).attr("class","selected");var c=$(d.target).attr("data");$.ajax({url:FW.Registry.get("FW.cityselector.url2"),type:"post",dataType:"json",cache:false,data:"federalstate="+c,beforeSend:function(f,e){$("#cityselector_cityloader").show()},success:function(g){$("#cityselector_cityList").html("");if(g&&g.length){for(var f=0;f<g.length;f++){var j=document.createElement("li");j.data=g[f]["slug"];var e=document.createElement("a");var h=document.createTextNode(g[f]["city"]);e.href=g[f]["link"];if(g[f]["selected"]){$(j).addClass("selected")}e.appendChild(h);j.appendChild(e);document.getElementById("cityselector_cityList").appendChild(j)}$("#cityselector_cityList").trigger("loaded")}$("#cityselector_cityloader").hide()}})});$("#cityselector_searchfield").defaultValue();$("#cityselector_searchfield").keypress(function(c){if(c.keyCode==13){$("#cityselector_searchButton").trigger("click")}});$("#cityselector_searchButton").click(function(c){c.preventDefault();$.ajax({url:FW.Registry.get("FW.cityselector.url3"),type:"post",dataType:"json",cache:false,data:"search="+$("#cityselector_searchfield").val(),beforeSend:function(e,d){$("#cityselector_cityloader").show()},success:function(d){if(d.forward){location.href=d.forward;return}else{if(d.slug&&d.federalstate){$("#cityselector_regionList > li").each(function(e,f){if($(f).attr("data")==d.federalstate){$(f).trigger("click");$("#cityselector_cityList").bind("loaded",function(){$("#cityselector_cityList > li").each(function(g,h){if($(h).attr("data")==d.slug){$(h).addClass("selected")}});$("#cityselector_cityList").unbind("loaded")});return}else{$(f).removeClass("selected")}})}}$("#cityselector_cityloader").hide()}})})}})}else{$("#cityselector").css("display","block")}})};FW.Registry.add("FW.startups.run",FW.startups.citySelection);
