jQuery.noConflict(); /* #On Document Ready ================================================== */ /* Color animation jQuery-plugin http://www.bitstorm.org/jquery/color-animation/ Copyright 2011 Edwin Martin Released under the MIT and GPL licenses. */ (function(d){function i(){var b=d("script:first"),a=b.css("color"),c=false;if(/^rgba/.test(a))c=true;else try{c=a!=b.css("color","rgba(0, 0, 0, 0.5)").css("color");b.css("color",a)}catch(e){}return c}function g(b,a,c){var e="rgb"+(d.support.rgba?"a":"")+"("+parseInt(b[0]+c*(a[0]-b[0]),10)+","+parseInt(b[1]+c*(a[1]-b[1]),10)+","+parseInt(b[2]+c*(a[2]-b[2]),10);if(d.support.rgba)e+=","+(b&&a?parseFloat(b[3]+c*(a[3]-b[3])):1);e+=")";return e}function f(b){var a,c;if(a=/#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})/.exec(b))c= [parseInt(a[1],16),parseInt(a[2],16),parseInt(a[3],16),1];else if(a=/#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])/.exec(b))c=[parseInt(a[1],16)*17,parseInt(a[2],16)*17,parseInt(a[3],16)*17,1];else if(a=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(b))c=[parseInt(a[1]),parseInt(a[2]),parseInt(a[3]),1];else if(a=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9\.]*)\s*\)/.exec(b))c=[parseInt(a[1],10),parseInt(a[2],10),parseInt(a[3],10),parseFloat(a[4])];return c} d.extend(true,d,{support:{rgba:i()}});var h=["color","backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","outlineColor"];d.each(h,function(b,a){d.fx.step[a]=function(c){if(!c.init){c.a=f(d(c.elem).css(a));c.end=f(c.end);c.init=true}c.elem.style[a]=g(c.a,c.end,c.pos)}});d.fx.step.borderColor=function(b){if(!b.init)b.end=f(b.end);var a=h.slice(2,6);d.each(a,function(c,e){b.init||(b[e]={a:f(d(b.elem).css(e))});b.elem.style[e]=g(b[e].a,b.end,b.pos)});b.init=true}})(jQuery); jQuery(document).ready(function() { /* INIT SELECTOR */ initSelector(); /* NAVIGATION INITALISATION */ initNav(); /* FIELDS INITALISATION */ initSearchField() /* INIT THE QUOTES */ if(jQuery("#quotes_carousel").length) initQuotes(); /* CALL TWITTER PLUGIN */ //initTwitter(); /* INIT HOVERING */ initHovering(); /* INIT HOVERING */ initSocial(); /* INIT LIGHTBOX **/ initLightboxPlugin(); /** INIT FOOTERORGANISER **/ footerHandler(); /** INIT CLICKHIDE **/ initClickHide(); /* TABS INIT */ tabsInit(); /* ACCORDION INIT */ initAccordion(); jQuery('.checkbutton').click(function() { var t=jQuery(this); if (t.hasClass('selected')) t.removeClass('selected'); else t.addClass('selected'); }); /* CHECK IF SALOON EXIST IN HEADER !! */ if (jQuery('#sidebarcontainer').find('.saloonbanner').length>0) jQuery('#sidebarcontainer').css({'z-index':15}); // SHOW / HIDE THE PANEL.... jQuery(".signup-expander").click(function() { var th=jQuery(".signup-wrap"); var $signupheight = 65; if (th.position().top == 0) { th.cssAnimate({'top':(0-$signupheight)+"px"},{duration:300,queue:false}); jQuery('#nav').stop(); jQuery('#nav').css({'visibility':'visible'}).animate({'opacity':1},{duration:300,queue:false}); } else { th.cssAnimate({'top':"0px"},{duration:300,queue:false}) jQuery('#nav').stop(); jQuery('#nav').animate({'opacity':0},{duration:300,queue:false, complete:function() {jQuery('#nav').css({'visibility':'hidden'})}}); } }); $silvacolor1 = '#eb1a1d'; // THE COLORING OF THE SIGNUP BUTTON jQuery(".signup-expander").live({ mouseenter:function() { jQuery(this).stop(); jQuery(this).animate({ backgroundColor: "#1a2d36" },{duration:300,queue:false}); }, mouseleave:function() { jQuery(this).stop(); jQuery(this).animate({ backgroundColor: $silvacolor1 },{duration:200,queue:false}); } }); // COLORING THE A TAGS 2 -> 1 jQuery("#footer_container a, #content_container a, a.pdflink div, a.lunchproject,.blog_div h5 a,.blogdetail a, .subpageinfo a,.subpageinfo_right a, .contact_mail a, .colorchanger").live({ mouseenter:function() { if(!jQuery(this).hasClass("button")){ jQuery(this).stop(); jQuery(this).animate({ color: $silvacolor1 },{duration:600,queue:false}); } }, mouseleave:function() { if(!jQuery(this).hasClass("button")){ jQuery(this).stop(); jQuery(this).animate({ color: "#1a2d36" },{duration:400,queue:false}); } } }); // COLORING THE A TAGS 3 -> 2 jQuery(".breadcrumb a, .blogcategory a,.bloguser a,.blogcomment a,.blogtags a").live({ mouseenter:function() { if(!jQuery(this).hasClass("button")){ jQuery(this).stop(); jQuery(this).animate({ color: "#1a2d36" },{duration:600,queue:false}); } }, mouseleave:function() { if(!jQuery(this).hasClass("button")){ jQuery(this).stop(); jQuery(this).animate({ color: "#869093" },{duration:400,queue:false}); } } }); // COLORING THE A TAGS 3 -> 1 jQuery(".silva_archive a,.tagcloud a,a.widget_post_link").live({ mouseenter:function() { if(!jQuery(this).hasClass("button")){ jQuery(this).stop(); jQuery(this).animate({ color: $silvacolor1 },{duration:600,queue:false}); } }, mouseleave:function() { if(!jQuery(this).hasClass("button")){ jQuery(this).stop(); jQuery(this).animate({ color: "#869093" },{duration:400,queue:false}); } } }); // COLORING THE A TAGS in BLOG ARCHIVES AND CATEGORY jQuery("a.sh_arrowright, a.sh_arrowleft").live({ mouseenter:function() { jQuery(this).stop(); jQuery(this).animate({ color: $silvacolor1 },{duration:600,queue:false}); }, mouseleave:function() { jQuery(this).stop(); jQuery(this).animate({ color: "#869093" },{duration:400,queue:false}); } }); // COLORING THE BORDERS ON IMG jQuery('.borderhover').live({ mouseenter:function() { jQuery(this).stop(); jQuery(this).animate({ borderColor: $silvacolor1 },{duration:600,queue:false}); }, mouseleave:function() { jQuery(this).stop(); jQuery(this).animate({ borderColor: "#bcc1c1" },{duration:400,queue:false}); } }); }); ////////////////////// // INIT ACCORDION // ///////////////////// function initAccordion() { jQuery('.accordion-item').each(function(i) { var item=jQuery(this); item.find('.togglecontent').slideUp(0); item.find('.toggleswitch').click(function() { var displ = item.find('.togglecontent').css('display'); item.closest('ul').find('.toggleswitch').each(function() { var li = jQuery(this).closest('li'); li.find('.togglecontent').slideUp(300); li.find('.toggleswitch').removeClass("selected"); }); if (displ=="block") { item.find('.togglecontent').slideUp(300) item.find('.toggleswitch').removeClass("selected"); } else { item.find('.togglecontent').slideDown(300) item.find('.toggleswitch').addClass("selected"); } }); }); } /////////////////// // HIDE ON CLICK // ////////////////// function initClickHide() { jQuery('.clickhide').each(function() { jQuery(this).click(function() { jQuery(this).slideUp(300); }); }); } //////////////////// // Create Overlay // /////////////////// function createOverlay() { jQuery('body').append('
'); var overlay=jQuery('body').find('#boxoverlay'); var targetOpacity = overlay.css('opacity'); overlay.css({ 'width':jQuery(window).width()+'px', 'height':(jQuery(window).height()+150)+'px', 'opacity':'0.4', 'top':'0px', 'left':'0px' }); overlay.cssAnimate({'opacity':targetOpacity},{duration:500,queue:false}); overlay.click(function() { jQuery(".signup-wrap").cssAnimate({'top':"-88px"},{duration:300,queue:false}); jQuery(this).remove(); }); } ////////////////// // INITSOCIAL // ///////////////// function initSocial() { var socwidth=0; var amount = jQuery('body').find('.socials li').length; if (amount>0) { jQuery('body').find('.socials li').each(function(i) { socwidth = socwidth + jQuery(this).width(); }); socwidth = socwidth + ((amount-1)*10) jQuery('body').find('.soc').each(function() { var tt=jQuery(this).find(' .tooltip'); tt.css({'left':(-7-(tt.width()/2))+"px"}); setTimeout(function() { tt.css({'left':(-7-(tt.width()/2))+"px"}); },500); var tt = jQuery(this); tt.hover(function() { var tt=jQuery(this).find(' .tooltip'); tt.css({'left':(-7-(tt.width()/2))+"px"}); },function() {}); }) var socials= jQuery('body').find('.socials'); var socleft = socials.position().left; var socml = (960 - socwidth) / 2; socials.css({'left':socml+'px'}); } } ////////////////////////////// // NAVIGATION INITALISATION // ////////////////////////////// function initNav() { var nav = jQuery('#nav'); nav.find('ul li ul, ul li ul li ul').each(function() { var li=jQuery(this).find('>li').last(); li.addClass('last'); }); nav.append(''); nav.find('ul li ul, ul li ul li ul').each(function(i) { var ul =jQuery(this); ul.append(''); ul.data('height',ul.outerHeight()); //ul.animate({'height':'0px'},{duration:230,queue:false}); //ul.slideUp(0); }); nav.find('ul:first >li').each(function() { var li=jQuery(this); if (li.find('ul').length>0) li.addClass('firstlevel-submenu'); }); /* NAVIGATION */ nav.find(' li').each(function() { jQuery(this).hover( function() { var li=jQuery(this); var firsta =li.find('a:first'); var faw = firsta.width(); var diff = (li.width() - faw); if (diff>20) li.find('a:first').css({'paddingRight':(diff-20)+"px"}); var ul=jQuery(this).find('ul:first'); clearTimeout(ul.data('timeout')); clearTimeout(ul.data('timeout2')); ul.slideDown(130); /*ul.css({'display':'block'}); console.log(ul.data('height')); ul.animate({'height':ul.data('height')+"px",'opacity':1.0},{duration:230,queue:false});*/ }, function() { var ul=jQuery(this).find('>ul:first'); ul.data('timeout',setTimeout(function() {ul.slideUp(130);},230)); //li.delay(100).slideUp(230); //clearTimeout(li.data('timeout')); /*ul.data('timeout',setTimeout(function() { ul.animate({'height':"0px",'opacity':0},{duration:230,queue:false}); ul.data('timeout2',setTimeout(function() {ul.css({'display':'none'})},230)); },100));*/ }); }); } //////////////////////////////// // INITIALISATION OF LIGHTBOX // /////////////////////////////// function initLightboxPlugin() { jQuery(".lightbox").tplightboxsolo({ // Which Style should be used in the LightBox style:"dark-lightbox", // Which Social Items should be used on the Lightbox showGoogle:"", showFB:"", showTwitter:"", // Which Divider should be used by Deep Link http://www.yourwebsite.com?id=1 deepLink:"true", urlDivider:"?", // YOUTUBE / VIMEO MARKUP - iframe example vimeo_markup:'', youtube_markup:'', flvmarkup:' ', flvplayer:'flowplayer_plugins/flowplayer-3.2.7.swf' }); } /////////////////////// // INIT SEARCH FIELD // ////////////////////// function initSearchField() { // Check the Search value on Standard jQuery("#form_search, #Form_signupemail, #Form_signupname, #Form_Search, #commentfields .InputBox, #commentfields .TextBox").each(function() { var field=jQuery(this); field.data('standard',field.val()); }); jQuery("#form_search, #Form_signupemail, #Form_signupname,#Form_Search, #commentfields .InputBox, #commentfields .TextBox").focus(function(){ var $this = jQuery(this); $this.val($this.val()== $this.data('standard') ? "" : $this.val()); }); jQuery("#form_search, #Form_signupemail, #Form_signupname,#Form_Search, #commentfields .InputBox, #commentfields .TextBox").blur(function(){ var $this = jQuery(this); $this.val($this.val()== "" ? $this.data('standard') : $this.val()); }); } ////////////////////////////// // ADD THE HOVERING EFFECTS // ///////////////////////////// function initHovering() { // console.log(jQuery('body').find('.portfolio').offset().top+" "+jQuery('body').find('.portfolio').height()); jQuery('.hovering').each(function() { var a = jQuery(this); var item=a.parent(); var img = item.find('img'); //img.width(img.width()); //img.height(img.height()); }); jQuery('.hovering').live("mouseenter", function() { var a = jQuery(this); var item=a.parent(); var img = item.find('img'); img.width(img.width()); img.height(img.height()); var src = img.attr('src'); var w = img.innerWidth(); var h = img.innerHeight();//+parseInt(img.css('marginBottom'),0); if (jQuery(window).width()>0) { if (w>61) { // CLEAR THE REMOVEMENT IF THERE IS ANY ALREADY clearTimeout(item.data('timeout')); // IF THERE IS NO IMAGE YET, WE NEED TO ADD IT if (a.find('.himage').length==0) a.append('
'); // CATCH THE ITEMS WE NEED var newimg = item.find('.newimg'); var doverlay = item.find('.darker_overlay'); // STOP ANIMATION IF THERE IS ANY newimg.stop(true,true); doverlay.stop(true,true); // ANIMATE THE ITEM HERE doverlay.css({'opacity':0}).animate({'opacity':1},{duration:400,queue:false}); var factor = 1.10; if (w<150) factor=1.10; var factor=factor-1; var sp=w*(factor*5); //console.log("sp:"+sp); // SPEED DEPENDING ON SIZING DIFFERENTS if (sp<50) sp=sp*8; else if (sp<200) sp=sp*2; else if (sp>400) sp=sp/3; sp=w; if (sp<250) sp=250; if (sp>300) sp=300; //console.log("Factor:"+factor+" Speed:"+sp+" oldWidth"+w+" newWidth:"+(w*(1+factor*2))+" Dif:"+(w -(w*(1+factor*2))) ); newimg.data('ww',w); newimg.data('hh',h); newimg.data('sp',sp); //console.log(sp); if (!jQuery('body').hasClass('nozoom')) { //newimg.css({'opacity':0, 'top':(-h*factor)+"px",'left':(-w*factor)+'px','width':(w*(1 + factor*2))+'px','height':(h*(1+factor*2))+"px"}); newimg.css({'top':"10px",'left':"0px",'width':w+'px','height':(h)+"px",opacity:0}); newimg.animate({'top':"0px",'left':"0px",'width':w+'px','height':h+"px",opacity:1},{duration:(sp),queue:false, easing:"linear"}); } // ADD LINK AND PLUS BUTTONS HERE var plus=""; var link=""; var tt=""; var delay=0; // SHO THE MEDIA ICON ALSO if (item.find('.blogmediashow').length>0) { var bsw = item.find('.blogmediashow'); var pll = 20; var bidh = 65; var bidw = 60; if (item.find('.blogimagedate').length>0) { var bid = item.find('.blogimagedate'); bidh=(bid.innerHeight()-24)/2; bidw=bid.innerWidth(); } bsw.css({'paddingTop':bidh+"px", 'paddingBottom':bidh+"px",'paddingRight':(bidh-5)+'px'}); bsw.cssAnimate({'paddingLeft':(-15+bidw+bidh)+'px','opacity':1},{duration:300,queue:false}); } if (a.hasClass("lightbox")) { if (doverlay.find('.hover_plus').length==0) doverlay.append('
'); plus=doverlay.find('.hover_plus'); plus.css({'opacity':0}); } if (a.attr('href').length>0) { if (doverlay.find('.hover_link').length==0) doverlay.append(''); link=doverlay.find('.hover_link'); link.css({'opacity':0}); } if (plus!="" && link!="") { var pl = plus.position().left; var ll = link.position().left; plus.css({'left':(pl-23)+"px"}); link.css({'left':(ll+23)+'px'}); a.css({'cursor':'default'}); plus.css({'cursor':'pointer'}); link.css({'cursor':'pointer'}); } // ADD THE TITLE IF THERE IS ANY if (a.data('title')!=undefined) { if (doverlay.find('.teaser_title').length==0) doverlay.append('
'+a.data('title')+'
'); tt = doverlay.find('.teaser_title'); tt.css({'opacity':0}); var tth=tt.outerHeight(); var dif = 0; //h/2 - (h/2 - tth/2); if (plus!="") var pt = plus.position().top; else var pt=500; if (link!="") { var lt = link.position().top; if (link!="") link.css({'top':(lt-dif)+"px"}); } if (plus!="") plus.css({'top':(pt-dif)+"px"}); } // Animate the small Parts as well if (tt!="") { tt.css({'bottom':'-='+tt.outerHeight()}); setTimeout(function() {tt.animate({'bottom':'0px','opacity':0.8},{duration:300,queue:false})},delay); delay=delay+0; } if (plus!="") { pt = plus.position().top; plus.css({'top':(pt+20)+'px'}); setTimeout(function() {plus.animate({'top':(pt)+'px','opacity':1},{duration:300,queue:false})},delay); delay=delay+150; } if (link!="") { a.data('link',true); item.data('link',true); lt = link.position().top; link.css({'top':(lt+20)+'px'}); setTimeout(function() {link.animate({'top':(lt)+'px','opacity':1},{duration:300,queue:false})},delay); delay=delay+150; link.click(function() { if (a.attr('target') == undefined) window.location.href = a.attr('href') else window.open(a.attr('href'),a.attr('target')); }); } } else { if (!jQuery(this).hasClass("zoomanimon")) { jQuery(this).closest('.bordered').stop(); jQuery(this).closest('.bordered').animate({ borderColor: "#fff" },{duration:600,queue:false}); } } } else { a.css({'cursor':'pointer'}); a.click(function() { if (a.attr('target') == undefined) window.location.href = a.attr('href') else window.open(a.attr('href'),a.attr('target')); }); } }); // REMOVE THE ZOOMED IMAGE FROM TEASER jQuery('.hovering').live("mouseleave", function() { // CATCH THE ITEMS WE NEED var item = jQuery(this).parent(); var img = item.find('img'); var newimg = item.find('.newimg'); var doverlay = item.find('.darker_overlay'); // STOP THE ANIMATION IS THERE ANY newimg.stop(); doverlay.stop(); doverlay.find('.teaser_title').remove(); doverlay.find('.hover_link').remove(); doverlay.find('.hover_plus').remove(); // ZOOM BACK, AND THAN REMOVE WHAT WE DONT NEED ANY MORE var ww=newimg.data('ww'); var hh=newimg.data('hh'); var sp=newimg.data('sp'); // IF MEDIA EXIST, THAN LETS SHOW IT ALSO if (item.find('.blogmediashow').length>0) { var bsw = item.find('.blogmediashow'); bsw.cssAnimate({'paddingLeft':'0px','opacity':0},{duration:300,queue:false}); } doverlay.animate({'opacity':0},{duration:sp,queue:false}); if (!jQuery('body').hasClass('nozoom')) newimg.animate({'top':"0px",'left':'0px','width':ww+'px','height':hh+"px"},{duration:sp,queue:false, easing:"linear"}); item.data('timeout',setTimeout(function() {item.find('.himage').remove()},sp)); jQuery(this).closest('.bordered').stop(); jQuery(this).closest('.bordered').animate({ borderColor: "#1e1e1e" },{duration:600,queue:false}); }); } //////////////////////////// // BUTTON FADES ON HOVER // /////////////////////////// function initButtonFades() { jQuery('.bfade').each(function() { var button=jQuery(this); button.css({'opacity':0.4}); button.hover( function() { var button=jQuery(this); button.stop(); button.animate({'opacity':1},{duration:300,queue:false}); }, function() { var button=jQuery(this); button.stop(); button.animate({'opacity':0.4},{duration:300,queue:false}); }); }); } /*********************/ /* Footer Handler */ /********************/ function footerHandler() { jQuery(window).resize(function() { organiseBgs(); }); setInterval(function() { organiseBgs(); },100); } ////////////////////////////////////////////////////////// // PUT THE FOOTER,CONTAINER ETC. IN THE RIGHT POSITION // ///////////////////////////////////////////////////////// function organiseBgs() { if (jQuery('#content_container').length>0) var mainh = jQuery('#content_container').position().top + jQuery('#content_container').outerHeight(); else var mainh = 0; var footer = jQuery('#footer'); var callig = jQuery('.calligraphy'); var sidebar = jQuery('#sidebarcontainer'); footer.find('.footer_seperator').each(function() { jQuery(this).height(footer.find('.fullcontainer').height()); }); sidebar.find('.footer_seperator').each(function() { jQuery(this).height(sidebar.find('.fullcontainer').height()); }); if (footer.length>0) var footerh = footer.outerHeight(); else footerh=0; var windowh = jQuery(window).height(); var dif = windowh - (mainh+footerh); if (dif>0) { footer.animate({'marginTop':dif+"px"},{duration:600,queue:false}); } if (dif<0) { footer.stop(); footer.animate({'marginTop':"0px"},{duration:600,queue:false}); } } ////////////////// // INIT TWITTER // ////////////////// function initTwitter() { jQuery('#twitter_feed').twitterReader({ user:'envato', count:3 }); } function listfades(container) { jQuery(container).find('>li').each(function() { var li=jQuery(this); li.hover( function() { var li=jQuery(this); li.addClass("over"); jQuery(container).find('>li').each(function(i) { var lis = jQuery(this); lis.stop(); if (!lis.hasClass("over")) lis.animate({opacity:0.5},{duration:300,queue:false}); else lis.animate({opacity:1},{duration:300,queue:false}); }); }, function() { var li=jQuery(this); li.removeClass("over"); li.siblings().each(function() { var lis = jQuery(this); lis.stop(); lis.animate({opacity:1},{duration:300,queue:false}); }); li.stop(); li.animate({opacity:1},{duration:300,queue:false}); }); }); } ////////////// // QUOTES // ///////////// function initQuotes() { jQuery("#quotes_carousel").each(function() { var ca=jQuery(this); ca.find('li').each(function(i){ var li=jQuery(this); li.css({'position':'absolute','top':'-30px', 'opacity':0,'display':'block'}); if (i==0) { li.addClass('selectedquote'); setTimeout(function() { var endt = ca.height() / 2 - ca.find('.selectedquote').height() / 2; ca.find('.selectedquote').css({'top':'40px','opacity':0}).animate({'top':endt+'px','opacity':1},{duration:700,queue:false}); setTimeout(function() { var actli=ca.find('.selectedquote').index(); var nextli=actli+1; if (nextli==ca.find('li').length) nextli=0; ca.find('.selectedquote').addClass('oldquote').removeClass('selectedquote') ca.find('li:eq('+nextli+')').addClass('selectedquote'); },10); },1000); } }); setInterval(function() { var endt = ca.height() / 2 - ca.find('.selectedquote').height() / 2; ca.find('.oldquote').animate({'top':'50px','opacity':0},{duration:400,queue:false}); ca.find('.selectedquote').css({'top':'40px'}).animate({'top':endt+'px','opacity':1},{duration:700,queue:false}); setTimeout(function() { var actli=ca.find('.selectedquote').index(); var nextli=actli+1; if (nextli==ca.find('li').length) nextli=0; ca.find('.selectedquote').addClass('oldquote').removeClass('selectedquote') ca.find('li:eq('+nextli+')').addClass('selectedquote'); },10); },6000); }); } function rgb2hex(rgb) { try{ rgb = rgb.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/); function hex(x) { return ("0" + parseInt(x).toString(16)).slice(-2); } return "#" + hex(rgb[1]) + hex(rgb[2]) + hex(rgb[3]); } catch(error) { return "#000000"; } } /********************************* - INIT SELECTOR - **********************************/ function initSelector() { jQuery('.themechooser_arrow').live('click',function() { var chos = jQuery('#themechooser'); if (chos.hasClass('selected')) { chos.animate({'left':'-135px'},{duration:300,queue:false}); chos.removeClass('selected'); } else { chos.animate({'left':'0px'},{duration:300,queue:false}); chos.addClass('selected'); } }); jQuery('.themechooserbutton').live('click',function() { var sel = jQuery(this); jQuery('.themechooserbutton').each(function() { jQuery(this).removeClass('selected') }); sel.addClass('selected') jQuery('body').find('div, p, span,.button, a, div:hover, p:hover, span:hover, ul:hover, li:hover, ul,li,h1,h2,h3,h4,h5,h6').each(function(i) { var el = jQuery(this); el.css({'font-family':sel.data('font')}); var c1 = '#eb1a1d'; //RED var c2 = '#a57212'; //GOLD var c3 = '#6abc15'; //GREEN var c4 = '#1a96eb'; //BLUE console.log(el.css('color')+" : "+rgb2hex(el.css('color'))); if (rgb2hex(el.css('color')) == c1 || rgb2hex(el.css('color')) == c2 || rgb2hex(el.css('color')) == c3 || rgb2hex(el.css('color')) == c4) { el.css({'color':sel.data('color')}); } if (rgb2hex(el.css('background-color')) == c1 || rgb2hex(el.css('background-color')) == c2 || rgb2hex(el.css('background-color')) == c3 || rgb2hex(el.css('background-color')) == c4) { el.css({'background-color':sel.data('color')}); } if (rgb2hex(el.css('borderTopColor')) == c1 || rgb2hex(el.css('borderTopColor')) == c2 || rgb2hex(el.css('borderTopColor')) == c3 || rgb2hex(el.css('borderTopColor')) == c4) { el.css({'borderTopColor':sel.data('color')}); } $silvacolor1 = sel.data('color'); }); jQuery('#nav').removeClass('khgreen').removeClass('khgold').removeClass('khblue'); jQuery('#nav').addClass(sel.data('cclass')); jQuery('body').removeClass('khgreen').removeClass('khgold').removeClass('khblue'); jQuery('body').addClass(sel.data('cclass')); jQuery('.likeitbutton, .dislikeitbutton').removeClass('khgreen').removeClass('khgold').removeClass('khblue'); jQuery('.likeitbutton, .dislikeitbutton').addClass(sel.data('cclass')); jQuery('.logo').removeClass('khgreen').removeClass('khgold').removeClass('khblue'); jQuery('.logo').addClass(sel.data('cclass')); var newfont = sel.data('font'); //alert(("")); jQuery('head').append(""); }); } function tabsInit() { /* * Skeleton V1.1 * Copyright 2011, Dave Gamache * www.getskeleton.com * Free to use under the MIT license. * http://www.opensource.org/licenses/mit-license.php * 8/17/2011 */ /* Tabs Activiation ================================================== */ var tabs = jQuery('ul.tabs'); tabs.each(function(i) { //Get all tabs var tab = jQuery(this).find('> li > a'); tab.click(function(e) { //Get Location of tabs content var contentLocation = jQuery(this).attr('href'); //Let go if not a hashed one if(contentLocation.charAt(0)=="#") { e.preventDefault(); //Make Tab Active tab.removeClass('active'); jQuery(this).addClass('active'); //Show Tab Content & add active class jQuery(contentLocation).show().addClass('active').siblings().hide().removeClass('active'); } }); }); } jQuery(window).load(function(){ (function(d, s, id) { if(jQuery(".fb-like").length) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=162252937201892"; fjs.parentNode.insertBefore(js, fjs); } }(document, 'script', 'facebook-jssdk')); });