
//----- Validate searchform Data
function chkSearchForm()
{
   var ch = 0	
   if ( document.frmsimple.modelno.value == ""  )
	{if (!(PrintMesg(document.frmsimple.modelno,"Please Enter the search word")))
	{return false;}}
   else  { 
	if (!SpaceChk(document.frmsimple.modelno))
	{if (!(PrintMesg(document.frmsimple.modelno,"Enter value other than space")))
	{return false;}}
   }
   
/*
if (document.frmsimple.valButton[3].checked)
	{ 

	  if (isNaN(document.frmsimple.modelno.value))
	{
		tmpvalue		= Trim(document.frmsimple.modelno.value);
		tmpstrlen		= tmpvalue.length
		tmpfirstchar	= tmpvalue.charAt(0)
		chkflag		= 1

		if(tmpfirstchar=="$")
		{
			if(tmpstrlen>1)
			{ 
				tmpcheckstr	= tmpvalue.substring(1,tmpstrlen)
				if(isNaN(tmpcheckstr))
				{
					chkflag		= 0
				}				
			}
			else
			{
				chkflag		= 0
			}
		}
		else
		{
			chkflag		= 0

		}

		if(chkflag==0)
		{
			if (!(PrintMesg(document.frmsimple.modelno,"Please Enter valid Price")))
			{return false;}
		}
	}
}
   
for(i=0;i<4;i++)
{
if(document.frmsimple.valButton[i].checked)
	{ch = 1}

}
if (ch == 0)
   {
    if (!(PrintMesg(document.frmsimple.valButton[0],"Please Select the Required Button")))
	{return false;}}
*/	
   return true
}

//---- prints messages
function PrintMesg(ctrlvar,mesg)
{ alert(mesg); ctrlvar.focus(); return false }

//---- function to check spaces
function SpaceChk(ctrlvar)
{
   chkstr     = ctrlvar.value
   stlength   = chkstr.length
   spacecount = 0
   if (stlength >0)  {
    for(i=0;i<=stlength;i++)
     if ( chkstr.charAt(i)==" ") { spacecount=spacecount+1  }
    if (stlength == spacecount) { return false }
   return true }
}


function Trim(s) 
{
  // Remove leading spaces and carriage returns
  
  while ((s.substring(0,1) == ' ') || (s.substring(0,1) == '\n') || (s.substring(0,1) == '\r'))
  {
    s = s.substring(1,s.length);
  }

  // Remove trailing spaces and carriage returns

  while ((s.substring(s.length-1,s.length) == ' ') || (s.substring(s.length-1,s.length) == '\n') || (s.substring(s.length-1,s.length) == '\r'))
  {
    s = s.substring(0,s.length-1);
  }
  return s;
}



//========= dynamic loading of price in searchdetails form ==========
function splitSize(scode,price,sizetxt)
{

  SizeIDArry 	= scode.split("~");
  LDPrice		= price.split("~");
  SizeTxtArry	= sizetxt.split("~") 	
}

