konverzny_kurz = 30.126;

function open_window ( url, w, h, b_resizable, b_scrollbars )
{
        if ( w > screen.width - 100 )
        {
                w = screen.width - 100;
                h += 21;
                b_scrollbars = true;
        }
        if ( h > screen.height - 100 )
        {
                h = screen.height - 100;
                w += 21;
                b_scrollbars = true;
        }

        var x = Math.floor ( ( screen.width - w - 10 ) / 2 );
        var y = Math.floor ( ( screen.height - h - 29 ) / 2 );

        if ( typeof ( gallery_window ) == "undefined" || gallery_window.closed )
        {
                gallery_window = window.open ( url, 'gallery_window', 'menubar=0,toolbar=0,location=0,scrollbars=' + ( b_scrollbars ? '1' : '0' ) + ',screenX=' + x + ',screenY=' + y + ',left=' + x + ',top=' + y + ',width=' + w + ',height= ' + h + ',resizable=' + ( b_resizable ? '1' : '0' ) );
        }else gallery_window.location.href = url;

        gallery_window.focus();
}

function _SetCookie ( name, value ) 
{
	var expires_date = 'Thu, 01-Jan-2038 00:00:01 GMT';

	document.cookie = name + "=" + escape ( value ) + "; expires=" + expires_date + "; path=/";
}

function _GetCookie ( name )
{
	var start = document.cookie.indexOf ( name + "=" );

	if ( start > -1 )
	{
		var from = start + name.length + 1;

		var end = document.cookie.indexOf ( ";", from );

		if ( end == -1 ) end = document.cookie.length;

		return unescape( document.cookie.substring ( from, end ) );
	}else return "";
}

function _PridatDoMojhoVyberu ( i_id )
{
	var s_moj_vyber = _GetCookie ( "moj_vyber" );

	if ( s_moj_vyber == "" ) s_moj_vyber = "|" + i_id + "|";
	else s_moj_vyber += i_id + "|";

	_SetCookie ( "moj_vyber", s_moj_vyber );

	return true;
}

function _OdobratZMojhoVyberu ( i_id )
{
	var s_moj_vyber = _GetCookie ( "moj_vyber" );

	s_moj_vyber = s_moj_vyber.replace ( "|" + i_id + "|", "|" ); 

	if ( s_moj_vyber == "|" )
	{
		s_moj_vyber = "";
	}

	_SetCookie ( "moj_vyber", s_moj_vyber );

	return true;
}

function _JeVMojomVybere ( i_id )
{
	var s_moj_vyber = _GetCookie ( "moj_vyber" );

	var i_pos = s_moj_vyber.indexOf ( "|" + i_id + "|" );

	return i_pos > -1;
}

function DalsiaFotka ()
{
	i_where++;

	if ( i_where == i_obrazok ) i_where = 0;

	for ( var i=0; i<3; i++ )
	{
		var i_next = i_where + i;

		if ( i_next >= i_obrazok ) i_next = i_next - i_obrazok;

		var o_obr = document.getElementById ( 'obrazok' + ( i + 1 ) );

		if ( o_obr == null )
		{
			return;
		}

		o_obr.href = 'javascript:GaleriaUkaz(\'' + i_next + '\')';
		o_obr.firstChild.src = a_obrazok[i_next];
	}
}

function PredchFotka ()
{
	i_where--;

	if ( i_where == -1 ) i_where = i_obrazok - 1;

	for ( var i=0; i<3; i++ )
	{
		var i_next = i_where + i;

		if ( i_next >= i_obrazok ) i_next = i_next - i_obrazok;

		var o_obr = document.getElementById ( 'obrazok' + ( i + 1 ) );

		if ( o_obr == null )
		{
			return;
		}

		o_obr.href = 'javascript:GaleriaUkaz(\'' + i_next + '\')';
		o_obr.firstChild.src = a_obrazok[i_next];
	}
}

function _Selecty ( b, s_parent )
{
	var a = null;

	if ( s_parent == "" )
	{
		var a = document.getElementsByTagName ( 'select' );
	}else
	{
		var o_parent = document.getElementById ( s_parent );
		if ( o_parent != null )
		{
			var a = o_parent.getElementsByTagName ( 'select' );
		}else
		{
			var a = document.getElementsByTagName ( 'select' );
		}
	}
	var i_a = a.length;
	var i;

	for ( i=0; i<i_a; i++ )
	{
		a[i].style.visibility = b ? 'visible' : 'hidden';
	}
}

