// JavaScript Document
<!--
function RecuperaClau( mail, href, target )
{
      if ( CheckEmail( mail.value ) ) {
            window.open( href + '?email=' + mail.value, target, 'width=350,height=140' );
      } else {
	  		window.open( href, target, 'width=350,height=140' );
	  }
      return false;
}
function CheckEmail( string )
{
	if (!string) return false;
	if (!isAGoodString(string) == false) return false;
	if (string.search(/^([0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*@(([0-9a-zA-Z])+([-\w]*[0-9a-zA-Z])*\.)+[a-zA-Z]{2,9})$/) == -1)
		return false;			
	return true;
}
function isAGoodString( string )
{
	if (!string) return false;
	var badChars = "*|,\":<>[]{}`\';()@&$#%";
	for (var i = 0; i < string.length; i++) {
		if (badChars.indexOf(string.charAt(i)) != -1)
			return false;
	}
	return true;
}

/* seleccionar anuncis; */

function add_ad(Id,sessio){
today = new Date();
ult=open("/add_ad.php?Id="+Id+"&sessio="+sessio+"&T="+today.getSeconds(),"add_ad","width=350,height=350,left=200, top=200,status=no,menubar=no,scrollbars=no,resizable=no");
}
function des_add_ad(Id,sessio){
today = new Date();
ult=open("/des_add_ad.php?Id="+Id+"&sessio="+sessio+"&T="+today.getSeconds(),"add_ad","width=350,height=350,left=200, top=200,status=no,menubar=no,scrollbars=no,resizable=no");
}

/* obre no spam*/
function NoSpam(href, target )
{
	window.open( href, target, 'width=500,height=350,status=no,menubar=no,scrollbars=yes,resizable=no' );
    return false;
}

/* obre no spam*/
function Amic(href, target )
{
	window.open( href, target, 'width=600,height=500,status=no,menubar=no,scrollbars=yes,resizable=no' );
    return false;
}

/* obre no spam*/
function Tel(href, target )
{
	window.open( href, target, 'width=600,height=500,top=50,left=50,status=no,menubar=no,scrollbars=yes,resizable=no' );
    return false;
}

/* obre empresa*/
function Empresa(href, target )
{
	window.open( href, target, 'width=600,height=500,top=50,left=50,status=no,menubar=no,scrollbars=yes,resizable=no' );
    return false;
}

/* obre acces professional*/
function acces_professional(href, target )
{
	window.open( href, target, 'width=600,height=500,top=50,left=50,status=no,menubar=no,scrollbars=yes,resizable=no' );
    return false;
}

/* obre acces professional*/
function web_client(form){
var URL = document.form5.url_client.options[document.form5.url_client.selectedIndex].value;
window.open(URL);
}
//-->