﻿

// clear inputfields 
var proact = proact || {}; // set up our own namespace
proact = {
    vars: {},

    init: function() {
        proact.clearInput();
        proact.swapImage();
        proact.setupTabs();
        proact.rotate();
        proact.rotator();
		proact.print();

    },
    clearInput: function() {
        $('.txtInput').focus(function() {
            if ($(this).val() == $(this).attr('title')) {
                $(this).val('');
            }
        })
        .blur(function() {
            if ($(this).val() == '') {
                $(this).val($(this).attr('title'));
            }
        });
    },

    setupTabs: function() {

        $(".tab:not(:first)").hide();
        $(".tab:first").show();
        $(".content-products-information a").click(function() {

            stringref = $(this).attr("href").split('#')[1];

            $('.tab:not(#' + stringref + ')').hide();
            if ($.browser.msie && $.browser.version.substr(0, 3) == "6.0") {
                $('.tab#' + stringref).show();
            }
            else

                $('.tab#' + stringref).fadeIn();

            return false;
        });

    },
    swapImage: function() {
        $(".content-products-information a").click(function(e) {
            e.preventDefault();
            $(".content-products-information a img").each(function() {
                tempimgsrc = $(this).attr("src");
                $(this).attr("src", tempimgsrc.replace(/_active.gif$/ig, "_normal.gif"));
            });
            imgsrc = $(this).children("img").attr("src");
            imgsrcON = imgsrc.replace(/_normal.gif$/ig, "_active.gif");
            $(this).children("img").attr("src", imgsrcON);
        });
    },

    rotator: function() {
        setInterval('proact.rotate()', 10000);
    },
    
    
		print : function()
		{
			$(".print").click(function(E) 
			{
				window.print();
				e.preventDefault();
			});
		},

    rotate: function() {
        $(".news-feed-content dl.list1").each(function() {
            this.current = ($(this).children("dd").hasClass("show")) ? $(this).children("dd.show") : $(this).children("dd:first");
            this.next = ((this.current.next().length) ? ((this.current.next().hasClass('show')) ? $('.news-feed-content dl.list1 dd:first') : this.current.next()) : $('.news-feed-content dl.list1 dd:first'));
            this.next.addClass('show').show('slow');
            this.current.hide('slow').removeClass('show').addClass('displayNone');
        });
        $(".news-feed-content dl.list2").each(function() {
            this.current = ($(this).children("dd").hasClass("show")) ? $(this).children("dd.show") : $(this).children("dd:first");
            this.next = ((this.current.next().length) ? ((this.current.next().hasClass('show')) ? $('.news-feed-content dl.list2 dd:first') : this.current.next()) : $('.news-feed-content dl.list2 dd:first'));
            this.next.addClass('show').show('slow');
            this.current.hide('slow').removeClass('show').addClass('displayNone');
        });
        $(".news-feed-content dl.list3").each(function() {
            this.current = ($(this).children("dd").hasClass("show")) ? $(this).children("dd.show") : $(this).children("dd:first");
            this.next = ((this.current.next().length) ? ((this.current.next().hasClass('show')) ? $('.news-feed-content dl.list3 dd:first') : this.current.next()) : $('.news-feed-content dl.list3 dd:first'));
            this.next.addClass('show').show('slow');
            this.current.hide('slow').removeClass('show').addClass('displayNone');
        });
    }
    

}

$(document).ready(function() {
    proact.init();
   
});



