function clearList(listElem) {
    while(listElem.options.length > 0) {
      listElem.options[0] = null;
    }
  }
function showColor()
{
	
	var mainListResult = 'ddColorDiv';
	var url = 'getManufecturerColors.php';
	var params = 'param=' + document.frm.ddmanufecture.value ;
	var ajax = new Ajax.Updater({success: mainListResult},	url,{method: 'post', parameters: params, onFailure: 'reportError'});
	
	
}

function addToList()
{
	var mainListResult = 'mainList';
	var url = 'getManufecturerColors.php';
	var params = 'mnfct=' + document.frm.ddmanufecture.value + '&color=' + document.getElementById('ddcolor').value + '&qty=' +document.frm.txtqty.value + '&sid=<?=session_id()?>' ;
	var ajax = new Ajax.Updater({success: mainListResult},	url,{method: 'post', parameters: params, onFailure: reportError});
}
function changeList()
{
	
	var mainListResult = 'mainList';
	var url = 'getManufecturerColors.php';
	var params = '&flag=1&sessid=<?=session_id()?>' ;
	var ajax = new Ajax.Updater({success: mainListResult},	url,{method: 'post', parameters: params, onFailure: 'reportError'});
}

function editList()
{	
	alert('This feature will be active very soon!');
}

function removeList(parm)
{	
	//document.frm.action='removeitem.php';
	//document.frm.submit();
	//alert(document.getElementById("id[]").value);
	//alert (parm);
}

function printList()
{	
	//alert('This feature will be active very soon!');
	document.frm.action='print-report.php';
	document.frm.submit();
	//window.open("<?=$base_path?>print-report.php","Print List","menubar=0,resizable=1,scrollbars=1,width=800,height=750")
}

function email()
{	
	//alert('This feature will be active very soon!');
	document.frm.action='mail-to-dcr.php';
	document.frm.submit();
}

function validation()
{
	if (document.frm.txtname.value=='')	
	{
		alert('Person name can not left blank!');
		document.frm.txtname.focus();
		return false;
	}
	if (document.frm.txtperson.value=='')	
	{
		alert('Contact Person can not left blank!');
		document.frm.txtname.focus();
		return false;
	}
	if (document.frm.txtadress.value=='')	
	{
		alert('Person Adress can not left blank!');
		document.frm.txtname.focus();
		return false;
	}
	if (document.frm.txtnotes.value=='')	
	{
		alert('Special Notes can not left blank!');
		document.frm.txtname.focus();
		return false;
	}
	return true;
}