//----------- price loading ---------
function LoadPrice(val,edtFlg,flgPerc,amtPerc,ws,whFixed)
{
     var intFirstDelPosition, intSecondDelPosition, intItemCount, int_Counter;
     var strArrayItem, arrSourceArray,strPrimaryCodeArry;
     var strPrimaryCode, flg ,firstValue;
     fnCheckCustom(val,2)

     strPrimaryCode 	= document.details.plussize[document.details.plussize.selectedIndex].value;
	if(strPrimaryCode == "")
	{
		document.details.txtRegular.value	= formatCurrency(document.details.TMPnormalprice.value) ;
		document.details.normalprice.value 	= document.details.TMPnormalprice.value;
		document.frmConversion.Amount.value	= document.details.TMPnormalprice.value;


		if(edtFlg == 1)
		{ 
			document.details.txtSalePrice.value = formatCurrency(document.details.TMPsaleprice.value) 
			document.details.saleprice.value 	= document.details.TMPsaleprice.value ;
			document.frmConversion.Amount.value	= document.details.TMPsaleprice.value ;
		}
		if(edtFlg == 2)
		{ 
			document.details.txtOnSalePrice.value 	= formatCurrency(document.details.TMPonSalePrice.value) ;
			document.details.onSalePrice.value 		= document.details.TMPonSalePrice.value ;
			document.frmConversion.Amount.value		= document.details.onSalePrice.value;
		}
		return false;
	}
     arrSourceArray 	= SizeIDArry ;     
     ObjTargetText 	= document.details.txtRegular;
     intItemCount 	= 0; 
	flg 			= 0;
     for (int_Counter=0; int_Counter<arrSourceArray.length; int_Counter++)  {   if (LDPrice[int_Counter] != "" ) { firstValue  = LDPrice[int_Counter] }
	    if (SizeIDArry[int_Counter] != "" ) { thirdValue = SizeIDArry[int_Counter] }
		if (thirdValue == strPrimaryCode) 
		{
			//---- If the item selected

			if (!(firstValue>0)) {firstValue = "Nil"; 
				    document.details.StdValue.value   = firstValue;
		}
		else { quantity = document.details.quantity.value ;
		 if(!(isNaN(quantity)) && (quantity>0) ) 
			{document.details.StdValue.value   = firstValue;

		  }else { document.details.StdValue.value = firstValue;
		   }
	 	}
	var tmpRegular1 = 0, tmpRegular2=0 ;
	tmpRegular1	= parseFloat(document.details.TMPnormalprice.value) ;
	tmpRegular2	= parseFloat(firstValue) ;
//	tmpRegular	= tmpRegular1 + tmpRegular2;  ---commented on 22-12-2006
	tmpRegular	=  tmpRegular2;
	whPlusAmt	=  tmpRegular2- tmpRegular1;

	document.details.normalprice.value 	=  tmpRegular ;
	ObjTargetText.value			=  formatCurrency(tmpRegular);
	document.frmConversion.Amount.value	=  Math.round(tmpRegular*100)/100 ;

	if(edtFlg == 1)
	{ 
		tmpRegular1	= parseFloat(document.details.TMPsaleprice.value) ; //saleprice
		if(parseInt(flgPerc) == 0)
			{if(parseInt(amtPerc)==0)
			{
				if(parseInt(whFixed) >0)
					tmpRegular  = parseFloat(whFixed) + parseFloat(whPlusAmt)
				else
					tmpRegular	= tmpRegular2
			}
			else
				tmpRegular	= tmpRegular2 - ((tmpRegular2 * amtPerc)/100) ;
			}
		else
			tmpRegular	= tmpRegular2

		document.details.saleprice.value 	=  tmpRegular ;
		document.details.txtSalePrice.value	=  formatCurrency(tmpRegular);
		document.frmConversion.Amount.value	=  Math.round(tmpRegular*100)/100 ;

	}
	if(edtFlg == 2)
	{
		tmpRegular1	= parseFloat(document.details.TMPonSalePrice.value) ; //ONSaleprice

		if(parseInt(flgPerc) == 1)
			tmpRegular	= tmpRegular2 - ((tmpRegular2 * amtPerc)/100) ;
		else 
		{
			if(parseInt(flgPerc) == 2)
				tmpRegular	= tmpRegular2 - parseFloat(amtPerc);
			else
				tmpRegular	= tmpRegular2;
		}
		document.details.onSalePrice.value 		=  tmpRegular ;
		document.details.txtOnSalePrice.value	=  formatCurrency(tmpRegular);
		document.frmConversion.Amount.value		=  Math.round(tmpRegular*100)/100 ;


	}

	flg = 1;
   
       }}	
if(ws!=2)
	document.details.customcolor.selectedIndex = 0;

}

function validateDetails()
{
//------ normalsize
/*
 if((document.details.checkCustom.value == 0) && (document.details.plussize.selectedIndex == 0))
 {
   if(document.details.tmpSizeFlag.value==0){
	if (document.details.normalsize.selectedIndex == 0  )
	{if (!(PrintMesg(document.details.normalsize,"Please select the size")))
	   {return false;}}
    } 
    else
    { if(document.details.tmpSizeFlag.value==1)
	{if (!(PrintMesg(document.details.plussize,"Please select the Plus Size")))
	   {return false;}
	}
    } 

}
*/
//------ Quantity
 if ( document.details.quantity.value == ""  )
   {if (!(PrintMesg(document.details.quantity,"Please enter the quantity")))
   {return false;}}
 else  { 
   if (!SpaceChk(document.details.quantity))
    {if (!(PrintMesg(document.details.quantity,"Enter quantity Other than space")))
    {return false;}}
   if (isNaN(document.details.quantity.value))
    {if (!(PrintMesg(document.details.quantity,"Enter a numeric value")))
    {return false;}}
   if(document.details.quantity.value == 0)       
    {if (!(PrintMesg(document.details.quantity,"Please enter valid quantity")))
   {return false;}} 
 }
return true
}

