// Array aller Popup-Fenster mit Name und Parameter
var PopupWindows = new Array();
// Standard
PopupWindows["standard"] = "width=400,height=550,scrollbars=yes,resizable=yes";
// definierte Fensternamen
PopupWindows["printservice"] = "width=385,height=335,scrollbars=yes,resizable=yes";
PopupWindows["merkliste"] = "width=100,height="+(screen.height-110)+",scrollbars=yes,resizable=no,screenX="+(screen.width-110)+",screenY=0,left="+(screen.width-110)+",top=0";
PopupWindows["auswahl"] = "width=300,height=200,resizable=no,scrollbars=no,dependent=yes";
PopupWindows["groessenberater"] = "width=756,height=538,scrollbars";
PopupWindows["kollektion"] = "width=795,height=769,scrollbars=yes,resizable=yes";
PopupWindows["wkorb"] = "width=608,height=350,scrollbars=yes,resizable=yes";
PopupWindows["wkorb_abs"] = "width=250,height=340,scrollbars=no,resizable=no";
PopupWindows["uw_popup"] = "width=640,height=550,scrollbars=no,resizable=yes";
PopupWindows["modeberater"] = "width=900,height=700,scrollbars=no,resizable=yes";
PopupWindows["technikwelt"] = "width=495,height="+((screen.width > 1024)?"412":"300")+",scrollbars=yes,resizable=yes,locationbar=no,menubar=no,toolbar=no";
PopupWindows["hilfecenter"] = "width=855,height=591,scrollbars=yes";
PopupWindows["hilfe_center"] = "width=855,height=591,scrollbars=yes";
PopupWindows["basket_survey"] = "width=520,height=590,scrollbars=no";
PopupWindows["migration_hilfe"] ="width=430,height=430,scrollbars=yes,resizable=no";
PopupWindows["merkzettel"] ="width=580,height=620,scrollbars=yes,resizable=no";
PopupWindows["mein_neckermann_login"] ="width=310,height=430,resizable=no,scrollbars=no";
PopupWindows["artikel_change"] = "width=710,height=690,scrollbars=yes,resizable=yes";
PopupWindows["techniklexikon"] = "width=750,height=560,scrollbars=no,resizable=no";
PopupWindows["bicycleSizeAdvisor"] = "width=750,height=620,scrollbars=no,resizable=no";
PopupWindows["leuchtenstudio"] = "width=760,height=580,resizable=no,toolbar=no,status=no,directories=no,menubar=no,location=no";
PopupWindows["hauptkatalog"] = "width=781,height=540,resizable=no,toolbar=no,status=no,directories=no,menubar=no,location=no";
PopupWindows["emailNotConfirmed"] = "width=435,height=500,scrollbars=no,resizable=no";
PopupWindows["liveshopping"] 	  = "width=639,height=600,scrollbars=no,resizable=no";
PopupWindows["patternSample"] 	  = "width=790,height=680";
PopupWindows["finanzierungsrechner"] 	  = "width=410,height=510,scrollbars=yes,resizable=yes"; // ff
if( window.ie ) {
	PopupWindows["finanzierungsrechner"] 	  = "width=410,height=570,scrollbars=yes,resizable=yes"; // ie
}

// altes Warenkorb-Popup
PopupWindows["pop"] = PopupWindows["wkorb"];

/*
* Function removes leading "/" and replaces all "/" with " > "
*/
function prepareUrlForTracking(anUrl) {
	if (anUrl[0] == "/") {
		anUrl = anUrl.substring(1);
	}
	if (anUrl.indexOf("http://") == -1 || anUrl.indexOf("https://") == -1 ) {
		anUrl = anUrl.replace(/[\/]/g," > ")
	}
	return anUrl;
}

