
var xOp7Up,xOp6Dn,xIE4Up,xIE4,xIE5,xNN4,xUA=navigator.userAgent.toLowerCase();if(window.opera){var i=xUA.indexOf('opera');if(i!=-1){var v=parseInt(xUA.charAt(i+6));xOp7Up=v>=7;xOp6Dn=v<7;}}else if(navigator.vendor!='KDE' && document.all && xUA.indexOf('msie')!=-1){xIE4Up=parseFloat(navigator.appVersion)>=4;xIE4=xUA.indexOf('msie 4')!=-1;xIE5=xUA.indexOf('msie 5')!=-1;}else if(document.layers){xNN4=true;}xMac=xUA.indexOf('mac')!=-1;function xDef(){for(var i=0; i<arguments.length; ++i){if(typeof(arguments[i])=='undefined') return false;}return true;}function xDisplay(e,s){if(!(e=xGetElementById(e))) return null;if(e.style && xDef(e.style.display)) {if (xStr(s)) e.style.display = s;return e.style.display;}return null;}function xGetElementById(e){if(typeof(e)!='string') return e;if(document.getElementById) e=document.getElementById(e);else if(document.all) e=document.all[e];else e=null;return e;}function xStr(s){for(var i=0; i<arguments.length; ++i){if(typeof(arguments[i])!='string') return false;}return true;}

function ampliaImatges(imatge)
{

obj=document.getElementById("imatgeGran");
obj.src = imatge;   
	
}

function personal ()
{
		xDisplay('obreempresa', 'none');
}

function obreempresa ()
{
	 xDisplay('obreempresa', 'block');
}

function proteccio ()
{
	if (document.getElementById('dades').style.display =='block')
	{
		xDisplay('dades', 'none');
	}
	else
	{
	 xDisplay('dades', 'block');
	}

}

/**
 * SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 */
if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return "";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;


//VALIDACIÓ FORMULARIS

//funcions generals 

function esta_ple(d1)
{
/* Torna
	0: Camp Buit
	1: Camp Ple
*/
	if (d1.value=='')
		return 0;
	else
		return 1;
}


function mira_email(email) {
/* Torna
        0: no hi ha res
        1: si es correcte
        9: email incorrecte
*/

if(email.value!="")
   {
   if (/^[A-Za-z0-9\.+_-]+@[A-Za-z0-9\.-]+\.[A-Za-z]{2,6}$/.test(email.value))
  	{
	return 1;
	}
	else
	{
	return 9;
	}
   }
else
   {
	return 0;
   }
}


function comprova_radio(que,longitud)
{

/*
        Retorna 0 si no hi ha cap seleccio
        Retorna el numero d'ordre de la seleccionada (començant per 1)
*/
                value=0;
                for(i=0;i<longitud;i++)
                {

                        if(que[i].checked == true)
                        {
                                value=i+1;
                        }
                }
                return value;
}



function alerta_en (str)
{
	alert("Check the field " + str + " ...");
}


function alerta_ca (str)
{
	alert("Revisa el camp " + str + " ...");
}

function alerta_fr (str)
{
	alert("Contrôlez le champ " + str + " ...");
}

function alerta_es (str)
{
	alert("Revisa el campo " + str + " ...");
}



// valida contactar