function GaleriaUkaz ( i )
{
	var o_obj = document.getElementById ( 'popup_galeria' );

	if ( o_obj == null ) return;

	o_obj.childNodes[2].firstChild.src = '/swift_data/scripts/kiska/obrazok2.php?obrazok=' + a_obrazok_id[i] + '&velkost=3';
	o_obj.childNodes[2].lastChild.innerHTML = a_obrazok_opis[i];

	PopupUkaz ( 'popup_galeria' );

	i_gallery_where = i;
}

function GaleriaSkry ()
{
	var o_obj = document.getElementById ( 'popup_galeria' );

	if ( o_obj == null ) return;

	o_obj.childNodes[2].firstChild.src = '';
	o_obj.childNodes[2].lastChild.innerHTML = '';

	PopupSkry ( 'popup_galeria' );
}

function GaleriaDalsiaFotka ()
{
	i_gallery_where++;

	if ( i_gallery_where == i_obrazok ) i_gallery_where = 0;

	var o_obj = document.getElementById ( 'popup_galeria' );

	if ( o_obj == null ) return;

	o_obj.childNodes[2].firstChild.src = '/swift_data/scripts/kiska/obrazok2.php?obrazok=' + a_obrazok_id[i_gallery_where] + '&velkost=3';
	o_obj.childNodes[2].lastChild.innerHTML = a_obrazok_opis[i_gallery_where];
}

function GaleriaPredchFotka ()
{
	i_gallery_where--;

	if ( i_gallery_where == -1 ) i_gallery_where = i_obrazok - 1;

	var o_obj = document.getElementById ( 'popup_galeria' );

	if ( o_obj == null ) return;

	o_obj.childNodes[2].firstChild.src = '/swift_data/scripts/kiska/obrazok2.php?obrazok=' + a_obrazok_id[i_gallery_where] + '&velkost=3';
	o_obj.childNodes[2].lastChild.innerHTML = a_obrazok_opis[i_gallery_where];
}

function HodnotenieUkaz ()
{
	var o_obj = document.getElementById ( 'popup_hodnotenie' );

	if ( o_obj == null ) return;

	PopupUkaz ( 'popup_hodnotenie' );
}

function HodnotenieSkry ()
{
	var o_obj = document.getElementById ( 'popup_hodnotenie' );

	if ( o_obj == null ) return;

	PopupSkry ( 'popup_hodnotenie' );
}

var i_zindex = 10;

function PopupUkaz ( s_elem )
{
	var o_obj = document.getElementById ( s_elem );

	if ( o_obj == null ) return;

	_Selecty ( false, "popis_main" );

	i_zindex++;

	o_obj.style.zIndex = i_zindex;
	o_obj.style.display = 'block';
}

function PopupSkry ( s_elem )
{
	var o_obj = document.getElementById ( s_elem );

	if ( o_obj == null ) return;

	i_zindex--;

	o_obj.style.display = 'none';

	var i_c = _PopupOpenedCount ();

	if ( i_c == 0 )
	{
		_Selecty ( true, "popis_main" );
	}
}

function _PopupOpenedCount ()
{
	var o = document.getElementsByTagName ( 'div' );
	var i_o = o.length;

	var i_c = 0;
	var i;

	for ( i=0; i<i_o; i++ )
	{
		if ( o[i].id.indexOf ( "popup_" ) != -1 )
		{
			if ( o[i].style.display == 'block' ) i_c++;			
		}		
	}

	return i_c;
}

function HodnotenieNastav ( i )
{
	var o_obj = null;

	for ( var a=1; a<=5; a++ )
	{
		o_obj = document.getElementById ( 'hviezda' + a );

		o_obj.src = a <= i ? hviezda1 : hviezda0;
	}
}

function HodnotenieVynuluj ( i )
{
	var o_obj = null;

	for ( var a=1; a<=5; a++ )
	{
		o_obj = document.getElementById ( 'hviezda' + a );

		o_obj.src = a <= i_hodnotenie ? hviezda1 : hviezda0;
	}
}

function HodnoteniePotvrd ( i )
{
	i_hodnotenie = i;

	document.forms['form_hodnotenie'].elements['Rating'].value = i_hodnotenie;
}

