
function urlencode(str){var ret=str;ret=ret.toString();ret=escape(ret);ret=ret.replace(/%20/g,'+');return ret;}
$(function(){$("a.reportPostClick").toggle(function(){var reportId=($(this).attr('id'));$("ul."+reportId).show("slow");},function(){var reportId=($(this).attr('id'));$("ul."+reportId).hide("slow");});$("a.cancelReportButton").click(function(){$("ul.reportPostForm").hide("slow");return false;});$("#inviteSubmit").click(function(){if(!$('#send').attr('value')){$('#friendInvite').prepend('<p class="error">You must enter at least one e-mail address to invite.</p>');return false;}
return true;});$(".emailInputField").click(function(){if($(this).val()=='Just enter your e-mail'){$(this).val("");}});$("#newsletterBtn").click(function(){var filter=/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;if(filter.test($(".emailInputField").attr("value"))){var rText=$.ajax({type:"POST",url:"/func/newsletter.php?type=subscribe",data:"email="+$(".emailInputField").attr("value"),async:false}).responseText;$("#newsletterSignupWrap").html(rText);}
return false;});$("#headerSearchForm").submit(function(){var sval=$('#searchInput').val();sval=urlencode(sval);$("#headerSearchForm").attr("action",'/search/'+sval);var searchval=$("#searchInput").val();if((searchval=="Find beauty products, pro tips, how-tos, videos, photo galleries, etc...")||(searchval=="")){return false;}});$("#didYouMeanSearchForm").submit(function(){var sval2=$('#topSearchInput').val();sval2=urlencode(sval2);var tabnow=$("#searchtab").val();if(tabnow){sval2=tabnow+'/'+sval2;}
$("#didYouMeanSearchForm").attr("action",'/search/'+sval2);if(sval2==""){return false;}});$("#searchInputMid").click(function(){$("#searchInputMid").val("");});$("#midpageSearchForm").submit(function(){var sval=$('#searchInputMid').val();sval=urlencode(sval);$("#midpageSearchForm").attr("action",'/search/'+sval);var searchval=$("#searchInputMid").val();if((searchval=="Find beauty products, pro tips, how-tos, videos, photo galleries, etc...")||(searchval=="Find what you're looking for...")||(searchval=="")){return false;}});$("#footerSearchForm").submit(function(){var sval2=$('#searchInput2').val();sval2=urlencode(sval2);$("#footerSearchForm").attr("action",'/search/'+sval2);if(sval2==""){return false;}});var thisLetter;$("#abcSorter li").click(function(){thisLetter=$(this).children("a").text();if(thisLetter){$("#abcSorter li").each(function(){if(!$(this).children("").is("a")){$(this).html("<a href=\"#\">"+$(this).text()+"</a>");}});$(this).prepend(thisLetter).children("a").remove();$(".brandListings").removeClass("show");$("#letter"+thisLetter).addClass("show");}
return false;});$("#editorsClick").click(function(){top.document.location.href="/editors_blogs";});$("#editorsClick").mouseover(function(){this.style.cursor="pointer";});if($('#sct').length>0){$('#navSamples a').css({backgroundPosition:"-331px -80px",paddingTop:0});$('#navHowto a').css({backgroundPosition:"-148px 0",paddingTop:0});}
if($('#aboutSubNav').length>0){$('#navHowto a').css({backgroundPosition:"-148px 0",paddingTop:0});}
if((jQuery.browser.msie)&&(jQuery.browser.version<7)){$("#wrapper.searchresults ul.subnav li").mouseover(function(){this.style.background="url(http://images.totalbeauty.com/img/v3img/search_tab_hover_right.gif) 100% 0 no-repeat;";});$("#wrapper.searchresults ul.subnav li.active").mouseout(function(){this.style.background="url(http://images.totalbeauty.com/img/v3img/search_tab_on_right.gif) 100% 0 no-repeat;";});$("#wrapper.searchresults ul.subnav li").mouseout(function(){this.style.background="url(http://images.totalbeauty.com/img/v3img/search_tab_off_right.gif) 100% 0 no-repeat;";});}});function quizSubmit(formID)
{var val=$("#"+formID+" input[@checked]").length;if(val>0){return true}
return false;}
function bookmark(){var title="Total Beauty"
var url="http://www.totalbeauty.com"
if(window.sidebar)window.sidebar.addPanel(title,url,"");else if(window.opera&&window.print)
{var mbm=document.createElement('a');mbm.setAttribute('rel','sidebar');mbm.setAttribute('href',url);mbm.setAttribute('title',title);mbm.click();}
else if(document.all)window.external.AddFavorite(url,title);}
function textLimit(textid,limit,infodiv){var text=$('#'+textid).val();var textlength=text.length;if(textlength>limit){if(infodiv){$('#'+infodiv).html('You cannot write more then'+limit+' characters!');}
$('#'+textid).val(text.substr(0,limit));return false;}else{if(infodiv){$('#'+infodiv).html('You have '+(limit-textlength)+' characters left.');}
return true;}}
var ord=Math.random()*10000000000000000;