function Popup(url, name, parameter, block_url, block_target, return_ref) {
	if (name == "" || name == null) {
		name = "standard";
	}
	if (name == 'SmartAssistant') {
		setSmartAssistantDomain();
	}
	if (name.indexOf("beratung_") != -1) {
		name = "beratung_";
		self.parent.name = 'openerwindow';
	}
	if (PopupWindows[name] != null) {
		parameter = PopupWindows[name];
	}
	else if (parameter == "" || parameter == null) {
		// undefinierter Name und keine Parameter übergeben => Standard-Parameter
		parameter = PopupWindows["standard"];
	}
	// Popup zentrieren, dazu X und Y Koordinate berechnen
	var width, height, left = null, top = null;
	temp = parameter.split(",");
	for (var i = 0; i < temp.length; i++) {
		values = temp[i].split("=");
		if (values[0] == "width") width = parseInt(values[1]);
		if (values[0] == "height") height = parseInt(values[1]);
		if (values[0] == "left") left = parseInt(values[1]);
		if (values[0] == "top") top = parseInt(values[1]);
	}
	if (left == null) {
		left = Math.round((screen.width - width) / 2);
	}
	if (top == null) {
		top = Math.round((screen.height - height) / 3);
	}
	if (left != null) {
		parameter += ",screenX="+left+",left="+left;
	}
	if (top != null) {
		parameter += ",screenY="+top+",top="+top;
	}

	var popuphandler = window.open(url, name, parameter);
	if (popuphandler != null) {
		popuphandler.window.focus();
	}
	else {
		if (block_url != null && block_url != "") {
			if (block_target == null || block_target == "") {
				window.location.href = block_url;
			}
			else {
				eval("window." + block_target.replace(/^_/,"") + ".location.href = '" +	block_url + "'");
			}
		}
	}
	if (return_ref == true) {
		return popuphandler;
	}
}

function isParentWindowAlive(){
	//check, if Parent-Window is still opened (hast nothing to do with the target _parent!)
	//Fix for IE
	//	-- opener.closed returns in IE 6 a "permission denied" error
	//	-- see http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=771101&SiteID=1 (Oct 2006)
	//		 or http://www.google.de/search?hl=de&q=window.opener.closed+%27Permission+denied%27+IE&meta=
	try {
			window.opener.document.title = window.opener.document.title;
			return true;
	} catch(e) {
			return false;
	}
}



function setSmartAssistantDomain(parentFrame) {
	try {
		document.domain = document.domain.substring(document.domain.indexOf('.') + 1);
		if (parentFrame == true) {
			window.parent.document.domain = window.parent.document.domain.substring(document.domain.indexOf('.') + 1);
		}
	}
	catch (e) {
	}
}



function reloadOpener(url, opener_target, dont_close) {
	var nm_window = null;
	if (opener != null) {
		if (isParentWindowAlive()) {
			if (opener_target == '' || opener_target == null) {
				nm_window = opener;
			}
			else {
				nm_window = eval("opener."+opener_target);
			}
		}
	}
	if (nm_window == null) {
		nm_window = window.open("", "neckermann_at_main");
	}
	if (nm_window != null) {
		nm_window.location.href = url;
		nm_window.focus();
		//shall the current window be closed?
		if(dont_close == true) {
			//do nothing
			//--> window stays opened
		} else {
			this.close();
		}
	}
}


// returns true, if searchText is rewritable
function isRewritableSearchText(s_searchText) {
	return (s_searchText.match(/[^A-Za-z0-9,_\-\/]/) == null);
}


// redirects searchform to rewrite url
function onSubmitSearchForm(o_searchform, b_start) {
	try {
		if (urlRewritingEnabled == true) {
			var s_searchText = o_searchform.suchtext.value;
			var s_mb_f020_id = '';
			try {
				s_mb_f020_id = o_searchform.mb_f020_id.value;
			} catch(e) { }

			if (isRewritableSearchText(s_searchText)) {
				if (s_searchText != '') {
					search_url = '/search_start/' + escape(s_searchText) + '.html';
					if (document.cookie == '') {
						search_url += '?mb_f020_id=' + s_mb_f020_id;
					}
				}
				else {
					search_url = '/search_start';
					if (document.cookie == '') {
						search_url += '/?mb_f020_id=' + s_mb_f020_id;
					}
				}
				window.location.href = search_url;
				return false;
			}
		}
	}
	catch(e) { }

	return true;
}


