function $(id)
{
	return document.getElementById(id);
} // $


function is_empty(str)
{
	return ( str==null || str==0 || str=="" || str.length<1 );
} // is_empty


//funtion value Form
function contentVerification(){

	var finalMessage = "";
	var error = false;


	var nombre = $('nombre').value;
	var empresa = $('empresa').value;
	var pais = $('pais').options[$('pais').selectedIndex].value;
	var telefono = $('telefono').value;
	var email = $('email').value;
	var comentario = $('comentario').value;


	if ( is_empty(nombre) )
	{
		finalMessage += "* Nombre.\n";
		error = true;
	}

	if ( is_empty(empresa) )
	{
		finalMessage += "* Empresa.\n";
		error = true;
	}

	if ( is_empty(pais) )
	{
		finalMessage += "* Pais.\n";
		error = true;
	}

	if ( is_empty(telefono)  || !is_email(telefono) )
	{
		finalMessage += "* Telefono.\n";
		error = true;
	}

	 if (is_empty(email) )
	{
		finalMessage += "* Email.\n";
		error = true;
	}

	if (is_empty(comentario) )
	{
		finalMessage += "* Comentario.\n";
		error = true;
	}

		if ( error == false )
	{
		return true;
	}
	else
	{
		alert("Ha ocurrido un error, por favor introduzca informacion en los siguientes espacios:\n\n"+finalMessage);
		return false;
	}

}// contentVerification

// fuction to use target blank in xhtml strict
function transformExternalAnchors()
{
	var i,a,f;
	if ( document.getElementsByTagName )
	{

		a = document.getElementsByTagName("a");
		i = 0;

		// for using in normal href tag, you you have to add: rel="external"
		// example: <a href="http://affiliate.dptsportsgroup.com" rel="external">Affiliate program</a>
		for(i=0;i<a.length;i++)
		{
			if ( a[i].getAttribute('href') && ( a[i].getAttribute("rel")=="external" ) )
			{
				a[i].target = "_blank";
			}
		} // for

		f = document.getElementsByTagName("form");
		i = 0;

		// for using in forms, you have to add in the form tag: title="external"
		// example: 		<form action=# id="frmId" title="external"></form>
		for(i=0;i<f.length;i++)
		{
			if ( f[i].getAttribute('action') && ( f[i].getAttribute("title")=="external" ) )
			{
				f[i].target = "_blank";
			}
		} // for
	} // if
} // transformExternalAnchors

window.onload = transformExternalAnchors;