//----------- dynamic loading of additional price in searchdetails form
function splitColor(Colorcode,Colorprice,Colortxt,ProdSize,ColorQty)
{
  ColorIDArry 	= Colorcode.split("~");
  ClrPrice		= Colorprice.split("~");
  ColorTxtArry	= Colortxt.split("~") ;	
  ProdSzArry	= ProdSize.split("~") ;	
  ColorQtyArry	= ColorQty.split("~") ;
}
//----------- dynamic loading of additional price in searchdetails form

function splitCustColor(Colorcode,Colorprice,Colortxt,ProdSize,ColorQty)
{
  ColorCustIDArry 	= Colorcode.split("~");
  ClrCustPrice		= Colorprice.split("~");
  ColorCustTxtArry	= Colortxt.split("~") ;	
  ProdCustSzArry		= ProdSize.split("~") ;	
  ColorCustQtyArry	= ColorQty.split("~") ;
}

//========= dynamic loading of additional price in searchdetails form ==========
function splitFabric(Fabriccode,Fabricprice,Fabrictxt)
{
  FabricIDArry 	= Fabriccode.split("~");
  FPrice		= Fabricprice.split("~");
  FabricTxtArry	= Fabrictxt.split("~") 	
}

//----------- price loading ---------
function LoadFabricPrice()
    {
     var intFirstDelPosition, intSecondDelPosition, intItemCount, int_Counter;
     var strArrayItem, arrSourceArray,strPrimaryCodeArry;
     var strPrimaryCode, flg , firstValue , quantity;
	var floatValue = 0;

     strPrimaryCode 	= document.details.customfabric[document.details.customfabric.selectedIndex].value;

     arrSourceArray 	= FabricIDArry ;     
//     ObjTargetText 	= document.details.custfabricfee;
     intItemCount 	= 0; 
	flg 			= 0;

     for (int_Counter=0; int_Counter<arrSourceArray.length; int_Counter++)  {
	    if (FPrice[int_Counter] != "" ) { firstValue  = FPrice[int_Counter] }
	    if (FabricIDArry[int_Counter] != "" ) { thirdValue = FabricTxtArry[int_Counter] }
          if (thirdValue == strPrimaryCode)  {
		//-------- custom made  check ---------
		if (FabricTxtArry[int_Counter] == "custom-made")	
		//if (FabricTxtArry[int_Counter] == "zz")	

		{ if (confirm("This is a Custom Made Item. Please fill your measurements"))
			{location.href="Measurement_Cust.asp"}	
		} 

	//---- If the item selected
	if (!(firstValue>0)) {firstValue = "Nil" 
				    document.details.FabricValue.value   = firstValue;
	}
	else { quantity = document.details.quantity.value ;
		 if(!(isNaN(quantity)) && (quantity>0) ) 
			{document.details.FabricValue.value   = firstValue;
			 firstValue =  "$ " + (quantity * firstValue) ;

		  }else { document.details.FabricValue.value = firstValue;
			     firstValue =  "$ " + firstValue }
	 }
	//ObjTargetText.value =  firstValue;
	
	flg = 1;
   
       }}	
   /*	if (flg == 0){ObjTargetText.value =  "Nil";} */
		 }

//---- Format currency ---
function formatCurrency(num) {
num = num.toString().replace(/\$|\,/g,'');
if(isNaN(num))
num = "0";
sign = (num == (num = Math.abs(num)));
num = Math.floor(num*100+0.50000000001);
cents = num%100;
num = Math.floor(num/100).toString();
if(cents<10)
cents = "0" + cents;
for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
num = num.substring(0,num.length-(4*i+3))+','+
num.substring(num.length-(4*i+3));
return (((sign)?'':'-') + '$' + num + '.' + cents);
}
//-------------------------------------------------------------------------------------

//**********************

