///////////////////
function getElementsByRegexpName(container_obj,s_regexp,tag_name)
{
	return getElementsByRegexp(container_obj,s_regexp,tag_name,'name');
}

function getElementsByRegexpId(container_obj,s_regexp,tag_name)
{
	return getElementsByRegexp(container_obj,s_regexp,tag_name,'id');
}

function getElementsByRegexp(container_obj,s_regexp,tag_name,s_method)
{
	var tmp_array_objs = container_obj.getElementsByTagName(tag_name);
	var array_objs     = new Array();

	var regexp_obj = new RegExp(s_regexp,"i");
	for(var i=0;i<tmp_array_objs.length;i++)
	{
		if(s_method=='name')
		{

			if(regexp_obj.exec(tmp_array_objs[i].name))
			{
				array_objs[array_objs.length] = tmp_array_objs[i];
			}
		}
		else if(s_method=='id')
		{
			if(regexp_obj.exec(tmp_array_objs[i].id))
			{
				array_objs[array_objs.length] = tmp_array_objs[i];
			}
		}
		else
		{
			return false;
		}
	}

	return array_objs;
}

function escribecorreo(){
	var elcorr=	"ref"+"&#111;rmared@"+"reform&#97;re"+"d&#46;&#99;o&#109;";
	document.write(elcorr);
}

function add_favorito()
{
	var my_url = 'http://www.reformared.com';
	var my_title = 'ReformaRed, Portal de reformas en Internet';

	if (window.sidebar)
	{
		// Mozilla Firefox Bookmark
		window.sidebar.addPanel(my_title, my_url,"");
	}
	else if( window.external )
	{
		// IE Favorite
		window.external.AddFavorite(my_url,my_title);
	}
}

function abrecondiciones(theURL)
{
	winName = "vcondiciones";
	features = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=500,height=300,left=250,top=150";
	var ventanacondiciones;
	ventanacondiciones = window.open(theURL,winName,features);

	if(ventanacondiciones)
	{
		ventanacondiciones.focus();
	}
}
