function setCtype()
{
	var f1=document.goForm;
	j=f1.CTYPE.selectedIndex;
	if (j==0) { // TABLE
		f1.EMAIL.value='TABLE';
		showHide(document.all.div1,0);
		showHide(document.all.div2,0);
		showHide(document.all.div3,0);
		showHide(document.all.div41,1);

		showHide(document.all.div4,1);
		document.all.div4a.innerText='[-]';
	}
	else if (j==1) {
		if (f1.EMAIL.value.toUpperCase()=='TABLE') {
			f1.EMAIL.value='';
		}
		showHide(document.all.div1,1);
		showHide(document.all.div2,1);
		showHide(document.all.div3,1);
		showHide(document.all.div41,0);

		showHide(document.all.div4,0);
		document.all.div4a.innerText='[+]';
	}
}
function send_email()
{
   var s1=document.goForm.EMAIL.value;
   // Check s1 syntax
   var ar1=s1.split('@');
   if (ar1.length!=2) {
      window.alert('Email syntax error!');
      return;
   }
   var ar2=ar1[1].split('.');
   if (ar2.length<2) {
      window.alert('Email syntax error!');
      return;
   }
   var url='mailto:'+s1;
   window.open(url);
}
function onReselChange()
{
   var f1=document.goForm;
   document.all.ISWHOLESALEREX.innerText=f1.ISWHOLESALER.checked?'YES':'No';
   document.all.PRLISTNOEX.selectedIndex=f1.PRLISTNO.selectedIndex;
   document.all.SHOWPRWVATEX.checked=f1.SHOWPRWVAT.checked;
   show_popup(document.all.popresel);
}
function applyReselChange()
{
   var f1=document.goForm;
   f1.PRLISTNO.selectedIndex=document.all.PRLISTNOEX.selectedIndex;
   f1.SHOWPRWVAT.checked=document.all.SHOWPRWVATEX.checked;
   showHide(document.all.popresel,0);
}