//----------- price loading ---------
function LoadAddPrice(val,edtFlg,flgPerc,amtPerc,whFixAmt)
{ 	LoadPrice(val,edtFlg,flgPerc,amtPerc,2,whFixAmt)
     var intFirstDelPosition, intSecondDelPosition, intItemCount, int_Counter;
     var strArrayItem, arrSourceArray,strPrimaryCodeArry;
     var strPrimaryCode, flg ,firstValue;
//     fnCheckCustom(val,2)

     strPrimaryCode 	= document.details.customcolor[document.details.customcolor.selectedIndex].value;

	if(strPrimaryCode=="")
	{ return false;
		document.details.txtRegular.value	= formatCurrency(document.details.TMPnormalprice.value) ;
		document.details.normalprice.value 	= document.details.TMPnormalprice.value;
		document.frmConversion.Amount.value	= document.details.TMPnormalprice.value;


		if(edtFlg == 1)
		{ 
			document.details.txtSalePrice.value = formatCurrency(document.details.TMPsaleprice.value) 
			document.details.saleprice.value 	= document.details.TMPsaleprice.value ;
			document.frmConversion.Amount.value	= document.details.TMPsaleprice.value ;
		}
		if(edtFlg == 2)
		{ 
			document.details.txtOnSalePrice.value 	= formatCurrency(document.details.TMPonSalePrice.value) ;
			document.details.onSalePrice.value 		= document.details.TMPonSalePrice.value ;
			document.frmConversion.Amount.value		= document.details.onSalePrice.value;
		}
		return false;
	}
     arrSourceArray 	= ColorTxtArry ;     
     ObjTargetText 	= document.details.txtRegular;
     intItemCount 	= 0; 
	flg 			= 0;
     for (int_Counter=0; int_Counter<arrSourceArray.length; int_Counter++)  {   if (ClrPrice[int_Counter] != "" ) { firstValue  = ClrPrice[int_Counter] }
	    if (ColorTxtArry[int_Counter] != "" ) { thirdValue = ColorTxtArry[int_Counter] }


		if (thirdValue == strPrimaryCode) 
		{
			var tmpRegular1 = 0, tmpRegular2=0 ;
			tmpRegular1	= parseFloat(document.details.TMPnormalprice.value) ;
			tmpRegular2	= parseFloat(firstValue) ;

			if (document.details.TMPnormalprice.value != document.details.normalprice.value)
			{ 
				if(tmpRegular2 > 0) 

				{	tmpRegular1	= parseFloat(document.details.normalprice.value) ;}
				else
				{	tmpRegular1	= parseFloat(document.details.normalprice.value) ;

					tmpRegular1 = tmpRegular1 - parseFloat(document.details.PrevSelCustColor.value)
				}
			}

			tmpRegular	= tmpRegular1 + tmpRegular2;  //---commented on 22-12-2006
			//tmpRegular	=  tmpRegular2;
			document.details.normalprice.value 	=  tmpRegular ;
			ObjTargetText.value			=  formatCurrency(tmpRegular);
			document.frmConversion.Amount.value	=  Math.round(tmpRegular*100)/100 ;

			if(edtFlg == 1)
			{ 
				tmpRegular1	= parseFloat(document.details.saleprice.value) ; //saleprice
				if (isNaN(firstValue))
					tmpRegular2	= parseFloat(firstValue) ;
				else
					tmpRegular2	= 0


				if(parseInt(flgPerc) == 0)
				{
					if(parseInt(amtPerc)==0)
					{
						if(parseInt(whFixAmt) >0)
						{
							wh1		= document.details.saleprice.value;
							tmpRegular	= parseFloat(wh1) + parseFloat(firstValue)
						}
						
						else

							tmpRegular	= tmpRegular - ((tmpRegular * amtPerc)/100) ;
					}
					else

						tmpRegular	= tmpRegular - ((tmpRegular * amtPerc)/100) ;

				}
				else 
				{
					if(parseInt(flgPerc) == 2)
						tmpRegular	= tmpRegular - parseFloat(amtPerc);
			
				} 
		
				document.details.saleprice.value 	=  tmpRegular ;
				document.details.txtSalePrice.value	=  formatCurrency(tmpRegular);
				document.frmConversion.Amount.value	=  Math.round(tmpRegular*100)/100 ;

			}
			if(edtFlg == 2)
			{  	
				tmpRegular1	= parseFloat(document.details.onSalePrice.value) ; //ONSaleprice

				if (isNaN(firstValue))
					tmpRegular2	= parseFloat(firstValue) ;
				else
					tmpRegular2	= 0
		
				//if(parseInt(tmpRegular2)== 0) return false;

		 		if(parseInt(flgPerc) == 1) 
					tmpRegular	= tmpRegular - ((tmpRegular * amtPerc)/100) ;
				else 
				{
					if(parseInt(flgPerc) == 2)
						tmpRegular	= tmpRegular - parseFloat(amtPerc);
			
				} 
				document.details.onSalePrice.value 		=  tmpRegular ;
				document.details.txtOnSalePrice.value	=  formatCurrency(tmpRegular);
				document.frmConversion.Amount.value		=  Math.round(tmpRegular*100)/100 ;


			}

			flg = 1; break;
   
       	}}	
		document.details.PrevSelCustColor.value 	=firstValue
	}

