<!--
/* -----------------------------------------------------------*/
/*
*	Copyright 2006 [di] digitale informationssysteme gmbh, Manheim, Germany
*	global.js - global js file
*
*	AUTHOR:
*	goma - Gordon Marshall - marshall(at)digi-info(dot)de
*
*	CREATED:
*	goma, 12.01.2006
*
*	LAST MODIFIED:
*	goma, 17.05.2011
*
*/
/* -----------------------------------------------------------*/


// global document.ready functions
$(function() {

    // set width of image captions
    $(".image-left,.image-center,.image-right").each(function() {
        var w = $(this).find("img:first").width();
        $(this).css("width", w);
    });

    // fill/empty search box
    $('#search').focus(function() {
        if ($(this).val() == "Search") $(this).val("");
    });
    $('#search').blur(function() {
        if ($(this).val() == "") $(this).val("Search");
    });

    // alternating table rows
    $('table tr:nth-child(odd)').addClass('odd');

    // replace legend with div.legend for consistent cross-browser styling	
    $('legend').each(function() {
        var content = $(this).html();
        $(this).replaceWith('<' + 'div class="legend">' + content + '<' + '/div>');
    });

    // print button
    $('#btn-tool-print').click(function () {
        window.print();
    });
	
	$('.tbUsername,.tbPassword').keypress(function(event) {
		if (getKeyCode(event) == 13) {
            // enter: 13
            $('.btnLogin').click();
        }						   
	});
	

	
	
	
	function getKeyCode(e) {
		var code = (e.keyCode ? e.keyCode : e.which);
		return code;
	}


});