// Funktion, die verwendet wird, wenn ein Popup-Blocker am Werk ist; blendet das Layer mit dem Hinweis zum manuellen Oeffnen ein
function changeBlockLayer() {
	if (blocker == undefined || blocker == null) {
		if (document.layers) {	// Old Netscape
			document.layers["blocklayer"].visibility = "visible";
		}
		else if (document.all) {	// IE
			document.all["blocklayer"].style.visibility = "visible";
		}
		else {	// Mozilla based Browser
			layers=document.getElementsByTagName("DIV");
			layers["blocklayer"].style.visibility = "visible";
		}
	} else {
		// Popups are not blocked and go up
	}
}



/**********************************************************/
function OpenWindowBerater(url,name,parameter,block_url,block_target,return_ref) {
	openWindowBerater(url,name,parameter,block_url,block_target,return_ref);
}

function openWindowBerater(url,name,parameter,block_url,block_target,return_ref) {

	if ( name.indexOf("beratung_") != -1 ) {
		self.parent.name='openerwindow';
		size = "width=615,height=480,scrollbars=yes,resizable=yes";
	}
	else if (name == "a1_seite") {
		size = "width=800,height=600,scrollbars=yes,resizable=yes,locationbar=yes,menubar=yes,toolbar=yes";
	}
	else if (name == "alamode") {
		size = "width=250,height=150,scrollbars=no,resizable=no";
	}
	else if (name == "baby_groessenberater") {
		size = "width=700,height=520,scrollbars=yes,resizable=yes";
	}
	else if (name == "bild") {
		size = "width=760,height=660,screenX=20,screenY=20,left=20,top=20";
	}
	else if (name == "dvdberater") {
		size = "width=570,height=390,scrollbars=no,resizable=no";
	}
	else if (name == "dvdberater_html") {
		size = "width=440,height=550,scrollbars=yes,resizable=yes";
	}
	else if (name == "einrichtungsplaner") {
		size = "width=800,height=600,left=1,top=1,scrollbars=no,resizable=yes";
	}
	else if (name == "emailempfehlung") {
		size = "scrollbars,width=540,height=580";
	}
	else if (name == "euro") {
		size = "width=320,height=205,scrollbars=yes,resizable=no";
	}
	else if (name == "extern") {
		size = "location=yes,menubar=yes,personalbar=yes,resizable=yes,scrollbars=yes,status=yes,toolbar=yes";
	}
	else if (name == "fotolexikon") {
		size = "width=605,height=490,scrollbars=yes,resizable=yes";
	}
	else if (name == "fotoschule") {
		size = "width=605,height=490,scrollbars=yes,resizable=yes";
	}
	else if (name == "geschenkefinder") {
		size = "width=650,height=600,scrollbars,resizable=yes";
	}
	else if (name == "komfortshopping") {
		size = "width=520,height=400,scrollbars=yes,resizable=yes";
	}
	else if (name == "merkzettel") {
		size = "width=615,height=480,scrollbars=yes,resizable=yes";
	}
	else if (name == "moebellexikon") {
		size = "width=615,height=480,scrollbars=yes,resizable=yes";
	}
	else if (name == "modelexikon") {
		size = "width=615,height=400,scrollbars=no,resizable=yes";
	}
	else if (name == "normal") {
		size = "location=yes,menubar=yes,personalbar=yes,resizable=yes,scrollbars=yes,status=yes,toolbar=yes";
	}
	else if (name == "printservice") {
		size = "width=385,height=335,scrollbars=yes,resizable=yes";
	}
	else if (name == "service") {
		size = "width=400,height=390,scrollbars";
	}
	else if (name == "stoffmusterkorb") {
		size = "width=500,height=500,scrollbars=yes";
	}
	else if (name == "techniklexikon") {
		size = "width=685,height=490,scrollbars=yes";
	}
	else if (name == "weihnachtsgewinnspiel") {
		size = "width=550,height=400,scrollbars=no,resizable=no";
	}
	else if (name == "moebelbezugsstoffe") {
		size = "width=620,height=480,scrollbars=no";
	}
	else if (name == "modeberater") {
		size = "width=756,height=538,scrollbars";
	}
	else if (name == "infoshow_mansworld") {
		size = "width=625,height=600,scrollbars=no";
	}else if (name == "SmartAssistant") {
		size = "width=855,height=680,scrollbars=no,resizeable=no,resizable=no";
	}

	// Wenn ein undefinierter Name uebergeben wird, setze Standardparameter
	else {
		size = "width=400,height=550,scrollbars=yes,resizable=yes";
	}

	// Wenn ein Parameter uebergeben wurde, dann diesen uebernehmen
	if (parameter) {
		size = parameter;
	}

	var popuphandler = Popup(url,name,size,block_url,block_target,return_ref);

	if (return_ref == true) {
		return popuphandler;
	}
}