function setSizeCombo(strSizeVal)
{
	ObjTargetCombo	= document.details.plussize;
	//============
	var x=document.getElementById("plussize")
	for (s=x.length-1;s>=0;s--)
	{
		x.remove(s)
	} //-----------------------------
	if (strSizeVal != null)
	{
 		TmpSArry 		= strSizeVal.split(",");
		ObjTargetCombo.options[0] =  new Option("select size","","");
		for (intCt=0; intCt<TmpSArry.length; intCt++) 
		{
  			if(TmpSArry[intCt] != null);
			{
				TmpIDArry 		= TmpSArry[intCt].split("~");
				ObjTargetCombo.options[intCt+1] =  new Option(TmpIDArry[1],TmpIDArry[0],TmpIDArry[1]); 
			}
		}
 	}
	document.details.plussize.selectedIndex  = 0;
	document.details.customcolor.selectedIndex  = 0;
	document.details.quantity.selectedIndex = 0;

		document.details.txtRegular.value	= formatCurrency(document.details.TMPnormalprice.value) ;
		document.details.normalprice.value 	= document.details.TMPnormalprice.value;
		document.frmConversion.Amount.value	= document.details.TMPnormalprice.value;
} //----------------------end function setSizeCombo

function LoadColorCombo(scr) //=========Color combo ================
{	flget = 0;
	ObjTargetCombo	= document.details.customcolor;
	//============remove all from color combo 
	var x=document.getElementById("customcolor")
	for (s=x.length-1;s>=0;s--)
	{
		x.remove(s)
	} //-----------------------------

	selectedSizeCode	= document.details.plussize.value
	ObjTargetCombo.options[0] =  new Option("select color","","");
	cIncr = 1
	if(scr=="B")
	{
		if(document.details.custom.checked )
 		{
			if(ProdCustSzArry.length>=0)
			{
				for(lp=0;lp<ProdCustSzArry.length;++lp)
				{
					if(ProdCustSzArry[lp]==selectedSizeCode)
					{
						ObjTargetCombo.options[cIncr] =  new Option(ColorCustTxtArry[lp],ColorCustTxtArry[lp],ColorCustTxtArry[lp]); 
						cIncr	+= 1;flget = 1;
					}
				}
			}
			else
				ObjTargetCombo.options[0] =  new Option('NOT IN STOCK','0','0'); 

		}	
		else
		{
			if(ProdSzArry.length>=0)
			{	
				for(lp=0;lp<ProdSzArry.length;++lp)
				{
					if(ProdSzArry[lp]==selectedSizeCode)
					{
						ObjTargetCombo.options[cIncr] =  new Option(ColorTxtArry[lp],ColorTxtArry[lp],ColorTxtArry[lp]); 
						cIncr	+= 1;flget = 1;
					}
				}
			}
			else
				ObjTargetCombo.options[0] =  new Option('NOT IN STOCK','0','0'); 
		}
	}
	else
	{
		if(ProdSzArry.length>=0)
		{	
			for(lp=0;lp<ProdSzArry.length;++lp)
			{
				if(ProdSzArry[lp]==selectedSizeCode)
				{
					ObjTargetCombo.options[cIncr] =  new Option(ColorTxtArry[lp],ColorTxtArry[lp],ColorTxtArry[lp]); 
					cIncr	+= 1;flget = 1;
				}
			}
		}
		else
			ObjTargetCombo.options[0] =  new Option('NOT IN STOCK','0','0'); 

	}
	if(flget == 0)
		if(selectedSizeCode!="")
			ObjTargetCombo.options[0] =  new Option('NOT IN STOCK','0','0'); 
//if(document.details.customcolor.value == "" )
	//============remove all from color combo 
	var x=document.getElementById("quantity")
	for (s5=x.length-1;s5>=0;s5--)
	{
		x.remove(s5)
	} //-----------------------------

	document.details.quantity.options[0] =  new Option('select quantity','0','0');

	document.details.customcolor.selectedIndex  = 0;
	document.details.quantity.selectedIndex = 0;

}//---end function ---------

