function popUp(strURL, strName, width, height,n_vorlage)
	{		
	if(n_vorlage.checked){
			alert('Bitte speichern Sie zuerst,\ndann können Sie Bilder bzw. PDFs zuordnen.');
	}else{
			setzeZentriert(strURL, strName, width, height, 'scrollbars=no,toolbar=yes,location=no,menubar=no,resizable=yes,status=yes')
	}
}

function popUp2(strURL, strName, width, height)
	{		
	setzeZentriert(strURL, strName, width, height, 'scrollbars=no,toolbar=yes,location=no,menubar=no,resizable=yes,status=yes')
}

function setzeZentriert(url, name, width, height, winstyle) {
	var str = "height=" + height + ",innerHeight=" + height;
	str += ",width=" + width + ",innerWidth=" + width;
	if (window.screen) {
		var ah = screen.availHeight - 30;
		var aw = screen.availWidth - 10;
		var xc = (aw - width) / 2;
		var yc = (ah - height) / 2;
		str += ",left=" + xc + ",screenX=" + xc;
		str += ",top=" + yc + ",screenY=" + yc;
	}
	return window.open(url, name, str + "," + winstyle);
}

function deleteconfirm(was){
	if (was == 'zuord'){
		return confirm("Wollen Sie die Materialzuordnung löschen?");
	}else{
		return confirm("Sie wollen löschen?");
	}
	
}

function confirmAllLinks(){
	for (var i = 13; i<document.links.length;i=i+2){
		document.links[i].onclick= deleteconfirm;
	}
}

function deleteCookie(name){
  	var expire = new Date(-3600);
	expire = expire.toGMTString();
  	document.cookie = name + "= '';"  + "expires=" + expire  + "; path=/";
	location.reload();
}
function submitOrder(href){
	if(!document.getElementById('agb').checked){
			alert('Bitte bestätigen Sie, unsere Geschäftsbedingungen \n zur Kenntnis genommen zu haben.');
			return false;
	}
	else{
		document.location.href=href;
	}
}