/**
	* Switches the src of an image
	 *
	 * @access	public
	 * @param	Object o_image; An image-object
	 * @param	Optional: String; Postfix of different image
	* @return 	null
*/
function switchImageColor(o_image) {
	var imageName = extractImageName(o_image.src);
	var colorIdentifier = "nocolor";

	if (arguments[1] && arguments[1] != '') {
		colorIdentifier = arguments[1];
	}
	if (imageName.indexOf(colorIdentifier) > -1 ) {
		o_image.src = o_image.src.replace(imageName, removeString(imageName, "_" + colorIdentifier));
	} else {
		o_image.src = o_image.src.replace(imageName, imageName + "_" + colorIdentifier);
	}
}

/**
	* Extracts the image name out of an image source
	 *
	 * @access	public
	 * @param	String s_imageSource; The source of an image object
	* @return 	String imageName
*/
function extractImageName(s_imageSource) {
	//@todo: make it work for images without path!
	var imagePathParts = s_imageSource.split('/');
	var imageName = imagePathParts[imagePathParts.length - 1].split('.')[0]
	return imageName;
}

/**
	* Removes a string in another string if it is existing
	 *
	 * @access	public
	 * @param	String s_string; The string you want to replace something in
	 * @param	String s_stringToReplace; The string that you want to be removed
	* @return 	String s_string
*/
function removeString(s_string, s_stringToReplace) {
	if (s_string.indexOf(s_stringToReplace) > -1) {
		s_string = s_string.replace(s_stringToReplace, '')
	}
	return s_string;
}

function changeBg(object, color) {
	object.style.backgroundColor = "#" + color;
}


/* TeaserOverlay effects start */
var tol_statusHome = 0;
var o_tol_interval;

function fadeOutElement(s_id, i_duration) {
	$(s_id).effect("opacity", {duration: i_duration}).start(0);
	tol_statusHome = 1;
	return false;
}

function closeOverlay(s_id, i_duration) {
	if (o_tol_interval != null && o_tol_interval != '' && o_tol_interval != false) {
		window.clearInterval(o_tol_interval);
	}
	fadeOutElement(s_id, i_duration);
	o_tol_interval = false;

	return false;
}

function fadeInFadeOut(s_id, i_duration) {
	$(s_id).effect("opacity", {duration: i_duration}).start(tol_statusHome);
	tol_statusHome = (tol_statusHome == 0) ? 1 : 0;

	return false;
}

function startFadeInFadeOutWithDelay(s_id, i_duration, i_timeTillfadeOut) {
	startInterval = function(s_id, i_duration, i_timeTillfadeOut) {
		if (o_tol_interval != false) {
			o_tol_interval = window.setInterval('fadeInFadeOut("' + s_id + '",' + i_duration + ')',i_timeTillfadeOut)
		}
	}
	window.setTimeout('fadeOutElement("' + s_id + '",' + i_duration + ')', 4000);
	window.setTimeout('startInterval("' + s_id + '",' + i_duration + ',' + i_timeTillfadeOut + ')', 4000);

	return false;
}