function ZobrazMeny ()
{
	var o_obj = document.getElementById ( 'div_meny' );

	if ( o_obj == null ) return;

	o_obj.style.display = o_obj.style.display == 'block' ? 'none' : 'block';
	o_obj.style.zIndex = "9999";	
}

function ZobrazReci ()
{
	var o_obj = document.getElementById ( 'div_reci' );

	if ( o_obj == null ) return;

	o_obj.style.display = o_obj.style.display == 'block' ? 'none' : 'block'; 
}

function ZobrazKrajiny ()
{
	var o_obj = document.getElementById ( 'div_krajiny' );

	if ( o_obj == null ) return;

	o_obj.style.display = o_obj.style.display == 'block' ? 'none' : 'block'; 
}

function Mapa ( s )
{
	var o = document.getElementById ( 'mapa_sr' );

	if ( o == null ) return;

	o.src = "/swift_data/source/images/mapa_" + s + ".gif";
	//alert ( o.src );
}

function UkazSkryFakturu ( o )
{
	var s_display1;
	var s_display2;

	if ( o.checked )
	{
		s_display1 = "block";
		s_display2 = "none";
	}else
	{
		s_display1 = "none";
		s_display2 = "block";
	}

	var o_obj = document.getElementById ( "form_faktura" );

	if ( o_obj != null )
	{
		o_obj.style.display = s_display1;
	}

	var o_obj = document.getElementById ( "button_odoslat_rezervaciu" );

	if ( o_obj != null )
	{
		o_obj.style.display = s_display2;
	}
}

function NastavMesiacDo ( o )
{
	var o_den_od = document.getElementById ( "den_zaciatok_pobytu" );
	var o_mesiac_od = document.getElementById ( "mesiac_zaciatok_pobytu" );
	var o_mesiac_do = document.getElementById ( "mesiac_koniec_pobytu" );

	if ( o.selectedIndex <= o_den_od.selectedIndex )
	{
		if ( o_mesiac_do.selectedIndex <= o_mesiac_od.selectedIndex )
		{
			if ( o_mesiac_od.selectedIndex < o_mesiac_do.options.length - 1 )
			{
				o_mesiac_do.selectedIndex = o_mesiac_od.selectedIndex + 1;
			}else {
				o_mesiac_do.selectedIndex = o_mesiac_do.options.length - 1;
			}
		}
	}

	UkazNoci ();
}

function NastavTerminOd ( o )
{
	if ( o.dateClicked )
	{
		var s_day = o.date.getDate ();
		var s_month = o.date.getMonth () + 1;
		if ( s_month < 10 ) s_month = "0" + s_month;
		var s_year = o.date.getFullYear ();
		var s_year_month = s_year.toString () + s_month.toString ();

		var o_day = document.getElementById ( "den_zaciatok_pobytu" );
		var i_day = o_day.options.length;
		for ( var i=0; i<i_day; i++ )
		{
			if ( o_day.options[i].value == s_day )
			{
				o_day.selectedIndex = i;

				break;
			}
		}

		var o_month = document.getElementById ( "mesiac_zaciatok_pobytu" );
		var i_month = o_month.options.length;
		for ( var i=0; i<i_month; i++ )
		{
			if ( o_month.options[i].value == s_year_month )
			{
				o_month.selectedIndex = i;

				break;
			}
		}

		NastavMesiacRok ( o_month );
	}
}

function NastavTerminDo ( o )
{
	if ( o.dateClicked )
	{
		var s_day = o.date.getDate ();
		var s_month = o.date.getMonth () + 1;
		if ( s_month < 10 ) s_month = "0" + s_month;
		var s_year = o.date.getFullYear ();
		var s_year_month = s_year.toString () + s_month.toString ();

		var o_day = document.getElementById ( "den_koniec_pobytu" );
		var i_day = o_day.options.length;
		for ( var i=0; i<i_day; i++ )
		{
			if ( o_day.options[i].value == s_day )
			{
				o_day.selectedIndex = i;

				break;
			}
		}

		var o_month = document.getElementById ( "mesiac_koniec_pobytu" );
		var i_month = o_month.options.length;
		for ( var i=0; i<i_month; i++ )
		{
			if ( o_month.options[i].value == s_year_month )
			{
				o_month.selectedIndex = i;

				break;
			}
		}

		NastavMesiacDo ( o_day );
	}
}

