

/*************************************************************************\
boolean isNum(String argvalue)
return true if argvalue contains only numeric characters,
else return false.
\*************************************************************************/
function isNum(argvalue) {
argvalue = argvalue.toString();

if (argvalue.length == 0)
return false;

for (var n = 0; n < argvalue.length; n++)
if (argvalue.substring(n, n+1) < "0" || argvalue.substring(n, n+1) > "9")
return false;

return true;
}

// function for checking phone number
function validatePhone(str)
{
	var len = str.length;
	for(i=0;i<len;i++)
	{
		if((str.charAt(i)<0 || str.charAt(i) > 9) || (str.charAt(i) != "-"))
		{
			return false;
		}
	}
}
// Function for checking blanks
function IsBlank( str ) {
	var isValid = false;
 	if ( IsNull(str) || IsUndef(str) || (str+"" == "") )
 		isValid = true;
	return isValid;
}
// Function for checking undefined value
function IsUndef( val ) {
	var isValid = false;
 	if (val+"" == "undefined")
 		isValid = true;
	return isValid;
}
// Function for checking null value
function IsNull( val ) {
	var isValid = false;
 	if (val+"" == "null")
 		isValid = true;
	return isValid;
}
// Function for checking alphabets
function IsAlpha( str ) {
	if (str+"" == "undefined" || str+"" == "null" || str+"" == "")
		return false;
	var isValid = true;
		str += "";
  	for (i = 0; i < str.length; i++) {
		if ( !( ((str.charAt(i) >= "a") && (str.charAt(i) <= "z")) ||
      			((str.charAt(i) >= "A") && (str.charAt(i) <= "Z")) ) ) {
         				isValid = false;
         				break;
      			}
   }
	return isValid;
}
// Function for checking valid email
function IsValidEmail( str ) {
	if (str+"" == "undefined" || str+"" == "null" || str+"" == "")
		return false;
	var isValid = true;	str += "";namestr = str.substring(0, str.indexOf("@"));
	domainstr = str.substring(str.indexOf("@")+1, str.length);
   	if (IsBlank(str) || (namestr.length == 0) ||(domainstr.indexOf(".") <= 0) ||(domainstr.indexOf("@") != -1) ||!IsAlpha(str.charAt(str.length-1)))
		{isValid = false;return isValid;}
}

