$(document).ready(function() {                

  // open external link in new tab/window
  $("a[href*='http://']:not([href*='"+location.hostname+"'])").click(function(){
    this.target = "_blank";
  });

	/* hide n show */
	$('#hide-n-show li, #hide-n-show2 li').eq(0).show().addClass('opened').siblings('li').find('.description').hide();
	$('#hide-n-show li h3, #hide-n-show li a.hide_show, #hide-n-show2 li h3, #hide-n-show2 li a.hide_show').click(function() {
		$(this).parent().toggleClass('opened');
		$(this).siblings('.description').slideToggle(300);
		return false;
	});

	//removed border and padding bottom on last product detail
	$('ul#products-details li:last').css({'border' : '0', 'padding-bottom' : '0'});
	
	
	$('input[alt]').focus(function () {
        if ($(this).attr("value") == $(this).attr("defaultValue")) {
                $(this).attr("value", '');
        }		
	});
	$('input[alt]').blur(function () {
        if ($(this).attr("value") == '') {
      	$(this).attr("value", $(this).attr("defaultValue"));
      }
	});
	
	
	//hide and show search form
	$('#cntnt01moduleform_1').hide();
	$('#show_search').click(function(){
		$('#cntnt01moduleform_1').toggle();
		return false;
	});
	$('.cancel-button').click(function(){
		$('#cntnt01moduleform_1').hide();
		return false;
	});
	
	//print vacancies
	$('#hide-n-show .print, #hide-n-show2 .print').click(function() {
		$('#hide-n-show li, #hide-n-show2 li').removeClass('dont_print_me');
		$(this).closest('li').siblings().addClass('dont_print_me');
		window.print();
		return false;
	});

});