jQuery(document).ready(function($){ //$('.validate').validate(); $('form.validate').each(function(key, form) { //selects every
on page $(this).validate({ // initialize validate() on each form // your options //set your options inside }); }); jQuery.extend(jQuery.validator.messages, { required: "", email: "" }); // form validation jQuery("a.anchor").anchorAnimate({ speed : 500, margin: 0 }) $(".fancybox").fancybox({ // Options will go here }); // FOR HOMEPAGE imagesLoaded( '.home-news', function() { makeSameHeight() ; }); function makeSameHeight() {; win_width = $(window).width(); $(".box-news").css('min-height','inherit'); if (win_width > 759) { //$(".block-container").each(function(){ var currentTallest = 0; $('.box-news').each(function(i){ if ($(this).height() > currentTallest) { currentTallest = $(this).height(); } //alert (currentTallest); $(this).css({'min-height': currentTallest}); }); //}); } } $('.flexslider').flexslider({ animation: "fade", touch: true, controlNav: true, directionNav: true, prevText : '', nextText: '', animationLoop: true, smoothHeight: true, slideshow: true, itemMargin: 0, slideshowSpeed: 8000, //Integer: Set the speed of the slideshow cycling, in milliseconds animationSpeed: 1500 }); /***** Mobile Nav *******/ //et_duplicate_menu( $('#menu-main-menu'), $('.mobile_nav'), 'mobile_menu', 'et_mobile_menu' ); et_duplicate_menu( $('#ul-main-menu'), $('.mobile_nav'), 'mobile_menu', 'et_mobile_menu' ); function et_duplicate_menu( menu, append_to, menu_id, menu_class ){ var $cloned_nav; menu.clone().attr('id',menu_id).removeClass().attr('class',menu_class).appendTo( append_to ); $cloned_nav = append_to.find('> ul'); //$cloned_nav.find('.menu_slide').remove(); $cloned_nav.find('li:first').addClass('et_first_mobile_item'); append_to.click( function(){ if ( $(this).hasClass('closed') ){ $(this).removeClass( 'closed' ).addClass( 'opened' ); $cloned_nav.slideDown( 500 ); } else { $(this).removeClass( 'opened' ).addClass( 'closed' ); $cloned_nav.slideUp( 500 ); } return false; } ); append_to.find('a').click( function(event){ event.stopPropagation(); } ); } prepareEncuesta(); function prepareEncuesta() { $('#bpopup_modal').hide(); $('#send_enc').click(function() { $('#bpopup_modal').bPopup(); $('#bpopup_modal').submit(); }); $('#ver_res').click(function() { $('#bpopup_modal').bPopup(); $('#bpopup_modal').submit(); }); $('#bpopup_close').click(function() { $('#bpopup_modal').bPopup().close(); }); } }); function IsEmail(sMail) { var iLastPos = sMail.length - 1; for (var iPos = 0; iPos <= iLastPos; iPos++) if (sMail.charAt(iPos) < "!" || sMail.charAt(iPos) > "~") return false; iPos = sMail.indexOf("@"); if (iPos < 1 || iLastPos == iPos || sMail.charAt(iLastPos) == "." || sMail.indexOf("@", iPos + 1) >= 0 || sMail.indexOf(".", iPos + 1) < iPos + 2) return false; return true; } //----------------------------------------------------- //--- FILE UPLOADS ------------------------------------ //----------------------------------------------------- function upload(type, rename, field, field_img, dest,width,height,max_size){ win = window.open("file_upload.php?dest=" + dest + "&field=" + field + "&field_img=" + field_img + "&rename=" + rename + "&type=" + type + "&width=" + width + "&height=" + height + "&max_size=" + max_size,"Upload","width=400,height=210,top=150,left=150"); win.focus(); } function changeImage (img1, img2) { img = getElementById(img1); img.src = img2 //return true; } function movepic(img_name,img_src) { document[img_name].src=img_src; } function borrar(img, field) { window.open("file_upload.php?borrar=" + img + "&field=" + field,"Borrar","width=366,height=210,top=150,left=150"); }