function isValidPhoneNo(thestring)
{
	var OK=true;
	for(var i=0;i<thestring.length;i++)
	{
		thechar=thestring.charAt(i);
		if((thechar<"0") || (thechar>"9"))
		{
			if(!((thechar=="+") || (thechar=="(") || (thechar==")") || (thechar=="-") || (thechar==" ")))
			{
				OK=false;
				break;
			}
		}
	}
	return OK;
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function valEmail()
{
	with(document.frm)
	{
		if(IsValidEmail(email.value) == false)
		{
			alert("Invalid email");
			email.focus();
		}
	}
}


function calculateVol()
{
	with(document.frm)
	{

	if((visa_volume.value != "")&&(visa_tkt.value != ""))
		visa_trans.value = visa_volume.value/visa_tkt.value;
	if((debit_volume.value != "")&&(debit_tkt.value != ""))
		debit_trans.value = debit_volume.value/debit_tkt.value;
	if((pin_volume.value != "")&&(pin_tkt.value != ""))
		pin_trans.value = pin_volume.value/pin_tkt.value;
	if((te_volume.value != "")&&(te_tkt.value != ""))
		te_trans.value = te_volume.value/te_tkt.value;
	if((fleet_volume.value != "")&&(fleet_tkt.value != ""))
		fleet_trans.value = fleet_volume.value/fleet_tkt.value;

	if((visa_volume.value != "")&&(debit_volume.value != "")
	&&(pin_volume.value != "")&&(te_volume.value != "")&&
	(fleet_volume.value != ""))
	sum_volume.value = parseInt(visa_volume.value) +
	parseInt(debit_volume.value) +
	parseInt(pin_volume.value) +
	parseInt(te_volume.value) +
	parseInt(fleet_volume.value);

	if((visa_trans.value != "")&&(debit_trans.value != "")
	&&(pin_trans.value != "")&&(te_trans.value != "")&&
	(fleet_trans.value != ""))
	var sum_trans = parseFloat(visa_trans.value) +
	parseFloat(debit_trans.value) +
	parseFloat(pin_trans.value) +
	parseFloat(te_trans.value) +
	parseFloat(fleet_trans.value);

	if((visa_volume.value != "")&&(debit_volume.value != "")
	&&(pin_volume.value != "")&&(te_volume.value != "")&&
	(fleet_volume.value != "")&&(visa_trans.value != "")&&(debit_trans.value != "")
	&&(pin_trans.value != "")&&(te_trans.value != "")&&
	(fleet_trans.value != ""))
		{
		calculation.value = sum_volume.value/sum_trans;
		}

	}

}
function checkTotal()
{
	with(document.frm)
	{
	var sum_trans = 0;
	if(  retail.value != "" &&
	  moto.value != "" &&
	  restaurant.value != "" &&
	  supermarket.value != "" &&
	  gas.value != "" &&
	  lodging.value != "" &&
	  emerging_market.value != "" &&
	  utility.value != "" &&
	  l_ticket.value != "" &&
	  s_ticket.value != "" &&
	  b2b.value != "" &&
	  aru.value != "")
		{
		sum_trans = parseInt(retail.value) +
		parseInt(moto.value) +
		parseInt(restaurant.value) +
		parseInt(supermarket.value) +
		parseInt(gas.value)+
		parseInt(lodging.value) +
		parseInt(emerging_market.value) +
		parseInt(utility.value) +
		parseInt(l_ticket.value)+
		parseInt(s_ticket.value) +
		parseInt(b2b.value) +
		parseInt(aru.value);

		if(sum_trans != 100)
			{
			alert ("total must equal to 100%");
			}
		}

	}



}
function vallidate()
{
	var validated=true;
	with(document.frm)
	{
		action.value = 's';
		if (SalesRep_MerchantDemographicInfoValidation())
		  if(MerchantCreditCardProcessingInformationValidation())		  
		    if(MerchantEquipmentInformationValidate())
		      if(MerchantECheckInformationValidate())
		        if(MerchantGiftCardInformationValidate())
		          if(MerchantFeesInformationValidate())
		            submit();
	}
}
function vallidate_admin()
{
		document.frm.action.value = 'a';
		document.frm.submit();
}

function refreshType(elem)
{
	if(elem == "1")
	{
	document.frm.code.value="";
	window.parent.location.href="exception_form.php?user_type=new";
	}
	else if(elem == "2")
	{
	document.frm.code.disabled=false;
	}

}
function submitCode()
{
	if(document.frm.code.value == "")
	{
		alert ("please fill the assigned case number");
	}
	else
	{
		document.frm.action.value = 'm';
		document.frm.submit();
	}
}
function submitChannel()
{
	if(document.frm.channel.value == "")
	{
		alert ("Please select a channel");
	}
	else
	{
		document.frm.submit();
	}
}
function expandGateway()
{
  if(document.frm.gateway.value == "16")
  {
	  if(!extrendPaper("gateway_span"))
	  {
		//openPopup('popup.php?dtype='+dtype+'&id='+paperID);
	  }
  }
  else if(document.getElementById("gateway_span").style.display=="block")
		extrendPaper("gateway_span");

  return true;
}
function refreshAdditional(dtype)
{
  var elemID = "add"+dtype;
  var eleName = "additional_info"+dtype;
  if(document.getElementById(elemID).style.display=="block")
  {
  	document.getElementById(eleName).checked = false;
  }
  if(!extrendPaper(elemID))
  {
    //openPopup('popup.php?dtype='+dtype+'&id='+paperID);
  }

  return true;
}

function extrendPaper(dpaperID)
{  
  if(!document.getElementById)
  {
    return false;
  }

  if(document.getElementById(dpaperID).style.display=="block")
  {
    document.getElementById(dpaperID).style.display="none";    
  }
  else
  {
    document.getElementById(dpaperID).style.display="block";
  }
  return true;
}
function onSelOthers()
{
	if(document.frm.acquirer.value==28)
	{
	document.frm.other_acq.disabled=false;
	}
	else
	{
	document.frm.other_acq.disabled=true;
	}

}
function enableOptions(elem)
{
	if(elem == "1")
	{
	for(var i=0;i<4;i++)
		document.frm.price_choice[i].disabled=false;
	}
	else if(elem == "2")
	{
	for(var i=0;i<4;i++)
		document.frm.price_choice[i].disabled=true;
	}
}
function enablePricingOptions(elem)
{
	if(elem == "1")
	{
		disableTiered(false);
		disablePassThrough(true);
		disableDifferential(true);
		disableOther(true);
	}
	if(elem == "2")
	{
		disableTiered(true);
		disablePassThrough(false);
		disableDifferential(true);
		disableOther(true);
	}
	if(elem == "3")
	{
		disableTiered(true);
		disablePassThrough(true);
		disableDifferential(false);
		disableOther(true);
	}
	if(elem == "4")
	{
		disableTiered(true);
		disablePassThrough(true);
		disableDifferential(true);
		disableOther(false);
	}

}

function disableTiered(state)
{
	var started = false;
	var count = 0;
	with(document.frm)
	{
		for(i=0;i < (elements.length-1);i++)
		{

			if(elements[i].name == "q_d")
			{
				started = true;
			}
			if(started && count<14)
			{
				elements[i].disabled=state;
				count++;
			}
		}
	}
}
function disablePassThrough(state)
{
	with(document.frm)
	{
		p_d.disabled=state;
		i_d.disabled=state;
	}

}
function disableDifferential(state)
{
	with(document.frm)
	{
		qr_d.disabled=state;
		qr_p.disabled=state;
		ds_d.disabled=state;
	}

}
function disableOther(state)
{
	with(document.frm)
	{
		other_explain.disabled=state;
	}

}
function enableDesiredOptions(elem)
{
	if(elem == "1")
	{
		disableDesiredTiered(false);
		disableDesiredPassThrough(true);

	}
	if(elem == "2")
	{
		disableDesiredTiered(true);
		disableDesiredPassThrough(false);

	}

}
function disableDesiredTiered(state)
{
	with(document.frm)
	{
		q_rate.disabled=state;
		q_item.disabled=state;
		r_rate.disabled=state;
		r_item.disabled=state;
		m_rate.disabled=state;
		m_item.disabled=state;
		n_rate.disabled=state;
		n_item.disabled=state;
		c_rate.disabled=state;
		c_item.disabled=state;
	}

}
function disableDesiredPassThrough(state)
{
	with(document.frm)
	{
		p_rate.disabled=state;
		i_rate.disabled=state;
	}

}

function enablePOSOptions(elem)
{
	with(document.frm)
	{
		if(elem == "1")
		{
		pos_name.disabled = false;
		certified[0].disabled = false;
		certified[1].disabled = false;
		}
		else if(elem == "2")
		{
		pos_name.disabled = true;
		certified[0].disabled = true;
		certified[1].disabled = true;
		}
	}

}

function OnChangeRequestType()
{
	if(document.frm.request_type.value==2)
	{
		disableOnRequest(true)
	}
	else
	{
		disableOnRequest(false)
	}
}

function disableOnRequest(state)
{
	var started = false;
	with(document.frm)
	{
		for(i=0;i < (elements.length-1);i++)
		{

			if(elements[i].name == "service_interest")
			{
				started = true;
			}
			if(started && (elements[i].name != "state_merchant[]") && (elements[i].name != "desired_pop") && (elements[i].name != "desired_arc"))
			{
				elements[i].disabled=state;
			}
			if(elements[i].name == "echeck_comments")
			{
				started = false;
			}
		}
	}

}
function checkService(elem)
{
	if(elem == "1")
	{
		document.frm.current_pro.disabled=false;
		document.frm.current_rate.disabled=false;
		document.frm.current_item.disabled=false;
		document.frm.monthly_rate.disabled=false;
		document.frm.monthly_item.disabled=false;

	}
	if(elem == "2")
	{
		document.frm.current_pro.disabled=true;
		document.frm.current_rate.disabled=true;
		document.frm.current_item.disabled=true;
		document.frm.monthly_rate.disabled=true;
		document.frm.monthly_item.disabled=true;
	}
}

function enableCards(elem)
{
	if(elem == "1")
	{
		document.frm.gift_cards.disabled=false;

	}
	if(elem == "2")
	{
		document.frm.gift_cards.disabled=true;

	}
}

function disableElements()
{
	var started = false;

	with(document.frm)
	{
		for(i=0;i < (elements.length-1);i++)
		{

			if(elements[i].name == "m_type")
			{
				started = true;
			}
			if(started)
			{
				elements[i].disabled=true;
			}
			if(elements[i].name == "fee_comments")
			{
				started = false;
			}

		}
	}
}
/*************************************************************************\
\*************************************************************************/

/*************************************************************************\
boolean SalesRep_MerchantDemographicInfoValidation()
return true if all the desired fields are filled
else return false.
called in the  "vallidate()"
\*************************************************************************/

function SalesRep_MerchantDemographicInfoValidation()
{
	with(document.frm)
	{		
		if(rep_name.value == "")
		{
			alert("Enter rep name");rep_name.focus(); return false;}
		if(email.value == "")
		{
			alert("Enter email");email.focus(); return false;}
		if(phone.value == "")
		{
			alert("Enter phone");phone.focus(); return false;}
		if(m_name.value == "")
		{
			alert("Enter Manager name");m_name.focus(); return false;}
		if(channel.value == "")
		{
			alert("Enter sales channel");channel.focus(); return false;}
		if(sub_channel.value == "")
		{
			alert("Enter sub-channel");sub_channel.focus(); return false;}
		if(dba.value == "")
		{
			alert("Enter Merchant DBA");dba.focus(); return false;}
		if(no_loc.value == "")
		{
			alert("Enter Number of Locations");no_loc.focus(); return false;}
		if(mcc.value == "")
		{
			alert("Enter MCC Code");mcc.focus(); return false;}
		return true;
	}
}

/*************************************************************************\
boolean MerchantCreditCardProcessingInformationValidation()
return true if all the desired fields are filled
else return false.
called in the  "vallidate()"
\*************************************************************************/

function MerchantCreditCardProcessingInformationValidation()
{
	var count=0, flag = 0;
	with(document.frm)
	{	
		if(additional_info1.checked)
		{
			if(acquirer.value == 28)
			{
				if(other_acq.value == "") 
				{alert("Enter Current Acquirer");other_acq.focus(); return false;}
			}
			if(price_ava[0].checked == false)
			  if(price_ava[1].checked == false)
			   {alert("Select the \"Current Pricing Available\"");price_ava[0].focus(); return false;}
			   
			if(price_ava[0].checked) //Current Pricing Available(Y/N) are selected.
			{
				flag = 0;
				for(count = 0; count<4; count++)
					{if(price_choice[count].checked == true) flag = 1;}
				if(flag == 0) 
					{alert("Select any one option of \"Current Pricing Available\""); return false;}				
			}
			if(MerchantTypeValidation())
				if(AnnualVolumeInformationValidate())
					if(DesiredPricingValidate())	    	
						return true;
					else
						return false;
				else
					return false;
			else
				return false;
		}		
	}return true;
}

/*************************************************************************\
boolean MerchantTypeValidation()
return true if all the desired fields are filled
else return false.
called in the  "vallidate()"
\*************************************************************************/

function MerchantTypeValidation()
{
	with(document.frm)
	{
		if(retail.value == "")
			{alert("Enter Retail");retail.focus(); return false;}
		if(moto.value == "")
			{alert("Enter Moto");moto.focus(); return false;}
		if(restaurant.value == "")
			{alert("Enter Restaurant");restaurant.focus(); return false;}
		if(supermarket.value == "")
			{alert("Enter Supermarket");supermarket.focus(); return false;}
		if(gas.value == "")
			{alert("Enter Gas stations");gas.focus(); return false;}
		if(lodging.value == "")
			{alert("Enter Lodging");lodging.focus(); return false;}
		if(emerging_market.value == "")
			{alert("Enter Emerging Market");emerging_market.focus(); return false;}
		if(utility.value == "")
			{alert("Enter Utility");utility.focus(); return false;}
		if(l_ticket.value == "")
			{alert("Enter Large Ticket");l_ticket.focus(); return false;}						
		if(s_ticket.value == "")
			{alert("Enter Small Ticket");s_ticket.focus(); return false;}
		if(b2b.value == "")
			{alert("Enter B2B");b2b.focus(); return false;}
		if(aru.value == "")
			{alert("Enter ARU");aru.focus(); return false;}														
		
		if(pos[0].checked == false)
		 if(pos[1].checked == false)
		  {alert("Select the \"Front-end POS Solution\"");pos[0].focus(); return false;}
		if(pos[0].checked == true) 
		{
			if(pos_name.value == "")
				{alert("Enter Front-end POS Solution Name");return false;}
			if(certified[0].checked == false) 
				{if(certified[1].checked == false) 
					{alert("Select Certified on Nova Network(Y/N)"); certified[0].focus();return false;}
				}
		}
		if(gateway.value == 28)
		{
			if(other_gateway.value == "") 
				{alert("Enter Foreign Network / Gateway");other_gateway.focus(); return false;}
		}
	}
	return true;
}

/*************************************************************************\
boolean AnnualVolumeInformationValidate()
return true if all the desired fields are filled
else return false.
called in the  "vallidate()"
\*************************************************************************/
function AnnualVolumeInformationValidate()
{
	with(document.frm)
	{	
		if(visa_volume.value == "")
			{alert("Enter visa-volume");visa_volume.focus(); return false;}
		if(visa_tkt.value == "")
			{alert("Enter visa-tkt");visa_tkt.focus(); return false;}
		if(visa_trans.value == "")
			{alert("Enter visa-trans");visa_trans.focus(); return false;}
		if(debit_volume.value == "")
			{alert("Enter debit-volume");debit_volume.focus(); return false;}
		if(debit_tkt.value == "")
			{alert("Enter debit-tkt");debit_tkt.focus(); return false;}
		if(debit_trans.value == "")
			{alert("Enter debit-trans");debit_trans.focus(); return false;}
		if(pin_volume.value == "")
			{alert("Enter pin-volume");pin_volume.focus(); return false;}
		if(pin_tkt.value == "")
			{alert("Enter pin-tkt");pin_tkt.focus(); return false;}
		if(pin_trans.value == "")
			{alert("Enter pin-trans");pin_trans.focus(); return false;}						
		if(te_volume.value == "")
			{alert("Enter te-volume");te_volume.focus(); return false;}
		if(te_tkt.value == "")
			{alert("Enter te-tkt");te_tkt.focus(); return false;}
		if(te_trans.value == "")
			{alert("Enter te-trans");te_trans.focus(); return false;}			
		if(fleet_volume.value == "")
			{alert("Enter fleet-volume");fleet_volume.focus(); return false;}
		if(fleet_tkt.value == "")
			{alert("Enter fleet-tkt");fleet_tkt.focus(); return false;}						
		if(fleet_trans.value == "")
			{alert("Enter fleet-trans");fleet_trans.focus(); return false;}
	}
	return true;
}

/*************************************************************************\
boolean DesiredPricingValidate()
return true if all the desired fields are filled
else return false.
called in the  "vallidate()"
\*************************************************************************/
function DesiredPricingValidate()
{
	with(document.frm)

	{	
	  if(desired_radio[0].checked == true)  //Tiered is selected.
	  {	
		if(q_rate.value == "")
			{alert("Enter Qual-rate");q_rate.focus(); return false;}
		if(q_item.value == "")
			{alert("Enter Qual-item");q_item.focus(); return false;}			
		if(r_rate.value == "")
			{alert("Enter Rewards-rate");r_rate.focus(); return false;}
		if(r_item.value == "")
			{alert("Enter Rewards-item");r_item.focus(); return false;}
		if(m_rate.value == "")
			{alert("Enter Mid-qual-rate");m_rate.focus(); return false;}
		if(m_item.value == "")
			{alert("Enter Mid-qual-item");m_item.focus(); return false;}
		if(n_rate.value == "")
			{alert("Enter Non-qual-rate");n_rate.focus(); return false;}
		if(n_item.value == "")
			{alert("Enter Non-qual-item");n_item.focus(); return false;}						
		if(c_rate.value == "")
			{alert("Enter Check Card-rate");c_rate.focus(); return false;}
		if(c_item.value == "")
			{alert("Enter Check Card-item");c_item.focus(); return false;}
	  }
	  if(desired_radio[1].checked == true)  //Pass-through is selected.
	  {	
		if(p_rate.value == "")
			{alert("Enter Percent Markup");p_rate.focus(); return false;}
		if(i_rate.value == "")
			{alert("Enter Per Item Markup");i_rate.focus(); return false;}
	  }
	}
	return true;
}

/*************************************************************************\
boolean MerchantEquipmentInformationValidate()
return true if all the desired fields are filled
else return false.
called in the  "vallidate()"
\*************************************************************************/
function MerchantEquipmentInformationValidate()
{
	var units, count = 0, flag = 0;
	with(document.frm)
	{	
		if(additional_info2.checked) 
		{
			flag = 0;
			for(count = 0; count<3; count++)
				{if(purchase_options[count].checked == true) flag = 1;}
			if(flag == 0) 
				{alert("Select any one option of \"Purchase or Lease\""); return false;}				
			flag = 0;
			for(count = 1; count<30; count++)
			{
				units = "p"+count+"_units";			
				if(document.getElementById(units).value != "")
					flag = 1;
				if(flag == 0) 
				{alert("Enter atleast one unit"); p1_units.focus();return false;}
			}
		}
	}
	return true;
}

/*************************************************************************\
boolean MerchantECheckInformationValidate()
return true if all the desired fields are filled
else return false.
called in the  "vallidate()"
\*************************************************************************/
function MerchantECheckInformationValidate()
{
	var count = 0, flag = 0 ,i=0, started=0;
	with(document.frm)
	{	
		if(additional_info3.checked) 
		{
			for( i=0 ; i<elements.length ; i++)
			{
				if (elements[i].name=='product_interest')
				{
					if(elements[i].checked==1)
					{
						p_interest.value=p_interest.value+elements[i].value+"#";
						started=1;
					}
				}
			}
			if(started == 0)
			{
				alert("Check atleast one product interest");
				return false;
			}
			started = 0;
			for( i=0 ; i<elements.length ; i++)
			{
				if (elements[i].name=='state_merchant')
				{
					if(elements[i].checked==1)
					{
						s_merchant.value=s_merchant.value+elements[i].value+"#";
						started=1;
					}
				}
			}
			if(started == 0)
			{
				alert("Check atleast one States of Merchant Locations");
				return false;
			}
			
			
			
			if(check_service[0].checked == false)
			 if(check_service[1].checked == false)
			  {alert("Select the \"Currently Using Check Service\"");check_service[0].focus(); return false;}
			  
			if(check_service[0].checked == true)
			 if(current_pro.value == "")
			  {alert("Enter Name of Current Processor");current_pro.focus(); return false;}
		}
	} return true;
}


/*************************************************************************\
boolean MerchantGiftCardInformationValidate()
return true if all the desired fields are filled
else return false.
called in the  "vallidate()"
\*************************************************************************/
function MerchantGiftCardInformationValidate()
{
	var count = 0, flag = 0;
	with(document.frm)
	{	
		if(additional_info4.checked) 
		{
			if(card_qty.value == "")
			  {alert("Enter \"Card Quantity Requested\"");card_qty.focus(); return false;}
			if(include_papers[0].checked == false)
			 if(include_papers[1].checked == false)
			  {alert("Select the \"Include Paper Carriers\"");include_papers[0].focus(); return false;}
			if(rad_cards[0].checked == false)
			  if(rad_cards[1].checked == false)
			   {alert("Select the \"Currently Use Gift Cards\"");rad_cards[0].focus(); return false;}			   
			if(gift_cards.value == "")
			  {alert("Enter \"Currently Use Gift Cards\"");gift_cards.focus(); return false;}
			  
		}
	}return true;
}


/*************************************************************************\
boolean MerchantFeesInformationValidate()
return true if all the desired fields are filled
else return false.
called in the  "vallidate()"
\*************************************************************************/

function MerchantFeesInformationValidate()
{
	var count = 0, flag = 0;
	with(document.frm)
	{	
		if(additional_info5.checked) 
		{
			flag = 0;
			for(count = 1; count<30; count++)
			{
				units = "fee_"+count;			
				if(document.getElementById(units).value != "")
					flag = 1;
				if(flag == 0) 
				{alert("Enter atleast one \"Merchant Fees Information\""); fee_1.focus();return false;}
			}
		}
	}return true;
}
