/*
 * WWE [y] Global Edtion
 * 
 * WWE e-commerce IT GmbH, Hamburg, Germany
 * Copyright (c) 2000-2002
 *
 * WWE e-commerce IT GmbH
 * www.e-commerceIT.de
 * Juergen Kaatz
 * kaatz@e-commerceit.de
 *
 * $Id: wwe.js,v 1.4 2002/05/07 12:29:17 juergen Exp $
 *
 * additional js scripts
*/ 

function foo(url,width,height)
{
	var features='menubar=1,status=0,toolbar=0,scrollbars=1,'+'width='+width+',height='+height+',';
	window.open(url,"",features);
}

function popup(url,width,height)
{
	var _top = (screen.height / 2) - (height / 2);
	var _left = (screen.width / 2) - (width / 2);
	var features='menubar=0,status=0,toolbar=0,scrollbars=1,'+'width='+width+',height='+height+',top='+_top+',left='+_left+',';
	window.open(url,"",features);
}

function to_basket(form,Id,id_prefix,at_prefix)
{
	var prd_amount_fieldname = at_prefix + Id.substr(id_prefix.length);
	var amount = new Number(form[prd_amount_fieldname].value);

	if(isNaN(amount) || amount == 0)
	{
		amount = 1;
	}
	form["ProductId"].value = Id.substr(id_prefix.length);
	form["Quantity"].value = Math.floor(amount);

	if(form["ProductId"] != "" && form["Quantity"] != "")
	{
		form.submit();
	}
}

function perform_link(fid,fpar_name,fpar_val,isSSL,type)
{
	_val = fpar_val[fpar_val.selectedIndex].value;

	if(_val != 0)
	{
		_link = "/call.html?fid=" + fid + "&fpar_name=" + fpar_name + "&fpar_val=" + _val + "&isSSL=" + isSSL + "&type=" + type;
		window.location.href = _link;
		// alert(_link);
	}
	else
	{
		alert("Bitte wählen Sie einen Eintrag aus der Liste aus.\nPlease choose an entry from list!");
	}
}

// used in cust_my_profile.inc
function checkDeliveryAddress(LanguageISOCode)
{
	with(document.forms.set_profile)
	{
		if(withDeliveryAddress.checked)
		{
			if(LanguageISOCode == "de")
			{
				alert("Bitte geben Sie Daten für eine Lieferadresse ein!");
			}
			if(LanguageISOCode == "en")
			{
				alert("Please type in data for your delivery address!");
			}
			DAdrNameI.focus();
		}
	}
}
