//
//---------------------------------
//		
//FUNCIONES DE CREACION DE LISTBOXES EN LAS PAGINAS DE LOS PUBLICOS
function addToSelect(ctrl,val,txt)
{
	if (txt != "")
	{
		if (val != "")
		{
			var myNewOption = new Option(txt,val);	
			document.getElementById(ctrl).add(myNewOption); 
		}
		else
		{
			alert("Escribe el valor");
		}
	}
	else
	{
		alert("Escribe el texto");
	}
}
function DelFromSelect(ctrl)
{
	if (document.getElementById(ctrl).selectedIndex != -1)
	{
		document.getElementById(ctrl).options[document.getElementById(ctrl).selectedIndex] = null;
	}
	else
	{
		alert("Debes seleccionar un elemento de la lista '"+ document.getElementById(ctrl).id + "' para poder continuar"); 
	}
}
function ViewElementsInString(ctrl1,ctrl2)
{
	var str = "";
	var coll = document.getElementById(ctrl1);
	if (coll.length	>0) 
	{				
		if (coll.length == 1)
		{
			if (ctrl1 == "links1")
			{
				var myNewOption = new Option("Enlaces Sugeridos...","");	
			}
			else if (ctrl1 == "links2")
			{
				var myNewOption = new Option("Reservas...","");	
			}						
			document.getElementById(ctrl1).add(myNewOption,0);
		}
		var tales = confirm("Desea salvar los items del control " + ctrl1 + "?");
		if (tales)
		{
			for (i=0; i< coll.options.length; i++)
			{
				str += "<option value=" + coll.options(i).value + ">" + coll.options(i).text + "</option>";
			}
			document.getElementById(ctrl2).value = str;
			alert("Items Salvados");
		}
	}							
}			
function Redirector(strhref)
{
	//alert(strhref);
	window.location.href = strhref;
}