function UkazNoci ()
{
	var o_span_noci = document.getElementById ( "span_noci" );

	if ( o_span_noci == null ) return;	

	var s_pocet_noci = "";

	var o_start_den = document.getElementById ( "den_zaciatok_pobytu" );
	var o_start_mesiac_rok = document.getElementById ( "mesiac_zaciatok_pobytu" );

	var o_koniec_den = document.getElementById ( "den_koniec_pobytu" );
	var o_koniec_mesiac_rok = document.getElementById ( "mesiac_koniec_pobytu" );

	if ( 	o_start_den.options[o_start_den.selectedIndex].value != "" &&
		o_start_mesiac_rok.options[o_start_mesiac_rok.selectedIndex].value != "" &&
		o_koniec_den.options[o_koniec_den.selectedIndex].value != "" &&
		o_koniec_mesiac_rok.options[o_koniec_mesiac_rok.selectedIndex].value != "" )
	{
		var i_start_den = o_start_den.options[o_start_den.selectedIndex].value;
		var i_start_mesiac = o_start_mesiac_rok.options[o_start_mesiac_rok.selectedIndex].value.substring ( 4 ) * 1;
		var i_start_rok = o_start_mesiac_rok.options[o_start_mesiac_rok.selectedIndex].value.substring ( 0, 4 );

		var i_koniec_den = o_koniec_den.options[o_koniec_den.selectedIndex].value;
		var i_koniec_mesiac = o_koniec_mesiac_rok.options[o_koniec_mesiac_rok.selectedIndex].value.substring ( 4 ) * 1;
		var i_koniec_rok = o_koniec_mesiac_rok.options[o_koniec_mesiac_rok.selectedIndex].value.substring ( 0, 4 );

		i_pocet_noci = _PocetNoci ( i_start_den, i_start_mesiac, i_start_rok, i_koniec_den, i_koniec_mesiac, i_koniec_rok );

		s_pocet_noci = i_pocet_noci;

		if ( i_pocet_noci == 1 )
		{
			s_pocet_noci += " " + s_noci[1];
		}else if ( i_pocet_noci >= 2 && i_pocet_noci <= 4 )
		{
			s_pocet_noci += " " + s_noci[2];
		}else
		{
			s_pocet_noci += " " + s_noci[0];
		}
	}else
	{
		s_pocet_noci = "&nbsp;";
	}

	o_span_noci.innerHTML = s_pocet_noci;
}

function _PocetNoci ( i_start_den, i_start_mesiac, i_start_rok, i_koniec_den, i_koniec_mesiac, i_koniec_rok )
{
	var i_start = new Date ( i_start_rok, i_start_mesiac - 1, i_start_den );
	var i_end = new Date ( i_koniec_rok, i_koniec_mesiac - 1, i_koniec_den );

	var i_den = 86400000;

	var i_start_ms = i_start.getTime ();
	var i_end_ms = i_end.getTime ();

	var i_rozdiel_ms = i_end_ms - i_start_ms;

	var i_dni = Math.ceil ( i_rozdiel_ms / i_den );

	if ( i_dni < 0 )
	{
		i_dni = 0;
	}

	return i_dni;
}

function NastavMesiacRok ( o )
{
	var o_do = document.getElementById ( "mesiac_koniec_pobytu" );

	if ( o.options[o.selectedIndex].value != "" && o_do.options[o_do.selectedIndex].value == "" )
	{
		o_do.selectedIndex = o.selectedIndex;
	}

	UkazNoci ();
}

function TextPobytu ( o )
{
	var o_text = document.getElementById ( "pobyty_text" );

	var s_text = a_pobyty_text[o.selectedIndex];

	o_text.innerHTML = s_text;
}

function TextIzby ( o )
{
	var o_text = document.getElementById ( "izby_text" );

	var s_text = a_izby_text[o.selectedIndex];

	o_text.innerHTML = s_text;
}

function PridatIzbu ()
{
	var o = document.getElementById ( "table_nova_izba" );

	if ( o == null ) return;

	o.style.display = "block";
}

function UkazRozsirene ()
{
	var o_div = document.getElementById ( "div_rozsirene" );

	if ( o_div == null ) return;

	o_div.style.display = "block";

	o_div = document.getElementById ( "div_rozsirene_ukaz" );

	if ( o_div == null ) return;

	o_div.style.display = "none";

	o_input = document.getElementById ( "rozsirene" );

	if ( o_input == null ) return;

	o_input.value = "1";
}

