function swapOptions(the_array_name)
                {
                  if(the_array_name!=""){
                          var numbers_select = window.document.search.type;
                          var the_array = eval(the_array_name);
                          var the_price1 = eval(price1);
                          var the_price2 = eval(price2);
                          setOptionText(window.document.search.type,the_array, the_array.length);
                                if(the_array_name=="z1"){
                                  setOptionText_price1(window.document.search.price,the_price1, the_price1.length);
                                }
                                else if(the_array_name=="z2"){
                                  setOptionText_price2(window.document.search.price,the_price2, the_price2.length);
                                }
                  }
				  window.document.search.curr.value='AED';
				  refreshPrice();
				  
                }
        function setOptionText(the_select, the_array, the_array_length)
                {
                  the_select.options.length=the_array_length;
                  the_select.options[0].selected = true;
                  for (loop=0; loop <the_array_length; loop++)
                  {
                        var split=the_array[loop].split(",,,,,");
                        the_select.options[loop].text = split[0];
                        the_select.options[loop].value = split[1];
                  }
                }
        function setOptionText_price1(the_select, the_array, the_array_length)
                {
                  the_select.options.length=the_array_length;
                  the_select.options[0].selected = true;
                  for (loop=0; loop <the_array_length; loop++)
                  {
                        var split=the_array[loop].split(",,,,,");
                        the_select.options[loop].text = split[0];
                        the_select.options[loop].value = split[1];
                  }
                }
        function setOptionText_price2(the_select, the_array, the_array_length)
                {
                  the_select.options.length=the_array_length;
                  the_select.options[0].selected = true;
                  for (loop=0; loop <the_array_length; loop++)
                  {
                        var split=the_array[loop].split(",,,,,");
                        the_select.options[loop].text = split[0];
                        the_select.options[loop].value = split[1];
                  }
                }
		function refreshPrice(){
			var ztype=window.document.search.purpose[0].checked;
			var curr_val=window.document.search.curr.value;
			//alert(ztype);
			if (ztype==true){
			//	alert("price_"+curr_val+"_1");
				var the_price1 = eval("price_"+curr_val+"_1");
                setOptionText_price1(window.document.search.price,the_price1, the_price1.length);
			}else{
				//alert("price_"+curr_val+"_2");
				var the_price2 = eval("price_"+curr_val+"_2");
				setOptionText_price2(window.document.search.price,the_price2, the_price2.length);
			}
		}

function swapOptionsEmi(the_array_name){
    //alert(the_array_name);
    if(the_array_name!=""){
		var the_array = eval("alist"+the_array_name);
        setOptionTextArea(window.document.search.area,the_array, the_array.length);
    }else{
	    eval("var x=window.document.search.area")
	    eval("var prp_len=window.document.search.area.options.length;");
	    if ( prp_len > 0){
	        for (var i = 0; i < prp_len; i++){
				x.remove(x.selectedIndex);
	            eval("window.document.search.area.options[i] = null;");
	        }
	    }
	}
}
        function setOptionTextArea(the_select, the_array, the_array_length)
                {
                  the_select.options.length=the_array_length;
                  the_select.options[0].selected = true;
                  for (loop=0; loop <the_array_length; loop++)
                  {
			//var loop1=loop+1;
                        var split=the_array[loop].split(",,,,,");
                        the_select.options[loop].text = split[0];
                        the_select.options[loop].value = split[1];
                  }
                }
