function __mk_ow_print(lang,css){
	printwin = window.open("extensions/print/"+lang+"/print.htm","Print","status=yes,scrollbars=yes,width=600,height=600");
}

function nm_change_css(nm_css) {
	printwin.document.header.printheader.src = "../../../designs/"+nm_css+"/images/headerprint.jpg";
}

function __mk_window_open(url){
  var popup = window.open(url);
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  var printfenster = window.open(theURL,winName,features);
}

function check(vv,vn,ve,vk,vc,vs)
{
	if(!checkEmail(document.getElementById(ve).value, true )) {
		alert("keine gültige Emailadresse");
		return false;
	}
	if ((document.getElementById(vv).value!="") && (document.getElementById(vn).value!="") && (document.getElementById(ve).value!="")) {
		if (document.getElementById(vc)) {
			if (document.getElementById(vc).value == vs) {
				return true;
			} else {
				alert(document.getElementById("angaben_check").value); return false
			}
		} else {
				alert(document.getElementById("angaben_check").value); return false
		}
		return true; 
	} else { 
		alert(document.getElementById("angaben").value); return false
	}
}

// Shop


function check_agb()
{
	if (document.form_user.agb[0].checked == false) {
		alert(document.form_user.agb_meldung.value);
		return false;
	} else {
		return true;
	}
}

//function inkorb(nr,j)
//{
//  count=eval("document.formprod"+j+".mengenfeld.value");
//	ausnr=eval("document.formprod"+j+".id.value");
//	attribnr = "0";
//	es = "0";
//	alert(count + document.formugruppen.shop_anzahl_in_warenkorb.value);
//	myurl = window.location.href+'&ib=1&ibnr='+nr+'&ibausnr='+ausnr+'&ibattribnr='+attribnr+'&ibes='+es+'&ibcount='+count;
//	window.location.href = myurl;
//}

function inkorb(nr)
{
	//alert(nr);
//	ocnt++;
	count=document.form1.anzahl.value;
	//alert(document.form1.anzahl.value);
	if (count=="") count=1;
//	//if (!cd_available) alert("Das Produkt ist leider nicht verfügbar!\nBitte rufen Sie uns an, es existieren in vielen Fällen Alternativen (z.B. Restposten)"); else
	myurl = window.location.href+'&ib=1&ibnr='+nr+'&ibcount='+count;
	window.location.href = myurl;
}

function attribute(j)
{
	__anr = eval("document.formprod"+j+".ausfuehrung.options[document.formprod"+j+".ausfuehrung.selectedIndex].value");
	var myurl=window.location.search;
	var neue_url = myurl.replace(/ib=1/, "");
	location.href="index.php"+neue_url+"&__anr="+__anr;
}

function MM_callJS(jsStr) { //v2.0
  return eval(jsStr)
}

function delbasket(nr)
{
  if (confirm(document.form1.shop_artikel_loeschen_abfragen.value) )
  {
		self.location.href = 'index.php?lang='+document.form1.shop_lang.value+'&css='+document.form1.shop_css.value+'&aend=1&bd=1&id='+nr;
  }
}

function chcnt(pnr)
{
  if (confirm(document.form1.shop_artikel_aendern_abfragen.value)) {
    if (eval("document.form1.cnt"+pnr+".value")!="") {
			self.location.href = 'index.php?lang='+document.form1.shop_lang.value+'&css='+document.form1.shop_css.value+'&aend=1&bc=1&id='+pnr+'&count='+eval('document.form1.cnt'+pnr+'.value');
    }	
  }
}

// DropDown Hover für IE
sfHover = function() {
	if(document.getElementById("base_nav")){
		var sfEls = document.getElementById("base_nav").getElementsByTagName("LI");
		for (var i=0; i<sfEls.length; i++) {
			sfEls[i].onmouseover=function() {
				this.className+=" sfhover";
			}
			sfEls[i].onmouseout=function() {
				this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
			}
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);
// Ende DropDown

// onclick="index.php?sto=3&kennung={kennung}&{sessionid}"
var album;
function showalbum(url,field) 
{
	// branch for native XMLHttpRequest object
	if (window.XMLHttpRequest) {
		//requrl = url+'&gem='+document.form1.Orte.options[document.form1.Orte.selectedIndex].value;
		requrl = url;
		album = new XMLHttpRequest();
//		album.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
		album.onreadystatechange = palbum;
		album.open("GET", requrl, true);
		album.send(null);
	// branch for IE/Windows ActiveX version
	} else if (window.ActiveXObject) {
		album = new ActiveXObject("Microsoft.XMLHTTP");
		if (req) {
			album.onreadystatechange = palbum;
			album.open("GET", requrl, true);
			album.send();
		}
	}
}	

function palbum() 
{
	if (album.readyState == 4) {
		if (album.status == 200) {
			document.getElementById('nm_alben_details').innerHTML = album.responseText;
			//he = document.getElementById('nm_alben_details').offsetHeight;
			document.getElementById('nm_alben').style.height = document.getElementById('nm_alben_details').offsetHeight+"px";
			//document.getElementById('nm_alben').style.height = "200px";
		} else {
			alert("There was a problem retrieving the XML data");
		}
	}
}

var sampler;
function showsampler(url,field) 
{
	// branch for native XMLHttpRequest object
	if (window.XMLHttpRequest) {
		//requrl = url+'&gem='+document.form1.Orte.options[document.form1.Orte.selectedIndex].value;
		requrl = url;
		sampler = new XMLHttpRequest();
		sampler.onreadystatechange = psampler;
		sampler.open("GET", requrl, true);
		sampler.send(null);
	// branch for IE/Windows ActiveX version
	} else if (window.ActiveXObject) {
		sampler = new ActiveXObject("Microsoft.XMLHTTP");
		if (req) {
			sampler.onreadystatechange = psampler;
			sampler.open("GET", requrl, true);
			sampler.send();
		}
	}
}	

function psampler() 
{
	if (sampler.readyState == 4) {
		if (sampler.status == 200) {
			document.getElementById('nm_alben_details').innerHTML = sampler.responseText;
			//he = document.getElementById('nm_alben_details').offsetHeight;
			document.getElementById('nm_alben').style.height = document.getElementById('nm_alben_details').offsetHeight+"px";
			//document.getElementById('nm_alben').style.height = "200px";
		} else {
			alert("There was a problem retrieving the XML data");
		}
	}
}
 
 