function SkryRozsirene ()
{
	var o_div = document.getElementById ( "div_rozsirene" );

	if ( o_div == null ) return;

	o_div.style.display = "none";

	o_div = document.getElementById ( "div_rozsirene_ukaz" );

	if ( o_div == null ) return;

	o_div.style.display = "block";

	o_input = document.getElementById ( "rozsirene" );

	if ( o_input == null ) return;

	o_input.value = "0";
}

function Priprav ( s_default, o )
{
	if ( o.value == s_default )
	{
		o.value = "";
	}
}

function UkazSkryPoplatok ( b )
{
	var o_poplatok = document.getElementById ( "poplatok_na_mieste" );

	if ( o_poplatok == null ) return;

	o_poplatok.style.display = b ? 'inline' : 'none';
}

function UkazSkryPrihlasenie ( b )
{
	var o_prihlasenie = document.getElementById ( "div_prihlasenie" );

	if ( o_prihlasenie == null ) return;

	o_prihlasenie.style.display = b ? 'block' : 'none';

	if ( b )
	{
		var o_prihlasovacie_meno = document.getElementById ( "prihlasovacie_meno" );

		if ( o_prihlasovacie_meno == null ) return;

		o_prihlasovacie_meno.focus ();
	}
}

function UkazSkry ( s )
{
	var o = document.getElementById ( s );

	if ( o == null ) return;

	o.style.display = o.style.display == 'none' ? 'block' : 'none';
}

function VymazCenu ()
{
	var o;
	var i;

	for ( i=1; i<50; i++ )
	{
		o = document.getElementById ( "cena" + i );
		if ( o == null )
		{
			break;
		}

		o.style.display = "none";
	}

	o = document.getElementById ( "id_prepocitat_cenu" );
	if ( o != null )
	{
		o.style.color = "#df0000";
	}
}

function UkazSkryPsa ( o )
{
	var o_pes = document.getElementById ( "id_velkost_psa" );

	if ( o_pes == null ) return;

	o_pes.style.display = o.checked ? "block" : "none";
}

function UkazTypPobytu ( o )
{
	var div = o.nextSibling;

	if ( div == null ) return;

	div = div.nextSibling;

	if ( div == null ) return;

	div = div.nextSibling;

	if ( div == null ) return;

	div.style.display = div.style.display == "none" ? "block" : "none";
}

function UkazSkryZameranie ( o )
{
	/*
	var div = o.parentNode.nextSibling;

	if ( div == null ) return;

	div.style.display = div.style.display == "none" ? "block" : "none";
	*/

	var o_komentar = o.parentNode.nextSibling;
	var o_bodky = o_komentar.nextSibling;

	o_komentar = o_bodky.nextSibling;

	if ( o_komentar.style.display != "none" )
	{
		o_bodky.style.display = "inline";
		o_komentar.style.display = "none";
	}else
	{	
		o_bodky.style.display = "none";
		o_komentar.style.display = "inline";
	}

}

function _PridajNulu ( i )
{
	if ( i == "" ) i = "00";
	else if ( i < 10 ) i = "0" + i;

	return i;
}

function SkontrolujDatum ( s )
{
	//return;

	var den_zaciatok_pobytu = document.getElementById ( "den_zaciatok_pobytu" );
	var mesiac_zaciatok_pobytu = document.getElementById ( "mesiac_zaciatok_pobytu" );
	var den_koniec_pobytu = document.getElementById ( "den_koniec_pobytu" );
	var mesiac_koniec_pobytu = document.getElementById ( "mesiac_koniec_pobytu" );	

	var zaciatok_den = den_zaciatok_pobytu.options[den_zaciatok_pobytu.selectedIndex].value;
	var zaciatok_mesiac = mesiac_zaciatok_pobytu.options[mesiac_zaciatok_pobytu.selectedIndex].value;
	var koniec_den = den_koniec_pobytu.options[den_koniec_pobytu.selectedIndex].value;
	var koniec_mesiac = mesiac_koniec_pobytu.options[mesiac_koniec_pobytu.selectedIndex].value;

	if ( zaciatok_den == "" || zaciatok_mesiac == "" || koniec_den == "" || koniec_mesiac == "" ) return;

	var mesiac_zaciatok_pobytu_l = mesiac_zaciatok_pobytu.options.length;
	var mesiac_koniec_pobytu_l = mesiac_koniec_pobytu.options.length;

	var z = zaciatok_mesiac + _PridajNulu ( zaciatok_den );
	var k = koniec_mesiac + _PridajNulu ( koniec_den );

	if ( z < k ) return;

	if ( s == 'zaciatok' )
	{
		var tmp = k;
		var i = 0;
		while ( tmp < z )
		{
			if ( i++ == 100 ) break;

			if ( mesiac_koniec_pobytu.selectedIndex + i >= mesiac_koniec_pobytu_l ) break;

			tmp = mesiac_koniec_pobytu.options[mesiac_koniec_pobytu.selectedIndex+i].value + _PridajNulu ( koniec_den );
		}

		alert ( tmp );
	}else
	{
		if ( den_koniec_pobytu == "" || mesiac_koniec_pobytu == "" || z < k ) return;
	}
}

