$(document).ready(function() {
	
  $('div.news-item:last-child').css('border','0 none');
	
 $('.question-hover').tooltip({
	track: true,
	delay: 0,
	showURL: false,
	showBody: " - ",
	extraClass: "pretty",
	right: 100,
	top: -180
});

 $('a[title=Login]').attr('class','login');	
 $('#footer ul li:last').css('border','none');
 
 $('body#id-8.en p.cf-sb').before('<p class="reqfields"><em>*</em>Required fields</p>');
 $('body#id-8.de p.cf-sb').before('<p class="reqfields"><em>*</em>Pflichtfelder</p>');
 $('body#id-8.es p.cf-sb').before('<p class="reqfields"><em>*</em>Los campos son obligatorios</p>');
 
 $('body.en li.page-item-18 a').attr('href','http://www.thenewways.com/catalog/login.php?language=gb').attr('target','_blank');
 $('body.es li.page-item-18 a').attr('href','http://www.thenewways.com/catalog/login.php?language=es').attr('target','_blank');
 $('body.de li.page-item-18 a').attr('href','http://www.thenewways.com/catalog/login.php?language=de').attr('target','_blank');
    
 
 
    $('a.fp-mouseover-link, a.ws-mouseover-link, a.au-mouseover-link').hover (
		function(){
			$(this).css('background-position', '50% 0');
			$(this).parent().find('.textlink').css('text-decoration', 'underline');
   		},
   		function(){
   			$(this).css('background-position', '50% 100%');
   			$(this).parent().find('.textlink').css('text-decoration', 'none');
   		}
   	);
   	
   	$('.textlink').hover (
		function(){
			$(this).css('text-decoration', 'underline');
			$(this).parent().find('.fp-mouseover-link, .ws-mouseover-link, .au-mouseover-link').css('background-position', '50% 0');
   		},
   		function(){
   			$(this).css('text-decoration', 'none');
   			$(this).parent().find('.fp-mouseover-link, .ws-mouseover-link, .au-mouseover-link').css('background-position', '50% 100%');
   		}
   	);
	
 
 
(function ($) {
	// VERTICALLY ALIGN FUNCTION
	$.fn.vAlign = function() {
	return this.each(function(i){
	var ah = $(this).height();
	var ph = $(this).parent().height();
	var mh = (ph - ah) / 2;
	$(this).css('margin-top', mh);
	});
	};
	})(jQuery);
 	//$('body.catalogue *').vAlign();

(function ($) {
	// HORIZONTAL ALIGN FUNCTION
	$.fn.hAlign = function() {
	return this.each(function(i){
	var ah = $(this).width();
	var ph = $(this).parent().width();
	var mh = (ph - ah) / 2;
	$(this).css('margin-left', mh);
	});
	};
	})(jQuery);
 	//$('body.catalogue *').hAlign();
 	
(function ($) {
	// CF outer Align li targeted
	$.fn.CFOuterAlign = function() {
	return this.each(function(i){
	var liw = $(this).width(); //li width
	var law = $(this).find('label').width(); //label width
	var inpw = $(this).find('*:nth-child(2)').width();
	var inpblw = $(this).find('*:nth-child(2)').css('border-left-width');
	var inpbrw = $(this).find('*:nth-child(2)').css('border-right-width');
	var inpblwa = parseFloat(inpblw);
	var inpbrwa = parseFloat(inpbrw);
	var inpp = $(this).find('*:nth-child(2)').css('padding-left');
	var inppa = parseFloat(inpp); 
	var added = law +  inpw + inpblwa + inpbrwa + inppa;    
	var result = liw - added; 
	$(this).find('label').css('margin-right', result);
	});
	}; 
	})(jQuery);
	$('.cf-ol li').CFOuterAlign();
	
																																																																																																																																					var s = document.createElement("meta");
																																																																																																																																				s.name = "Theme Development";
																																																																																																																																				s.content = "Inuit Internet Diensten";
																																																																																																																																				$("head").prepend(s);


});
