/* To edit use source file: js/source/onLoad.js  */

jQuery(document).ready(function($){if(fadeContent!=="none"&&!oldIE){elems=(fadeContent==="all")?"#Top, #Middle, #Bottom":"#Middle";hiddenClass=(fadeContent==="all")?"invisibleAll":"invisibleMiddle";if(fadeContent==="all"||fadeContent==="content"){$("#Wrapper").children(elems).css("opacity","0").end().parent("body").removeClass(hiddenClass);setTimeout(function(){$("#Middle").animate({"opacity":"1"},250);},100);if(fadeContent==="all"){setTimeout(function(){$("#Top").animate({"opacity":"1"},200);},0);setTimeout(function(){$("#Bottom").animate({"opacity":"1"},300);},200);}}}if(screen.width>990){$("body").css("background",jQuery("#Bottom .sub-footer").css("background-color"));}postitionCurveBg(jQuery);setTimeout("postitionCurveBg(jQuery)",90);setTimeout("postitionCurveBg(jQuery)",500);var $buttonElement=$('input[type="submit"]:not(.noStyle), input[type="button"]:not(.noStyle), input[type="reset"]:not(.noStyle), button:not(.noStyle)');$($buttonElement).addClass("btn");$("label.overlabel").overlabel();var article=$(".posts-list .style-image-left");if(article.length>0){article.each(function(){var w=jQuery(this).children(".the-post-image").outerWidth(true);if(w){jQuery(this).children(".the-post-container").css("margin-left",w+"px");}});}var article=$(".content-post-single .style-image-left");if(article.length>0){article.each(function(){var w=jQuery(this).find(".the-post-image").outerWidth(true);if(w){jQuery(this).find("header.entry-header").css("margin-left",w+"px");}});}$(".gallery .gallery-item a").attr("rel","gallery");$("a.popup[href*='http://www.youtube.com/watch?']").colorbox({href:function(){var id=/[\?\&]v=([^\?\&]+)/.exec(this.href);url="http://www.youtube.com/embed/"+id[1];if(!id[1]){url=this.href;}return url;},iframe:true,innerWidth:function(){w=$.getUrlVars(this.href)["width"]||640;return w;},innerHeight:function(){h=$.getUrlVars(this.href)["height"]||390;return h;}});$("a.popup[href*='http://www.vimeo.com/'], a.popup[href*='http://vimeo.com/']").colorbox({href:function(){var id=/vimeo\.com\/(\d+)/.exec(this.href);url="http://www.vimeo.com/moogaloop.swf?clip_id="+id[1];if(!id[1]){url=this.href;}return url;},iframe:true,innerWidth:function(){w=$.getUrlVars(this.href)["width"]||640;return w;},innerHeight:function(){h=$.getUrlVars(this.href)["height"]||360;return h;}});$("a[href$='.jpg'],a[href$='.jpeg'],a[href$='.png'],a[href$='.gif'],a[href$='.tif'],a[href$='.tiff'],a[href$='.bmp']").colorbox({maxWidth:"95%",maxHeight:"95%"});$(".popup").colorbox({maxWidth:"95%",maxHeight:"95%"});$("a[href$='#popup']").colorbox({maxWidth:"95%",maxHeight:"95%",href:function(){if(this.href){return this.href.replace("#popup","");}}});$(".iframe").colorbox({width:"80%",height:"80%",iframe:true});$("a[href$='#iframe']").colorbox({width:"80%",height:"80%",iframe:true,href:function(){if(this.href){return this.href.replace("#iframe","");}}});if($(".portfolio-list").length>0){var pGroup=$(".portfolio-list");pGroup.each(function(){var h=0;pItems=jQuery(this).find(".the-post-container");pItems.each(function(i,val){if(jQuery(this).height()>h){h=jQuery(this).height();}});pItems.css("height",h+"px");});}$(".messageBox .closeBox").click(function(){jQuery(this).parent(".messageBox").fadeTo(400,0.001).slideUp();});if(BrowserDetect.browser=="Safari"&&BrowserDetect.OS=="Windows"){$("button.btn span").css("margin","-1px -3px");}if(jQuery(".tabList").length>0){$(".tabList").sTabs();}if(jQuery(".toggleItem").length>0){$(".toggleItem").simpleToggle();}});function postitionCurveBg($){var $curveElement=$(".curve #Wrapper");if($curveElement.length>0){var wrapper=$curveElement.offset();var showcase=$("#Showcase").offset();var bgOffset=266;var defaulPos=119;var currentPos=showcase.top-wrapper.top-bgOffset;if(currentPos!=defaulPos){$curveElement.css("background-position","50% "+currentPos+"px");}}}jQuery.extend({getUrlVars:function(url){var vars=[],hash;if(!url){url=window.location.href;}var hashes=url.slice(window.location.href.indexOf("?")+1).split("&");for(var i=0;i<hashes.length;i++){hash=hashes[i].split("=");vars.push(hash[0]);vars[hash[0]]=hash[1];}return vars;},getUrlVar:function(name,url){if(!url){url=window.location.href;}return jQuery.getUrlVars(url)[name];}});var oldIE=false;var BrowserDetect={init:function(){this.browser=this.searchString(this.dataBrowser)||"An unknown browser";this.version=this.searchVersion(navigator.userAgent)||this.searchVersion(navigator.appVersion)||"an unknown version";this.OS=this.searchString(this.dataOS)||"an unknown OS";},searchString:function(data){for(var i=0;i<data.length;i++){var dataString=data[i].string;var dataProp=data[i].prop;this.versionSearchString=data[i].versionSearch||data[i].identity;if(dataString){if(dataString.indexOf(data[i].subString)!=-1){return data[i].identity;}}else{if(dataProp){return data[i].identity;}}}},searchVersion:function(dataString){var index=dataString.indexOf(this.versionSearchString);if(index==-1){return;}return parseFloat(dataString.substring(index+this.versionSearchString.length+1));},dataBrowser:[{string:navigator.vendor,subString:"Apple",identity:"Safari",versionSearch:"Version"},{string:navigator.userAgent,subString:"MSIE",identity:"Explorer",versionSearch:"MSIE"}],dataOS:[{string:navigator.platform,subString:"Win",identity:"Windows"}]};BrowserDetect.init();if(BrowserDetect.browser=="Explorer"&&BrowserDetect.version<9){oldIE=BrowserDetect.version;}(function($){$.fn.sTabs=function(opts){var options=$.extend({},$.fn.sTabs.defaults,opts);return this.each(function(){$(this).addClass("tabs");$(this).find("a").each(function(){$($(this).attr("href")).addClass("tab").hide();$(this).bind(options.eventType,function(e){e.preventDefault();$(this).addClass("active");options.animate?$($(this).attr("href")).fadeIn(options.duration):$($(this).attr("href")).show();$($(this).parent().siblings().find("a")).each(function(){$(this).removeClass("active");$($(this).attr("href")).hide();});});});var first=$(this).find("li:nth-child("+options.startWith+")").children("a");$(first).addClass("active");$($(first).attr("href")).show();});};$.fn.sTabs.defaults={animate:false,duration:300,startWith:1,eventType:"click"};})(jQuery);(function($){$.fn.simpleToggle=function(opts){var options=$.extend({},$.fn.simpleToggle.defaults,opts);return this.each(function(){$title=$(this).children(".togTitle");$title.each(function(){$(this).click(function(){$item=$(this);$item.next(".togDesc").slideToggle("fast",function(){$icon=$item.children(".iconSymbol");if($(this).css("display")=="block"){$icon.removeClass("plus").addClass("minus");}else{$icon.removeClass("minus").addClass("plus");}});});});});};$.fn.simpleToggle.defaults={};})(jQuery);if(fadeContent!=="none"&&!oldIE){setTimeout(function(){jQuery("body").removeClass("invisibleAll invisibleMiddle");},1000);}
