function pop(url, width, height)
{
	window.open(url,'','width='+width+', height='+height+', menubar=no, status=no, location=no, toolbar=no, scrollbars=no, resizable=no', false);
}

function poppage(url, width, height)
{
	window.open(url,'','width='+width+', height='+height+', menubar=no, status=no, location=no, toolbar=no, scrollbars=yes, resizable=yes', false);
}

function fFoldPay(cName)
{
	switch(cName)
	{
		case "bill":
			document.getElementById('payBill').style.display='block';
			document.getElementById('payFwd').style.display='none';
			document.getElementById('payInc').style.display='none';
		break;

		case "fwd":
			document.getElementById('payBill').style.display='none';
			document.getElementById('payFwd').style.display='block';
			document.getElementById('payInc').style.display='none';
		break;

		case "inc":
			document.getElementById('payBill').style.display= 'none';
			document.getElementById('payFwd').style.display='none';
			document.getElementById('payInc').style.display='block';
		break;
	}
}

function fSearchShow(cItem)
{
	switch(cItem)
	{
		case "arts":
			document.getElementById('searchArts').className = 'displayShow';
			document.getElementById('searchPages').className = 'displayHidden';
			document.getElementById('searchBoth').className = 'displayHidden';
		break;

		case "pages":
			document.getElementById('searchArts').className = 'displayHidden';
			document.getElementById('searchPages').className = 'displayShow';
			document.getElementById('searchBoth').className = 'displayHidden';
		break;

		case "both":
			document.getElementById('searchArts').className = 'displayHidden';
			document.getElementById('searchPages').className = 'displayHidden';
			document.getElementById('searchBoth').className = 'displayShow';
		break;
	}
}

window.onload = function()
{
	initOrderButton();
	initCityImput();
}

function initOrderButton()
{
	var loBtn = document.getElementById("cmd_OrderNow")
	if(loBtn != null)
	{
		loBtn.onclick = function()
		{
			this.value= "Processing order..."
			this.onclick = function()
			{
				return false;
			}
		}
	}
}

function initCityImput()
{
	var loFld = document.getElementById("custx_city");
	if(loFld != null)
	{
		loFld.onchange = function()
		{
			this.value= this.value.toUpperCase();
		}
	}

	var loFld = document.getElementById("cust_mstatus/corcity");
	if(loFld != null)
	{
		loFld.onchange = function()
		{
			this.value= this.value.toUpperCase();
		}
	}
}

function fSetPaymentCondition()
{
	var loCountry;

	if(loCountry = document.getElementById('custx_country'))
	{
		var loE3;

		if(loE3 = document.getElementById('cust_extra3'))
			loE3.value = loCountry.value.toUpperCase()=='NL' ? 2 : 21;
	}
}

function fCheckInvoice(tcCheckID)
{
	var loChecker = document.getElementById(tcCheckID);
	if(loChecker == null)
		return;

	var loTmp;

	if(loChecker.checked)
	{
		if(loTmp = document.getElementById('chkInvCompany'))
			loTmp.value = 'cust_mstatus/corcompany';
		if(loTmp = document.getElementById('chkInvName'))
			loTmp.value = 'cust_mstatus/corname';
		if(loTmp = document.getElementById('chkInvAddress1'))
			loTmp.value = 'cust_mstatus/coraddress1';
		if(loTmp = document.getElementById('chkInvZipcode'))
			loTmp.value = 'cust_mstatus/corzipcode';
		if(loTmp = document.getElementById('chkInvCity'))
			loTmp.value = 'cust_mstatus/corcity';
		if(loTmp = document.getElementById('chkInvCountry'))
			loTmp.value = 'cust_mstatus/corcountry';
	}
	else
	{
		if(loTmp = document.getElementById('cust_mstatus/corcompany'))
			loTmp.value = '';
		if(loTmp = document.getElementById('cust_mstatus/corname'))
			loTmp.value = '';
		if(loTmp = document.getElementById('cust_mstatus/coraddress1'))
			loTmp.value = '';
		if(loTmp = document.getElementById('cust_mstatus/corzipcode'))
			loTmp.value = '';
		if(loTmp = document.getElementById('cust_mstatus/corcity'))
			loTmp.value = '';
		if(loTmp = document.getElementById('cust_mstatus/corcountry'))
			loTmp.value = '';
	}
}

function toggleInvoice(use, id)
{
alert("N/A");
return "N/A";

	oArea = document.getElementById(id);

	var laFields = new Array(
		'CheckField_empty_mstatus/corcompany',
		'CheckField_empty_mstatus/corname',
		'CheckField_empty_mstatus/coraddress1',
		'CheckField_empty_mstatus/corzipcode',
		'CheckField_empty_mstatus/corcity',
		'CheckField_empty_mstatus/corcountry')

	if(oArea == null)
		return;

	if(use)
	{
		oArea .style.visibility= "visible";

		for(var i=0; i<laFields.length; i++)
		{
			var loField = document.getElementById(laFields[i]) ;
			if(loField != null)
			{
				loField.value = "cust_" + laFields[i].substr(17) ;
				loCustField = document.getElementById("cust_" + laFields[i].substr(17)) ;
				var lcDefaultValue = "";

				if(loCustField.nodeName.toLowerCase() == "select")
				{
					for(var o=0; o<loCustField.options.length; o++)
					{
						if(loCustField.options[o].defaultSelected)
							lcDefaultValue = loCustField.options[o].value;
					}
				}
				else
				{
					lcDefaultValue = loCustField.defaultValue ;
				}
				loCustField.value = lcDefaultValue ;
			}
		}
	}
	else
	{
		oArea .style.visibility= "hidden" ;

		for(var i=0; i<laFields.length; i++)
		{
			var loField = document.getElementById(laFields[i]) ;
			if(loField != null)
				loField.value="" ;
			document.getElementById("cust_" + laFields[i].substr(17)).value = "" ;
		}
	}
}