function openWindow(theURL,winName,features) {
	window.open(theURL,winName,features);
}

// laurin
function clearLrnTitle(lrnTitle) {
	aSEARCH = new Array('\\xa0','\\xae','&reg;','%','®','\\.','Ä','Ö','Ü','ä','ö','ü','ß','`','´','&nbsp;','&', '\\x3f','<i>','<\\/i>','<b>','<\\/b>','<I>','<\\/I>','<B>','<\\/B>', '\\/', '<br>', '<BR>','  ', ' ', '___', '__','\\xa0','\\(','\\)');
	aREPLACE = new Array('','','','','','','Ae','Oe','Ue','ae','oe','ue','ss','','','_','_', '', '', '', '', '', '','','','','_','_','_','_','_','_','_','_','_','_');
	
	for (a=0; a<aSEARCH.length; a++) {
		eval('lrnTitle = lrnTitle.replace(/'+aSEARCH[a]+'/g, "'+aREPLACE[a]+'");');
	}
	return lrnTitle;
}

function elwin(elwinID,elwinW,elwinH,elwinURL,elwinOptions) {
	o = new Array();
	// DEFINE DEFAULTS
	o['r'] = 'no'; // resizable = no
	o['s'] = 'yes'; // scrollbars = no
	if (elwinOptions == 's') {
		for (c=0; c<elwinOptions.length; c++) {
			o[elwinOptions.charAt(c)] = 'yes';
		}
	}
	elWindow=window.open(elwinURL,'elwindow'+elwinID,'width='+elwinW+',height='+elwinH+',resizable='+o['r']+',scrollbars='+o['s']);
	elWindow.focus();
}

function scaleup(scaleupID,scaleupW,scaleupH,scaleupURL,scaleupOptions) {
	o = new Array();
	// DEFINE DEFAULTS
	o['r'] = 'yes'; // resizable = no
	o['s'] = 'no'; // scrollbars = no
	if (scaleupOptions == 's') {
		for (c=0; c<scaleupOptions.length; c++) {
			o[scaleupOptions.charAt(c)] = 'yes';
		}
	}
	scaleupWindow=window.open(scaleupURL,'scaleupwindow'+scaleupID,'width='+scaleupW+',height='+scaleupH+',resizable='+o['r']+',scrollbars='+o['s']);
	scaleupWindow.focus();
}

function slideInElwin(elwinID,elwinW,elwinH,elwinURL) {
	elWindow=window.open(elwinURL,'elwindow'+elwinID,'width='+elwinW+',height='+elwinH+',resizable=yes,scrollbars=no');
	elWindow.focus();
}

function printPage(printUrl) {
	window.print();
}

function tellafriend(id) {
	mailWin=window.open(webroot+'/index.php'+querystring_separator+'fuseaction/tellafriend/id/'+id,'mailWindow','width=480, height=480,resizable=yes,scrollbars=yes');
}

function glossary(showHide,gURL) {
	gwin=window.open(gURL,'gwin','width=480, height=360,resizable=yes,scrollbars=yes');
	gwin.focus();
}


// Browser Check
function browserCheck() {
	UA = new Array();
	browserPlatform = navigator.platform;
	ua = navigator.userAgent;
	an = navigator.appName;
	ua = ua.toLowerCase();
	ua_msie = ua.indexOf('msie');
	ua_netscape = ua.indexOf('netscape');
	ua_mozilla = ua.indexOf('mozilla');
	ua_opera = ua.indexOf('opera');
	ua_firefox = ua.indexOf('firefox');
	userAgent = 'other';
	if (ua_msie != -1 && ua_opera == -1) userAgent = 'MSIE';
	if (ua_opera != -1) userAgent = 'Opera';
	if (ua_firefox != -1) userAgent = 'Firefox';
	if (ua_msie == -1 && ua_opera == -1 && ua_firefox == -1) {
		userAgent = 'Mozilla';
		browserVersion = parseFloat(ua.substr(8, 4));
		if (browserVersion >= 5) { // Netscape 6 or higher
			pos = ua.indexOf('netscape');
			if (pos != -1) browserVersion = parseFloat(ua.substr(pos+9, 4));
		}
	}
	if (userAgent == 'MSIE') browserVersion = parseFloat(ua.substr(ua_msie + 5, 5));
	if (userAgent == 'Opera') browserVersion = parseFloat(ua.substr(ua_opera + 6, 4));
	if (userAgent == 'Firefox') browserVersion = parseFloat(ua.substr(ua_opera + 7, 4));
	UA[0] = userAgent;
	UA[1] = browserVersion;
	UA[2] = browserPlatform;
	return UA;
}
userAgent = browserCheck();

// Shop
function order(pid,min,orderform) {
	if (typeof(orderform) == "undefined")
		orderform = "orderform";
	anz = document.forms[orderform].elements["anzahl_"+pid].value;
	if (anz < min) {
		alert('Die Mindestbestellmenge beträgt '+min+' Stück.');
	} else {
		document.forms[orderform].elements["add2cart"].value = pid;
		document.forms[orderform].elements["amount"].value = anz;
		document.forms[orderform].submit();
	}
}

// Dropdown Menues
startList = function() {
	if (document.all&&document.getElementById) {
		var navRoot;
		navRoot = document.getElementById("topnavigation2");
		if (!navRoot) return;
		navRoot = navRoot.getElementsByTagName("ul");
		if (!navRoot.length) return;
		navRoot = navRoot[0];
		for (i=0; i<navRoot.childNodes.length; i++) {
		node = navRoot.childNodes[i];
		if (node.nodeName=="LI") {
		node.onmouseover=function() {
		this.className+=" over";
		  }
		  node.onmouseout=function() {
		  this.className=this.className.replace(" over", "");
		   }
		   }
		  }
	}
}
addLoadEvent(startList);