<!--
function check_form() {
	if ( !document.last_kasse.belehrung.checked ) {
		alert("Bitte stimmen Sie der Widerrufsbelehrung zu.");
		return false;
	}
	return true;
}
function validate_search() {
	no_size_checked = true;
	for ( i=1; i<=30; i++ ) {
		if ( document.getElementById("ssize_"+i) && document.getElementById("ssize_"+i).checked ) {
			no_size_checked = false;
		}
	}
	if ( no_size_checked ) {
		alert("Bitte geben Sie mindestens eine Schuhgroesse an.");
		return false;
	}
	return true;
}
function check_all(all_name, which) {
	if ( document.getElementById(which).checked ) {
		if ( !window[all_name+'_length'] ) {
			window[all_name] = new Array(which);
			window[all_name+'_length'] = 1;
		} else {
			window[all_name].push(which);
			window[all_name+'_length']++;
		}
		document.getElementById(all_name).checked = false;
	} else {
		window[all_name+'_length']--;
	}
	if ( window[all_name+'_length'] == 0 ) {
		document.getElementById(all_name).checked = true;
	}
	return true;
}
function click_all(all_name) {
	if ( !document.getElementById(all_name).checked && !window[all_name+'_length'] ) {
		document.getElementById(all_name).checked = true;
	} else {
		for ( i=0; i<20; i++ ) {
			if ( document.getElementById(window[all_name][i]) ) { document.getElementById(window[all_name][i]).checked = false; }
		}
		window[all_name+'_length'] = false;
	}
	return true;
}

// AJAX ======================================
var httpRequest = false;
var noResult = "Kein Ergebnis";

function load_content(php_script, div_id, prod_params, cart_forward) {
	url = "/_scripts/"+php_script;
	outputId = div_id;
	httpRequest = false;
	if(window.XMLHttpRequest)  // Mozilla, Safari,...
	   httpRequest = new XMLHttpRequest();
	else if(window.ActiveXObject) { // IE
	   try {
		   httpRequest = new ActiveXObject("Msxml2.XMLHTTP");
	}
	   catch (e) {
		   try {
			   httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
	 }
		   catch (e) {}
	   }
	}
	if(!httpRequest) 
	  return false;
	httpRequest.onreadystatechange = function() {
	  if(httpRequest.readyState == 4) {
		 if(httpRequest.status == 200) 
			handleHttpResponse(httpRequest.responseText, outputId, cart_forward);
	   else
		  return false;
		 }
	else
	   return false;
	} 
	httpRequest.open('post', url, true);
	httpRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	httpRequest.send(prod_params);
	return false;
}

minicart_visible = false;
function handleHttpResponse(content, outputId, cart_forward) {
	if(!document.getElementById)
		return false;
	if(!document.getElementById(outputId))
		return false;
	if (content == "FALSE") {
		document.getElementById(outputId).innerHTML = noResult;
	} else {
		document.getElementById(outputId).innerHTML = content;
		minicart_visible = true;
		if ( cart_forward===true ) {
			document.location.href = "http://www.levelschuh.de/content/kasse.php";
		}
	}
} 
// AJAX END ======================================
function check_register_land(which) {
	if ( which.options[which.selectedIndex].text=="Europa" ) {
		document.getElementById('detail_land').style.display = "inline";
	} else {
		document.getElementById('detail_land').style.display = "none";
	}
}
selected_size = 0;
function sizeOver(which, wert) {
	which.style.backgroundPosition = "0px -24px";
	which.style.color = "#595146";
	which.style.cursor = "pointer";
}
function sizeOut(which, wert) {
	if ( selected_size!=wert ) {
		which.style.backgroundPosition = "0px 0px";
		which.style.color = "#ffffff";
	}
}
function sizeClick(wert) {
	if (wert=="---") {
		selected_size = 0;
		soled_alert();
	} else {
		selected_size = wert;
	}
}
/*function sizeClick(which, wert) {
	selected_size = wert;
	for ( i=0; i<50; i++ ) {
		if ( temp_obj = document.getElementById('sizebox'+i) ) {
			temp_obj.style.backgroundPosition = "0px 0px";
		}
	}
	which.style.backgroundPosition = "0px -24px";
}*/
function add2cart(params) {
	if ( selected_size==0 ) {
		alert("Bitte geben Sie erst eine Groesse an.");
		return false;
	} else {
		load_content('cart.inc.php', 'cart_div', params+'&size='+selected_size, true);
		return true;
	}
}
function load_versand(params) {
	document.getElementById('cart_div').innerHTML = "";
	load_content('versand.inc.php', 'versand_div', params, false);
}

function change_menge(select_obj, prod_id, correct) {
	new_menge = select_obj.options[select_obj.selectedIndex].value;
	document.location.href = "kasse.php?prod_id="+prod_id+"&change_menge="+new_menge+"&correct="+correct;
}

function soled_alert() {
	alert("Diese Groesse ist zur Zeit nicht lieferbar.");
}

function openWindow(theURL,winName,features) {
	popup = window.open(theURL,winName,features);
	popup.focus();
}
function openContentImage(which, template_num, language) {
	openWindow('/_scripts/show_image.php?content='+which+'&template='+template_num+'&lang='+language,'bigbild','width=200,height=200,resizable=yes,scrollbars=yes,menubar=yes,status=yes');
}
function openImage(which, template_num, language) {
	openWindow('/_scripts/show_image.php?which='+which+'&template='+template_num+'&lang='+language,'bigbild','width=200,height=200,resizable=yes,scrollbars=yes,menubar=yes,status=yes');
}
function openProdImage(which, template_num, language) {
	openWindow('/_scripts/show_image.php?prod='+which+'&template='+template_num+'&lang='+language,'bigbild','width=200,height=200,resizable=yes,scrollbars=yes,menubar=yes,status=yes');
}
function openDocImage(which, template_num, language) {
	openWindow('/_scripts/show_image.php?docimage='+which+'&template='+template_num+'&lang='+language,'bigbild','width=200,height=200,resizable=yes,scrollbars=yes,menubar=yes,status=yes');
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->