function moveAndFadeOut(s_id, s_image,	i_duration) {
	Fx.Morph = Fx.Styles.extend({
		start: function(slot){
			var to = {};
			to['width'] = '0px';
			to['height'] = '0px';
			to['margin-left'] = '0px';
			to['margin-top'] = '0px';
			to['opacity'] = '0';

			return this.parent(to);
		}
	});

	Fx.CSS.Styles = ["backgroundColor", "backgroundPosition", "color", "width", "height", "left", "top", "bottom", "right", "fontSize", "letterSpacing", "lineHeight", "textIndent", "opacity"];
	Fx.CSS.Styles.extend(Element.Styles.padding);
	Fx.CSS.Styles.extend(Element.Styles.margin);

	Element.Styles.border.each(function(border){
		['Width', 'Color'].each(function(property){
			Fx.CSS.Styles.push(border + property);
		});
	});

	if (s_image != '') {
		new Fx.Morph(s_image, {duration: i_duration}).start();
	}
	new Fx.Morph(s_id, {duration: i_duration}).start();
	return false;
}

var Voucherset = new Class({
	initialize: function(options) {
		this.options = Object.extend({
			s_state			: '',
			s_linkSmall 	: '',
			s_linkBig		: '',
			a_size_big		: Array(),
			a_size_small	: Array(),
			a_margins_big	: Array(),
			a_margins_small	: Array()
		}, options || {});
		
		var o_scope = this;
	$('voucherSetTeaser_ImageSmall').onclick = function() {
			o_scope.moveAndTransform('voucherSetTeaser',1000, '');
	};

		return this;
	},
	
	moveAndTransform: function(s_id, i_duration, s_link) {
		var o_scope = this;
	s_image = $(s_id + '_Image');

		if (this.options.s_state == 'voucher_big') {
			$FX('voucherSet_closeLink').hide();
			$('voucherSetLink').href = this.options.s_linkSmall;
	} else {
			$FX('voucherSet_closeLink').show();
			$('voucherSetLink').href = this.options.s_linkBig;
	}

		o_scope.options.a_size_big[0]
		
	Fx.Morph = Fx.Styles.extend({
		start: function(slot){
			var to = {};
				if (o_scope.options.s_state == 'voucher_big') {
				to['opacity'] 		= '0';
					to['width'] 		= o_scope.options.a_size_small[0] + 'px';
					to['height'] 		= o_scope.options.a_size_small[1] + 'px';
					to['margin-top'] 	= o_scope.options.a_margins_small[0] + 'px';
					to['margin-left'] 	= o_scope.options.a_margins_small[1] + 'px';
			} else {
				to['opacity'] 		= '1';
					to['width']			= o_scope.options.a_size_big[0] + 'px';
					to['height'] 		= o_scope.options.a_size_big[1] + 'px';
					to['margin-top']	= o_scope.options.a_margins_big[0] + 'px';
					to['margin-left']	= o_scope.options.a_margins_big[1] + 'px';
			}
			return this.parent(to);
		}
	});

	Fx.MorphImage = Fx.Styles.extend({
		start: function(slot){
			var to = {};
				if (o_scope.options.s_state == 'voucher_big') {
					to['width']	= o_scope.options.a_size_small[0] + 'px';
					to['height']= o_scope.options.a_size_small[1] + 'px';
			} else {
					to['width']	= o_scope.options.a_size_big[0] + 'px';
					to['height']= o_scope.options.a_size_big[1] + 'px';
			}
			return this.parent(to);
		}
	});

	Fx.CSS.Styles = ["backgroundColor", "backgroundPosition", "color", "width", "height", "left", "top", "bottom", "right", "fontSize", "letterSpacing", "lineHeight", "textIndent", "opacity"];
	Fx.CSS.Styles.extend(Element.Styles.padding);
	Fx.CSS.Styles.extend(Element.Styles.margin);

	Element.Styles.border.each(function(border){
		['Width', 'Color'].each(function(property){
			Fx.CSS.Styles.push(border + property);
		});
	});

	if (s_image != '') {
		new Fx.MorphImage(s_image, {duration: i_duration}).start();
	}
	new Fx.Morph(s_id, {duration: i_duration}).start();

		var o_smallImage = $FX('voucherSetTeaser_ImageSmall');
		if (this.options.s_state == 'voucher_big') {
			o_smallImage.show(2000);
	} else {
			o_smallImage.hide(800);
	}

		this.options.s_state = (this.options.s_state == 'voucher_big') ? 'voucher_small' : 'voucher_big';
		this.saveVoucherState(this.options.s_state);

	return false;
	},

	saveVoucherState: function(s_value) {
	setVisitorFeature('visitor_source', s_value);
}
});


