// JavaScript Document

$(document).ready(function(){
	
	//IF INPUT TYPE TEXT EXIST INIT DEFAULT VALUE FUNCTION
	if($('input[type="text"]').hasClass('txtFocus')){
		initInputValue('txtFocus');
	}
	if($('input[type="text"]').hasClass('txtFocus2')){
		initInputValue('txtFocus2');
	}
	if($('input[type="text"]').hasClass('txtFocus3')){
		initInputValue('txtFocus3');
	}
	if($('input[type="text"]').hasClass('txtForm1')){
		initInputValue('txtForm1');
	}
	if($('input[type="text"]').hasClass('txtForm2')){
		initInputValue('txtForm2');
	}
	if($('input[type="text"]').hasClass('txtForm3')){
		initInputValue('txtForm3');
	}
	if($('input[type="text"]').hasClass('txtForm4')){
		initInputValue('txtForm4');
	}
	if($('input[type="text"]').hasClass('txtForm5')){
		initInputValue('txtForm5');
	}
	if($('input[type="text"]').hasClass('txtForm6')){
		initInputValue('txtForm6');
	}
	if($('input[type="text"]').hasClass('txtForm7')){
		initInputValue('txtForm7');
	}
	if($('input[type="text"]').hasClass('txtForm8')){
		initInputValue('txtForm8');
	}

	if($('input[type="password"]').hasClass('txtPass')){
		initChangeValueInputTypePass();
	}

	if($('.menu').length){
		initTakeBackgroundMenu();
	}
	
	if($('.internalLinks').length){
		initChangeCssInternalLinks();
	}
	
	if ($('.navigation').length) {
		initChangeNavigation();
	}

	if($('.blockCampaignListHome').length){
		$('.blockCampaignListHome:first').addClass('paddingTopNone');
	}

	$('.contentRelatedAreas .list').each(function(){
		initRemoveLinkAccordion();										  
	});
	
	$('.contentListTops .list').each(function(){
		initRemoveLinkAccordion();	
	});
	
	if ($('.areaHighlight .listBooks').length) {
		initRemoveCss('.areaHighlight .listBooks', '3', 'backgroundNoneDifHeight', 'marginBottomZero' , '4' );
	}
	
	if ($('.contentRelatedAreas .top').length) {
		initRemoveCss('.contentRelatedAreas .top', '5', 'backgroundNoneDifHeight','marginBottomZero', '6' );
	}
	
	if ($('.listItensSearch .list .contentListBooks').length) {
		initRemoveCss('.list .contentListBooks', '5', 'backgroundNoneDifHeight','marginBottomZero', '6' );
	}
	
	if ($('.topHome .contentListBooks').length) {
		initRemoveCss('.topHome .contentListBooks', '5', 'backgroundNoneDifHeightHome','marginBottomZero', '6' );
	}
	
	if ($('.areaList .contentListBooks').length) {
		initRemoveCss('.areaList .contentListBooks', '5', 'backgroundNoneDifHeight','marginBottomZero', '6' );
	}
	
	if ($('.campaignListBooks .listBooks').length) {
		initRemoveCss('.campaignListBooks .listBooks', '6', 'backgroundNoneDifHeight','marginBottomZero', '7' );
	}
	
	/*if ($('.campaignListBooks .listBooks').length) {
		initRemoveCss('.campaignListBooks .listBooks', '6', 'backgroundNoneDifHeight','paddingNone', '7' );
	}*/
		
	if ($('.blockListBooks .contentRelatedAreas .top').length) {
		initRemoveCss('.blockListBooks .contentRelatedAreas .top', '5', 'backgroundNoneDifHeight','marginBottomZero', '6' );
	}
	
	if ($('.educationalListBooks .contentListBooks').length) {
		initRemoveCss('.educationalListBooks .list .contentListBooks', '6', 'backgroundNoneDifHeight','marginBottomZero', '7' );
	}
	
	if($('.carrocelHomeBooks').length){
		initCarrHomeBooks();
	}
	
	if($('.contentTabsDetail').length){
		initTabsProductDetail();
	}
	
	if ($('.contentCovers').length) {
		initRemoveCssCovers();
	}

	/*Submenu Vertical Show*/
	/*
	if ($('ul.sf-menu').length) {
		initSubmenuVertical();
	}
	/**/
	/*SUBMENU HORIZONTAL SHOW*/
	if($('ul.menu').length){ 
		initSubmenuHorizontal();
	}
	
	//INIT ACCORDION 
	if($('.customAcc').length){
		initCustomAcc();
	}
	
	if($('.contentAccordionShoppingCart').length){
		initStepFourShoppingCartAcc();
	}
	
	if($('.contentAccordionStepFourEducational').length){
		initStepFourEducationalAcc();
	}
	
	/*if($('.homePageList').length){
		initListBooksHomePageAcc();
	}*/
	
	//HIDE AND SHOW BOX OF ECART IN THE HEADER
	if ($('.contentCart').length) {
		initHideShowContainerECart();
	}
	
	//
	if ($('.contentBox .textBox').length) {
		$('.contentBox .textBox p:last').addClass('paddingBottomZero');
	}
	
	//CHANGE CSS BORDER RIGHT AT THE LAST LI AND THE MARGIN LEFT OF THE FIRST LI
	if ($('.contentMultimedia .blockMulti').length) {
		initChangeCssContentMultimedia();
	}
	
	//AT PRODUCT DETAIL PUT THE PADDING BOTTOM OF THE ALL LAST <P> A ZERO
	if ($('.contentLiteralCritic .description').length) {
		$('.contentLiteralCritic .description p:odd').addClass('paddingBottomZero')
	}
	
	//HIDE AND SHOW WITH ANIMATE EVENT THE LINK SEE MORE OF TAB COMMENT
	if ($('.contentComment').length){
		initHideShowLinkSeeMoreComment();
	}

	//VERIFY THE HEIGHT OF THE CONTAINERS
	setHeight('.heightFooter');
	setHeight('.heightLi');
	
	//FORM EDUCATIONAL
	if($('.radioBox').length){
		initStepsRadio();
	}
	
	//PUT POSITION FIXED AT FIRST STEP OF THE RIGHT CONTAINER
	if($('.eCartLeftSide').length) {
		initChangeCssFirstStepCart();
	}
	
	if($('.contentSubscribeNewsletter').length) {
		$('.textConfirmation p:last').addClass('paddingBottomZero');
	}
	
	if($('.contentPagesTransverse .contentList').length) {
		$('.contentList .listText li:last').addClass('paddingBottomZero');
	}
	
	if($('.contentPagesTransverse .infoPrivacyPolicy').length) {
		$('.infoPrivacyPolicy:last').addClass('backgroundNonePaddingBottomZero');
	}


	if($('.contentEndSubmit').length) {
		$('.textConfirmation p:last').addClass('paddingBottomZero');
	}
	
	if($('.blockSiteMap').length) {
		heightLi();
	}

	
	if($('.listOfItensCatalog').length) {
		var bgHover = $(this).find('li');
		//alert(bgHover.html());
		bgHover.hover(function(){
    	    $(this).find('a.toTop').addClass('arrowUpHover');
			$(this).find('a.toBottom').addClass('arrowDownHover');
			$(this).find('a.remove').addClass('removeItemHover');
		},
		function(){
     		$(this).find('a.toTop').removeClass('arrowUpHover');
			$(this).find('a.toBottom').removeClass('arrowDownHover');
			$(this).find('a.remove').removeClass('removeItemHover');
		});
	}
});
 





