
function criteriaOnChange(frm)
{
var val='';
for (var i= 0;i<frm.length;i++)
{
if(frm[i].name!='searchKey' && frm[i].name!='qry' && frm[i].name!='fields')
{
if(val=='')
val=frm[i].name+'='+frm[i].value;
else
val+='~'+frm[i].name+'='+frm[i].value;
}
}
jsrsExecute( '/include/select_rs.php', getSearchResult, 'getSearchResult', val);
} 
  

function generateShipScheme(frm,orderID)
		{
		document.getElementById("loadMsgHolder").innerHTML="Loading Shipping Scheme...<br>Please Wait";
		var prodIds="";
		 var prodQtys="";
		 var finalStr="";
		 temp="";
		
			for(i=0;i<(frm.length)-5;i++)
			{
				if(frm[i].type=='checkbox' && frm[i].checked==true)
					{
						if(prodIds=="")
							{
							prodQtys+=frm[i+1].value;
							prodIds+=frm[i].name.substring(13,frm[i].name.length);
							}
						else
							{
							prodQtys+='~'+frm[i+1].value;
							prodIds+='~'+frm[i].name.substring(13,frm[i].name.length);
							}
					}
				}
			finalStr=prodIds+'~~'+prodQtys+'~~'+orderID;
		
			jsrsExecute( '/include/select_rs.php', getShipResult, 'getShipResult', finalStr);
		}



function getSearchResult( strOptions )
{ 
var temp=strOptions.split("~~~~");
document.getElementById("vaHolder").innerHTML=temp[0];
document.getElementById("searchResultHolder").innerHTML="<font size=6>"+temp[1] +"</font><br> Products found.";
}

function getShipResult( strOptions )
{ 

var temp=strOptions.split("****");
var shipName=temp[0].split("~~~~");
var shipVal=temp[1].split("~~~~");
var tempChk=""
document.orderDetailFrm.shipused.options[0]=new Option('Select Shipping','');
for(i=0;i<shipName.length;i++)
{
tempChk=shipVal[i].split("______");
document.orderDetailFrm.shipused.options[i+1]=new Option(shipName[i],shipVal[i]);
if(tempChk[0]==selShipScheme)
{
document.orderDetailFrm.shipused.selectedIndex=i+1;
document.orderDetailFrm.applicableShipCharge.value=tempChk[1];
calcFinalPrice(document.orderDetailFrm.disc_amt,document.orderDetailFrm.tax_amt,document.orderDetailFrm.applicableShipCharge)
}
}
document.getElementById("loadMsgHolder").innerHTML='';
}





