

// **********************************************************************
// **********************************************************************
// ***** SHOP                                        ********************
// **********************************************************************
// **********************************************************************

function shop_order_selad (objekt)
{
document.getElementById("bestelle_ad1").style.display = "none";
document.getElementById("bestelle_ad2").style.display = "none";
document.getElementById("bestelle_ad3").style.display = "none";

document.getElementById("shop_statuslnr0").checked = false;

if(document.getElementById("shop_statuslnr1"))
	document.getElementById("shop_statuslnr1").checked = false;
	
document.getElementById("shop_statuslnr2").checked = false;


if (objekt == "bestelle_ad1")
	{
	document.getElementById("shop_statuslnr0").checked = true;
	}
if (objekt == "bestelle_ad2")
	{
	if(document.getElementById("shop_statuslnr1"))
		document.getElementById("shop_statuslnr1").checked = true;
	}
if (objekt == "bestelle_ad3")
	{
	document.getElementById("shop_statuslnr2").checked = true;
	}

document.getElementById(""+objekt).style.display = "block";
}

function shop_meinkonto(kat)
{
theurl = sslurl+"shop/index.php?kategorie=meinkonto";

if (kat)
	theurl += "&bezug="+kat;
	
document.location.href = theurl;
}


function shop_pwform()
{
document.shop_form.submit();
}


function shop_wkadd (anr,pfad,ts,astueck)
{
if (pfad == "warenkorb" || pfad == "artikel")
	stueck = document.getElementById("wkanr"+anr).value;
else
	stueck = astueck+1;

theurl2 = "";
if (document.getElementById("shopcnr"))
	theurl2 = "&shopcnr="+document.getElementById("shopcnr").value;
if (document.getElementById("shopgnr"))
	theurl2 += "&shopgnr="+document.getElementById("shopgnr").value;

theurl2 += "&kategorie="+pfad
theurl = baseurl+"shop/index.php?shop_sadd=1&wk_anr="+anr+"&wk_stck="+stueck+theurl2;
if (document.getElementById("shop_ref"))
	{
	if (document.getElementById("shop_ref").value == "bestellen")
		{
		theurl += "&shop_ref=bestellen";
		}
	}

document.getElementById("shop_sadd").value = "1";
document.getElementById("wk_anr").value = anr;
document.getElementById("wk_stck").value = stueck;

if (pfad == "warenkorb" )
	document.getElementById("shop_add").value = '';
// alert ("Ok");
document.getElementById("shop_form").submit();
// document.location.href = theurl;
}

function shop_uebernehmen_la ()
{
document.shop_form.submit();
}


function shop_uebernehmen ()
{
document.shop_form.submit();
}


function shop_edit_warenkorb(gnr,cnr)
{
theurl = baseurl+"shop/index.php?kategorie=warenkorb";
/*
if (gnr > 0)
	theurl = theurl + "&shopgnr="+gnr;
if (cnr > 0)
	theurl = theurl + "&shopcnr="+cnr;
*/
document.location.href = theurl;
}

function shop_gotostep4 ()
{
document.shop_form.submit();
}

function shop_change_cat(catnr)
{
document.location.href = baseurl+"shop/index.php?shopcnr="+catnr
}

function shop_change_group(gnr)
{
document.location.href = baseurl+"shop/index.php?kategorie=shop&shopgnr="+gnr
}

function shop_open_artikel(cnr,anr)
{
fenster_2 = window.open ("artikel_detail.php?shopcnr="+cnr+"&shopanr="+anr,"fenster2","scrollbars=yes,resizable=yes,menubar=no,status=no,width=550,height=510");		
fenster_2.focus ();
}

function shop_open_artikelfoto(cnr,anr,x,y)
{
x += 35;
y += 95;
x = 550;
y = 510;
fenster_2 = window.open ("artikel_detail_foto.php?shopcnr="+cnr+"&shopanr="+anr,"fenster2","scrollbars=yes,resizable=yes,menubar=no,status=no,width="+x+",height="+y);
fenster_2.focus ();
}

function switch_container(objekt)
{
if (document.getElementById(objekt).style.display == "none")
	document.getElementById(objekt).style.display = "block";
else
	document.getElementById(objekt).style.display = "none";
}

function shop_artikelfoto ()
{
if (document.getElementById('shop_artikelliste_bild').style.display == 'block')
	document.getElementById('shop_artikelliste_bild').style.display='none';
else
	document.getElementById('shop_artikelliste_bild').style.display='block';
}
