﻿

// 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;
		});
		$(".content-products-information a:first").addClass("sel");
	},
	swapImage: function () {
		$(".content-products-information a").click(function (e) {
			e.preventDefault();
			$(".content-products-information a").each(function () {
				$(this).removeClass("sel");
				$(this).closest('ul').removeClass('last');
			});
			$(this).addClass("sel");
			if ($(this).closest('li').hasClass('last')) {
				$(this).closest('ul').addClass('last');
			}
		});
	},

	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();
   
});




