
var default_justification_classname = 'warenkorbnavi';
var kategorie_target_url_template = null;

var shadow_offset_left = 3;
var shadow_offset_top = 3;

function body_onload() {

	var elem = document.getElementById('txtExpressSearch');
	if ( elem ) elem.focus();

	justifyNavigation();

}

function body_onresize() {

	justifyNavigation();

}

function justifyNavigation() {

	if ( window.innerWidth < 1020 ) {
		var elem = null;
		if ( elem = document.getElementById('navTop') ) {
			elem.className = 'warenkorbnavi warenkorbnavi_leftjust';
		}
		if ( elem = document.getElementById('navBottom') ) {
			elem.className = 'warenkorbnavi warenkorbnavi_leftjust';
		}
	} else if ( window.innerWidth >= 1020 ) {
		var elem = null;
		if ( elem = document.getElementById('navTop') ) {
			elem.className = default_justification_classname;
		}
		if ( elem = document.getElementById('navBottom') ) {
			elem.className = default_justification_classname;
		}
	}

}

function searchFocus(ctrl) {
	if ( ctrl.value == 'suchen' ) {
		ctrl.value = '';
	}
}

function searchBlur(ctrl) {
	if ( ctrl.value == '' ) {
		ctrl.value = 'suchen';
	}
}

function openExtern(ctrl) {
	window.open(ctrl.href, '_blank');
	return false;
}

function gotoOrdered(order) {
	var elem = document.getElementById('ord_' + order);
	if ( elem ) {
		window.location.href = elem.href;
	}
}

function shadowize(obj) {
	var parent = obj.parentNode;

	if ( parent ) {
		var shadow = document.createElement('div');
		if ( obj.id ) shadow.id = 'shadow_' + obj.id;
		shadow.style.position = 'absolute';
		shadow.style.left = (obj.offsetLeft + shadow_offset_left) + 'px';
		shadow.style.top = (obj.offsetTop + shadow_offset_top) + 'px';
		shadow.style.width = obj.offsetWidth + 'px';
		shadow.style.height = obj.offsetHeight + 'px';
		shadow.style.backgroundColor = '#999';
		parent.insertBefore(shadow, obj);
	}
}
