
var detalheProdutoWebServiceUrl='/WebService/DetalheProduto.asmx/';var pageValue=1;var avaliationHit=0;var hasBindedComments=false,hasBindedCommentAndAvaliation=false,hasVerifiedUserAuthent=false;function vote(commentId,voteValue){if(confirm("Deseja confirmar seu voto neste comentário?")){$.ajax({type:"POST",url:"/WebService/CustomerReviews.asmx/InsertCommentPoint",data:"{'commentId':"+commentId+",'productId':"+productId+",'point':"+voteValue+"}",contentType:"application/json; charset=utf-8",dataType:"json",success:function(T){setPagging(T,pageValue);}});}}
function setPagging(T,currentPage){var pageValue=currentPage;var $comments=$('#comments');$comments.setTemplateElement('templateComments');$comments.processTemplate(T);if(T.d.LinkFirst==''){$('#liFirst').attr('style','display: none;');}
if(T.d.LinkPrevious==''){$('#liPrevious').attr('style','display: none;');}
if(T.d.LinkNext==''){$('#liNext').attr('style','display: none;');}
if(T.d.LinkLast==''){$('#liLast').attr('style','display: none;');}
if(currentPage>4){$('.liPages:eq(3)').children().attr('class','sel');}
else{$('.liPages:eq('+(currentPage-1).toString()+')').children().attr('class','sel');}}
function showComments(currentPage,forceBind){if(!hasBindedComments||forceBind){hasBindedComments=true;$('#comments').html($('#templateLightboxLoading').val());$.ajax({type:"POST",url:"/WebService/CustomerReviews.asmx/GetComments",data:"{'productId':"+productId+",'currentPage':"+currentPage+"}",contentType:"application/json; charset=utf-8",dataType:"json",success:function(T){setPagging(T,currentPage);}});}}
function getUserCommentAndAvaliation(){if(!hasBindedCommentAndAvaliation){hasBindedCommentAndAvaliation=true;$.ajax({type:"POST",url:"/WebService/CustomerReviews.asmx/GetUserCommentAndAvaliation",data:"{'productId':"+productId+"}",contentType:"application/json; charset=utf-8",dataType:"json",success:function(msg){if(msg.d!=null){if(msg.d.CommentId>0){$('#pnlJaAvaliou').attr('style','display:block;');$('#pnlLogedIn').attr('style','display:none;');}else if(msg.d.AvaliationHit>0){for(var i=0;i<msg.d.AvaliationHit;i++){$('div[id$=customerReviewsAndAvaliations_avaliation_div'+i.toString()+']').addClass('aval-on');}
avaliationHit=msg.d.AvaliationHit;}}}});}}
function verifyUserAuthenticated(){if(!hasVerifiedUserAuthent){hasVerifiedUserAuthent=true;$.ajax({type:"POST",url:"/WebService/CustomerReviews.asmx/VerifyUserAuthenticated",data:"{'productId':"+productId+"}",contentType:"application/json; charset=utf-8",dataType:"json",success:function(msg){if(msg.d!=null){$('#txtNome').val(msg.d.ClientName);$('#txtEmail').val(msg.d.ClientEmail);$('#pnlNotLogedIn').attr('style','display:none;');$('#pnlLogedIn').attr('style','display:block;');}}});}}
function changeTab(){if(getQueryString('tabType')=='A'){showTabAvaliate();}}
$(window).load(function(){delayedLoadProductDetail();$(window).bind('scroll',delayedLoadProductDetail);$(window).bind('resize',delayedLoadProductDetail);function delayedLoadProductDetail(){$("#ControlePalavraInternautaId:in-viewport").each(function(){showComments(pageValue,false);verifyUserAuthenticated();getUserCommentAndAvaliation();});if(hasBindedComments&&hasBindedCommentAndAvaliation&&hasVerifiedUserAuthent){$(window).unbind('scroll',delayedLoadProductDetail);$(window).unbind('resize',delayedLoadProductDetail);}}
changeTab();$("#publicar").click(function(e){e.preventDefault();if(!$('#chkAceito').is(':checked')){alert(MsgReviewCheckAvaliationPolicy);return false;}
if(avaliationHit==0){alert(MsgReviewMissingAvaliation);return false;}
$.ajax({type:"POST",url:"/WebService/CustomerReviews.asmx/InsertComment",data:"{'productId':"+productId+",'reviewTitle':'"+$('#txtTitulo').val()+"','reviewText':'"+$('[id$=txtDescricao]').val()+"','avaliationHit':"+avaliationHit+",'emailAuthorization':"+$('#chkEmailAutorizacao').is(':checked')+"}",contentType:"application/json; charset=utf-8",dataType:"json",success:function(msg){$('div[id$=pnlLogedIn]').attr('style','display:none;');if(msg.d){$('#divConfirmacaoComentario').attr('style','display:block;');}
else{$('#divErroComentario').attr('style','display:block;');}}});});});function showTabComments(){for(var i=0,n;n=document.getElementById('liComentarios').childNodes[i];i++){if(n.nodeType===1){if(n.className.indexOf('-on')<0)
n.className=n.className+'-on';}}
for(var i=0,n;n=document.getElementById('liAvalie').childNodes[i];i++){if(n.nodeType===1){if(n.className.indexOf('-on')>=0)
n.className=n.className.replace('-on','');}}
$('#boxComentario').attr('style','display:block;');$('#boxAvalieComente').attr('style','display:none;');}
function showTabAvaliate(){for(var i=0,n;n=document.getElementById('liAvalie').childNodes[i];i++){if(n.nodeType===1){if(n.className.indexOf('-on')<0)
n.className=n.className+'-on';}}
for(var i=0,n;n=document.getElementById('liComentarios').childNodes[i];i++){if(n.nodeType===1){if(n.className.indexOf('-on')>=0)
n.className=n.className.replace('-on','');}}
$('#boxComentario').attr('style','display:none;');$('#boxAvalieComente').attr('style','display:block;');}
var productId;$(window).load(function(){$('a.recomende').click(function(e){e.preventDefault();productId=$(this).attr('productId');showRecommend();});});function showRecommend(){if(productId){lightBox.Loading();$('div.btnFecharLightbox a').click(function(){lightBox.Close();});lightBox.SetScriptTemplate('#templateLightboxRecommend');lightBox.AddContentCssClass('recommend-content');}}
function sendRecommendation(o){$("form").validate({rules:{'textNameFrom':{required:true},'textMailFrom':{required:true,email:true},'textNameTo':{required:true},'textMailTo':{required:true,email:true},'textMessage':{required:true}},messages:{'textNameFrom':"<div class='validation' style='clear: none;' />",'textMailFrom':"<div class='validation' style='clear: none;' />",'textNameTo':"<div class='validation' style='clear: none;' />",'textMailTo':"<div class='validation' style='clear: none;' />",'textMessage':"<div class='validation' style='clear: none;' />"}});if($("form").valid()){if(productId){var $currentForm=$(o).parents('.form-recomende');$.ajax({type:"POST",url:detalheProdutoWebServiceUrl+"RecommendProduct",data:"{'productId':"+productId
+",'nameFrom':'"+$currentForm.find('#textNameFrom').val()+"'"
+",'mailFrom':'"+$currentForm.find('#textMailFrom').val()+"'"
+",'nameTo':'"+$currentForm.find('#textNameTo').val()+"'"
+",'mailTo':'"+$currentForm.find('#textMailTo').val()+"'"
+",'message':'"+$currentForm.find('#textMessage').val()+"'"
+",'isOptIn':"+$currentForm.find('#chkOptIn').is(':checked')+"}",contentType:"application/json; charset=utf-8",dataType:"json",beforeSend:lightBox.Loading(),success:function(T){lightBox.SetTemplate('templateLightboxRecommendMessage',T);}});}}}
$(window).load(function(){$('.security-notice-opener').click(function(e){e.preventDefault();lightBox.Loading();$('div.btnFecharLightbox a').click(function(){lightBox.Close();});lightBox.SetStaticContent($('#templateLightboxSecurityNotice').html());lightBox.AddContentCssClass('security-notice-content');$('.security-notice-content .tab-container div.contents div.tab-content').each(function(){$(this).css("display","none");});$('.security-notice-content .tab-container ul.tabs li:first div').each(function(){$(this).attr('class',$(this).attr('class')+'-on');});$('.security-notice-content .tab-container div.contents div.tab-content:first').css("display","block");$('.security-notice-content .tab-container ul.tabs li a').click(function(e){e.preventDefault();var selectedTab=$(this).attr("name");$('.security-notice-content .tab-container ul.tabs li div').each(function(){$(this).attr('class',$(this).attr('class').replace('-on',''));});$(this).parents('li').children('div').each(function(){$(this).attr('class',$(this).attr('class')+'-on');});$('.security-notice-content .tab-container div.contents div.tab-content').each(function(){if(selectedTab==$(this).attr("name")){$(this).css("display","block");var $scrollableContent=$('.security-notice-content .scrollable-content');if($(this).height()<=285){$scrollableContent.height($(this).height()+20);$scrollableContent.parents('.jScrollPaneContainer').height($(this).height()+20);$scrollableContent.parents('.jScrollPaneContainer').find('.jScrollPaneTrack, .jScrollArrowUp, .jScrollArrowDown').css("display","none");}
else{$scrollableContent.height(285);$scrollableContent.parents('.jScrollPaneContainer').height(285);$('.security-notice-content .scrollable-content').jScrollPane({scrollbarWidth:12,scrollbarMargin:10,showArrows:true,dragMaxHeight:8});$scrollableContent[0].scrollTo(0);}}
else
$(this).css("display","none");});});});});$(window).load(function(){$('#aPoliticaAvaliacao').click(function(e){e.preventDefault();lightBox.Loading();$('.btnFecharLightbox a').click(function(){lightBox.Close();});lightBox.SetStaticContent($('#templateLightboxColaborationPolicy').html());});});$(window).load(function(){$('.shipping-simulator-opener').click(function(e){e.preventDefault();showShippingSimulator();});});function showShippingSimulator(){lightBox.Loading();$('div.btnFecharLightbox a').click(function(){lightBox.Close();});lightBox.SetStaticContent($('#divShippingSimulator').html());$('[id$=cep]').focus();$('.button-confirm').click(function(e){e.preventDefault();var $currentForm=$(this).parents('.form-cep');viewCEP($currentForm.parent(),$currentForm.find('#cep').val(),$('#hidProductId').val());});}
function executePostalCodeSearch(obj,evt){var code=evt.charCode||evt.keyCode;if(code==13){$('[id$=CepOk]').focus();}
else if(obj.value.length==8){$('[id$=CepOk]').focus();}}
function viewCEP(o,c,p){if(c==""){alert('Informe seu CEP para consultar frete e prazo de entrega para a sua região.');}
else if(c.length<8){alert('CEP Inválido, informe um CEP válido para consultar o frete e prazo de entrega para a sua região. ');}
else{$.ajax({type:"POST",url:detalheProdutoWebServiceUrl+"ShippingCalculate",data:"{'productId':"+p
+",'cep':'"+c+"'}",contentType:"application/json; charset=utf-8",dataType:"json",beforeSend:function(){var $oResult=$(o).find('#CepResult');$oResult.html($('#templateLightboxLoading').val());$oResult.css('display','');lightBox.Position();},success:function(T){var $oResult=$(o).find('#CepResult');$oResult.setTemplateElement('templateLightboxShippingSimulator',null,{filter_data:false});$oResult.processTemplate(T);lightBox.Position();}});}}
function ApenasNumeros(tirarHifen,objEvent){var evt=new CrossKeyPress(objEvent);if(!(evt.crossKeyCode>=48&&evt.crossKeyCode<=57)){if((evt.crossKeyCode==45&&!tirarHifen)||isBasicKeys(evt.crossKeyCode))return;if(evt.isIE)
event.returnValue=false;else{objEvent.preventDefault();objEvent.stopPropagation();}}}
function viewOE(p){var li=document.getElementById(p);li.className='liOpcaoEntrega';if(p=='liEntregaNormal'){var a=document.getElementById('liEntregaRapida');a.className='liDisable';var b=document.getElementById('liEntregaAgendada');b.className='liDisable';var c=document.getElementById('divDadosOpcaoEntrega');if(c!=null)
c.className='show';var d=document.getElementById('divOpcaoEntregaRapida');if(d!=null)
d.className='noshow';else{var f=document.getElementById('divOpcaoEntregaRapidaDisable');if(f!=null)
f.className='noshow';}
var e=document.getElementById('divOpcaoEntregaAgendada');if(e!=null)
e.className='noshow';else{var g=document.getElementById('divOpcaoEntregaAgendadaDisable');if(g!=null)
g.className='noshow';}}
else if(p=='liEntregaRapida'){var a=document.getElementById('liEntregaNormal');a.className='liDisable';var b=document.getElementById('liEntregaAgendada');b.className='liDisable';var c=document.getElementById('divDadosOpcaoEntrega');if(c!=null)
c.className='noshow';var d=document.getElementById('divOpcaoEntregaRapida');if(d!=null)
d.className='show';else{var f=document.getElementById('divOpcaoEntregaRapidaDisable');if(f!=null){f.className='show';var h=document.getElementById('haveOption');if(h!=null)
h.className='noshow';}}
var e=document.getElementById('divOpcaoEntregaAgendada');if(e!=null)
e.className='noshow';else{var g=document.getElementById('divOpcaoEntregaAgendadaDisable');if(g!=null)
g.className='noshow';}}
else if(p=='liEntregaAgendada'){var a=document.getElementById('liEntregaRapida');a.className='liDisable';var b=document.getElementById('liEntregaNormal');b.className='liDisable';var c=document.getElementById('divDadosOpcaoEntrega');if(c!=null)
c.className='noshow';var d=document.getElementById('divOpcaoEntregaRapida');if(d!=null)
d.className='noshow';else{var f=document.getElementById('divOpcaoEntregaRapidaDisable');if(f!=null)
f.className='noshow';}
var e=document.getElementById('divOpcaoEntregaAgendada');if(e!=null)
e.className='show';else{var g=document.getElementById('divOpcaoEntregaAgendadaDisable');if(g!=null){g.className='show';var h=document.getElementById('haveOption');if(h!=null)
h.className='noshow';}}}}
$(window).load(function(){$('.installment-options-opener').click(function(e){e.preventDefault();showInstallmentOptions($(this).attr('productId'),$(this).attr('isPromo'));});});function showInstallmentOptions(productId,isPromo){if(productId){$.ajax({type:"POST",url:detalheProdutoWebServiceUrl+"GetProductInstallmentOptions",data:"{'productId':"+productId+",'isPromo':'"+isPromo+"'}",contentType:"application/json; charset=utf-8",dataType:"json",beforeSend:function(){lightBox.Loading();$('.btnFecharLightbox a').click(function(){lightBox.Close();});},success:function(T){lightBox.SetTemplate('templateLightboxInstallmentOptions',T);lightBox.AddContentCssClass('installment-options-content');$('.installment-options-content .tab-container ul.contents li').each(function(){$(this).css("display","none");});$('.installment-options-content .tab-container ul.tabs li:first div').each(function(){$(this).attr('class',$(this).attr('class')+'-on');});$('.installment-options-content .tab-container ul.contents li:first').css("display","block");$('.installment-options-content .tab-container ul.tabs li a').click(function(e){e.preventDefault();var selectedTab=$(this).attr("name");$('.installment-options-content .tab-container ul.tabs li div').each(function(){$(this).attr('class',$(this).attr('class').replace('-on',''));});$(this).parent().parent().children('div').each(function(){$(this).attr('class',$(this).attr('class')+'-on');});$('.installment-options-content .tab-container ul.contents li').each(function(){if(selectedTab==$(this).attr("name"))
$(this).css("display","block");else
$(this).css("display","none");});});}});}}
$(window).load(function(){$('.payment-methods-notice-opener').click(function(e){e.preventDefault();lightBox.Loading();$('.btnFecharLightbox a').click(function(){lightBox.Close();});lightBox.SetStaticContent($('#templateLightboxPaymentMethodsNotice').html());lightBox.AddContentCssClass('payment-methods-notice-content');$('.payment-methods-notice-content .tab-container div.contents div.tab-content').each(function(){$(this).css("display","none");});$('.payment-methods-notice-content .tab-container ul.tabs li:first div').each(function(){$(this).attr('class',$(this).attr('class')+'-on');});$('.payment-methods-notice-content .tab-container div.contents div.tab-content:first').css("display","block");$('.payment-methods-notice-content .tab-container ul.tabs li a').click(function(e){e.preventDefault();var selectedTab=$(this).attr("name");$('.payment-methods-notice-content .tab-container ul.tabs li div').each(function(){$(this).attr('class',$(this).attr('class').replace('-on',''));});$(this).parents('li').children('div').each(function(){$(this).attr('class',$(this).attr('class')+'-on');});$('.payment-methods-notice-content .tab-container div.contents div.tab-content').each(function(){if(selectedTab==$(this).attr("name")){$(this).css("display","block");var $scrollableContent=$('.payment-methods-notice-content .scrollable-content');if($(this).height()<=285){$scrollableContent.height($(this).height()+20);$scrollableContent.parents('.jScrollPaneContainer').height($(this).height()+20);$scrollableContent.parents('.jScrollPaneContainer').find('.jScrollPaneTrack, .jScrollArrowUp, .jScrollArrowDown').css("display","none");}
else{$scrollableContent.height(285);$scrollableContent.parents('.jScrollPaneContainer').height(285);$('.payment-methods-notice-content .scrollable-content').jScrollPane({scrollbarWidth:12,scrollbarMargin:10,showArrows:true,dragMaxHeight:8});$scrollableContent[0].scrollTo(0);}}
else
$(this).css("display","none");});});});});function toggleTab(o,s){start=o.id.lastIndexOf('ctl');end=o.id.substring(start).indexOf('_');current=o.id.substring(start,start+end);for(var i=0,n;n=o.parentNode.parentNode.childNodes[i];i++){if(n.nodeType===1){for(var j=0,c;c=n.childNodes[j];j++){if(c.nodeType===1){if(n.id.indexOf(current)>=0&&c.className.indexOf('-on')<0)
c.className=c.className+'-on';else if(n.id.indexOf(current)<0&&c.className.indexOf('-on')>=0)
c.className=c.className.replace('-on','');}}}}
var scope=document.getElementById(s);for(var i=0,n;n=scope.childNodes[i];i++){if(n.nodeType===1){if(n.id.indexOf(current)>=0&&n.className.indexOf('current')<0)
n.className=n.className+' current';else if(n.id.indexOf(current)<0&&n.className.indexOf('current')>=0)
n.className=n.className.replace(' current','');}}}
$(window).load(function(){$('.toolTip').tooltip({showURL:false,fade:450,track:true,showBody:" - "});var zoom=0;$("div.divAcessibilidade a:eq(1)").click(function(e){if(zoom>0){$("div.divDetalhesProdutoAbas *").each(function(){var atual=$(this).css('font-size');var nova=0;nova=parseInt(atual)-1;$(this).css('font-size',nova+"px");});zoom--;}
e.preventDefault();});$("div.divAcessibilidade a:eq(0)").click(function(e){if(zoom<4){$("div.divDetalhesProdutoAbas *").each(function(){var atual=$(this).css('font-size');var nova=0;nova=parseInt(atual)+1;$(this).css('font-size',nova+"px");});zoom++;}
e.preventDefault();});});function ShowGlossaryToolTip(div){for(var i=0,obj;obj=div.childNodes[i];i++){if(obj.nodeType===1){if(obj.className=='boxTooltipGlossaryDescription'){obj.className='boxTooltipGlossaryDescriptionShow';}}}}
function HideGlossaryToolTip(div){for(var i=0,obj;obj=div.childNodes[i];i++){if(obj.nodeType===1){if(obj.className=='boxTooltipGlossaryDescriptionShow'){obj.className='boxTooltipGlossaryDescription';}}}}
$(window).load(function(){var codProduto=$('#hidProductId').val();var categoryPath=$('#hidCategoryPath').val();var categoryId=$('#hidCategoryId').val();var isbnId=$('#hidISBNId').val();if(isbnId){for(isbn in _GBSBookInfo){var b=_GBSBookInfo[isbn];if(b&&(b.preview=="full"||b.preview=="partial")){$('#buttonGoogleBook').attr('url',b.preview_url);$('#buttonGoogleBook').attr('isbn',b.bib_key);$('#buttonGoogleBook').attr('style','display:block;');break;}}}
$.ajax({type:"POST",url:"/WebService/DetalheProduto.asmx/LogCustomerAccess",data:"{'codProduto':'"+codProduto+"','codCategoria':'"+categoryPath+"','codSubCategoria':'"+categoryId+"'}",contentType:"application/json; charset=utf-8",dataType:"json"});$('[id$=buttonTellMe]').click(function(e){e.preventDefault();$("form").validate({rules:{'txtTellMeName':{required:true},'txtTellMeEmail':{required:true,email:true}},messages:{'txtTellMeName':"<div class='validation' style='clear: none;' />",'txtTellMeEmail':"<div class='validation' style='clear: none;' />"}});if($("form").valid()){$.ajax({type:"POST",url:"/WebService/TellMe.asmx/AddTellMe",data:"{'productId':"+codProduto+",'userName':'"+$("#txtTellMeName").val()+"','userEmail':'"+$("#txtTellMeEmail").val()+"','isOffer':"+$('[id$=cbxOffer]').is(":checked")+"}",contentType:"application/json; charset=utf-8",dataType:"json",success:function(msg){$("#divTellMeMessage").show();var msgSplit=msg.d.split('|');if(msgSplit[0]=='OK')
$("#divTellMeForm").hide();$("#divTellMeText").html(msgSplit[1]);}});}});});function updateDropDownListChip(ddlChip,nameChipAlert,nameFieldCross,nameButtonBuyProduct){if(document.getElementById(nameButtonBuyProduct)!=null){var urlBuy=document.getElementById(nameButtonBuyProduct);if(urlBuy.href.indexOf('?')>0){queryString=urlBuy.href.split('?');queryFields=queryString[1].split('&');var urlBuyNew=queryString[0]+'?';for(i=0;i<queryFields.length;i++)
if(queryFields[i].indexOf(nameFieldCross)<0)
urlBuyNew=urlBuyNew+queryFields[i]+'&';if(ddlChip.value!='0'){urlBuyNew=urlBuyNew+nameFieldCross+'='+ddlChip.value+'&';document.getElementById(nameChipAlert).style["display"]='none';}
document.getElementById(nameButtonBuyProduct).href=urlBuyNew.substring(0,urlBuyNew.length-1);}}}
function validate(){return(validateFields('#comboVariante')&&validateFields('#comboChip'));}
function validateFields(field){var $ddl=$(field).find("select");if($ddl.length==1){if($ddl.val()!='-1')
return true;else{$(field).find("span").css('display','inline');window.location='#divConteinerGeral';alert("Selecione o campo "
+$(field).find("label:first").text().replace(/^\s+|\s+$/g,"").replace(":","").toUpperCase()
+" para continuar a compra.");}}
else
return true;return false;}
function selectVariant(sender,addresses){if(sender.value!=-1&&sender.selectedIndex>0){if(addresses[sender.selectedIndex-1].indexOf('?')!=-1&&addresses[sender.selectedIndex-1].indexOf('&')!=-1)
window.location.href=addresses[sender.selectedIndex-1]+'&selectedVar=1';else
window.location.href=addresses[sender.selectedIndex-1]+'?selectedVar=1';}}
function showWarrantyInfo(){$.ajax({type:"POST",url:"/WebService/DetalheProduto.asmx/GetWarrantyInfo",data:"{}",contentType:"application/json; charset=utf-8",dataType:"json",beforeSend:function(){lightBox.Loading();$('.btnFecharLightbox a').click(function(){lightBox.Close();});},success:function(msg){lightBox.SetStaticContent(msg.d);}});}
$(window).load(function(){$('a.btn-comprargarantia').click(function(e){e.preventDefault();lightBox.Loading();$('.btnFecharLightbox a').click(function(){lightBox.Close();});var html=$('#templateLightboxWarrantyRules').html();html=html.replace("__link__",$(this).attr('href'))
lightBox.SetStaticContent(html);});});$(window).load(function(){$('.availability-notice-opener').click(function(e){e.preventDefault();lightBox.Loading();$('.btnFecharLightbox a').click(function(){lightBox.Close();});lightBox.SetStaticContent($('#templateLightboxAvailabilityNotice').html());lightBox.AddContentCssClass('availability-notice-content');$('.availability-notice-content .tab-container div.contents div.tab-content').each(function(){$(this).css("display","none");});$('.availability-notice-content .tab-container ul.tabs li:first div').each(function(){$(this).attr('class',$(this).attr('class')+'-on');});$('.availability-notice-content .tab-container div.contents div.tab-content:first').css("display","block");$('.availability-notice-content .tab-container ul.tabs li a').click(function(e){e.preventDefault();var selectedTab=$(this).attr("name");$('.availability-notice-content .tab-container ul.tabs li div').each(function(){$(this).attr('class',$(this).attr('class').replace('-on',''));});$(this).parents('li').children('div').each(function(){$(this).attr('class',$(this).attr('class')+'-on');});$('.availability-notice-content .tab-container div.contents div.tab-content').each(function(){if(selectedTab==$(this).attr("name"))
$(this).css("display","block");else
$(this).css("display","none");});});});});