function setVisitorFeature(s_name, s_value) {
	var url = '/gateways/save_visitorFeature.mb1';
	var params = 'name=' + s_name + '&value=' + s_value;
	var myAjax = new Ajax(url, {method: 'post', data: params});

	myAjax.request();
}

function deleteElement(s_elementId) {
	$(s_elementId).style.display = 'none';
}

function removeAllLastseenItems() {
	setVisitorFeature('gesehene_produkte', '');
	fadeOutElement('productdetail_lastseen', 500);
	window.setTimeout('deleteElement("productdetail_lastseen")', 550);
}

function switchTabs(s_activeTabId) {
	var tabs = Array('Slider', 'Information', 'Program');

	for (i_count = 0; i_count < tabs.length; i_count++) {

		var o_element = $('productdetail_tabContent' + tabs[i_count]);

		if (o_element) {
			if (o_element.id == 'productdetail_tabContent' + s_activeTabId) {
				o_element.style.display = 'block';
				$('productdetail_tab' + tabs[i_count]).addClass('current');
			} else {
				o_element.style.display = 'none';
				$('productdetail_tab' + tabs[i_count]).removeClass('current');
			}
		}
	}
}

/* TeaserOverlay effects end */

s_feedback = '';
function feedback_showComment(s_fb) {
	var o_commentContainer = $('search_feedback_commentContainer');

	if (o_commentContainer.style.display == 'none' || o_commentContainer.style.display == '') {
		$('search_feedback_commentContainer').style.display = 'block';
	}
	s_feedback = s_fb;
}

function getFeedback() {
	var a_feedback = $('search_feedback').getElements('input[name=searchFeedback_rating]');
	var i_rating = 0;

	for (var i_count = 0; i_count < a_feedback.length; i_count++) {
		if (a_feedback[i_count].checked) {
			i_rating = a_feedback[i_count].value;
		}
	}

	return i_rating;
}

function saveFeedback() {
	var o_commentField = $('search_feedbackComment');
	var o_searchField	= $('save_searchtext');

	var s_url	= '/gateways/save_feedback.mb1';
	var s_params= 'rating=' + getFeedback() + '&searchtext=' + o_searchField.value + '&comment=' + o_commentField.value;

	var myAjax	= new Ajax(s_url, {method: 'post', data: s_params});
	myAjax.request();

	$('search_feedbackContent').innerHTML = '<strong>Vielen Dank für Ihr Feedback!</strong>';
}

function setHiddenSearchText( searchText ) {
	var s_searchText = decodeURIComponent(searchText);
	var o_searchField = $('save_searchtext');
	
	o_searchField.value = s_searchText;	
	
}
function isWebkit() {
	var b_isWebkit = false;
	var userAgent = navigator.userAgent.toLowerCase();

	//Hide layer-navigation for Safari and Chrome
	if (/chrome/.test(userAgent)) {
		b_isWebkit = true;
	}
	if (/safari/.test(userAgent) && !(/chrome/.test(userAgent))) {
		b_isWebkit = true;
	}
	return b_isWebkit;
}

