// JavaScript Document

$(document).ready(function() {
	if ($('td.product_information p span').hasClass('highlight_text')){
		$('td.product_information').removeHighlight();
		$('td.product_information p span').removeClass('highlight_text');
	}
	$('td.product_information').highlight('Code:');
	$('td.product_information').highlight('Product:');
	$('td.product_information').highlight('Dimensions:');
	$('td.product_information').highlight('Description:');
	$('td.product_information').highlight('Line Rating:');
	$('td.product_information').highlight('Casting Weight:');
	$('td.product_information').highlight('CMax L:');
	$('td.product_information').highlight('Line Capacity (mm/m):');
	
	
    $('a[rel="external"]').click( function() {
        window.open( $(this).attr('href') );
        return false;
    });
	$(".article_wrapper tr td a").attr("rel","external");
	$(".catalogues_table tr td a").attr("rel","external");
		
	$('#archive_title').addClass('minimised').click(function() {
		$(this).next().slideToggle('fast');
		if ($(this).hasClass('minimised')) {
			$(this).removeClass('minimised').addClass('maximised');
		} else if($(this).hasClass('maximised')){
			$(this).removeClass('maximised').addClass('minimised');	
		} else {
		}
		return false;
	}).next().hide();
														
	$("a img").hover(
	function() {
		$(this).css("border-color", "#EAA10B");
	},
	function() {
		$(this).css("border-color", "#B6BAA0");
	});
	
	$(".video_link a").hover(
	function() {
		$(this).parent(".video_link").css("background", "url(public/media/images/video-image-link_over.jpg) no-repeat left top");
	},
	function() {
		$(this).parent(".video_link").css("background", "url(public/media/images/video-image-link.jpg) no-repeat left top");
	});
	
	$(".instructions_link a").hover(
	function() {
		$(this).parent(".instructions_link").css("background", "url(public/media/images/instructions-link-over.jpg) no-repeat left top");
	},
	function() {
		$(this).parent(".instructions_link").css("background", "url(public/media/images/instructions-link.jpg) no-repeat left top");
	});
	
	$(".download_image_inside a").hover(
	function() {
		$(this).parent(".download_image_inside").css("background", "url(public/media/images/download-image-link-over.jpg) no-repeat left center");
	},
	function() {
		$(this).parent(".download_image_inside").css("background", "url(public/media/images/download-image-link.jpg) no-repeat left center");
	});

});