function EUR2SKK ( o )
{
	var form = o.form;
	var from_skk = ( o.name == "conv_to" );
	var ofrom = form.elements["conv_from"];
	var oto = form.elements["conv_to"];

	if ( !from_skk )
	{
		var eur = ofrom.value.replace ( /,+/, "." );
		var skk = '';

		if ( !isNaN ( eur ) )
		{
			skk = eur * konverzny_kurz * 100;
			skk = Math.round ( skk );
			skk /= 100;
			skk = String ( skk );
			skk = skk.replace ( /\./, "," );			
		}

		oto.value = skk;
	}else
	{
		var skk = oto.value.replace ( /,+/, "." );
		var eur = '';

		if ( !isNaN ( skk ) )
		{
			eur = ( skk / konverzny_kurz ) * 100;
			eur = Math.round ( eur );
			eur /= 100;
			eur = String ( eur );
			eur = eur.replace ( /\./, "," );			
		}

		ofrom.value = eur;
	}
}

function conv_calc(form)
{
	var from = parseFloat(form.conv_from.value.replace(/,/, '.'));
	var from_valuta=parseFloat(form.conv_from_valuta.value);
	var to_valuta=parseFloat(form.conv_to_valuta.value);
	var result, result_str;

	if (isNaN(from) || isNaN(from_valuta) || isNaN(to_valuta))
		form.conv_to.value = '';
	else
	{
		result = from * ( to_valuta / from_valuta );
		if (isNaN(result))
			form.conv_to.value = '';
		else
		{
			result_str = String(result);
			if (result_str.indexOf('.') == 0)
				result_str = '0' + result_str;
			else if (result_str.indexOf('.') == -1)
				result_str = result_str + '.';
			result_str = result_str + '00000';
			result_str = result_str.substring(0, result_str.indexOf('.') + 3);
			form.conv_to.value = result_str.replace(/\./g, ',');
		}
	}
}

function UkazKomentar ( o )
{
	var o_komentar = o.nextSibling;

	o_komentar = o_komentar.nextSibling;
	var o_bodky = o_komentar.nextSibling;

	o_komentar = o_bodky.nextSibling;

	o_bodky.style.display = "none";
	o_komentar.style.display = "inline";
}

function SkryKomentar ( o )
{
	var o_parent = o.parentNode;
	var o_komentar = o_parent.previousSibling;

	o_parent.style.display = "none";
	o_komentar.style.display = "inline";
}

function UkazSkryKomentar ( o )
{
	var o_komentar = o.nextSibling;

	o_div = o_komentar.nextSibling;

	var o_bodky = o_div.firstChild;
	o_bodky = o_bodky.nextSibling;

	o_komentar = o_bodky.nextSibling;

	if ( o_komentar.style.display != "none" )
	{
		o_bodky.style.display = "inline";
		o_komentar.style.display = "none";
		o_div.className = "komentar";
	}else
	{	
		o_bodky.style.display = "none";
		o_komentar.style.display = "inline";
		o_div.className = "komentaro";
	}
}

function Viac ( o )
{
	if ( o.options[o.selectedIndex].value == 'viac' )
	{
		o.options.length = 1;

		var i;
		for ( i=1; i<=50; i++ )
		{
			o.options[i] = new Option ( i, i );
		}

		o.selectedIndex = 50;
	}
}