// JavaScript Document

/*
// €
// --------------------------------------------------------------------------
// jQuery.custom.js by orangepointsolutions Ltd., www.orangepointsolutions.de
// --------------------------------------------------------------------------
*/

$(document).ready(function() {

/*
// --------------------------------------------------------------------------
// general settings
// --------------------------------------------------------------------------
*/

// $('input:text').setMask(); // mask input form fields using meiomask

$("#back2top a#b2top").click( function() { $.scrollTo( 0, 400 ); });

// toggle site credits

/*
// --------------------------------------------------------------------------
// loginbox
// --------------------------------------------------------------------------
*/

$("a.loginbox_call").toggle( function() {
		$("#loginbox").animate({ opacity: 'show' }, 'normal');
		$(this).addClass("active");
		$("#text_login_username").focus();
}, function() {
		$("#loginbox").animate({ opacity: 'hide' }, 'normal');
		$(this).removeClass("active");
});

/*
$("#send_pw").toggle( function() {
		$("#login").hide();
		$("#get_pw").animate({ opacity: 'show' }, 'normal');
		$("#text_send_pw_username").focus();
}, function() {
		$("#get_pw").hide();
		$("#login").animate({ opacity: 'show' }, 'normal');
});
*/

/* $("#text_send_pw_username").focus( function() {
											$(this).text("");
											}); */

// -- end of loginbox --


/*
// --------------------------------------------------------------------------
// product navigation
// --------------------------------------------------------------------------
*/

// evaluate cookies
	
var myHeader = $.cookie('myHeader');
var product_navigation_container = $('.jScrollPaneContainer');
var product_navigation_close = $('#product_navigation_close');

function fadeOutProductNavigation() {
	product_navigation_container.animate({ opacity: '0.01' }, 'normal', function() {
		product_navigation_container.animate({ height: 'hide' }, 'normal');
		$('#breadcrumb_navigation').addClass('small_header');
		product_navigation_close.attr('src', 'images/open.gif');
	});
}

function fadeInProductNavigation() {
	product_navigation_container.animate({ height: 'show' }, 'normal', function() {
		product_navigation_container.animate({ opacity: '1.0' }, 'slow'); 
		$('#breadcrumb_navigation').removeClass('small_header');
		product_navigation_close.attr('src', 'images/close.gif');
	});
}

if (myHeader == 'collapsed') {
    fadeOutProductNavigation();
	product_navigation_close.attr('src', 'images/open.gif');
} else {
	$("#product_navigation_container").show();
};

product_navigation_close.click( function() {
	var myHeader = $.cookie('myHeader');

    if (myHeader == 'expanded') {
    	$.cookie('myHeader', 'collapsed');
		fadeOutProductNavigation();
	} else {
    	$.cookie('myHeader', 'expanded');
		fadeInProductNavigation();
	}
});


if ( !$.browser.msie ) {
	$('#product_navigation_more').click( function() {
		$('#product_navigation li:visible:first')
			.animate({ opacity: 'hide' }, 'normal')
			.addClass('left_hidden');
		$('#product_navigation_less').animate({ opacity: '1.0' }, 'normal');
	});
} else {
	$('#product_navigation_more').click( function() {
		$('#product_navigation li:visible:first')
			.hide()
			.addClass('left_hidden');
		$('#product_navigation_less').animate({ opacity: '1.0' }, 'normal');
	});
}

if ( !$.browser.msie ) {
	$('#product_navigation_less')
		.animate({ opacity: '0.25' }, 'normal')
		.click( function() {
			$('#product_navigation li.left_hidden:last')
				.animate({ opacity: 'show' }, 'normal')
				.removeClass('left_hidden');
		})
	;
} else {
	$('#product_navigation_less')
		.click( function() {
			$('#product_navigation li.left_hidden:last')
				.show()
				.removeClass('left_hidden');
		})
	;
}


if ( js_product != '' && !$.browser.msie ) {
	$('#product_navigation li').not($('#product_'+js_product)).animate({ opacity: '0.5' }, 'normal');
}

// -- end of product navigation --


/*
// --------------------------------------------------------------------------
// headlines
// --------------------------------------------------------------------------
*/

// boxes

// -- end of headlines --


}); // end of document ready



/*
// --------------------------------------------------------------------------
// misc functions
// --------------------------------------------------------------------------
*/

function nl2br (str, is_xhtml) {
    // +   original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +   improved by: Philip Peterson / Onno Marsman / Atli Þór 
    // +   bugfixed by: Onno Marsman / Kevin van Zonneveld
    // +      input by: Brett Zamir (http://brett-zamir.me)
 
    var breakTag = '';
 
    breakTag = '<br />';
    if (typeof is_xhtml != 'undefined' && !is_xhtml) {
        breakTag = '<br>';
    }
 
    return (str + '').replace(/([^>]?)\n/g, '$1'+ breakTag +'\n');
}


function show_at ( dn, e, l ) {
	document.write( e + ' [' + 'a' + 't' + '] ' +  dn + '.' );
	document.write( 'd' + 'e' );
}

// --- end of jQuery.custom.js ---

