<!--
function CheckJpeg(StrPath)
{
	var ext = StrPath.substr(StrPath.lastIndexOf(".") + 1).toLocaleLowerCase();
	if (ext != "jpg" && ext != "jpeg")
		return false;
	else
		return true;
}

function avui(){
	today = new Date()
	day = today.getDay()
	if ( day == 0 ) { 
		document.write("Diumenge, ");
	}
	if ( day == 1 ) {
		document.write("Dilluns, ");
	}
	if ( day == 2 ) {
		document.write("Dimarts, ");
	}
	if ( day == 3 ) {
		document.write("Dimecres, ");
	}
	if ( day == 4 ) {
		document.write("Dijous, ");
	}
	if ( day == 5 ) {
		document.write("Divendres, ");
	}
	if ( day == 6 ) {
		document.write("Dissabte, ");
	}
	
	today = new Date()
	hours = today.getHours()
	minutes = today.getMinutes()
	year = parseInt(today.getYear(),10)
	
	zerom = ''
	zeroh = ''
	if ( minutes < 10 ) { zerom = 0 }
	if ( hours < 10 ) { zeroh = 0 }
	
	if ( today.getMonth() == 0 ) { month = "de gener" }
	if ( today.getMonth() == 1 ) { month = "de febrer" }
	if ( today.getMonth() == 2 ) { month = "de març" }
	if ( today.getMonth() == 3 ) { month = "d'abril" }
	if ( today.getMonth() == 4 ) { month = "de maig" }
	if ( today.getMonth() == 5 ) { month = "de juny" }
	if ( today.getMonth() == 6 ) { month = "de juliol" }
	if ( today.getMonth() == 7 ) { month = "d'agost" }
	if ( today.getMonth() == 8 ) { month = "de setembre" }
	if ( today.getMonth() == 9 ) { month = "d'octubre" }
	if ( today.getMonth() == 10 ) { month = "de novembre" }
	if ( today.getMonth() == 11 ) { month = "de desembre" }
	if ( today.getYear() == 99 ) { year = "1999" }
	if ( today.getYear() == 0 || today.getYear() == 100 || today.getYear() == 2000) { year = "2000" }
	document.write( today.getDate()," ",month," del ",year );
}

function hora() {		
        var h = new Date();	
		document.write(h.getHours()+":"+h.getMinutes());
}

function ChangeSelect( List, FirstSelect, SecondSelect, selected){

	var SelectedArray = eval( List + selected );
	while( SelectedArray.length < SecondSelect.options.length)
		SecondSelect.options[(SecondSelect.options.length - 1)] = null;
	
	for( var i=0; i < SelectedArray.length; i++ )
		eval( "SecondSelect.options[i]=" + "new Option" + SelectedArray[i] );

	if( FirstSelect.options[0].value == '' ){
		FirstSelect.options[0]= null;
	}
}

function MM_openBrWindow( theURL, winName, features ) { //v2.0

  window.open( theURL, winName, features );

}

function ShowMessage( element, message, BolSelect ) {

	alert( message );
	element.focus();
	if( BolSelect )
		element.select();

}

function rellotge(){

	var Digital = new Date();
	var hours = Digital.getHours();
	var minutes = Digital.getMinutes();
	var seconds = Digital.getSeconds();

	if(hours < 10)
		hours = "0" + hours;
	
	if(minutes < 10)
		minutes = "0" + minutes;

	if(seconds < 10)
		seconds = "0" + seconds;

	//document.all.prova = hours + ":" + minutes + ":" + seconds;
	MM_setTextOfLayer('rellotge','',hours + ":" + minutes + ":" + seconds);

	setTimeout("rellotge()",1000)

}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_setTextOfLayer(objName,x,newText) { //v4.01
  if ((obj=MM_findObj(objName))!=null) with (obj)
    if (document.layers) {document.write(unescape(newText)); document.close();}
    else innerHTML = unescape(newText);
}

function pviiW3Cbg(obj, pviiColor) { //v1.1 by Project VII

	obj.style.backgroundColor=pviiColor;

}
function isValidEmail( sEmail ) { 

	var emailexp = /[a-z_0-9\-\.]@[a-z_0-9\-\.]+\.([a-z]{2}|[a-z]{3})$/i;
	if( emailexp.test( sEmail ) ) 
		return true;
	else 
		return false; 

} 


//-->