function contactar_ca()
{
        with (document.form1)
               {
               	result1 = esta_ple(nom);
				result2 = esta_ple(cognom1);

				result5 = mira_email(email);
				result6 = esta_ple(consulta);
				
				
				 if (condicions.checked)  
					{
					result8=0;
					}
					else
					{
					result8=1;      
					}


				

               if (result1 == 0)
               {
				pinta_blanc();
				alerta_ca('Nom');
				document.getElementById('nom').style.background = '#FFEFEF';
				nom.focus();
				return false;
				}
				
				else if (result2 == 0)
               {		
			   
			    pinta_blanc();
				alerta_ca('Primer Cognom');
				document.getElementById('cognom1').style.background = '#FFEFEF';
				cognom1.focus();
				return false;
				}
				

				
		
				

								
               else if (result5 != 1)
               {
				pinta_blanc();
				alert('Escriu una adreça de correu electrònic vàlida');
				document.getElementById('email').style.background = '#FFEFEF';
				email.focus();
				return false;
				}
				
				else if (result6 == 0)
               {		
			   
			    pinta_blanc();
				alerta_ca('Consulta');
				document.getElementById('consulta').style.background = '#FFEFEF';
				consulta.focus();
				return false;
				}	
				
			else if (result8==1)
		    {
			pinta_blanc();
		    alert("Ha de llegir i acceptar la Protecció de dades");
		    return false;        
			}

				
		

	       else 
		   {
		   document.getElementById('realname').value = document.getElementById('nom').value;
		   submit();
		   }
       }
}


 function pinta_blanc ()
 {
	document.getElementById('nom').style.background = '#FFF';
	document.getElementById('cognom1').style.background = '#FFF';


	document.getElementById('email').style.background = '#FFF';
	document.getElementById('consulta').style.background = '#FFF';

 }
 
 
 
 
 function inscripcio_ca()
{
        with (document.form1)
               {
               	result1 = esta_ple(nom);
				result2 = esta_ple(cognoms);

				result5 = mira_email(email);
				//result6 = esta_ple(comentaris);
				
				
				 if (condicions.checked)  
					{
					result8=0;
					}
					else
					{
					result8=1;      
					}


				

               if (result1 == 0)
               {
				pinta_blanc2();
				alerta_ca('Nom');
				document.getElementById('nom').style.background = '#FFEFEF';
				nom.focus();
				return false;
				}
				
				else if (result2 == 0)
               {		
			   
			    pinta_blanc2();
				alerta_ca('Cognoms');
				document.getElementById('cognoms').style.background = '#FFEFEF';
				cognoms.focus();
				return false;
				}
				

				
		
				

								
               else if (result5 != 1)
               {
				pinta_blanc2();
				alert('Escriu una adreça de correu electrònic vàlida');
				document.getElementById('email').style.background = '#FFEFEF';
				email.focus();
				return false;
				}
				
				//else if (result6 == 0)
               //{		
			   
			   // pinta_blanc2();
				//alerta_ca('Comentaris');
				//document.getElementById('comentaris').style.background = '#FFEFEF';
				//comentaris.focus();
				//return false;
				//}	
				
			else if (result8==1)
		    {
			pinta_blanc2();
		    alert("Ha de llegir i acceptar la Protecció de dades");
		    return false;        
			}

				
		

	       else 
		   {
		   document.getElementById('realname').value = document.getElementById('nom').value;
		   submit();
		   }
       }
}

 function pinta_blanc2 ()
 {
	document.getElementById('nom').style.background = '#FFF';
	document.getElementById('cognoms').style.background = '#FFF';


	document.getElementById('email').style.background = '#FFF';
	document.getElementById('comentaris').style.background = '#FFF';

 }
 
 
 function publicar_ca()
{
        with (document.form1)
               {
               	result1 = esta_ple(empresa);
				result2 = esta_ple(poblacio);
				result3 = esta_ple(telefon);
				result5 = mira_email(email);
				result6 = esta_ple(ambit);
				
			

               if (result1 == 0)
               {
				pinta_blanc3();
				alerta_ca('Empresa');
				document.getElementById('empresa').style.background = '#FFEFEF';
				empresa.focus();
				return false;
				}
				
				else if (result2 == 0)
               {		
			   
			    pinta_blanc3();
				alerta_ca('Poblacio');
				document.getElementById('poblacio').style.background = '#FFEFEF';
				poblacio.focus();
				return false;
				}
				
				else if (result3 == 0)
               {		
			   
			    pinta_blanc3();
				alerta_ca('Telèfon');
				document.getElementById('telefon').style.background = '#FFEFEF';
				telefon.focus();
				return false;
				}

				
	
								
               else if (result5 != 1)
               {
				pinta_blanc3();
				alert('Escriu una adreça de correu electrònic vàlida');
				document.getElementById('email').style.background = '#FFEFEF';
				email.focus();
				return false;
				}
				
				else if (result6 == 0)
               {		
			   
			    pinta_blanc3();
				alerta_ca('Àmbit');
				document.getElementById('ambit').style.background = '#FFEFEF';
				ambit.focus();
				return false;
				}	
				

	       else 
		   {
		  submit();
		   }
       }
}
 
 function pinta_blanc3 ()
 {
	document.getElementById('empresa').style.background = '#FFF';
	document.getElementById('poblacio').style.background = '#FFF';
	document.getElementById('telefon').style.background = '#FFF';
	document.getElementById('email').style.background = '#FFF';
	document.getElementById('ambit').style.background = '#FFF';

 }
 
 
 
 
 
 function solicitud_ca()
{
        with (document.form1)
               {
               	result1 = esta_ple(nom);
				
				result3 = esta_ple(adreca);
				result4 = esta_ple(cp);
				result5 = esta_ple(poblacio);
				result6 = esta_ple(telefon);
				result7 = esta_ple(activitat);
				result8 = esta_ple(nif);
				result9 = mira_email(email);

				 if (condicions.checked)  
					{
					result10=0;
					}
					else
					{
					result10=1;      
					}


				

               if (result1 == 0)
               {
				pinta_blanc4();
				alerta_ca('Nom i cognoms');
				document.getElementById('nom').style.background = '#FFEFEF';
				nom.focus();
				return false;
				}
				
				
				
				else if (result3 == 0)
               {		
			   
			    pinta_blanc4();
				alerta_ca('Adreça');
				document.getElementById('adreca').style.background = '#FFEFEF';
				adreca.focus();
				return false;
				}
				
				else if (result4 == 0)
               {		
			   
			    pinta_blanc4();
				alerta_ca('C.P.');
				document.getElementById('cp').style.background = '#FFEFEF';
				cp.focus();
				return false;
				}
				
				else if (result5 == 0)
               {		
			   
			    pinta_blanc4();
				alerta_ca('Població');
				document.getElementById('poblacio').style.background = '#FFEFEF';
				poblacio.focus();
				return false;
				}
				
				else if (result6 == 0)
               {		
			   
			    pinta_blanc4();
				alerta_ca('Telèfon');
				document.getElementById('telefon').style.background = '#FFEFEF';
				telefon.focus();
				return false;
				}
				
				else if (result7 == 0)
               {		
			   
			    pinta_blanc4();
				alerta_ca('Activitat actual');
				document.getElementById('activitat').style.background = '#FFEFEF';
				activitat.focus();
				return false;
				}
				
				else if (result8 == 0)
               {		
			   
			    pinta_blanc4();
				alerta_ca('NIF');
				document.getElementById('nif').style.background = '#FFEFEF';
				nif.focus();
				return false;
				}
				
			
               else if (result9 != 1)
               {
				pinta_blanc4();
				alert('Escriu una adreça de correu electrònic vàlida');
				document.getElementById('email').style.background = '#FFEFEF';
				email.focus();
				return false;
				}
	
			else if (result10==1)
		    {
			pinta_blanc4();
		    alert("Ha de llegir i acceptar la Protecció de dades");
		    return false;        
			}

	       else 
		   {
		   document.getElementById('realname').value = document.getElementById('nom').value;
		   submit();
		   }
       }
}

 function pinta_blanc4 ()
 {
	document.getElementById('nom').style.background = '#FFF';
	document.getElementById('numero_colegiat').style.background = '#FFF';
	document.getElementById('adreca').style.background = '#FFF';
	document.getElementById('cp').style.background = '#FFF';
	document.getElementById('poblacio').style.background = '#FFF';
	document.getElementById('telefon').style.background = '#FFF';
	document.getElementById('activitat').style.background = '#FFF';
	document.getElementById('nif').style.background = '#FFF';
	document.getElementById('email').style.background = '#FFF';

 }
 
 
 
 
 
 
 
  function tramit1_ca()
{
        with (document.form1)
               {
               	result1 = comprova_radio(colegiat_anteriorment,2);
				result2 = esta_ple(nom);
				result3 = esta_ple(cognoms);
				result4 = esta_ple(data_naixament);
				result5 = esta_ple(adreca);
				result6 = esta_ple(cp);
				result7 = esta_ple(poblacio);
				result8 = esta_ple(provincia);
				result9 = esta_ple(demarcacio);
				result9a = mira_email(email);
				result10 = esta_ple(telefon);
				
				result10a = esta_ple(dni);
				result10b = esta_ple(fotografia);
				result10c = comprova_radio(autoritzo,2);
				
				result11 = esta_ple(escola_universitat);
				result12 = esta_ple(data_expedicio);
				result13 = esta_ple(especialitat);
				result14 = esta_ple(entitat_bancaria);
				result15 = esta_ple(poblacio_entitat);
				result16 = esta_ple(numero_compte);


               if (result1 == 0)
               {
				pinta_blanc5();
				alerta_ca('Has estat col·legiat anteriorment al COETAPAC');
		
				return false;
				}
				
				else if (result2 == 0)
               {		
			   
			    pinta_blanc5();
				alerta_ca('Nom');
				document.getElementById('nom').style.background = '#FFEFEF';
				nom.focus();
				return false;
				}
				
				else if (result3 == 0)
               {		
			   
			    pinta_blanc5();
				alerta_ca('Cognoms');
				document.getElementById('cognoms').style.background = '#FFEFEF';
				cognoms.focus();
				return false;
				}
				
				else if (result4 == 0)
               {		
			   
			    pinta_blanc5();
				alerta_ca('Data de naixament');
				document.getElementById('data_naixament').style.background = '#FFEFEF';
				data_naixament.focus();
				return false;
				}
				
				else if (result5 == 0)
               {		
			   
			    pinta_blanc5();
				alerta_ca('Adreça');
				document.getElementById('adreca').style.background = '#FFEFEF';
				adreca.focus();
				return false;
				}
				
				else if (result6 == 0)
               {		
			   
			    pinta_blanc5();
				alerta_ca('Codi Postal');
				document.getElementById('cp').style.background = '#FFEFEF';
				cp.focus();
				return false;
				}
				
				else if (result7 == 0)
               {		
			   
			    pinta_blanc5();
				alerta_ca('Població');
				document.getElementById('poblacio').style.background = '#FFEFEF';
				poblacio.focus();
				return false;
				}
				
				else if (result8 == 0)
               {		
			   
			    pinta_blanc5();
				alerta_ca('Provincia');
				document.getElementById('provincia').style.background = '#FFEFEF';
				provincia.focus();
				return false;
				}
				
			
               else if (result9 == 0)
               {		
			   
			    pinta_blanc5();
				alerta_ca('Demarcació');
				document.getElementById('demarcacio').style.background = '#FFEFEF';
				demarcacio.focus();
				return false;
				}
				
				else if (result9a != 1)
               {
				pinta_blanc5();
				alert('Escriu una adreça de correu electrònic vàlida');
				document.getElementById('email').style.background = '#FFEFEF';
				email.focus();
				return false;
				}
				
				else if (result10== 0)
               {		
			   
			    pinta_blanc5();
				alerta_ca('Telèfon');
				document.getElementById('telefon').style.background = '#FFEFEF';
				telefon.focus();
				return false;
				}
				
				else if (result10a== 0)
               {		
			   
			    pinta_blanc5();
				alerta_ca('DNI');
				document.getElementById('dni').style.background = '#FFEFEF';
				dni.focus();
				return false;
				}
				
				else if (result10b== 0)
               {		
			   
			    pinta_blanc5();
				alerta_ca('Fotografia');
				document.getElementById('fotografia').style.background = '#FFEFEF';
				fotografia.focus();
				return false;
				}
				
				
				
				else if (result10c == 0)
               {
				pinta_blanc5();
				alerta_ca('Autoritzo la cessió de les meves dades de contacte a tercers?');
		
				return false;
				}
				
				else if (result11== 0)
               {		
			   
			    pinta_blanc5();
				alerta_ca('Escola / Universitat');
				document.getElementById('escola_universitat').style.background = '#FFEFEF';
				escola_universitat.focus();
				return false;
				}
				
				else if (result12== 0)
               {		
			   
			    pinta_blanc5();
				alerta_ca('Data expedició títol');
				document.getElementById('data_expedicio').style.background = '#FFEFEF';
				data_expedicio.focus();
				return false;
				}
				
					else if (result13== 0)
               {		
			   
			    pinta_blanc5();
				alerta_ca('Especialitat');
				document.getElementById('especialitat').style.background = '#FFEFEF';
				especialitat.focus();
				return false;
				}
				
						else if (result14== 0)
               {		
			   
			    pinta_blanc5();
				alerta_ca('Entitat Bancària');
				document.getElementById('entitat_bancaria').style.background = '#FFEFEF';
				entitat_bancaria.focus();
				return false;
				}
				
						else if (result15== 0)
               {		
			   
			    pinta_blanc5();
				alerta_ca('Població de l\'entitat ');
				document.getElementById('poblacio_entitat').style.background = '#FFEFEF';
				poblacio_entitat.focus();
				return false;
				}
				
						else if (result16== 0)
               {		
			   
			    pinta_blanc5();
				alerta_ca('Numero de compte');
				document.getElementById('numero_compte').style.background = '#FFEFEF';
				numero_compte.focus();
				return false;
				}
	
	
	
	


	       else 
		   {
		   document.getElementById('realname').value = document.getElementById('nom').value;
		   submit();
		   }
       }
}
 
 
  function pinta_blanc5 ()
 {
	document.getElementById('nom').style.background = '#FFF';
	document.getElementById('cognoms').style.background = '#FFF';
	document.getElementById('data_naixament').style.background = '#FFF';
	document.getElementById('adreca').style.background = '#FFF';
	document.getElementById('cp').style.background = '#FFF';
	document.getElementById('poblacio').style.background = '#FFF';
	document.getElementById('provincia').style.background = '#FFF';
	document.getElementById('demarcacio').style.background = '#FFF';
	document.getElementById('email').style.background = '#FFF';
	document.getElementById('telefon').style.background = '#FFF';
	document.getElementById('dni').style.background = '#FFF';
	document.getElementById('fotografia').style.background = '#FFF';
	document.getElementById('escola_universitat').style.background = '#FFF';
	document.getElementById('data_expedicio').style.background = '#FFF';
	document.getElementById('especialitat').style.background = '#FFF';
	document.getElementById('entitat_bancaria').style.background = '#FFF';
	document.getElementById('poblacio_entitat').style.background = '#FFF';
	document.getElementById('numero_compte').style.background = '#FFF';

 }
 
 
 
   function tramit2_ca()
{
        with (document.form1)
               {
               	result1 = esta_ple(num);
				result2 = esta_ple(nom);
				result3 = esta_ple(cognoms);
				result4 = esta_ple(data_naixament);
				result5 = esta_ple(adreca);
				result6 = esta_ple(cp);
				result7 = esta_ple(poblacio);
				result8 = esta_ple(provincia);
				result9 = esta_ple(demarcacio);
				result10 = esta_ple(telefon);
				
				result11 = esta_ple(dni);

				result12 = comprova_radio(baixa,2);
				



               if (result1 == 0)
               {
				pinta_blanc6();
				alerta_ca('Núm. de col·legiat');
				document.getElementById('num').style.background = '#FFEFEF';
				num.focus();
				return false;
				}
				
				else if (result2 == 0)
               {		
			   
			    pinta_blanc6();
				alerta_ca('Nom');
				document.getElementById('nom').style.background = '#FFEFEF';
				nom.focus();
				return false;
				}
				
				else if (result3 == 0)
               {		
			   
			    pinta_blanc6();
				alerta_ca('Cognoms');
				document.getElementById('cognoms').style.background = '#FFEFEF';
				cognoms.focus();
				return false;
				}
				
				else if (result4 == 0)
               {		
			   
			    pinta_blanc6();
				alerta_ca('Data de naixament');
				document.getElementById('data_naixament').style.background = '#FFEFEF';
				data_naixament.focus();
				return false;
				}
				
				else if (result5 == 0)
               {		
			   
			    pinta_blanc6();
				alerta_ca('Adreça');
				document.getElementById('adreca').style.background = '#FFEFEF';
				adreca.focus();
				return false;
				}
				
				else if (result6 == 0)
               {		
			   
			    pinta_blanc6();
				alerta_ca('Codi Postal');
				document.getElementById('cp').style.background = '#FFEFEF';
				cp.focus();
				return false;
				}
				
				else if (result7 == 0)
               {		
			   
			    pinta_blanc6();
				alerta_ca('Població');
				document.getElementById('poblacio').style.background = '#FFEFEF';
				poblacio.focus();
				return false;
				}
				
				else if (result8 == 0)
               {		
			   
			    pinta_blanc6();
				alerta_ca('Provincia');
				document.getElementById('provincia').style.background = '#FFEFEF';
				provincia.focus();
				return false;
				}
				
			
               else if (result9 == 0)
               {		
			   
			    pinta_blanc6();
				alerta_ca('Demarcació');
				document.getElementById('demarcacio').style.background = '#FFEFEF';
				demarcacio.focus();
				return false;
				}
				
				else if (result10== 0)
               {		
			   
			    pinta_blanc6();
				alerta_ca('Telèfon');
				document.getElementById('telefon').style.background = '#FFEFEF';
				telefon.focus();
				return false;
				}
				
				else if (result11== 0)
               {		
			   
			    pinta_blanc6();
				alerta_ca('DNI');
				document.getElementById('dni').style.background = '#FFEFEF';
				dni.focus();
				return false;
				}
				

				else if (result12 == 0)
               {
				pinta_blanc6();
				alerta_ca('Desitjo donar-me de baixa del Col·legi a partir del proper trimestre');
		
				return false;
				}
				
			


	       else 
		   {
		   document.getElementById('realname').value = document.getElementById('nom').value;
		   submit();
		   }
       }
}


  function pinta_blanc6 ()
 {
	document.getElementById('num').style.background = '#FFF';
	document.getElementById('nom').style.background = '#FFF';
	document.getElementById('cognoms').style.background = '#FFF';
	document.getElementById('data_naixament').style.background = '#FFF';
	document.getElementById('adreca').style.background = '#FFF';
	document.getElementById('cp').style.background = '#FFF';
	document.getElementById('poblacio').style.background = '#FFF';
	document.getElementById('provincia').style.background = '#FFF';
	document.getElementById('demarcacio').style.background = '#FFF';
	document.getElementById('telefon').style.background = '#FFF';
	document.getElementById('dni').style.background = '#FFF';


 }
 
 
 
    function tramit4_ca()
{
        with (document.form1)
               {
               
				result1 = esta_ple(nom);
				result2 = esta_ple(cognoms);
				result3 = comprova_radio(colegiat,2);
				result9 = esta_ple(demarcacio);
				result10 = esta_ple(telefon);
				
			
				



            if (result1 == 0)
               {		
			   
			    pinta_blanc7();
				alerta_ca('Nom');
				document.getElementById('nom').style.background = '#FFEFEF';
				nom.focus();
				return false;
				}
				
				else if (result2 == 0)
               {		
			   
			    pinta_blanc7();
				alerta_ca('Cognoms');
				document.getElementById('cognoms').style.background = '#FFEFEF';
				cognoms.focus();
				return false;
				}
				
				else if (result3 == 0)
               {
				pinta_blanc7();
				alerta_ca('Està col·legiat?');
		
				return false;
				}
				
				
			
               else if (result9 == 0)
               {		
			   
			    pinta_blanc7();
				alerta_ca('Demarcació');
				document.getElementById('demarcacio').style.background = '#FFEFEF';
				demarcacio.focus();
				return false;
				}
				
				else if (result10== 0)
               {		
			   
			    pinta_blanc7();
				alerta_ca('Telèfon');
				document.getElementById('telefon').style.background = '#FFEFEF';
				telefon.focus();
				return false;
				}
				

			


	       else 
		   {
		   document.getElementById('realname').value = document.getElementById('nom').value;
		   submit();
		   }
       }
}



  function pinta_blanc7 ()
 {

	document.getElementById('nom').style.background = '#FFF';
	document.getElementById('cognoms').style.background = '#FFF';
	document.getElementById('demarcacio').style.background = '#FFF';
	document.getElementById('telefon').style.background = '#FFF';



 }
