function fed_color(themeName){ var themeCSS = $("#color"); var url = themeCSS.attr('href'); var href = url.substring(0, url.indexOf('themes')) + '/Public/vfed/css/' + themeName + '.css'; themeCSS.attr('href', href); var iframe = $('iframe'); if(iframe.length > 0){ for(var i = 0; i < iframe.length; i++){ var ifr = iframe[i]; $(ifr).contents().find('#color').attr('href', href); } } $.cookie('colorName', themeName,{ path: "/", expiress: 7 }); } if($.cookie('colorName')){ fed_color($.cookie('colorName')); }