function isFirefox() {
	var b_isFirefox = false;
	var userAgent = navigator.userAgent.toLowerCase();

	if (/firefox/.test(userAgent)) {
		b_isFirefox = true;
	}

	return b_isFirefox;
}

function addAdditionalPrice() {
	var s_elements = $('productdetail_additionalServiceContainer').getElements('input[name=service]');
	var s_additionalPrice = 0;

	s_elements.each(function(o_checkbox){
		if(o_checkbox.checked){
			var s_price = (o_checkbox.value.split('_'))[6];
			s_additionalPrice += parseFloat(s_price);
		}
	});

	var o_priceAdditionalPrice = $('priceAdditionalPrice');

	if (s_additionalPrice > 0) {
		s_additionalPrice = s_additionalPrice.toString();

		if (!s_additionalPrice.contains('.')) {
			s_additionalPrice += ',00';
		}

		s_additionalPrice = s_additionalPrice.toFloat().toFixed(2).replace('.', ',');

		o_priceAdditionalPrice.innerHTML = 'zzgl. ' + s_additionalPrice + ' &euro;';
		o_priceAdditionalPrice.setStyle('display', 'block');
	} else {
		if (o_priceAdditionalPrice) {
			o_priceAdditionalPrice.innerHTML = '';
			o_priceAdditionalPrice.setStyle('display', 'none');
		}
	}
}

function intiAdditionalPrices() {
	addAdditionalPrice(); // check if service-checkboxes are checked on page load
}

/* Former topnavigation.js start */
function basketBox_updateBasketArticleAmount(i_visitorbasketTotalSize) {
	o_elemBasketBoxAmount = $('basket_text');
	o_elemBasketBoxAmount.innerHTML = "Artikel (" + i_visitorbasketTotalSize + ")";
}

function NmTopNaviUpdateBasketBoxItemsNumber(i_visitorbasketTotalSize) {
	basketBox_updateBasketArticleAmount(i_visitorbasketTotalSize);
}

function basketBox_updateNotepadArticleAmount(s_visitornotepadTotalSize) {
	o_elemBasketBoxAmount = $('notepad_text');
	o_elemBasketBoxAmount.innerHTML = "Merkzettel (" + s_visitornotepadTotalSize + ")";
}

function basketBox_updateBasketPrice(s_price) {
	var o_element = $('basket_price');
	o_element.innerHTML = 'Warenkorb ' + s_price + '&euro;';
}

function NmTopNavisetSalutation(s_salutation) {
	var o_element = $('topNavi_salutation');
	o_element.innerHTML = s_salutation;
}

function NmTopNavisetSearchBoxSearchString(s_searchString) {
	elemSearchBox = document.getElementById('suchtext_top');
	elemSearchBox.value = s_searchString;
	changeSearchField();
}

function NmTopNavigationEmoImageSrc(s_emoImageSrc) {
	elemEmoBox = document.getElementById('top_navigation_emo_image');
	elemEmoBox.style.backgroundImage = "url(" + s_emoImageSrc + ")";
}

function NmTopNavigationMeinNeckermannLoggedIn(s_href, s_text) {
	elemLink 				= $('meinneckermannBox_link');
	// setting link-href
	elemLink.href 			= s_href;
	// setting link-label text
	elemLinkLabel 			= elemLink.getElement('span');
	elemLinkLabel.innerHTML	= s_text;
}

function increaseNotepadArticelAmount() {
	var s_notepadText= $('notepad_text').innerHTML;
	var i_amount	= 0;

	if (s_notepadText.indexOf('(') > -1 && s_notepadText.indexOf(')') > -1) {
		i_amount = s_notepadText.substr(s_notepadText.indexOf('(') + 1,s_notepadText.indexOf(')') - (s_notepadText.indexOf('(') + 1));
	}

	basketBox_updateNotepadArticleAmount(parseInt(i_amount) + 1);
}

function changeLogoClass() {
	var o_logo = $('logo');
	o_logo.removeClass('logo').addClass('logo_homepage');
}
// Former topnavigation.js end