function printContentArea() {
    var field = 'printVersion';
    var url = window.location.href;

    if (url.indexOf(field) > -1) {
        $('head').append('<link rel="stylesheet" type="text/css" href="/Style Library/GKN/Styles/print.css" />');
        window.print();
    }
}
// ToDo: Change to be on division being in URL and not division.aspx for when more pages
function selectinList() {
    $("#division-links").children("a").removeClass("active");
    var arr = ['Automotive.aspx', 'Powder-Metallurgy.aspx', 'Land-Systems.aspx', 'Aerospace.aspx'];
    var dir = window.location.pathname.split('/')[3];
    var index = $.inArray(dir, arr) + 1;
    $(".nav" + index).addClass('active');
}

/* DIVISIONS TOP NAV */
$(function () {
    /*if ($('div.division-top-nav').length > 0 && $('div.division-top-nav').length > 0) {*/
    if ($('div.division-top-nav').length > 0 && $('div.show-divisions-menu').length > 0) {
        initDivisionNav();
    }
});

function initDivisionNav() {
    $('div.division-top-nav').append('<a href="#" id="alldivisionsbackbtn"><img src="/Style Library/GKN/Images/divisions-button-back.gif" alt="All Our Divisions" width="68" height="32" /></a>');
    $('div.division-top-nav').append('<a href="#" id="alldivisionsbtn"><img src="/Style Library/GKN/Images/divisions-button.gif" alt="All Our Divisions" width="68" height="32" /></a>');
    $("#division-links-search").appendTo("div.division-top-nav");
    //$('#division-links').animate({ left:0 }, { duration:1000 });

    var cssObj1 = {
        'position': 'absolute',
        'left': '0',
        'top': '0',
        'clip': 'rect(0px,950px,200px,0px)'
    }
    $('div#division-links-search').css(cssObj1);

    var cssObj2 = {
        'position': 'absolute',
        'left': '890px',
        'top': '0',
        'margin-top': '0'
    }
    $('div#division-links').css(cssObj2);



    $('#alldivisionsbtn').click(
		function () {
		    $('#division-links').animate({ left: 0, width: 960 }, { duration: 400 }).css("height", "30px");
		    $(this).fadeOut(400);
		}
	);
    $('#alldivisionsbackbtn').click(
		function () {
		    $('#division-links').animate({ left: 960, width: 1 }, { duration: 400 }).css("height", "30px");
		    $('#alldivisionsbtn').fadeIn(400);
		}
	);



    /*$('#division-top-nav').mouseleave(
    function(){
    $('#division-links').animate({left:960,width:1}, {duration:400}).css("height","30px");
    $('#alldivisionsbtn').fadeIn(400);
    }
    );*/


}
