// JavaScript Document

//    Смена валют   автор Смоляков В.В.


isDef = function (foo) {
	return ! (foo === undefined);
}

function MM_jumpMenu1(targ,selObj,restore){ //v3.0
  s=ret_item("page_param").value;
		var array=s.split("&");
		var pparam=array[0]+"&"+array[1];
		eval(targ+".location='?"+pparam+"&pmsort="+selObj.options[selObj.selectedIndex].value+"'");

		if (restore) selObj.selectedIndex=0;
}

function ch_act_val(id)
{
  act_valuta = ret_item(id);
		if (!act_valuta) {

					}
					else
						{
							 valuts = new Array("usd", "ru", "eu");
								for (b=0;b<valuts.length;b++)
												{
								      if(!ret_item(valuts[b])){ret_item("valuta_active").id=valuts[b];}
												}
														act_valuta.id = "valuta_active";
						}
}


function ret_item(item_id)
 {
	  var item = null;
			if (document.getElementById)
				{
					item = document.getElementById(item_id);
				} else if (document.all)
						{
								item = document.all[item_id];
						}
			 if (item) {return item;}
	}


function ShowOrHide(id)
 {
			ch_act_val(id);
			valuts = new Array("usd", "ru", "eu");
			for (a=1;a<=ret_item('item_count').value;a++)
			 {
					 for (b=0;b<valuts.length;b++)
							{
								item = ret_item("cost_"+valuts[b]+"_"+a);
								if (item) {item.style.display = "none";}
							}
							var item = null;
							if (document.getElementById)
								{
									item = document.getElementById("cost_"+id+"_"+a);
								} else if (document.all)
										{
												item = document.all["cost_"+id+"_"+a];
										}
					if (!item) {

					}
					else
						{
							if (item.style.display == "none")
								{
									item.style.display = "";
								}
							else
								{
									item.style.display = "none";
								}
						}
		  }
	}