function LoadQuantity(cdr)
{QtyNew =0 ;
	ObjTargetCombo	= document.details.quantity;

	selectedColor	= document.details.customcolor.value;
	selectedSize	= document.details.plussize.value;

	//============remove all from color combo 
	var x=document.getElementById("quantity")
	for (s=x.length-1;s>=0;s--)
	{
		x.remove(s)
	} //-----------------------------

	if(cdr=="B")
	{
		if(document.details.custom.checked )
 		{
			//---qty -------------------
			for(lp=0;lp<ProdCustSzArry.length;++lp)
			{
				if(ProdCustSzArry[lp]==selectedSize && ColorCustTxtArry[lp]==selectedColor)
				QtyNew	= ColorCustQtyArry[lp];
			
			}	
			if (QtyNew>0)	
			{
				if(document.details.custom != null)		//--------------
				{	
					if(document.details.custom.checked )
					{
						if(parseInt(QtyNew)<=500 && QtyNew>=20)
						QtyNew = 20;
					}
				} //--------------------------------------


				for(q=1;q<=QtyNew;++q)
				{
					ObjTargetCombo.options[q] =  new Option(q,q,q); 
				} //----qty----------------------------
			}
			else
			{
				if(selectedColor =="")
					ObjTargetCombo.options[0] =  new Option("Select Quantity","",""); 
				else
					ObjTargetCombo.options[0] =  new Option("SOLD OUT","0","0"); 
			}


		}
		else
		{
			//---qty -------------------
			for(lp=0;lp<ProdSzArry.length;++lp)
			{
				if(ProdSzArry[lp]==selectedSize && ColorTxtArry[lp]==selectedColor)
				QtyNew	= ColorQtyArry[lp];
		
			}
			if (QtyNew>0)	
			{
				for(q=1;q<=QtyNew;++q)
				{
					ObjTargetCombo.options[q] =  new Option(q,q,q); 
				} //----qty----------------------------
			}
			else

			{
				if(selectedColor =="")
					ObjTargetCombo.options[0] =  new Option("Select Quantity","",""); 
				else
					ObjTargetCombo.options[0] =  new Option("SOLD OUT","0","0"); 
			}
				
		}
	}
	else
	{
		//---qty -------------------
		for(lp=0;lp<ProdSzArry.length;++lp)
		{
			if(ProdSzArry[lp]==selectedSize && ColorTxtArry[lp]==selectedColor)
			QtyNew	= ColorQtyArry[lp];
		
		}
		if(QtyNew>0)
		{
				if(document.details.custom != null)		//--------------
				{	
					if(document.details.custom.checked )
					{
						if(parseInt(QtyNew)<=500 && QtyNew>=20)
						QtyNew = 20;
					}
				} //--------------------------------------


			for(q=1;q<=QtyNew;++q)
			{
				ObjTargetCombo.options[q] =  new Option(q,q,q); 
			} //----qty----------------------------
		}
		else
			{
				if(selectedColor =="")
					ObjTargetCombo.options[0] =  new Option("Select Quantity","",""); 
				else
					ObjTargetCombo.options[0] =  new Option("SOLD OUT","0","0"); 
			}


	}
	document.details.quantity.selectedIndex = 0;
} //----end function --------------------

/*
	for(lp=0;lp<ProdSzArry.length;++lp)
	{
		if(ProdSzArry[lp]==selectedSize && ColorTxtArry[lp]==selectedColor)
			QtyNew	= ColorQtyArry[lp];
		
	}
	for(q=1;q<=QtyNew;++q)
	{
		ObjTargetCombo.options[q] =  new Option(q,q,q); 
	} //----qty----------------------------
*/




