function addForm(a){function f(){b.find(".successmessage").hide();var f="";if(a=="#contactform"){f="php/contact.php"}else if(a=="#newsletterform"){f="php/signup.php"}else{f=""}if(d()){if(!c){c=true;b.find(".errormessage").hide();b.find(".sendingmessage").show();jQuery.post(f,b.serialize(),function(){b.find(".sendingmessage").hide();b.find(".successmessage").fadeIn();e()})}}return false}function e(){b.find("input").each(function(){jQuery(this).val("")});b.find("textarea").val("");c=false}function d(){var a=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;var c=/.{4}/;var d=true;b.find(".requiredfield").each(function(){var b=jQuery(this).attr("name");var e=jQuery(this).val();if(b=="email"){if(!a.test(e)){jQuery(this).addClass("formerror");d=false}else{jQuery(this).removeClass("formerror")}}else{if(!c.test(e)){jQuery(this).addClass("formerror");d=false}else{jQuery(this).removeClass("formerror")}}});if(!d){b.find(".errormessage").fadeIn()}return d}var b=jQuery(a);var c=false;b.find("button[name=send]").click(f)}function addPortfolio(a){var b=jQuery("#portfoliolist"+a+"column");if(jQuery(b).length!=0){var c=b.clone();if(a==1){jQuery(".portfoliofilter_sidebar li").click(function(a){jQuery(".portfoliofilter_sidebar li a").addClass("sidebarmenuselect_noselect");jQuery(".portfoliofilter_sidebar li a").removeClass("sidebarmenuselect");jQuery(this).children("a").removeClass("sidebarmenuselect_noselect");jQuery(this).children("a").addClass("sidebarmenuselect");var d=jQuery(this).attr("class");if(d=="all"){var e=c.find(".blogpost")}else{var e=c.find(".blogpost[data-type="+d+"]")}jQuery(b).quicksand(e,{duration:500,easing:"swing",adjustHeight:"dynamic",enhancement:function(){}},function(){addPrettyPhoto()});return false})}else{jQuery(".portfoliofilter li").click(function(a){jQuery(".portfoliofilter li a").addClass("portfoliobutton_noselect");jQuery(".portfoliofilter li a").removeClass("portfoliobutton");jQuery(this).children("a").removeClass("portfoliobutton_noselect");jQuery(this).children("a").addClass("portfoliobutton");var d=jQuery(this).attr("class");if(d=="all"){var e=c.find(".portfolio")}else{var e=c.find(".portfolio[data-type="+d+"]")}jQuery(b).quicksand(e,{duration:500,easing:"swing",adjustHeight:"dynamic",enhancement:function(){}},function(){addPrettyPhoto()});return false})}}}function loadGoogleMaps(){if(jQuery("#googlemap").length!=0){var a=document.createElement("script");a.type="text/javascript";a.src="http://maps.google.com/maps/api/js?sensor=false&callback=initGoogleMaps";document.body.appendChild(a)}}function initGoogleMaps(){var a=new google.maps.LatLng(50.935816,6.961212);var b={zoom:14,center:a,popup:true,mapTypeId:google.maps.MapTypeId.ROADMAP};var c=new google.maps.Map(document.getElementById("googlemap"),b);var d=new google.maps.Marker({position:a,map:c,title:"Our Company Location"});google.maps.event.addListener(d,"click",function(){c.setZoom(17)})}function addSidebarSlider(){if(jQuery("#sidebarslider").length!=0){jQuery("#sidebarslider").tinycarousel({controls:false,pager:true,interval:true,intervaltime:3e3})}}function addTwitter(){if(jQuery("#twittertweet").length!=0){jQuery("#twittertweet").append('<a href="http://twitter.com/vicbrain" class="twitter-share-button" data-url="#" data-text="Vicbrain" data-count="vertical">Tweet</a>');var a=document.createElement("script");a.type="text/javascript";a.src="http://platform.twitter.com/widgets.js";document.getElementsByTagName("head")[0].appendChild(a)}}function addFacebook(){if(jQuery("#facebooklike").length!=0){window.fbAsyncInit=function(){jQuery("#facebooklike").append('<fb:like href="" layout="box_count" show_faces="false" width="55"></fb:like>')};var a=document.createElement("script");a.type="text/javascript";a.src="http://connect.facebook.net/en_US/all.js#xfbml=1";document.getElementsByTagName("head")[0].appendChild(a)}}function addGoogleplus(){if(jQuery("#googleplusone").length!=0){jQuery("#googleplusone").append('<g:plusone size="tall"></g:plusone>');var a=document.createElement("script");a.type="text/javascript";a.src="https://apis.google.com/js/plusone.js";document.getElementsByTagName("head")[0].appendChild(a)}}function addPrettyPhoto(){jQuery("a[data-rel^='prettyPhoto']").prettyPhoto({overlay_gallery:true,show_title:false,hideflash:true});jQuery("a[data-rel^='prettyPhoto'] img").hover(function(){jQuery(this).stop().fadeTo("fast",.5)},function(){jQuery(this).stop().fadeTo("fast",1)})}function relative_time(a){var b=a.split(" ");a=b[1]+" "+b[2]+", "+b[5]+" "+b[3];var c=Date.parse(a);var d=arguments.length>1?arguments[1]:new Date;var e=parseInt((d.getTime()-c)/1e3);e=e+d.getTimezoneOffset()*60;var f="";if(e<60){f="a minute ago"}else if(e<120){f="couple of minutes ago"}else if(e<45*60){f=parseInt(e/60).toString()+" minutes ago"}else if(e<90*60){f="an hour ago"}else if(e<24*60*60){f=""+parseInt(e/3600).toString()+" hours ago"}else if(e<48*60*60){f="1 day ago"}else{f=parseInt(e/86400).toString()+" days ago"}return f}jQuery.noConflict();jQuery(document).ready(function(){jQuery("a[data-rel^='fadeimg'] img").hover(function(){jQuery(this).stop().fadeTo("fast",.5)},function(){jQuery(this).stop().fadeTo("fast",1)});ddsmoothmenu.init({mainmenuid:"smoothmenu1",orientation:"h",classname:"ddsmoothmenu",contentsource:"markup"});if(jQuery("#partners").length!=0){jQuery("#partners").tinycarousel({display:4,interval:true,intervaltime:5e3,duration:1e3})}jQuery(".overview img[title]").tooltip({opacity:1,effect:"toggle",delay:0});jQuery("ul.tabs").tabs("div.panes > div");jQuery(".pricingtable td:odd").css({background:"#e5e5e5"});if(jQuery("#contactform").length!=0){addForm("#contactform")}if(jQuery("#newsletterform").length!=0){addForm("#newsletterform")}if(jQuery("#replyform").length!=0){addForm("#replyform")}addFacebook();addTwitter();addGoogleplus();addPrettyPhoto();addPortfolio("1");addPortfolio("3");if(jQuery("#tweets").length!=0){jQuery.ajaxSetup({cache:true});jQuery.getJSON("http://twitter.com/status/user_timeline/vicbrain.json?count=2&callback=?",function(a){jQuery.each(a,function(a,b){jQuery(".tweetlist").append("<li>"+b.text.linkify()+"<p>"+relative_time(b.created_at)+"</p></li>")})})}});jQuery(window).load(function(){if(jQuery("#nivoSlider").length!=0){jQuery("#nivoSlider").nivoSlider({effect:"random",slices:15,boxCols:8,boxRows:4,animSpeed:500,pauseTime:3e3,startSlide:0,directionNav:false,directionNavHide:true,controlNav:true,controlNavThumbs:false,controlNavThumbsFromRel:false,controlNavThumbsSearch:".jpg",controlNavThumbsReplace:"_thumb.jpg",keyboardNav:true,pauseOnHover:true,manualAdvance:false,captionOpacity:1,prevText:"?",nextText:"?",beforeChange:function(){},afterChange:function(){},slideshowEnd:function(){},lastSlide:function(){},afterLoad:function(){}})}loadGoogleMaps()});String.prototype.linkify=function(){return this.replace(/[A-Za-z]+:\/\/[A-Za-z0-9-_]+\.[A-Za-z0-9-_:%&\?\/.=]+/,function(a){return a.link(a)})};(function(a){a.fn.smoothTabs=function(b){var c=0;var d="smoothTabsLiCurrent";var e="smoothTabsDivHidden";var f="smoothTabsDivVisible";var g=document.location.hash.substr(1,document.location.hash.length);if(g&&a("#"+g,this).size()){c=a("#"+g,this).index()}this.each(function(){a("ul li:eq("+c+")",this).addClass(d);a(this).children("div").addClass(e);a("div:eq("+c+")",this).fadeIn(b).addClass(f).removeClass(e)});a("ul li",this).click(function(){var c=a(this).parent();var g=a(c).parent();a("li",c).removeClass(d);a(this).addClass(d);var h=a("li",c).index(this);var i=a("div",g).get(h);if(a(i).attr("class")==f){return false}a("."+f,g).fadeOut(b,function(){a(i).fadeIn(b).addClass(f).removeClass(e)});a("."+f,g).removeClass(f).addClass(e)})}})(jQuery)
