function setCookie(c_name,value,exdays)
{
var exdate=new Date();
exdate.setDate(exdate.getDate() + exdays);
var c_value=escape(value) + ((exdays==null) ? "" : "; expires="+exdate.toUTCString());
document.cookie=c_name + "=" + c_value;
}
function resizeVideo(){
if(jQuery('.embedded_videos').length){
jQuery('.embedded_videos iframe ').each(function(){
var iframe_width = jQuery(this).parents('.embedded_videos').parent().width()*0.95;
var_iframe_height = iframe_width/1.37;
jQuery(this).attr('width',iframe_width);
jQuery(this).attr('height',var_iframe_height);
});
jQuery('.embedded_videos div.video-js ').each(function(){
var iframe_width = jQuery(this).parents('.embedded_videos').parent().width()*0.95;
var_iframe_height = iframe_width/1.37;
jQuery(this).attr('width',iframe_width);
jQuery(this).attr('height',var_iframe_height);
jQuery(this).css('width',iframe_width);
jQuery(this).css('height',var_iframe_height);
});
}
}
jQuery(window).on('resize load orientationChanged', function() {
// do your stuff here
});
/* Mobile menu */
(function($){
$.fn.mobileMenu = function(options) {
var defaults = {
defaultText: 'Navigate to...',
className: 'select-menu',
subMenuClass: 'sub-menu',
subMenuDash: '–'
},
settings = $.extend( defaults, options ),
el = jQuery(this);
this.each(function(){
// ad class to submenu list
el.find('ul').addClass(settings.subMenuClass);
// Create base menu
jQuery('',{
'class' : settings.className
}).insertAfter( el );
// Create default option
jQuery('', {
"value" : '#',
"text" : settings.defaultText
}).appendTo( '.' + settings.className );
// Create select option from menu
el.find('a').each(function(){
if(jQuery(this).html().indexOf("") != -1){
var el_text = jQuery(this).html().replace(/.*<\/span>/gi,'');
} else{
var el_text = jQuery(this).text();
}
//console.log(el_text);
var $this = jQuery(this),
optText = ' ' + el_text,
optSub = $this.parents( '.' + settings.subMenuClass ),
len = optSub.length,
dash;
// if menu has sub menu
if( $this.parents('ul').hasClass( settings.subMenuClass ) ) {
dash = Array( len+1 ).join( settings.subMenuDash );
optText = dash + optText;
}
// Now build menu and append it
jQuery('', {
"value" : this.href,
"html" : optText,
"selected" : (this.href == window.location.href)
}).appendTo( '.' + settings.className );
}); // End el.find('a').each
// Change event on select element
jQuery('.' + settings.className).change(function(){
var locations = $(this).val();
if( locations !== '#' ) {
window.location.href = jQuery(this).val();
};
});
}); // End this.each
return this;
};
})(jQuery);
jQuery(document).ready(function($) {
$('.mobile-login-menu').mobileMenu({
defaultText: 'User menu...',
className: 'mobile-login-select-menu',
subMenuClass: 'mobile-login-sub-menu',
subMenuDash: '–'
});
$('.main-menu-top').mobileMenu();
});
/* Sharing effect */
jQuery(document).ready(function($) {
jQuery('.share-toggle').click(function(){
jQuery(this).next().animate({
left: '-=50%',
width: 'toggle',
easing: 'linear'
}, 500, function() {
// Animation complete.
});
});
});
/* Masonry */
jQuery(document).ready(function($) {
var CollManag = (function() {
if (typeof Masonry !== 'undefined') {
var nr_cols = Masonry.nr_columns;
}else{
var nr_cols = 3;
}
var $ctCollContainer = $('.masonry'),
collCnt = 1,
init = function() {
changeColCnt();
initEvents();
initPlugins();
},
changeColCnt = function() {
var w_w = $(window).width();
if( w_w <= 480 ){ n = 1; }
else { n = nr_cols; }
},
initEvents = function() {
$(window).on( 'smartresize.CollManag', function( event ) {
changeColCnt();
});
},
initPlugins = function() {
$ctCollContainer.imagesLoaded( function() {
setTimeout( function() {
$ctCollContainer.masonry({
itemSelector : '.masonry .masonry_elem',
columnWidth : function( containerWidth ) {
return containerWidth / n;
},
isAnimated : true,
gutterWidth: 0,
animationOptions: {
duration: 400
}
});
$ctCollContainer.css( 'visibility', 'visible' ).parent().removeClass( 'ct-coll-loading' );
}, 500 );
});
};
return { init: init };
})();
CollManag.init();
});
jQuery( window ).load( function(){
jQuery(function() {
if( /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent) ) {
}else{
jQuery(".scrollit").each( function(index,elem){
jQuery( elem ).jScroll({top : 82});
});
}
elastislide_carousel();
setInterval("showDiv()",300);
});
});
function showDiv()
{
jQuery(".ourcarousel ul").show('slow');
}
function elastislide_carousel(){
var slide_margin = 0;
var carousel_columns = jQuery('ul.elastislide').attr('columns');
jQuery('.ourcarousel').elastislide({
margin : slide_margin,
imageW : jQuery('.ourcarousel .es-carousel').width(),
minItems : 1
});
//slideshow single carousel
if(jQuery('.es-carousel > ul > li').length){
var the_width = jQuery('.es-carousel > ul > li').width(); /*for list view thumbs*/
}else{
var the_width = 1140; /*for single page*/
}
jQuery('list-big-gallery .single_carousel, .list-view.full-thumb-article .single_carousel, .grid-view .single_carousel').elastislide({
margin : 0 ,
imageW : the_width
});
/*for single page*/
jQuery('.featimg .single_carousel').elastislide({
margin : 0 ,
imageW : 1140
});
if(jQuery('.timeline-view article .entry-image').length){
var timeline_width = jQuery('.timeline-view article .entry-image').width();
}else{
var timeline_width = 825;
}
jQuery('.timeline-view .single_carousel').elastislide({
margin : 0 ,
imageW : timeline_width
});
if(jQuery('.list-big-gallery .list-tabs .five.columns').length){
var big_gallery_width = jQuery('.list-big-gallery .list-tabs .five.columns').width();
}else{
var big_gallery_width = 433;
}
jQuery('.list-big-gallery .single_carousel').elastislide({
margin : 0 ,
imageW : big_gallery_width
});
jQuery('.single_carousel li').each(function(index) {
jQuery(this).show();
});
jQuery(window).trigger('resize'); /*trigger window resize to fix the carousel */
}
(function($) {
$.fn.sorted = function(customOptions) {
var options = {
reversed: false,
by: function(a) {
return a.text();
}
};
$.extend(options, customOptions);
$data = jQuery(this);
arr = $data.get();
arr.sort(function(a, b) {
var valA = options.by(jQuery(a));
var valB = options.by(jQuery(b));
if (options.reversed) {
return (valA < valB) ? 1 : (valA > valB) ? -1 : 0;
} else {
return (valA < valB) ? -1 : (valA > valB) ? 1 : 0;
}
});
return jQuery(arr);
};
})(jQuery);
/* Repair thumbs on small size */
function thumbsRepair(){
jQuery('.thumbs-view').each(function(index) {
var this_view = jQuery(this);
var this_view_id = jQuery(this).attr('id');
jQuery(this_view).find('article').each(function() {
var first_elem_settings = jQuery(this).first();
var elem = jQuery(this);
var elem_width = jQuery(first_elem_settings).width();
var elem_height = jQuery(first_elem_settings).height();
var elem_half_height = jQuery(first_elem_settings).height() - 35;
if(jQuery(elem).width() < '220' && jQuery(elem).is(':visible')){
jQuery(elem).find('a.format-video, a.format').hide();
jQuery(elem).find('.top-hover h5').css('margin', '5px 10px 7px 10px');
jQuery(elem).find('.top-hover h5').css('font-size', '13px');
jQuery(elem).find('.top-hover span.entry-date').css('padding-left', '10px');
jQuery(elem).find('.top-hover').height(elem_half_height);
jQuery(elem).find('.top-hover').css('overflow', 'hidden');
jQuery(elem).find('.bottom-hover li a span i').css('display', 'none');
}
if(jQuery(elem).width() < '130' && jQuery(elem).is(':visible')){
jQuery(elem).find('.bottom-hover').css('display', 'none');
jQuery(elem).find('.top-hover').height(elem_half_height + 30);
jQuery(elem).find('.top-hover h5').css('font-size', '11px');
}
});
});
}
/* Thumbs Hover effects here */
function hoverThumbItems(){
function thumbsOnHover(){
jQuery(this).find('.item-overlay').stop().animate( { opacity: 1, filter: 'alpha(opacity=100)' }, 500, 'linear');
jQuery(this).find('.item-overlay').find('.top-hover').stop().animate( { opacity: 1, filter: 'alpha(opacity=100)', top: '0px' }, 500, 'linear');
jQuery(this).find('.item-overlay').find('.bottom-hover').stop().animate( { opacity: 1, filter: 'alpha(opacity=100)', bottom: '0px' }, 500, 'linear');
}
function thumbsOnHoverOut(){
jQuery(this).find('.item-overlay').stop().animate( { opacity: 0, filter: 'alpha(opacity=00)' }, 400, 'linear');
jQuery(this).find('.item-overlay').find('.top-hover').stop().animate( { opacity: 0, filter: 'alpha(opacity=100)', top: '-150px' }, 400, 'linear');
jQuery(this).find('.item-overlay').find('.bottom-hover').stop().animate( { opacity: 0, filter: 'alpha(opacity=100)', bottom: '-150px' }, 400, 'linear');
}
jQuery(document).ready(function() {
jQuery('div.hovermore').hover(thumbsOnHover, thumbsOnHoverOut);
});
}
hoverThumbItems();
/* ###### Filters ##### */
/* thumbs filter */
jQuery(function() {
var read_button = function(class_names) {
var r = {
selected: false,
type: 0
};
for (var i=0; i < class_names.length; i++) {
if (class_names[i].indexOf('selected-') == 0) {
r.selected = true;
}
if (class_names[i].indexOf('segment-') == 0) {
r.segment = class_names[i].split('-')[1];
}
};
return r;
};
var determine_sort = function($buttons) {
var $selected = $buttons.parent().filter('[class*="selected-"]');
return $selected.find('a').attr('data-value');
};
var determine_kind = function($buttons) {
var $selected = $buttons.parent().filter('[class*="selected-"]');
return $selected.find('a').attr('data-value');
};
var $preferences = {
duration: 800,
easing: 'easeInOutQuad',
adjustHeight: 'dynamic'
};
var $list = jQuery('.thumbs-list');
var $data = $list.clone();
var $controls = jQuery('ul.thumbs-splitter');
$controls.each(function(i) {
var $control = jQuery(this);
var $buttons = $control.find('a');
$buttons.bind('click', function(e) {
var $button = jQuery(this);
var $button_container = $button.parent();
var button_properties = read_button($button_container.attr('class').split(' '));
var selected = button_properties.selected;
var button_segment = button_properties.segment;
if (!selected) {
var nrOfButtonsMax = '15';
for(var i = 0; i<=15; i++)
nrOfButtonsMax += ' ' + 'selected-' + i;
$buttons.parent().removeClass(nrOfButtonsMax);
$buttons.parent().removeClass('selected');
$button_container.addClass('selected-' + button_segment);
$button_container.addClass('selected');
var sorting_type = determine_sort($controls.eq(1).find('a'));
var sorting_kind = determine_kind($controls.eq(0).find('a'));
if (sorting_kind == 'all') {
var $filtered_data = $data.find('div.all-elements');
} else {
var $filtered_data = $data.find('div.' + sorting_kind);
}
if (sorting_type == 'size') {
var $sorted_data = $filtered_data.sorted({
by: function(v) {
return parseFloat(jQuery(v).find('span').text());
}
});
} else {
var $sorted_data = $filtered_data.sorted({
by: function(v) {
return jQuery(v).find('strong').text().toLowerCase();
}
});
}
$list.quicksand($sorted_data, $preferences, function() {
// callback function
hoverThumbItems();
thumbsRepair();
}
);
}
e.preventDefault();
});
});
});
jQuery(document).ready(function(){
thumbsRepair();
/* Related tabs */
jQuery('.related-tabs li a').click(function(){
element_id = jQuery(this).attr('href');
jQuery(this).parents('li').parent().find('.active').removeClass('active');
jQuery(this).parents('li').addClass('active');
jQuery(this).parents('li').parent().next().find(' > div:visible').fadeOut(400);
jQuery(this).parents('li').parent().next().find(element_id).delay(400).fadeIn(400);
thumbsRepair();
return false;
});
/* Mosaic fade */
jQuery('.mosaic-overlay').hover(function(){
jQuery(this).stop().animate( { opacity: 1, filter: 'alpha(opacity=100)' }, 500);
}, function(){
jQuery(this).stop().animate( { opacity: 0, filter: 'alpha(opacity=00)' }, 300);
});
/* list view tabs */
jQuery('.big-list-tabs > div').hide(); // Hide all divs
jQuery('.big-list-tabs div:first-child').show(); // Show the first div
jQuery('ul.gallery-bottom li:first').addClass('active'); // Set the class for active state
jQuery('ul.gallery-bottom li a').click(function(){ // When link is clicked
if(!jQuery(this).parent().parent().hasClass('active')){
var currentTab2 = jQuery(this).attr('href'); // Set currentTab to value of href attribute
var currentTab2_height = jQuery(currentTab2).height();
var parenter2 = '#'+jQuery(this).parent().parent().parent().parent().prev().attr('id');
var div_height = jQuery(parenter2).height();
var par2 = '#'+jQuery(this).parent().parent().parent().parent().prev().attr('id') + ' > div';
jQuery(parenter2).height(div_height);
jQuery(par2).hide(); // Hide all divs
jQuery(parenter2).find(currentTab2).show(); // Show div with id equal to variable currentTab
jQuery(this).parent().parent().parent().find('.active').removeClass('active');
jQuery(this).parent().parent().addClass('active');
}
return false;
});
jQuery('.tabs-controller > li > a').click(function(){
var this_id = jQuery(this).attr('href'); // Get the id of the div to show
var tabs_container_divs = '.' + jQuery(this).parent().parent().next().attr('class') + ' > div'; // All of elements to hide
jQuery(tabs_container_divs).hide(); // Hide all other divs
jQuery(this).parent().parent().next().find(this_id).show(); // Show the selected element
jQuery(this).parent().parent().find('.active').removeClass('active'); // Remove '.active' from elements
jQuery(this).addClass('active'); // Add class '.active' to the active element
return false;
});
jQuery(document).ready(function(){
jQuery('.hovermore, .readmore, .full-screen, .mosaic-overlay').mosaic();
jQuery('.circle, .gallery-icon').mosaic({
opacity: 0.5
});
jQuery('.fade').mosaic({
animation: 'slide'
});
//testimonials
jQuery('.testimonials-quotes li').hide(); // Hide all divs
jQuery('.testimonials-quotes li:first-child').show(); // Show the first div
jQuery('.testimonials-quotes li:first').addClass('active'); // Set the class for active state
jQuery('.testimonials-authors li a').click(function(){ // When link is clicked
var currentTab = jQuery(this).attr('href'); // Set currentTab to value of href attribute
var parenter = '#'+jQuery(this).parent().parent().prev().attr('id');
var par = '#'+jQuery(this).parent().parent().prev().attr('id') + ' > li';
var div_height = jQuery(parenter).find(currentTab).height();
jQuery(parenter).find(currentTab).parent().height(div_height);
jQuery(par).hide(); // Hide all divs
jQuery(parenter).find(currentTab).fadeIn(); // Show div with id equal to variable currentTab
jQuery(parenter).find(currentTab).parent().height('auto');
//Here we change the image
var data_image = jQuery(this).parent().parent().prev().find(currentTab).attr('data-image');
jQuery(this).parent().parent().find('.author img').animate({opacity: 0},0).attr('src', data_image).animate({opacity: 0},1).animate({opacity: 1},500);
//Here we change the testimonial name
jQuery(this).parent().parent().next().find('li').hide();
jQuery(this).parent().parent().next().find(currentTab+'-author').fadeIn(1500);
return false;
});
});
/*resize FB comments depending on viewport*/
setTimeout('viewPort()',3000);
resizeVideo();
jQuery( window ).resize( function(){
viewPort();
resizeVideo();
});
/*Fixed user bar*/
jQuery(function () {
var msie6 = jQuery.browser == 'msie' && jQuery.browser.version < 7;
if (!msie6 && jQuery('.sticky-bar').length != 0) {
var top = jQuery('#sticky-bar').offset().top - parseFloat(jQuery('#sticky-bar').css('margin-top').replace(/auto/, 0));
jQuery(window).scroll(function () {
// what the y position of the scroll is
var y = jQuery(this).scrollTop();
// whether that's below the form
if (y >= top-0) {
// if so, ad the fixed class
jQuery('#sticky-bar').addClass('fixed');
} else {
// otherwise remove it
jQuery('#sticky-bar').removeClass('fixed');
}
});
}
});
/* Accordion */
jQuery('.cosmo-acc-container').hide();
jQuery('.cosmo-acc-trigger:first').addClass('active').next().show();
jQuery('.cosmo-acc-trigger').click(function(){
if( jQuery(this).next().is(':hidden') ) {
jQuery('.cosmo-acc-trigger').removeClass('active').next().slideUp();
jQuery(this).toggleClass('active').next().slideDown();
}
return false;
});
//Superfish menu
jQuery("ul.sf-menu").supersubs({
minWidth: 10, // minimum width of sub-menus in em units
maxWidth: 35, // maximum width of sub-menus in em units
animation: {height:'show'} // slide-down effect without fade-in
// due to slight rounding differences and font-family
}).superfish(); // call supersubs first, then superfish, so that subs are
// not display:none when measuring. Call before initialising
// containing tabs for same reason.
jQuery("#menu-login ul.sf-menu").supersubs({
minWidth: 15,
maxWidth: 32,
extraWidth: 1
}).superfish({
delay: 200,
speed: 250
});
jQuery('.clicker-s').click(function(){
element_height = jQuery(this).height(); // Get the height of the element clicked
jQuery(this).prev().find('#s').height('32px');
jQuery(this).prev().find('#s').css('color', 'transparent');
jQuery(this).prev().fadeIn().animate({width: '250px', right: '0px'}, 300,function(){
jQuery(this).find('#s').css('color', '#666');
});
});
var mouse_is_inside = false;
jQuery('.searchbarb, .clicker-s').hover(function(){
mouse_is_inside=true;
}, function(){
mouse_is_inside=false;
});
jQuery('body').mouseup(function(){
if(mouse_is_inside == false){
jQuery('.click-search .searchbarb').fadeOut().animate({width: '2.6em'});
}
});
/*Fixed user bar*/
jQuery(function () {
var msie6 = jQuery.browser == 'msie' && jQuery.browser.version < 7;
if (!msie6 && jQuery('.sticky-bar').length != 0) {
var top = jQuery('#sticky-bar').offset().top - parseFloat(jQuery('#sticky-bar').css('margin-top').replace(/auto/, 0));
jQuery(window).scroll(function (event) {
// what the y position of the scroll is
var y = jQuery(this).scrollTop();
// whether that's below the form
if (y >= top-0) {
// if so, ad the fixed class
jQuery('#sticky-bar').addClass('fixed');
} else {
// otherwise remove it
jQuery('#sticky-bar').removeClass('fixed');
}
});
}
});
/* Hide Tooltip */
jQuery(function() {
jQuery('a.close').click(function() {
jQuery(jQuery(this).attr('href')).slideUp();
jQuery.cookie(cookies_prefix + "_tooltip" , 'closed' , {expires: 365, path: '/'});
jQuery('.header-delimiter').removeClass('hidden');
return false;
});
});
/* initialize tabs */
jQuery(function() {
jQuery('.cosmo-tabs').tabs({ fxFade: true, fxSpeed: 'fast' });
jQuery( 'div.cosmo-tabs' ).not( '.submit' ).find( '.tabs-nav li:first-child a' ).click();
});
/* Hide title from menu items */
jQuery(function(){
jQuery("li.menu-item > a").hover(function(){
jQuery(this).stop().attr('title', '');},
function(){jQuery(this).stop().attr();
});
});
jQuery(document).ready(function() {
jQuery(".mobile-nav-menu").saccordion({
saccordion:false,
speed: 200,
closedSign: '',
openedSign: ''
});
jQuery('.mobile-nav-menu').css('display','none');
});
jQuery( '.toggle-menu' ).click( function(){
jQuery('.mobile-nav-menu').slideToggle();
});
/*Timeline edit*/
var timeline_parent = jQuery('.timeline-view').parent().parent().parent();
if(!jQuery(timeline_parent).hasClass('twelve')){
jQuery(timeline_parent).find('.timeline-view').addClass('notfull');
}
/*End timeline edit*/
jQuery(window).on('resize load orientationChanged', function() {
// do your stuff here
if(jQuery(this).width() < 767){
jQuery('#access').addClass('hide');
jQuery('#d-menu').addClass('hide');
jQuery('.mobile-menu').removeClass('hide');
jQuery('.mobile-menu').css('display','block');
} else{
jQuery('#access').removeClass('hide');
jQuery('#d-menu').removeClass('hide');
jQuery('.mobile-menu').css('display','none');
jQuery('.mobile-menu').addClass('hide');
}
});
jQuery(document).ready(function() {
jQuery('aside.widget').append('');
});
/* Mobile responsiveness */
jQuery(window).on('resize load orientationChanged', function() {
// do your stuff here
if(jQuery(this).width() < 767){
jQuery('#d-menu').addClass('hide');
jQuery('.mobile-menu').removeClass('hide');
jQuery('.mobile-menu').css('display','block');
jQuery('#sticky-bar').css('display','none');
jQuery('.keyboard-demo').css('display','none');
jQuery('#menu-login').css('display','none');
} else{
jQuery('#d-menu').removeClass('hide');
jQuery('.mobile-menu').css('display','none');
jQuery('.mobile-menu').addClass('hide');
jQuery('#sticky-bar').css('display','block');
jQuery('.keyboard-demo').css('display','block');
jQuery('#menu-login').css('display','block');
}
});
/* show/hide color switcher */
jQuery('.show_colors').toggle(function(){
jQuery(".style_switcher").animate({
left: "10px"
}, 500 );
}, function () {
jQuery(".style_switcher").animate({
left: "-152px"
}, 500 );
});
/* widget tabber */
jQuery( 'ul.widget_tabber li a' ).click(function(){
jQuery(this).parent('li').parent('ul').find('li').removeClass('active');
jQuery(this).parent('li').parent('ul').parent('div').find( 'div.tab_menu_content.tabs-container').fadeTo( 200 , 0 );
jQuery(this).parent('li').parent('ul').parent('div').find( 'div.tab_menu_content.tabs-container').hide();
jQuery( jQuery( this ).attr('href') + '_panel' ).fadeTo( 600 , 1 );
jQuery( this ).parent('li').addClass('active');
});
/*toogle*/
/*Case when by default the toggle is closed */
jQuery(".open_title").toggle(function(){
jQuery(this).next('div').slideDown();
jQuery(this).find('a').removeClass('show');
jQuery(this).find('a').addClass('toggle_close');
jQuery(this).find('.title_closed').hide();
jQuery(this).find('.title_open').show();
}, function () {
jQuery(this).next('div').slideUp();
jQuery(this).find('a').removeClass('toggle_close');
jQuery(this).find('a').addClass('show');
jQuery(this).find('.title_open').hide();
jQuery(this).find('.title_closed').show();
});
/*Case when by default the toggle is oppened */
jQuery(".close_title").toggle(function(){
jQuery(this).next('div').slideUp();
jQuery(this).find('a').removeClass('toggle_close');
jQuery(this).find('a').addClass('show');
jQuery(this).find('.title_open').hide();
jQuery(this).find('.title_closed').show();
}, function () {
jQuery(this).next('div').slideDown();
jQuery(this).find('a').removeClass('show');
jQuery(this).find('a').addClass('toggle_close');
jQuery(this).find('.title_closed').hide();
jQuery(this).find('.title_open').show();
});
/*Accordion*/
jQuery('.cosmo-acc-container').hide();
jQuery('.cosmo-acc-trigger:first').addClass('active').next().show();
jQuery('.cosmo-acc-trigger').click(function(){
if( jQuery(this).next().is(':hidden') ) {
jQuery('.cosmo-acc-trigger').removeClass('active').next().slideUp();
jQuery(this).toggleClass('active').next().slideDown();
}
return false;
});
//Scroll to top
jQuery(window).scroll(function() {
if(jQuery(this).scrollTop() != 0) {
jQuery('#toTop').fadeIn();
} else {
jQuery('#toTop').fadeOut();
}
});
jQuery('#toTop').click(function() {
jQuery('body,html').animate({scrollTop:0},300);
});
jQuery('div.sticky-bar li.my-add').mouseover(function () {
jQuery('.show-first').hide();
jQuery('.show-hover').fadeIn(10);
});
jQuery('#sticky-bar').mouseleave(function () {
jQuery('.show-hover').hide();
//jQuery('.show-first').show('slow');
jQuery('.show-first').fadeIn(10);
});
});
/* grid / list switch */
/*functions for style switcher*/
function changeBgColor(rd_id,element){
if(element == "footer"){
jQuery('.b_head').css('background-color', '#'+jQuery('#'+rd_id).val());
jQuery('.b_body_f').css('background-color', '#'+jQuery('#'+rd_id).val());
jQuery('#link-color').val('#'+jQuery('#'+rd_id).val());
jQuery.cookie(cookies_prefix + "_b_f_color",'#' + jQuery('#'+rd_id).val(), {expires: 365, path: '/'});
}
else if(element == "content"){
jQuery('#main').css('background-color', '#'+jQuery('#'+rd_id).val());
jQuery('#content-link-color').val('#'+jQuery('#'+rd_id).val());
jQuery.cookie(cookies_prefix + "_content_bg_color",'#' + jQuery('#'+rd_id).val(), {expires: 365, path: '/'});
}
return false;
}
/* Keyboard toggles */
jQuery(function() {
jQuery( '.mobile-user-menu select').change( function(){
location.href = jQuery( this).val();
});
jQuery('.keyboard-demo').click(function() {
jQuery('#big-keyboard').fadeIn();
jQuery('#keyboard-container').slideToggle().delay(100).animate( { top: '20%' }, 500, 'easeInOutExpo' );
jQuery('#sticky-bar').fadeOut('fast');
});
jQuery('.close').click(function() {
jQuery('#keyboard-container').animate( { top: '-120%' }, 300, 'easeInOutExpo' );
jQuery('#big-keyboard').delay(300).fadeOut();
jQuery('#sticky-bar').fadeIn('slow');
jQuery('#keyboard-container').css('display', 'none').animate( { top: '0%' }, 1);;
});
});
/* E.of keyboard toggles*/
/*EOF functions for style switcher*/
function viewPort(){
/* Determine screen resolution */
//var $body = jQuery('body');
wSizes = [1200, 960, 768, 480, 320, 240];
wSizesClasses = ['w1200', 'w960', 'w768', 'w480', 'w320', 'w240'];
//$body.removeClass(wSizesClasses.join(' '));
var size = jQuery(this).width();
//alert(size);
for (var i=0; i= wSizes[i] ) {
//$body.addClass(wSizesClasses[i]);
jQuery('.cosmo-comments .fb_iframe_widget iframe,.cosmo-comments .fb_iframe_widget span').css({'width':jQuery('.cosmo-comments.twelve.columns').width() });
break;
}
}
if(typeof(FB) != 'undefined' ){
FB.Event.subscribe('xfbml.render', function(response) {
FB.Canvas.setAutoGrow();
});
}
/** Mobile/Default - 320px
* Mobile (landscape) - 480px
* Tablet - 768px
* Desktop - 960px
* Widescreen - 1200px
* Widescreen HD - 1920px*/
}
jQuery(document).ready(function() {
/* Keyboard toggles */
jQuery('.keyboard-demo').click(function() {
jQuery('#big-keyboard').fadeIn();
//jQuery('#keyboard-container').slideToggle().delay(100).animate( { top: '20%' }, 500, 'easeInOutExpo' );
jQuery('#sticky-bar').fadeOut('fast');
});
jQuery('.close').click(function() {
jQuery('#keyboard-container').animate( { top: '-120%' }, 300, 'easeInOutExpo' );
jQuery('#big-keyboard').delay(300).fadeOut();
jQuery('#sticky-bar').fadeIn('slow');
jQuery('#keyboard-container').css('display', 'none').animate( { top: '0%' }, 1);;
});
/* E.of keyboard toggles*/
/*Tweets widget*/
var delay = 4000; //millisecond delay between cycles
function cycleThru(variable, j){
var jmax = jQuery(variable + " div").length;
jQuery(variable + " div:eq(" + j + ")")
.css('display', 'block')
.animate({opacity: 1}, 600)
.animate({opacity: 1}, delay)
.animate({opacity: 0}, 800, function(){
(j+1 == jmax) ? j=0 : j++;
jQuery(this).css('display', 'none').animate({opacity: 0}, 10);
cycleThru(variable, j);
});
};
jQuery('.tweets').each(function(index, val) {
//iterate through array or object
var parent_tweets = jQuery(val).parent().attr('id');
var actioner = '#' + parent_tweets + ' .tweets .dynamic .cosmo_twitter .slides_container';
cycleThru(actioner, 0);
});
});