jQuery(document).ready(function( $ ) { $('.subscribe-form .subscribe-form-inp, .subscribe-form .subscribe-form-textarea').each(function() { var default_value = this.value; //$(this).css('color', '#808080'); $(this).focus(function() { if(this.value == default_value) { this.value = ''; $(this).css('color', '#000000'); } }); $(this).blur(function() { if(this.value == '') { $(this).css('color', '#808080'); this.value = default_value; } }); }); $('.download-pdf-box .download-pdf').click(function(e) { e.preventDefault(); $(this).parents('form').submit(); }); //carousel var carouselBox = $('#carousel'); var carouselIns = $('#carousel .carousel-ins'); carouselBox.append(''); var carouselShow1 = $('#carousel .carousel-show1'); var carouselShow2 = $('#carousel .carousel-show2'); var carouselShow3 = $('#carousel .carousel-show3'); var carouselShow1W = carouselShow1.width(); var carouselShow1H = carouselShow1.height(); var carouselShow2W = carouselShow2.width(); var carouselShow2H = carouselShow2.height(); var carouselShow3W = carouselShow3.width(); var carouselShow3H = carouselShow3.height(); var carouselItems = carouselIns.find('img').length; carouselIns.find('a').eq(2).addClass('active'); if(carouselItems >= 3) { carouselShow1.html(''); carouselShow2.html(''); carouselShow3.html(''); } $('#carousel .carousel-show2, #carousel .carousel-show3').live('click', function() { if(!$('#carousel').hasClass('animated')) { $('#carousel').addClass('animated'); var speed = 1000; var carouselShow21 = $('#carousel .carousel-show1'); var carouselShow22 = $('#carousel .carousel-show2'); var carouselShow23 = $('#carousel .carousel-show3'); var carouselShow21W = carouselShow21.width(); var carouselShow21H = carouselShow21.height(); var carouselShow22W = carouselShow22.width(); var carouselShow22H = carouselShow22.height(); carouselShow21.animate({ left: '-=50', top: '+=20', opacity: '0' }, parseInt(speed/2), function() { $('#carousel .carousel-show3').css('left', '460px'); $('#carousel .carousel-show3').css('top', '0px'); $('#carousel .carousel-show3').width(carouselShow3W); $('#carousel .carousel-show3').height(carouselShow3H); $('#carousel .carousel-show3').animate({ opacity: '1'}, parseInt(speed/2), function() { $('#carousel').removeClass('animated') } ); }); carouselShow22.animate({ left: '0', top: '+=20', width: carouselShow21W+'px', height: carouselShow21H+'px' }, { queue: false, duration: speed }); carouselShow23.animate({ left: '-=230', top: '+=20', width: carouselShow22W+'px', height: carouselShow22H+'px' }, { queue: false, duration: speed }); carouselShow21.addClass('carousel-show3'); carouselShow22.addClass('carousel-show1'); carouselShow23.addClass('carousel-show2'); carouselShow21.removeClass('carousel-show1'); carouselShow22.removeClass('carousel-show2'); carouselShow23.removeClass('carousel-show3'); var lastImg = carouselIns.find('a.active').index(); if(lastImg == (carouselItems-1)) { $('#carousel .carousel-show3').html(''); carouselIns.find('a').removeClass('active'); carouselIns.find('a').eq(0).addClass('active'); }else{ $('#carousel .carousel-show3').html(''); carouselIns.find('a').removeClass('active'); carouselIns.find('a').eq(lastImg+1).addClass('active'); } } }); $('.print-link').click(function(e) { e.preventDefault(); window.print(); }); window.totaltarbut=$('.all-articles .article-small').length; window.currentoverflow=1; window.rightsmlmarg=(-1)*parseInt($('#smalloverflow .article-small:eq(0)').outerWidth(true)); window.rightbigmarg=(-1)*parseInt($('#bigoverflow .article-small:eq(0)').outerWidth(true)); }); function getoverflowdivs(){ var that=$('.all-articles .article-small:eq(o)'); var thats=$('.bigoverflow .bigcontainer:eq(o)'); var myarray=[that,thats]; return myarray; } function sliderighttarbut(){ var that=$('.all-articles .article-small:eq(0)'); var html=that.html(); window.html=html; window.that=that; if (!$('#smalloverflow').hasClass('animated')){ $('#smalloverflow').addClass('animated'); $('#smalloverflow').animate({'margin-left':window.rightsmlmarg+'px'}, { duration:400}); $('#smalloverflow').queue(function(){ //$('#smalloverflow').css('margin-left','-13px'); $('#smalloverflow').append('
'+window.html+'
'); window.that.remove(); $('#smalloverflow').css('margin-left','0px'); $(this).dequeue(); }); $('#smalloverflow').queue(function(){ //$('#smalloverflow').css('margin-left','-13px'); $(this).dequeue(); }); setTimeout(function() { $('#smalloverflow').removeClass('animated'); }, 500); } var that=$('.bigoverflow .article-small:eq(0)'); var html=that.html(); $('#bigoverflow').animate({'margin-left':window.rightbigmarg+'px'}, 400); $('#bigoverflow').queue(function(){ $('#bigoverflow').append('
'+html+'
'); that.remove(); $('#bigoverflow').css('margin-left','0px'); //$('#bigoverflow').animate({'margin-left':'-10px'}, 300); $(this).dequeue(); }); if (!$('#bigoverflow').hasClass('animated')){ $('#bigoverflow').addClass('animated'); setTimeout(function() { $('#bigoverflow').removeClass('animated'); }, 500); } } function slidelefttarbut(){ var total=window.totaltarbut-1; var that=$('.all-articles .article-small:eq('+total+')'); var html=that.html(); $('#smalloverflow').css('margin-left',window.rightsmlmarg+'px'); if (!$('#smalloverflow').hasClass('animated')){ $('#smalloverflow').addClass('animated'); $('#smalloverflow').animate({'margin-left':'0px'}, {queue:false, duration:400}); setTimeout(function() { $('#smalloverflow').removeClass('animated'); }, 500); } $('#smalloverflow').prepend('
'+html+'
'); that.remove(); var that=$('.bigoverflow .article-small:eq('+total+')'); var html=that.html(); $('#bigoverflow').css('margin-left',window.rightbigmarg+'px'); if (!$('#bigoverflow').hasClass('animated')){ $('#bigoverflow').addClass('animated'); $('#bigoverflow').animate({'margin-left':'0px'}, {queue:false, duration:400}); setTimeout(function() { $('#bigoverflow').removeClass('animated'); }, 500); } $('#bigoverflow').prepend('
'+html+'
'); that.remove(); }