// formsjs
function changed(formid)
{
aform=document.getElementById(formid);
aform.changedflag.value=1
}

function formreset(formid)
{
aform=document.getElementById(formid);
aform.reset();
aform.changedflag.value=0;
return true;
}

function exitpage(formid,where)
{
//alert('Debug message code 1');
aform=document.getElementById(formid);
if (aform.changedflag.value==1)
	{
	msg='Are you sure you wish to exit? You will lose the updates you have done'
	if (!window.confirm(msg)) return false	
	}
aform.update.value='1'
aform.action=where;
s=where.indexOf('php',0);
if 	(s>=0)
	{
	aform.submit();
	}
else
	{
	location.href=where;
	}
return true
}


function formsub(formid)
{
aform=document.getElementById(formid);
aform.submit()
}

function formsub_ex(formid,update)
{
aform=document.getElementById(formid);
aform.update.value=update;
aform.submit()
}

function gotopage(formid,where,check)
{
//alert('Debug message code 2');
aform=document.getElementById(formid);
if (check)
	{
	if (aform.changedflag.value==1)
		{
		msg='Are you sure you wish to exit? You will lose the updates you have done'
		if (!window.confirm(msg)) return false	
		}
	}
aform.update.value=0;
aform.page.value=where;
aform.submit()
}

var EU = [	13,	20,	51,	52,	53,	62,	66,	67,	73,	76,	88,	94,	96,	108,	114,	115,	123,	140,	157,	158,	176,	177,	181,	186];


function VATshow()
{
sel=document.getElementById("Country");
VAT_text=document.getElementById("VAT_text");
VAT=document.getElementById("VAT");
Is_EU=false;
for (index=0;index<EU.length;index++)
	{
	if (EU[index]==sel.selectedIndex)	
		{
		Is_EU=true;
		break;
		}
	}

if (Is_EU)
	{
	VAT_text.style.visibility="visible";		
	VAT.style.visibility="visible";
	}
else
	{
	VAT_text.style.visibility="hidden";
	VAT.style.visibility="hidden";
	}
}


