<?php
 /* Template Name: Form PPI */ 
?>
<link rel="stylesheet" href="<?php bloginfo( 'template_url' ); ?>/dist/styles/fastselect.min.css">
<script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="<?php bloginfo( 'template_url' ); ?>/dist/scripts/fastselect.standalone.js"></script>
<script>
		//wider caribbean
var Cgroups1=['92','228','93','80','81','66','102','67','96','68','69','82','272','83','84','310','85','98','70','71','86','72','87','100','74','99','75','73','101','315','311','235','89','278','314','271','76','223','370','78','77','313','108'];
//SICA
var Cgroups2=['66','69','84','70','72','75','73','318'];
//CARICOM
var Cgroups3=['66','92','228','80','81','96','83','85','71','86','87','99','235','89','278','76','223','317'];
//OECS
var Cgroups4=['92','228','83','85','99','235','89','278','100'];
//CP Countries 
var Cgroups5=['228','83','85','235','89','278','66','80','81','71','86','87','76','223','84','82'];
	
function visualizar(eLm,idDiv){
	if(document.getElementById("c_"+idDiv).checked == false ){
		eLm.className = "PPIF_S_SELECT";
		document.getElementById(idDiv).style.display = "block";
	}else{

		eLm.className = "PPIF_S";
		document.getElementById(idDiv).style.display = "none";

	}
}
function visualizarTitle(idDiv,action){
	if(action=="1"){
		document.getElementById(idDiv).style.display = "block";
	}
	if(action=="0"){
		document.getElementById(idDiv).style.display = "none";
	}
		
}

function visualizar2(eLm,idDiv){
	if(document.getElementById("c_"+idDiv).checked == false ){
		eLm.className = "PPIF_S_SELECT";
		//document.getElementById(idDiv).style.display = "block";
	}else{

		eLm.className = "PPIF_S";
		//document.getElementById(idDiv).style.display = "none";

	}
}
function reviewsaps(eLm){
	if(document.getElementById("c_"+eLm).checked == true ){
		document.getElementById("i_"+eLm).className = "PPIF_S_SELECT";
		document.getElementById(eLm).style.display = "block";
	}

}
function reviewsaps2(eLm){
	if(document.getElementById("c_"+eLm).checked == true ){
		document.getElementById("i_"+eLm).className = "PPIF_S_SELECT";
		//document.getElementById(eLm).style.display = "block";
	}

}
function phonenumber(inputtxt)
{
  var phoneno = /^\+?([0-9]{2})\)?[-. ]?([0-9]{4})[-. ]?([0-9]{4})$/;
  if(inputtxt.value.match(phoneno))
        {
      return true;
        }
      else
        {
        alert("Not a valid Phone Number");
        return false;
        }
}
function checkTel()
{

    var pass1 = document.getElementById('pleadcontphone');
 	//var phoneno = /^\+?([0-9]{2})\)?[-. ]?([0-9]{10})$/;
	var phoneno = /^\+?([0-9]{1})\)?[-. ]?\d/;
	

    var message = document.getElementById('message');

   var goodColor = "#0C6";
    var badColor = "#FF0000";
	
	if(pass1.value.length >0){
		if(pass1.value.match(phoneno)){
			pass1.style.backgroundColor = "";
	
		   
		}else{
			pass1.style.backgroundColor = badColor;
	
		}
	}
}
function StatusDates(){

	var str = document.getElementById('pgstatus').value;
      if (str==="205" || str==="813")
      {
		document.getElementById("pdatestar").required = false;
		document.getElementById("pdateend").required = false;

		jQuery('input[name=fastgroups]').attr('checked',false);
		 if(document.getElementsByClassName('fstElement fstMultipleMode fstNoneSelected rojofield').length >0){
			 document.getElementsByClassName('fstElement fstMultipleMode fstNoneSelected rojofield')[0].classList.remove("rojofield"); 
		}
		 if(document.getElementsByClassName('fstElement fstMultipleMode rojofield').length >0){
			document.getElementsByClassName('fstElement fstMultipleMode rojofield')[0].classList.remove("rojofield"); 
		}
		
      }
	  if (str==="206")
      {
        document.getElementById("pdatestar").required = true;
		document.getElementById("pdateend").required = true;
		//cleanSelect(op);
		jQuery('input[name=fastgroups]').attr('checked',false);
		 if(document.getElementsByClassName('fstElement fstMultipleMode fstNoneSelected').length >0){
			 document.getElementsByClassName('fstElement fstMultipleMode fstNoneSelected')[0].classList.add("rojofield"); 
		}
		 if(document.getElementsByClassName('fstElement fstMultipleMode').length >0){
			document.getElementsByClassName('fstElement fstMultipleMode')[0].classList.add("rojofield"); 
		}
      }
	  if (str==="204")
      {
        document.getElementById("pdatestar").required = true;
		document.getElementById("pdateend").required = true;
		//cleanSelect(op);
		jQuery('input[name=fastgroups]').attr('checked',false);
		 if(document.getElementsByClassName('fstElement fstMultipleMode fstNoneSelected').length >0){
			 document.getElementsByClassName('fstElement fstMultipleMode fstNoneSelected')[0].classList.add("rojofield"); 
		}
		 if(document.getElementsByClassName('fstElement fstMultipleMode').length >0){
			document.getElementsByClassName('fstElement fstMultipleMode')[0].classList.add("rojofield"); 
		}  


      }
}
</script>
<br>
<br>
<article class="article-content padding-topup" >
	<div class="flex-content">
  		<div class="row" style="padding-bottom:25px;">
        	<div class="large-12 columns">
           <?php echo get_the_content(); ?>
		   
		   
		   <div style="width: 100%; display: flex;">
<!--<div style="width: 50%;" align="left"><center><a style="background-color: #186e1a; color: white!important; width: 800px; padding: 20px; border-radius: 8px!important; cursor: pointer; text-decoration: none;" href="https://clmeplus.org/form-database-programmes/">Create new Project Profile </a></center></div>-->
<?php if (!is_user_logged_in() ) {?>
<div style="width: 100%;" align="center"><center><a style="background-color: #57c9e8; color: white!important; width: 800px; padding: 20px; border-radius: 8px!important; cursor: pointer; text-decoration: none;" href="https://www.clmeplus.org/wp/wp-login.php">Already a registered user? Please Log-in</a></center></div>
<?php } ?>
</div>
		   
		   
		   
		   
            </div>
        </div>
       
           <?php
           //TO DO - add fields for Post COVID-19 Recovery, Sargassum and Plastics and Marine Debris (ppost_covid-19_recovery_ppi, psargassum_ppi and pmarine_litter_ppi)
		   $pname = $pname2 = $pacronym = $pobjective = $pobjective2 = $pgscope = $pdatestar = $pdateend = $pgstatus = $pleadorg = $pleadcont = $pleadcontemail = $pleadcontphone = $pleadweb = $ppartners = $pdonors =$pdonorsgef = $pgrant = $pcountfun = $pcogef = $psapobs=$psdgobs=$potherobs=$psapfile=$psdgfile=$potherfile=$plogo=$pstatusfile=$peditFields="";
		   $pcountries = $pgstatus = $pgscope = $pOtherComm=[];
		   $pChecksap0= $pChecksap1=$pChecksap2= $pChecksap3= $pChecksap4= $pChecksap5= $pChecksap6= $pChecksap7= $pChecksap8= $pChecksap9= $pChecksdg1= $pChecksdg2= $pChecksdg3= $pChecksdg4= $pChecksdg5= $pChecksdg6= $pChecksdg7= $pChecksdg8= $pChecksdg9= $pChecksdg10= $pChecksdg11= $pChecksdg12= $pChecksdg13= $pChecksdg14 = $pChecksdg15= $pChecksdg16= $pChecksdg17= [];
		   $peditFields=false;
				if (isset($_GET['saved'])) {
					
					if ($_GET['saved']==1){?>
                    &nbsp;
					<div class="row" style="background-color:#57c9e8;color:white!important;padding-top:20px">
						<div class="large-12 columns"><div class="updated">
								<p style="color:white!important;"><?php _e('We thank you for your submission , your Project Profile is under review to be included in the Online Database. You will get notified through email when it is approved','sage');?></p>
							  </div> </div>
					</div>
					
					<?php }
					if ($_GET['saved']==2){?>
                     &nbsp;
					<div class="row" style="background-color:#57c9e8;color:white!important;padding-top:20px; padding-bottom:15px;">
						<div class="large-12 columns"><div class="updated">
								<p style="color:white!important;"><?php _e('Your information has been updated. Thank you for your commitment with collaborative work for the Wider Caribbean/CLME+ Region.','sage');?></p>
							  </div> </div>
					</div>
					
					<?php }
					if ($_GET['saved']==0){?>
                     &nbsp;
					<div class="row" style="background-color:red;color:white!important;padding-top:20px">
						<div class="large-12 columns"><div class="updated">
								<p style="color:white!important;"><?php _e('ERROR! please verify your data.','sage');?></p>
							  </div> </div>
					</div>';
					
				<?php	}
					
				
				}
				if (is_user_logged_in() ) {
					$current_user = wp_get_current_user();
							
					$email = strtolower($current_user->user_email);
					$args = array( 'post_type' => 'ppi_database','meta_query' => array(array('key' => 'lead_contact_email_ppi', 'value' => $email,'compare' => '=','order' => 'ASC',  'orderby' => 'acronym_ppi')));
					
									 
$the_query = new WP_Query( $args );
if( $the_query->have_posts() ): ?>
  <div class="row" style="padding-top:5px;border-top: 2px solid #44c8e8; padding-bottom:15px;">
									<div class="large-12 columns"><div class="updated">
                                    <table style="background-color:#FFF"><tr><td width="80%"><p style=""><strong><?php _e('Your project profile(s)list:','sage');?></strong></p></td><td width="20%">&nbsp;</td></tr>
											

	<?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
		<tr><td width="80%"><?php echo get_field( "acronym_ppi",$post->ID );?> - <?php echo get_field( "post_title",$post->ID );?></td><td width="20%"><center><a style="color:#FFF!important;" class="edit-profile-style"  href="https://clmeplus.org/form-database-programmes/?edit=<?php echo $post->ID;?>">EDIT</a></center></td></tr>
			

	<?php endwhile; ?>

 </table>
<?php endif; ?>
 </div></div></div>
<?php wp_reset_query();	 // Restore global post data stomped by the_post(). 
					
				}
				if (isset($_GET['edit'])) {
					if ( !is_user_logged_in() ) {
					   //auth_redirect(); ?> 
					  
					  <div class="row" style="background-color:red;color:white!important; padding-top:30px">
									<div class="large-12 columns"><div class="updated">
											<p style="color:white!important;">
											<?php _e('PLEASE LOG IN! you can not edit this data, please log in correctly.','sage');?> 
                                            </p>
										  </div> </div>
								</div>';
					   <?php
					   
					}else{
							$current_user = wp_get_current_user();
							
							$email = strtolower($current_user->user_email);
							$post   = get_post( $_GET['edit']);
							$emailPost = strtolower(get_field( "lead_contact_email_ppi",$post->ID ));
							if ($email == $emailPost ){
								$peditFields=true;?>
								<div class="row" style="padding-top:15px;border-top: 2px solid #44c8e8; padding-bottom:10px;">
									<div class="large-12 columns"><div class="updated">
											<p ><strong>
							 <?php  _e('Profile selected for editing:','sage');?>
							 </strong>
							 <?php echo get_field( "acronym_ppi",$post->ID ).'-'.get_field( "post_title",$post->ID );?>
							 </p>
</div> </div>
								</div>
								<?php 
							$pcountries = wp_get_post_terms($post->ID, 'ppi_countries', array("fields" => "ids"));
							$pgstatus = wp_get_post_terms($post->ID, 'ppi_status', array("fields" => "ids"));
							$pgscope = wp_get_post_terms($post->ID, 'ppi_geoscope', array("fields" => "ids"));
							
							$pname = get_field( "post_title",$post->ID );
							$pname2 = get_field( "post_title_2",$post->ID );
							$pacronym = get_field( "acronym_ppi",$post->ID );		
		
							$pobjective= get_field( "main_objectives_ppi",$post->ID );
							$pobjective2= get_field( "main_objectives_ppi_2",$post->ID );
							$pdatestar = get_field( "start_date_ppi",$post->ID );
							$pdateend = get_field( "end_date_ppi",$post->ID );
							$pdonorsgef = get_field( "gef_id_ppi",$post->ID );
							$pleadorg = get_field( "lead_organization_ppi",$post->ID );
							$pleadcont= get_field( "lead_contact_ppi",$post->ID );
							$pleadcontemail= get_field( "lead_contact_email_ppi",$post->ID );
							$pleadcontphone= get_field( "lead_contact_phone_number_ppi",$post->ID );
							$pleadweb= get_field( "lead_contact_website_ppi",$post->ID );
							
							$plogo= get_field( "logo_ppi",$post->ID );
							
							$pstatusfile=get_field( "status_file_ppi",$post->ID );
							
							
							$ppartners= get_field( "partners_ppi",$post->ID );
							$pdonors= get_field( "donors_ppi",$post->ID );
							
							$pgrant= get_field( "grant_us_ppi",$post->ID );
							$pcountfun= get_field( "counterpart_funding_us_ppi",$post->ID );
							$pcogef= get_field( "commitment_to_gef_ppi",$post->ID );
		
							$pChecksap0= explode(",",get_field( "sap_strategy_s1_ppi",$post->ID ));
							$pChecksap1= explode(",",get_field( "sap_strategy_s2_ppi",$post->ID ));
							$pChecksap2= explode(",",get_field( "sap_strategy_s3_ppi",$post->ID ));
							$pChecksap3= explode(",",get_field( "sap_strategy_s4_ppi",$post->ID ));
							$pChecksap4= explode(",",get_field( "sap_strategy_s4a_ppi",$post->ID ));
							$pChecksap5= explode(",",get_field( "sap_strategy_s4b_ppi",$post->ID ));
							$pChecksap6= explode(",",get_field( "sap_strategy_s5_ppi",$post->ID ));
							$pChecksap7= explode(",",get_field( "sap_strategy_s5a_ppi",$post->ID ));
							$pChecksap8= explode(",",get_field( "sap_strategy_s5b_ppi",$post->ID ));
							$pChecksap9= explode(",",get_field( "sap_strategy_s6_ppi",$post->ID ));
							$psapobs   = get_field( "sap_obs_ppi",$post->ID );
							$psapofile  = get_field( "sap_file_ppi",$post->ID );
					
					
					
							$pChecksdg1= explode(",",get_field( "sdg_1_ppi",$post->ID ));
							$pChecksdg2= explode(",",get_field( "sdg_2_ppi",$post->ID ));
							$pChecksdg3= explode(",",get_field( "sdg_3_ppi",$post->ID ));
							$pChecksdg4= explode(",",get_field( "sdg_4_ppi",$post->ID ));
							$pChecksdg5= explode(",",get_field( "sdg_5_ppi",$post->ID ));
							$pChecksdg6= explode(",",get_field( "sdg_6_ppi",$post->ID ));
							$pChecksdg7= explode(",",get_field( "sdg_7_ppi",$post->ID ));
							$pChecksdg8= explode(",",get_field( "sdg_8_ppi",$post->ID ));
							$pChecksdg9= explode(",",get_field( "sdg_9_ppi",$post->ID ));
							$pChecksdg10= explode(",",get_field( "sdg_10_ppi",$post->ID ));
							$pChecksdg11= explode(",",get_field( "sdg_11_ppi",$post->ID ));
							$pChecksdg12= explode(",",get_field( "sdg_12_ppi",$post->ID ));
							$pChecksdg13= explode(",",get_field( "sdg_13_ppi",$post->ID ));
							$pChecksdg14= explode(",",get_field( "sdg_14_ppi",$post->ID ));
							$pChecksdg15= explode(",",get_field( "sdg_15_ppi",$post->ID ));
							$pChecksdg16= explode(",",get_field( "sdg_16_ppi",$post->ID ));
							$pChecksdg17= explode(",",get_field( "sdg_17_ppi",$post->ID ));
							$psdgobs   = get_field( "sdg_obs_ppi",$post->ID );
							$psdgfile  = get_field( "sdg_file_ppi",$post->ID );
							
							$pOtherComm = wp_get_post_terms($post->ID, 'other_comm', array("fields" => "ids"));
							//$pOtherComm= explode(",",get_field( "otherscomm",$post->ID ));
							$potherobs   = get_field( "other_obs_ppi",$post->ID );
							$potherfile  = get_field( "other_file_ppi",$post->ID );
							
							//TO DO - add get_field for Post COVID-19 Recovery, Sargassum and Plastics and Marine Debris (ppost_covid-19_recovery_ppi, psargassum_ppi and pmarine_litter_ppi)
		
								
							}else{?>
							
								<div class="row" style="background-color:red;color:white!important;padding-top:30px">
									<div class="large-12 columns"><div class="updated">
											<p style="color:white!important;">
                                <?php _e('ERROR! you can not edit this data, please log in correctly.','sage'); ?>
                                
                                </p>
										  </div> </div>
								</div>
                                <?php
							}
					}
				}else{$pstatusfile=$plogo= $psapofile=$psdgfile=$potherfile=false;}
				
				
				?>
           
       
        <form id="ppi_database" action="<?php echo esc_url( admin_url('admin-post.php') ); ?>" method="POST" name="ppi_database" class="ppi_form_css"  enctype="multipart/form-data">
        <input type="hidden" name="action" value="ppi_form">
         <input type="hidden" name="post_type" value="ppi_database">
         <input type="hidden" name="id" value="<?php if(isset($_GET['edit'])){echo $_GET['edit'] ;}?>">
        
 		<div class="row" style=" padding-top:10px; padding-bottom:20px;border-top: 2px solid #44c8e8;">
            <div class="large-12 columns">
            <br>
                <h1><center><?php _e( 'PROJECT PROFILE FORM', 'sage' ); ?></center></h1>
             </div>
         </div>
          
 		<div class="row">
            <div class="large-12 columns">
            <p>Kindly note that <span style="color: #ff0000;">red</span> denotes a mandatory field.</p>
             </div>
         </div>
        
         <div class="row">
            <div class="large-12 columns">
            <br>
                <h4><?php _e( 'Basic information', 'sage' ); ?></h4>
             </div>
         </div>
        <div class="row">
        	<div class="large-6 columns" style="display: inline-flex;">
    		<div class="tooltipform"><input type="text" id="pname" name="pname" placeholder="<?php _e( 'Full name of Project', 'sage' ); ?>" required="required" value="<?php echo $pname; ?>" />
              <span class="tooltiptext"><?php _e( 'Official full name of the project/initiative', 'sage' ); ?></span>
            </div> 
           
            </div>
            <div class="large-6 columns">
           <div class="tooltipform"><input type="text" id="pacronym" name="pacronym" placeholder="<?php _e( 'Acronym', 'sage' ); ?>" value="<?php echo $pacronym; ?>" required="required" />
              <span class="tooltiptext"><?php _e( 'Project’s acronym or a shortened project title/name if applicable', 'sage' ); ?></span>
            </div> 
            </div>
            
        </div>
			<div class="row">
				<div class="large-12 columns">
					<div class="tooltipform"><textarea type="text" id="pobjective" name="pobjective" placeholder="<?php _e( 'Brief Description', 'sage' ); ?> " required="required" ><?php echo $pobjective; ?></textarea>
					  <span class="tooltiptext"><?php _e( 'Brief description of the project/initiative. Recommended length: no longer than half a page', 'sage' ); ?></span>
					</div> 
				</div>
			</div>
         <div class="row">
        	<div class="large-6 columns" style="display: inline-flex;">
    		<div class="tooltipform"><input type="text" id="pname2" name="pname2" placeholder="<?php _e( 'RECOMMENDED: Please provide a (Spanish) translation of the full project name (if available)', 'sage' ); ?>"  value="<?php echo $pname2; ?>" />
              <span class="tooltiptext"><?php _e( 'Full name of project (spanish, if applicable)', 'sage' ); ?></span>
            </div> 
           
            </div>
          
            <div class="large-6 columns">
                <div class="tooltipform"><input type="text" id="pobjective2" name="pobjective2" placeholder="<?php _e( 'RECOMMENDED: Please provide a (Spanish) translation of the brief project description (if available)', 'sage' ); ?> "  value="<?php echo $pobjective2; ?>">
                  <span class="tooltiptext"><?php _e( 'Brief description (spanish, if applicable)', 'sage' ); ?></span>
                </div> 
            </div>
        </div>
		<div class="row">
          <div class="large-4 columns">
            <div class="tooltipform">
                <select name="pgstatus" id="pgstatus" onchange="StatusDates();" placeholder="<?php _e( 'Status', 'sage' ); ?>" required>
                <option  disabled="disabled" selected="selected" ><?php _e( 'Status', 'sage' ); ?></option>
				<option value="813" <?php if (in_array(813, $pgstatus)){echo 'selected';}?> ><?php _e( 'Soft Pipeline (password protected)', 'sage' ); ?></option>
                <option value="205" <?php if (in_array(205, $pgstatus)){echo 'selected';}?> ><?php _e( 'Hard Pipeline', 'sage' ); ?></option>
                <option value="206" <?php if (in_array(206, $pgstatus)){echo 'selected';}?> ><?php _e( 'Ongoing', 'sage' ); ?></option>
                <option value="204" <?php if (in_array(204, $pgstatus)){echo 'selected';}?> ><?php _e( 'Completed', 'sage' ); ?></option>
				
                </select>
                  <span class="tooltiptext"><?php _e( 'Indicate the current status of your project/initiative (please remember to update your project profile as soon as the status of your project/initiative changes)', 'sage' ); ?></span>
                </div> 
            </div>
        	<div class="large-2 columns">
           <div class="tooltipform"> <input  onfocus = "(this.type = 'date')" onblur="(this.type='text')" type="text" name="pdatestar" id="pdatestar" placeholder="<?php _e( 'Project Start date', 'sage' ); ?>"  value="<?php echo $pdatestar; ?>" />
            <span class="tooltiptext"><?php _e( 'Official start date of the project/initiative: mm/dd/yyyy', 'sage' ); ?></span>
                </div> 
            </div>
            <div class="large-2 columns">
                <div class="tooltipform"> <input  onfocus = "(this.type = 'date')" onblur="(this.type='text')" type="text" name="pdateend" id="pdateend" placeholder="<?php _e( 'Project End date', 'sage' ); ?>"  value="<?php echo $pdateend; ?>"  />
                <span class="tooltiptext"><?php _e( 'Official end date of the project/initiative: mm/dd/yyyy', 'sage' ); ?></span>
            	</div>
            </div>
           <div class="large-4 columns">
                <div class="tooltipform">
                <select name="pgscope" id="pgscope" placeholder="<?php _e( 'Geographic scope', 'sage' ); ?>" required onchange="validarPaises();">
                <option disabled="disabled" selected="selected" ><?php _e( 'Geographic scope', 'sage' ); ?></option>
                <option value="309" <?php if (in_array(309, $pgscope)){echo 'selected';}?> ><?php _e( 'National', 'sage' ); ?></option> 
                <option value="365"  <?php if (in_array(365, $pgscope)){echo 'selected';}?> ><?php _e( 'Multicountry (regional)', 'sage' ); ?></option>
                <option value="367"  <?php if (in_array(367, $pgscope)){echo 'selected';}?> ><?php _e( 'Multicountry (global)', 'sage' ); ?></option>
                </select>
                  <span class="tooltiptext"><?php _e( 'Multicountry (regional) is to be used when all participating countries are from the wider Caribbean/CLME+ region, whereas Multicountry (global) is to be used when both a country or countries from within as well as from outside the wider Caribbean/CLME+ region participate.National is to be used when the project is being executed in a single country (the country has to be from the Wider Caribbean/CLME+ region)', 'sage' ); ?></span>
                </div> 
            </div>
        </div>
			
        <div class="row">
        	 
        	 <div class="large-12 columns">
			 <div class="tooltipform">
				 Fast select countries: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				 <input type="radio" id="fastgroups1" name="fastgroups" value="1" onChange="asignarPaises(1);"> Wider Caribbean&nbsp;&nbsp;&nbsp;&nbsp;
				<input type="radio" id="fastgroups2" name="fastgroups" value="2" onChange="asignarPaises(2);"> SICA&nbsp;&nbsp;&nbsp;&nbsp;
				<input type="radio" id="fastgroups3" name="fastgroups" value="3" onChange="asignarPaises(3);"> CARICOM&nbsp;&nbsp;&nbsp;&nbsp;
				 <input type="radio" id="fastgroups4" name="fastgroups" value="4" onChange="asignarPaises(4);"> OECS&nbsp;&nbsp;&nbsp;&nbsp;
				 <input type="radio" id="fastgroups5" name="fastgroups" value="5" onChange="asignarPaises(5);"> ACP Countries&nbsp;&nbsp;&nbsp;&nbsp;
				  <input type="radio" id="fastgroups6" name="fastgroups" value="6" onChange="asignarPaises(6);"> Reset&nbsp;&nbsp;&nbsp;&nbsp;
                  <span class="tooltiptext"><?php _e( 'Fast select: You can choose one of the following groupings for a faster selection of the participating countries of your project. You can always delete any country not applicable to your project using the "x" on its name', 'sage' ); ?></span>
                </div> 
			
			</div>
        </div>
         
        <div class="row">
			<div class="large-12 columns">
  			<select class="pcountries" multiple name="pcountries[]"  id="pcountries" placeholder="<?php _e( 'Participating countries', 'sage' ); ?>" >
<option value="92" <?php if (in_array(92, $pcountries)){echo 'selected="selected"';}?> >Anguilla</option>
<option value="228" <?php if (in_array(228, $pcountries)){echo 'selected="selected"';}?>>Antigua and Barbuda</option>
<option value="93" <?php if (in_array(93, $pcountries)){echo 'selected="selected"';}?>>Aruba</option>
<option value="80" <?php if (in_array(80, $pcountries)){echo 'selected="selected"';}?>>Bahamas</option>
<option value="81" <?php if (in_array(81, $pcountries)){echo 'selected="selected"';}?>>Barbados</option>
<option value="66" <?php if (in_array(66, $pcountries)){echo 'selected="selected"';}?>>Belize</option>
<!--<option value="317" <?php if (in_array(317, $pcountries)){echo 'selected="selected"';}?>>Bermuda</option>-->
<option value="102" <?php if (in_array(102, $pcountries)){echo 'selected="selected"';}?>>Bonaire</option>
<option value="67" <?php if (in_array(67, $pcountries)){echo 'selected="selected"';}?>>Brazil</option>
<option value="96" <?php if (in_array(96, $pcountries)){echo 'selected="selected"';}?>>Cayman Islands</option>
<option value="68" <?php if (in_array(68, $pcountries)){echo 'selected="selected"';}?>>Colombia</option>
<option value="69" <?php if (in_array(69, $pcountries)){echo 'selected="selected"';}?>>Costa Rica</option>
<option value="82" <?php if (in_array(82, $pcountries)){echo 'selected="selected"';}?>>Cuba</option>
<option value="272" <?php if (in_array(272, $pcountries)){echo 'selected="selected"';}?>>Curaçao</option>
<option value="83" <?php if (in_array(83, $pcountries)){echo 'selected="selected"';}?>>Dominica</option>
<option value="84" <?php if (in_array(84, $pcountries)){echo 'selected="selected"';}?>>Dominican Republic</option>
<!--<option value="318" <?php if (in_array(318, $pcountries)){echo 'selected="selected"';}?>>El Salvador</option>-->
<option value="310" <?php if (in_array(310, $pcountries)){echo 'selected="selected"';}?>>French Guiana</option>
<option value="85" <?php if (in_array(85, $pcountries)){echo 'selected="selected"';}?>>Grenada</option>
<option value="98" <?php if (in_array(98, $pcountries)){echo 'selected="selected"';}?>>Guadeloupe</option>
<option value="70" <?php if (in_array(70, $pcountries)){echo 'selected="selected"';}?>>Guatemala</option>
<option value="71" <?php if (in_array(71, $pcountries)){echo 'selected="selected"';}?>>Guyana</option>
<option value="86" <?php if (in_array(86, $pcountries)){echo 'selected="selected"';}?>>Haiti</option>
<option value="72" <?php if (in_array(72, $pcountries)){echo 'selected="selected"';}?>>Honduras</option>
<option value="87" <?php if (in_array(87, $pcountries)){echo 'selected="selected"';}?>>Jamaica</option>
<option value="100" <?php if (in_array(100, $pcountries)){echo 'selected="selected"';}?>>Martinique</option>
<option value="74" <?php if (in_array(74, $pcountries)){echo 'selected="selected"';}?>>Mexico</option>
<option value="99" <?php if (in_array(99, $pcountries)){echo 'selected="selected"';}?>>Montserrat</option>
<option value="75" <?php if (in_array(75, $pcountries)){echo 'selected="selected"';}?>>Nicaragua</option>
<option value="73" <?php if (in_array(73, $pcountries)){echo 'selected="selected"';}?>>Panama</option>
<option value="101" <?php if (in_array(101, $pcountries)){echo 'selected="selected"';}?>>Puerto Rico</option>
<option value="315" <?php if (in_array(315, $pcountries)){echo 'selected="selected"';}?>>Saba</option>
<option value="311" <?php if (in_array(311, $pcountries)){echo 'selected="selected"';}?>>Saint Barthélemy</option>
<!--<option value="368" <?php if (in_array(368, $pcountries)){echo 'selected="selected"';}?>>Saint Eustatius</option>-->
<option value="235" <?php if (in_array(235, $pcountries)){echo 'selected="selected"';}?>>Saint Kitts and Nevis</option>
<option value="89" <?php if (in_array(89, $pcountries)){echo 'selected="selected"';}?>>Saint Lucia</option>
<!--<option value="369" <?php if (in_array(369, $pcountries)){echo 'selected="selected"';}?>>Saint Maarten</option>-->
<!--<option value="312" <?php if (in_array(312, $pcountries)){echo 'selected="selected"';}?>>Saint Martin</option>-->
<option value="278" <?php if (in_array(278, $pcountries)){echo 'selected="selected"';}?>>Saint Vincent and the Grenadines</option>
<option value="314" <?php if (in_array(314, $pcountries)){echo 'selected="selected"';}?>>Sint Eustatius</option>
<option value="271" <?php if (in_array(271, $pcountries)){echo 'selected="selected"';}?>>Sint Marteen</option>
<option value="76" <?php if (in_array(76, $pcountries)){echo 'selected="selected"';}?>>Suriname</option>
<option value="223" <?php if (in_array(223, $pcountries)){echo 'selected="selected"';}?>>Trinidad and Tobago</option>
<!--<option value="370" <?php if (in_array(370, $pcountries)){echo 'selected="selected"';}?>>Turks and Caicos</option>-->
<option value="107" <?php if (in_array(107, $pcountries)){echo 'selected="selected"';}?>>Turks and Caicos Islands</option>
<option value="78" <?php if (in_array(78, $pcountries)){echo 'selected="selected"';}?>>United States of America</option>
<option value="77" <?php if (in_array(77, $pcountries)){echo 'selected="selected"';}?>>Venezuela</option>
<option value="313" <?php if (in_array(313, $pcountries)){echo 'selected="selected"';}?>>Virgin Islands (British)</option>
<option value="108" <?php if (in_array(108, $pcountries)){echo 'selected="selected"';}?>>Virgin Islands (U.S.)</option>
<!--los nuevos mundial -->
<option value="409" <?php if (in_array(409, $pcountries)){echo 'selected="selected"';}?>>Afghanistan</option>
<option value="410" <?php if (in_array(410, $pcountries)){echo 'selected="selected"';}?>>Aland Islands</option>
<option value="411" <?php if (in_array(411, $pcountries)){echo 'selected="selected"';}?>>Albania</option>
<option value="412" <?php if (in_array(412, $pcountries)){echo 'selected="selected"';}?>>Algeria</option>
<option value="413" <?php if (in_array(413, $pcountries)){echo 'selected="selected"';}?>>American Samoa</option>
<option value="414" <?php if (in_array(414, $pcountries)){echo 'selected="selected"';}?>>Andorra</option>
<option value="415" <?php if (in_array(415, $pcountries)){echo 'selected="selected"';}?>>Angola</option>
<option value="416" <?php if (in_array(416, $pcountries)){echo 'selected="selected"';}?>>Antarctica</option>
<option value="417" <?php if (in_array(417, $pcountries)){echo 'selected="selected"';}?>>Argentina</option>
<option value="418" <?php if (in_array(418, $pcountries)){echo 'selected="selected"';}?>>Armenia</option>
<option value="419" <?php if (in_array(419, $pcountries)){echo 'selected="selected"';}?>>Australia</option>
<option value="420" <?php if (in_array(420, $pcountries)){echo 'selected="selected"';}?>>Austria</option>
<option value="421" <?php if (in_array(421, $pcountries)){echo 'selected="selected"';}?>>Azerbaijan</option>
<option value="422" <?php if (in_array(422, $pcountries)){echo 'selected="selected"';}?>>Bahrain</option>
<option value="423" <?php if (in_array(423, $pcountries)){echo 'selected="selected"';}?>>Bangladesh</option>
<option value="424" <?php if (in_array(424, $pcountries)){echo 'selected="selected"';}?>>Belarus</option>
<option value="425" <?php if (in_array(425, $pcountries)){echo 'selected="selected"';}?>>Belgium</option>
<option value="426" <?php if (in_array(426, $pcountries)){echo 'selected="selected"';}?>>Benin</option>
<option value="427" <?php if (in_array(427, $pcountries)){echo 'selected="selected"';}?>>Bhutan</option>
<option value="428" <?php if (in_array(428, $pcountries)){echo 'selected="selected"';}?>>Bolivia</option>
<option value="429" <?php if (in_array(429, $pcountries)){echo 'selected="selected"';}?>>Bosnia And Herzegovina</option>
<option value="430" <?php if (in_array(430, $pcountries)){echo 'selected="selected"';}?>>Botswana</option>
<option value="431" <?php if (in_array(431, $pcountries)){echo 'selected="selected"';}?>>Bouvet Island</option>
<option value="432" <?php if (in_array(432, $pcountries)){echo 'selected="selected"';}?>>British Indian Ocean Territory</option>
<option value="433" <?php if (in_array(433, $pcountries)){echo 'selected="selected"';}?>>Brunei Darussalam</option>
<option value="434" <?php if (in_array(434, $pcountries)){echo 'selected="selected"';}?>>Bulgaria</option>
<option value="435" <?php if (in_array(435, $pcountries)){echo 'selected="selected"';}?>>Burkina Faso</option>
<option value="436" <?php if (in_array(436, $pcountries)){echo 'selected="selected"';}?>>Burundi</option>
<option value="437" <?php if (in_array(437, $pcountries)){echo 'selected="selected"';}?>>Cambodia</option>
<option value="438" <?php if (in_array(438, $pcountries)){echo 'selected="selected"';}?>>Cameroon</option>
<option value="439" <?php if (in_array(439, $pcountries)){echo 'selected="selected"';}?>>Canada</option>
<option value="440" <?php if (in_array(440, $pcountries)){echo 'selected="selected"';}?>>Cape Verde</option>
<option value="441" <?php if (in_array(441, $pcountries)){echo 'selected="selected"';}?>>Central African Republic</option>
<option value="442" <?php if (in_array(442, $pcountries)){echo 'selected="selected"';}?>>Chad</option>
<option value="443" <?php if (in_array(443, $pcountries)){echo 'selected="selected"';}?>>Chile</option>
<option value="444" <?php if (in_array(444, $pcountries)){echo 'selected="selected"';}?>>China</option>
<option value="445" <?php if (in_array(445, $pcountries)){echo 'selected="selected"';}?>>Christmas Island</option>
<option value="446" <?php if (in_array(446, $pcountries)){echo 'selected="selected"';}?>>Cocos (Keeling) Islands</option>
<option value="447" <?php if (in_array(447, $pcountries)){echo 'selected="selected"';}?>>Comoros</option>
<option value="448" <?php if (in_array(448, $pcountries)){echo 'selected="selected"';}?>>Congo</option>
<option value="449" <?php if (in_array(449, $pcountries)){echo 'selected="selected"';}?>>Congo, Democratic Republic</option>
<option value="450" <?php if (in_array(450, $pcountries)){echo 'selected="selected"';}?>>Cook Islands</option>
<option value="451" <?php if (in_array(451, $pcountries)){echo 'selected="selected"';}?>>Cote D\'Ivoire</option>
<option value="452" <?php if (in_array(452, $pcountries)){echo 'selected="selected"';}?>>Croatia</option>
<option value="453" <?php if (in_array(453, $pcountries)){echo 'selected="selected"';}?>>Curazao</option>
<option value="454" <?php if (in_array(454, $pcountries)){echo 'selected="selected"';}?>>Cyprus</option>
<option value="455" <?php if (in_array(455, $pcountries)){echo 'selected="selected"';}?>>Czech Republic</option>
<option value="456" <?php if (in_array(456, $pcountries)){echo 'selected="selected"';}?>>Denmark</option>
<option value="457" <?php if (in_array(457, $pcountries)){echo 'selected="selected"';}?>>Djibouti</option>
<option value="458" <?php if (in_array(458, $pcountries)){echo 'selected="selected"';}?>>Ecuador</option>
<option value="459" <?php if (in_array(459, $pcountries)){echo 'selected="selected"';}?>>Egypt</option>
<option value="460" <?php if (in_array(460, $pcountries)){echo 'selected="selected"';}?>>Equatorial Guinea</option>
<option value="461" <?php if (in_array(461, $pcountries)){echo 'selected="selected"';}?>>Eritrea</option>
<option value="462" <?php if (in_array(462, $pcountries)){echo 'selected="selected"';}?>>Estonia</option>
<option value="463" <?php if (in_array(463, $pcountries)){echo 'selected="selected"';}?>>Ethiopia</option>
<option value="464" <?php if (in_array(464, $pcountries)){echo 'selected="selected"';}?>>Falkland Islands (Malvinas)</option>
<option value="465" <?php if (in_array(465, $pcountries)){echo 'selected="selected"';}?>>Faroe Islands</option>
<option value="466" <?php if (in_array(466, $pcountries)){echo 'selected="selected"';}?>>Fiji</option>
<option value="467" <?php if (in_array(467, $pcountries)){echo 'selected="selected"';}?>>Finland</option>
<option value="468" <?php if (in_array(468, $pcountries)){echo 'selected="selected"';}?>>France</option>
<option value="469" <?php if (in_array(469, $pcountries)){echo 'selected="selected"';}?>>French Polynesia</option>
<option value="470" <?php if (in_array(470, $pcountries)){echo 'selected="selected"';}?>>French Southern Territories</option>
<option value="471" <?php if (in_array(471, $pcountries)){echo 'selected="selected"';}?>>Gabon</option>
<option value="472" <?php if (in_array(472, $pcountries)){echo 'selected="selected"';}?>>Gambia</option>
<option value="473" <?php if (in_array(473, $pcountries)){echo 'selected="selected"';}?>>Georgia</option>
<option value="474" <?php if (in_array(474, $pcountries)){echo 'selected="selected"';}?>>Germany</option>
<option value="475" <?php if (in_array(475, $pcountries)){echo 'selected="selected"';}?>>Ghana</option>
<option value="476" <?php if (in_array(476, $pcountries)){echo 'selected="selected"';}?>>Gibraltar</option>
<option value="477" <?php if (in_array(477, $pcountries)){echo 'selected="selected"';}?>>Greece</option>
<option value="478" <?php if (in_array(478, $pcountries)){echo 'selected="selected"';}?>>Greenland</option>
<option value="479" <?php if (in_array(479, $pcountries)){echo 'selected="selected"';}?>>Guam</option>
<option value="480" <?php if (in_array(480, $pcountries)){echo 'selected="selected"';}?>>Guernsey</option>
<option value="481" <?php if (in_array(481, $pcountries)){echo 'selected="selected"';}?>>Guinea</option>
<option value="482" <?php if (in_array(482, $pcountries)){echo 'selected="selected"';}?>>Guinea-Bissau</option>
<option value="483" <?php if (in_array(483, $pcountries)){echo 'selected="selected"';}?>>Heard Island &amp; Mcdonald Islands</option>
<option value="484" <?php if (in_array(484, $pcountries)){echo 'selected="selected"';}?>>Holy See (Vatican City State)</option>
<option value="485" <?php if (in_array(485, $pcountries)){echo 'selected="selected"';}?>>Hong Kong</option>
<option value="486" <?php if (in_array(486, $pcountries)){echo 'selected="selected"';}?>>Hungary</option>
<option value="487" <?php if (in_array(487, $pcountries)){echo 'selected="selected"';}?>>Iceland</option>
<option value="488" <?php if (in_array(488, $pcountries)){echo 'selected="selected"';}?>>India</option>
<option value="489" <?php if (in_array(489, $pcountries)){echo 'selected="selected"';}?>>Indonesia</option>
<option value="490" <?php if (in_array(490, $pcountries)){echo 'selected="selected"';}?>>Iran, Islamic Republic Of</option>
<option value="491" <?php if (in_array(491, $pcountries)){echo 'selected="selected"';}?>>Iraq</option>
<option value="492" <?php if (in_array(492, $pcountries)){echo 'selected="selected"';}?>>Ireland</option>
<option value="493" <?php if (in_array(493, $pcountries)){echo 'selected="selected"';}?>>Isle Of Man</option>
<option value="494" <?php if (in_array(494, $pcountries)){echo 'selected="selected"';}?>>Israel</option>
<option value="495" <?php if (in_array(495, $pcountries)){echo 'selected="selected"';}?>>Italy</option>
<option value="496" <?php if (in_array(496, $pcountries)){echo 'selected="selected"';}?>>Japan</option>
<option value="497" <?php if (in_array(497, $pcountries)){echo 'selected="selected"';}?>>Jersey</option>
<option value="498" <?php if (in_array(498, $pcountries)){echo 'selected="selected"';}?>>Jordan</option>
<option value="499" <?php if (in_array(499, $pcountries)){echo 'selected="selected"';}?>>Kazakhstan</option>
<option value="500" <?php if (in_array(500, $pcountries)){echo 'selected="selected"';}?>>Kenya</option>
<option value="501" <?php if (in_array(501, $pcountries)){echo 'selected="selected"';}?>>Kiribati</option>
<option value="502" <?php if (in_array(502, $pcountries)){echo 'selected="selected"';}?>>Korea</option>
<option value="503" <?php if (in_array(503, $pcountries)){echo 'selected="selected"';}?>>Kuwait</option>
<option value="504" <?php if (in_array(504, $pcountries)){echo 'selected="selected"';}?>>Kyrgyzstan</option>
<option value="505" <?php if (in_array(505, $pcountries)){echo 'selected="selected"';}?>>Lao People\'s Democratic Republic</option>
<option value="506" <?php if (in_array(506, $pcountries)){echo 'selected="selected"';}?>>Latvia</option>
<option value="507" <?php if (in_array(507, $pcountries)){echo 'selected="selected"';}?>>Lebanon</option>
<option value="508" <?php if (in_array(508, $pcountries)){echo 'selected="selected"';}?>>Lesotho</option>
<option value="509" <?php if (in_array(509, $pcountries)){echo 'selected="selected"';}?>>Liberia</option>
<option value="510" <?php if (in_array(510, $pcountries)){echo 'selected="selected"';}?>>Libyan Arab Jamahiriya</option>
<option value="511" <?php if (in_array(511, $pcountries)){echo 'selected="selected"';}?>>Liechtenstein</option>
<option value="512" <?php if (in_array(512, $pcountries)){echo 'selected="selected"';}?>>Lithuania</option>
<option value="513" <?php if (in_array(513, $pcountries)){echo 'selected="selected"';}?>>Luxembourg</option>
<option value="514" <?php if (in_array(514, $pcountries)){echo 'selected="selected"';}?>>Macao</option>
<option value="515" <?php if (in_array(515, $pcountries)){echo 'selected="selected"';}?>>Macedonia</option>
<option value="516" <?php if (in_array(516, $pcountries)){echo 'selected="selected"';}?>>Madagascar</option>
<option value="517" <?php if (in_array(517, $pcountries)){echo 'selected="selected"';}?>>Malawi</option>
<option value="518" <?php if (in_array(518, $pcountries)){echo 'selected="selected"';}?>>Malaysia</option>
<option value="519" <?php if (in_array(519, $pcountries)){echo 'selected="selected"';}?>>Maldives</option>
<option value="520" <?php if (in_array(520, $pcountries)){echo 'selected="selected"';}?>>Mali</option>
<option value="521" <?php if (in_array(521, $pcountries)){echo 'selected="selected"';}?>>Malta</option>
<option value="522" <?php if (in_array(522, $pcountries)){echo 'selected="selected"';}?>>Marshall Islands</option>
<option value="523" <?php if (in_array(523, $pcountries)){echo 'selected="selected"';}?>>Mauritania</option>
<option value="524" <?php if (in_array(524, $pcountries)){echo 'selected="selected"';}?>>Mauritius</option>
<option value="525" <?php if (in_array(525, $pcountries)){echo 'selected="selected"';}?>>Mayotte</option>
<option value="526" <?php if (in_array(526, $pcountries)){echo 'selected="selected"';}?>>Micronesia, Federated States Of</option>
<option value="527" <?php if (in_array(527, $pcountries)){echo 'selected="selected"';}?>>Moldova</option>
<option value="528" <?php if (in_array(528, $pcountries)){echo 'selected="selected"';}?>>Monaco</option>
<option value="529" <?php if (in_array(529, $pcountries)){echo 'selected="selected"';}?>>Mongolia</option>
<option value="530" <?php if (in_array(530, $pcountries)){echo 'selected="selected"';}?>>Montenegro</option>
<option value="531" <?php if (in_array(531, $pcountries)){echo 'selected="selected"';}?>>Morocco</option>
<option value="532" <?php if (in_array(532, $pcountries)){echo 'selected="selected"';}?>>Mozambique</option>
<option value="533" <?php if (in_array(533, $pcountries)){echo 'selected="selected"';}?>>Myanmar</option>
<option value="534" <?php if (in_array(534, $pcountries)){echo 'selected="selected"';}?>>Namibia</option>
<option value="535" <?php if (in_array(535, $pcountries)){echo 'selected="selected"';}?>>Nauru</option>
<option value="536" <?php if (in_array(536, $pcountries)){echo 'selected="selected"';}?>>Nepal</option>
<option value="537" <?php if (in_array(537, $pcountries)){echo 'selected="selected"';}?>>Netherlands</option>
<option value="538" <?php if (in_array(538, $pcountries)){echo 'selected="selected"';}?>>Netherlands Antilles</option>
<option value="539" <?php if (in_array(539, $pcountries)){echo 'selected="selected"';}?>>New Caledonia</option>
<option value="540" <?php if (in_array(540, $pcountries)){echo 'selected="selected"';}?>>New Zealand</option>
<option value="541" <?php if (in_array(541, $pcountries)){echo 'selected="selected"';}?>>Niger</option>
<option value="542" <?php if (in_array(542, $pcountries)){echo 'selected="selected"';}?>>Nigeria</option>
<option value="543" <?php if (in_array(543, $pcountries)){echo 'selected="selected"';}?>>Niue</option>
<option value="544" <?php if (in_array(544, $pcountries)){echo 'selected="selected"';}?>>Norfolk Island</option>
<option value="545" <?php if (in_array(545, $pcountries)){echo 'selected="selected"';}?>>Northern Mariana Islands</option>
<option value="546" <?php if (in_array(546, $pcountries)){echo 'selected="selected"';}?>>Norway</option>
<option value="547" <?php if (in_array(547, $pcountries)){echo 'selected="selected"';}?>>Oman</option>
<option value="548" <?php if (in_array(548, $pcountries)){echo 'selected="selected"';}?>>Pakistan</option>
<option value="549" <?php if (in_array(549, $pcountries)){echo 'selected="selected"';}?>>Palau</option>
<option value="550" <?php if (in_array(550, $pcountries)){echo 'selected="selected"';}?>>Palestinian Territory, Occupied</option>
<option value="551" <?php if (in_array(551, $pcountries)){echo 'selected="selected"';}?>>Papua New Guinea</option>
<option value="552" <?php if (in_array(552, $pcountries)){echo 'selected="selected"';}?>>Paraguay</option>
<option value="553" <?php if (in_array(553, $pcountries)){echo 'selected="selected"';}?>>Peru</option>
<option value="554" <?php if (in_array(554, $pcountries)){echo 'selected="selected"';}?>>Philippines</option>
<option value="555" <?php if (in_array(555, $pcountries)){echo 'selected="selected"';}?>>Pitcairn</option>
<option value="556" <?php if (in_array(556, $pcountries)){echo 'selected="selected"';}?>>Poland</option>
<option value="557" <?php if (in_array(557, $pcountries)){echo 'selected="selected"';}?>>Portugal</option>
<option value="558" <?php if (in_array(558, $pcountries)){echo 'selected="selected"';}?>>Qatar</option>
<option value="559" <?php if (in_array(559, $pcountries)){echo 'selected="selected"';}?>>Reunion</option>
<option value="560" <?php if (in_array(560, $pcountries)){echo 'selected="selected"';}?>>Romania</option>
<option value="561" <?php if (in_array(561, $pcountries)){echo 'selected="selected"';}?>>Russian Federation</option>
<option value="562" <?php if (in_array(562, $pcountries)){echo 'selected="selected"';}?>>Rwanda</option>
<option value="563" <?php if (in_array(563, $pcountries)){echo 'selected="selected"';}?>>Saint Helena</option>
<option value="564" <?php if (in_array(564, $pcountries)){echo 'selected="selected"';}?>>Saint Pierre And Miquelon</option>
<option value="565" <?php if (in_array(565, $pcountries)){echo 'selected="selected"';}?>>Samoa</option>
<option value="566" <?php if (in_array(566, $pcountries)){echo 'selected="selected"';}?>>San Marino</option>
<option value="567" <?php if (in_array(567, $pcountries)){echo 'selected="selected"';}?>>Sao Tome And Principe</option>
<option value="568" <?php if (in_array(568, $pcountries)){echo 'selected="selected"';}?>>Saudi Arabia</option>
<option value="569" <?php if (in_array(569, $pcountries)){echo 'selected="selected"';}?>>Senegal</option>
<option value="570" <?php if (in_array(570, $pcountries)){echo 'selected="selected"';}?>>Serbia</option>
<option value="571" <?php if (in_array(571, $pcountries)){echo 'selected="selected"';}?>>Seychelles</option>
<option value="572" <?php if (in_array(572, $pcountries)){echo 'selected="selected"';}?>>Sierra Leone</option>
<option value="573" <?php if (in_array(573, $pcountries)){echo 'selected="selected"';}?>>Singapore</option>
<option value="574" <?php if (in_array(574, $pcountries)){echo 'selected="selected"';}?>>Slovakia</option>
<option value="575" <?php if (in_array(575, $pcountries)){echo 'selected="selected"';}?>>Slovenia</option>
<option value="576" <?php if (in_array(576, $pcountries)){echo 'selected="selected"';}?>>Solomon Islands</option>
<option value="577" <?php if (in_array(577, $pcountries)){echo 'selected="selected"';}?>>Somalia</option>
<option value="578" <?php if (in_array(578, $pcountries)){echo 'selected="selected"';}?>>South Africa</option>
<option value="579" <?php if (in_array(579, $pcountries)){echo 'selected="selected"';}?>>South Georgia And Sandwich Isl.</option>
<option value="580" <?php if (in_array(580, $pcountries)){echo 'selected="selected"';}?>>Spain</option>
<option value="581" <?php if (in_array(581, $pcountries)){echo 'selected="selected"';}?>>Sri Lanka</option>
<option value="582" <?php if (in_array(582, $pcountries)){echo 'selected="selected"';}?>>Sudan</option>
<option value="583" <?php if (in_array(583, $pcountries)){echo 'selected="selected"';}?>>Svalbard And Jan Mayen</option>
<option value="584" <?php if (in_array(584, $pcountries)){echo 'selected="selected"';}?>>Swaziland</option>
<option value="585" <?php if (in_array(585, $pcountries)){echo 'selected="selected"';}?>>Sweden</option>
<option value="586" <?php if (in_array(586, $pcountries)){echo 'selected="selected"';}?>>Switzerland</option>
<option value="587" <?php if (in_array(587, $pcountries)){echo 'selected="selected"';}?>>Syrian Arab Republic</option>
<option value="588" <?php if (in_array(588, $pcountries)){echo 'selected="selected"';}?>>Taiwan</option>
<option value="589" <?php if (in_array(589, $pcountries)){echo 'selected="selected"';}?>>Tajikistan</option>
<option value="590" <?php if (in_array(590, $pcountries)){echo 'selected="selected"';}?>>Tanzania</option>
<option value="591" <?php if (in_array(591, $pcountries)){echo 'selected="selected"';}?>>Thailand</option>
<option value="592" <?php if (in_array(592, $pcountries)){echo 'selected="selected"';}?>>Timor-Leste</option>
<option value="593" <?php if (in_array(593, $pcountries)){echo 'selected="selected"';}?>>Togo</option>
<option value="594" <?php if (in_array(594, $pcountries)){echo 'selected="selected"';}?>>Tokelau</option>
<option value="595" <?php if (in_array(595, $pcountries)){echo 'selected="selected"';}?>>Tonga</option>
<option value="596" <?php if (in_array(596, $pcountries)){echo 'selected="selected"';}?>>Tunisia</option>
<option value="597" <?php if (in_array(597, $pcountries)){echo 'selected="selected"';}?>>Turkey</option>
<option value="598" <?php if (in_array(598, $pcountries)){echo 'selected="selected"';}?>>Turkmenistan</option>
<option value="599" <?php if (in_array(599, $pcountries)){echo 'selected="selected"';}?>>Tuvalu</option>
<option value="600" <?php if (in_array(600, $pcountries)){echo 'selected="selected"';}?>>Uganda</option>
<option value="601" <?php if (in_array(601, $pcountries)){echo 'selected="selected"';}?>>Ukraine</option>
<option value="602" <?php if (in_array(602, $pcountries)){echo 'selected="selected"';}?>>United Arab Emirates</option>
<option value="603" <?php if (in_array(603, $pcountries)){echo 'selected="selected"';}?>>United Kingdom</option>
<option value="604" <?php if (in_array(604, $pcountries)){echo 'selected="selected"';}?>>United States Outlying Islands</option>
<option value="605" <?php if (in_array(605, $pcountries)){echo 'selected="selected"';}?>>Uruguay</option>
<option value="606" <?php if (in_array(606, $pcountries)){echo 'selected="selected"';}?>>Uzbekistan</option>
<option value="607" <?php if (in_array(607, $pcountries)){echo 'selected="selected"';}?>>Vanuatu</option>
<option value="608" <?php if (in_array(608, $pcountries)){echo 'selected="selected"';}?>>Viet Nam</option>
<option value="609" <?php if (in_array(609, $pcountries)){echo 'selected="selected"';}?>>Wallis And Futuna</option>
<option value="610" <?php if (in_array(610, $pcountries)){echo 'selected="selected"';}?>>Western Sahara</option>
<option value="611" <?php if (in_array(611, $pcountries)){echo 'selected="selected"';}?>>Yemen</option>
<option value="612" <?php if (in_array(612, $pcountries)){echo 'selected="selected"';}?>>Zambia</option>
<option value="613" <?php if (in_array(613, $pcountries)){echo 'selected="selected"';}?>>Zimbabw</option>




            </select>

            <script>

                jQuery('.pcountries').fastselect();

            </script>
            </div>
			
			
			
			
		</div>
			 <div class="row">
          <div class="large-12 columns">
          &nbsp;
          </div>
			</div>	 
         <div class="row">
          <div class="large-2 columns">
          &nbsp;
          </div>
            <div class="large-8 columns">

                <h6 style=" text-align:justify"><?php _e( 'HIGHLY RECOMMENDED: Please, drag and drop in the following field the official project document (or similar). If your project proposal is currently under development ("pipeline"), you can add a “Concept Note” instead. If the project has been finalized you may wish to add the final report instead', 'sage' ); ?></h6>

			
             <?php
		
if( $pstatusfile ){ 
	if($pstatusfile['filename']<>""){

		?>
    <div id="file2div" style="display:flex;"><a href="<?php echo $pstatusfile['url']; ?>"><?php echo $pstatusfile['filename']; ?></a>&nbsp;&nbsp;<div  class="remove-files-style" onclick="document.getElementById('file1div').style.display='block';document.getElementById('pstatusfile').disabled=false;document.getElementById('file2div').style.display='none';">delete</div></div>
    <div id="file1div" class="image-upload-wrap" style="display:none;">
    				<input class="file-upload-input" type='file' onchange="readURL(this);" accept="*" name="pstatusfile" id="pstatusfile" disabled="disabled"/>
   					<div class="drag-text" id="drag-text" name="drag-text">
     					 <h3><?php _e( 'Click to Choose or Drag and drop a file', 'sage' ); ?></h3>
    				</div>
  			</div>
  				<div class="file-upload-content">
    				<img class="file-upload-image" src="#" alt="your image" />
    				<div class="image-title-wrap">
      					<button type="button" onclick="removeUpload()" class="remove-image"><?php _e( 'Remove', 'sage' ); ?> <span class="image-title"><?php _e( 'Uploaded File', 'sage' ); ?></span></button>
   					 </div>
 				 </div>
<?php }else{ ?>
	<div class="image-upload-wrap" >
    				<input class="file-upload-input" type='file' onchange="readURL(this);" accept="*" name="pstatusfile" id="pstatusfile"/>
   					<div class="drag-text">
     					 <h3><?php _e( 'Click to Choose or Drag and drop a file', 'sage' ); ?></h3>
    				</div>
  			</div>
  				<div class="file-upload-content">
    				<img class="file-upload-image" src="#" alt="your image" />
    				<div class="image-title-wrap">
      					<button type="button" onclick="removeUpload()" class="remove-image"><?php _e( 'Remove', 'sage' ); ?> <span class="image-title"><?php _e( 'Uploaded File', 'sage' ); ?></span></button>
   					 </div>
 				 </div>
<?php } }else{ ?>

             <div class="image-upload-wrap" >

    				<input class="file-upload-input" type='file' onchange="readURL(this);" accept="*" name="pstatusfile" id="pstatusfile"/>
		
   					<div  class="drag-text" >
     					 <h3><?php _e( 'Click to Choose or Drag and drop a file', 'sage' ); ?></h3>
    				</div>
  			</div>
  				<div class="file-upload-content">
    				<img class="file-upload-image" src="#" alt="your image" />
    				<div class="image-title-wrap">
      					<button type="button" onclick="removeUpload()" class="remove-image"><?php _e( 'Remove', 'sage' ); ?> <span class="image-title"><?php _e( 'Uploaded File', 'sage' ); ?></span></button>
   					 </div>
 				 </div>
          <?php }  ?>       
                 
          </div>
       <div class="large-2 columns">
          &nbsp;
          </div>
         </div>
        <div class="row">
            <div class="large-12 columns">
                <br>
                <h4><?php _e( 'Contact information', 'sage' ); ?></h4>
             </div>
         </div>
         <div class="row">
        	<div class="large-4 columns">
           
           	 <div class="tooltipform"> <input type="text" name="pleadorg" id="pleadorg" placeholder="<?php _e( 'Lead organisation', 'sage' ); ?>" required="required" value="<?php echo $pleadorg; ?>" />
                <span class="tooltiptext"><?php _e( 'Main agency(s) responsible for the implementation/execution of the Project (please use standard acronyms instead of full names)', 'sage' ); ?></span>
            	</div>
            </div>
            <div class="large-4 columns">
          
           	<div class="tooltipform"> <input type="text" name="pleadcont" id="pleadcont" placeholder="<?php _e( 'Project Profile Manager', 'sage' ); ?>" required="required" value="<?php echo $pleadcont; ?>" />
                <span class="tooltiptext"><?php _e( 'Name of the person responsible for keeping this Project Profile updated.', 'sage' ); ?></span>
            	</div>
            </div>
            <div class="large-4 columns">
          
           		<div class="tooltipform"> <input type="email" name="pleadcontemail" id="pleadcontemail" placeholder="<?php _e( 'Lead contact email', 'sage' ); ?>" required="required" value="<?php echo $pleadcontemail; ?>"  />
                <span class="tooltiptext"><?php _e( 'Email of the person responsible for keeping this Project Profile updated.', 'sage' ); ?></span>
            	</div> 
            </div>
        </div>
        <div class="row">
        	<div class="large-4 columns">
           
           <div class="tooltipform"> <input type="tel" name="pleadcontphone" id="pleadcontphone"  placeholder="<?php _e( 'Lead contact phone number', 'sage' ); ?>"   onkeyup="checkTel();return false;" onchange="checkTel();return false;" value="<?php echo $pleadcontphone; ?>"/>
                <span class="tooltiptext"><?php _e( 'Please add the contact number following the next format +xx (country code ex. +1, +57) xxxxxxxxx (number)', 'sage' ); ?></span><span id="message"></span>
            </div>
            </div>
            <div class="large-8 columns">
          
          		 <div class="tooltipform"> <input type="text" name="pleadweb" id="pleadweb" placeholder="<?php _e( "Project/Initiative's website", 'sage' ); ?>" value="<?php echo $pleadweb; ?>"/>
               	 <span class="tooltiptext"><?php _e( 'Please enter the website address, starting with "http://" or "https://" (e.g. https://www.clmeplus.org)', 'sage' ); ?></span>
           		 </div>
            </div>
            
        </div>
         
         <div class="row">
          <div class="large-2 columns">
          &nbsp;
          </div>
            <div class="large-8 columns">
            
                <h6 style=" text-align:justify"><?php _e( 'RECOMMENDED: Please, drag and drop in the following field a representative image or logo of your project. We highly recommend to do this because it would be useful in case that your initiative is selected to be shown as a "Featured project"  to the world on the CLME+ HUB', 'sage' ); ?></h6>
                
                 <?php
				 
if( $plogo) { 

	if($plogo['filename']<>""){
?>
                 
                 <div id="file4div" style="display:flex;"><a href="<?php echo $plogo['url']; ?>"><?php echo $plogo['filename']; ?></a>&nbsp;&nbsp;<div  class="remove-files-style" onclick="document.getElementById('file3div').style.display='block';document.getElementById('plogo').disabled=false;document.getElementById('file4div').style.display='none';">delete</div></div>
   <div id="file3div" class="image-upload-wrap2" style="display:none;">
    <input class="file-upload-input2" type='file' onchange="readURL2(this);" accept="image/*" name="plogo" id="plogo" disabled="disabled"/>
    <div class="drag-text2">
      <h3><?php _e( 'Click to Choose or Drag and drop a file', 'sage' ); ?> </h3>
    </div>
  </div>
  <div class="file-upload-content2">
    <img class="file-upload-image2" src="#" alt="your image" />
    <div class="image-title-wrap2">
      <button type="button" onclick="removeUpload2()" class="remove-image2"><?php _e( 'Remove, logo or other', 'sage' ); ?> <span class="image-title2"><?php _e( 'Uploaded Image', 'sage' ); ?></span></button>
    </div>
  </div>              
<?php } else {?>
<div class="image-upload-wrap2">
    <input class="file-upload-input2" type='file' onchange="readURL2(this);" accept="image/*" name="plogo" id="plogo"/>
    <div class="drag-text2">
      <h3><?php _e( 'Click to Choose or Drag and drop a file', 'sage' ); ?> </h3>
    </div>
  </div>
  <div class="file-upload-content2">
    <img class="file-upload-image2" src="#" alt="your image" />
    <div class="image-title-wrap2">
      <button type="button" onclick="removeUpload2()" class="remove-image2"><?php _e( 'Remove, logo or other', 'sage' ); ?> <span class="image-title2"><?php _e( 'Uploaded Image', 'sage' ); ?></span></button>
    </div>
  </div>

<?php }}else{ ?>

               <div class="image-upload-wrap2">
    <input class="file-upload-input2" type='file' onchange="readURL2(this);" accept="image/*" name="plogo" id="plogo"/>
    <div class="drag-text2">
      <h3><?php _e( 'Click to Choose or Drag and drop a file', 'sage' ); ?> </h3>
    </div>
  </div>
  <div class="file-upload-content2">
    <img class="file-upload-image2" src="#" alt="your image" />
    <div class="image-title-wrap2">
      <button type="button" onclick="removeUpload2()" class="remove-image2"><?php _e( 'Remove, logo or other', 'sage' ); ?> <span class="image-title2"><?php _e( 'Uploaded Image', 'sage' ); ?></span></button>
    </div>
  </div>
  <?php } ?>
             </div>
            
             <div class="large-2 columns">
          &nbsp;
          </div>
          
         </div>
        
         
        
         <div class="row">
            <div class="large-12 columns">
                <br>
                <h4><?php _e( 'Partners and Funding', 'sage' ); ?></h4>
             </div>
         </div>
         
         <div class="row">
        	 <div class="large-4 columns">
          		 
                 <div class="tooltipform"> <input type="text" name="ppartners" id="ppartners" placeholder="<?php _e( 'Partner(s)', 'sage' ); ?>"  value="<?php echo $ppartners; ?>"/>
                <span class="tooltiptext"><?php _e( 'Additional entity(s) or organization(s) involved in project execution (please use standard acronyms instead of full names)', 'sage' ); ?></span>
           		 </div>
            </div>
        	<div class="large-4 columns">
         
           <div class="tooltipform"> <input type="text" name="pdonors" id="pdonors" placeholder="<?php _e( 'Donor(s)', 'sage' ); ?> " required="required" value="<?php echo $pdonors; ?>"/>
                <span class="tooltiptext"><?php _e( 'Entity(s) and/or Organization(s) funding the project (please use acronyms, when available)', 'sage' ); ?></span>
           		 </div>
            </div>
            <div class="large-4 columns">
          
           	<div class="tooltipform"> <input type="text" name="pdonorsID" id="pdonorsID" placeholder="<?php _e( 'Donor Project ID', 'sage' ); ?>" value="<?php echo $pdonorsgef; ?>" />
                <span class="tooltiptext"><?php _e( 'STRONGLY RECOMMEDED - Please provide the official Donor Project ID (E.g. in the case of a GEF project, the GEF Project ID”)', 'sage' ); ?></span>
           		 </div>
            </div>
        </div>
         <div class="row">
          	<div class="large-4 columns">
          
         	 <div class="tooltipform"> <input type="number" name="pgrant" id="pgrant" placeholder="<?php _e( 'Grant (USD)', 'sage' ); ?> " required="required" value="<?php echo $pgrant; ?>" />
                <span class="tooltiptext"><?php _e( 'Total amount of Project Grant funds provided by the donor(s)', 'sage' ); ?></span>
            </div>
            </div>
            
        	<div class="large-4 columns">
           
          		 <div class="tooltipform"> <input type="number" name="pcountfun" id="pcountfun" placeholder="<?php _e( 'Total co-financing (USD)', 'sage' ); ?>" required="required"  value="<?php echo $pcountfun; ?>" />
            	    <span class="tooltiptext"><?php _e( 'Co-financing/additional funding provided by other agencies and stakeholders. Please enter a zero (“0”) if this information is not available', 'sage' ); ?></span>
           		 </div>
            </div>
            <div class="large-4 columns">
         
           	<div class="tooltipform"> <input type="number" name="pcogef" id="pcogef" placeholder="<?php _e( '(Co) financing not originating from GEF', 'sage' ); ?> " value="<?php echo $pcogef; ?>"/>
            	    <span class="tooltiptext"><?php _e( 'DESIRABLE: Please indicate the sum of all contributions (grants and co-financing) NOT provided by the Global Environment Facility (GEF)', 'sage' ); ?></span>
           		 </div>
            </div>
   
        </div>
         <div class="row">
            <div class="large-12 columns">
                <h4><?php _e( 'CLME+ Strategic Action Programme (SAP) Strategies and Actions', 'sage' ); ?></h4>
				</div>
				<div class="large-12 columns">&nbsp;</div>
				<div class="large-12 columns">
				<?php _e( 'The CLME+ Strategic Action Programme for the Sustainable Management of shared Living Marine Resources in the Caribbean and North Brazil Shelf Large Marine Ecosystems (CLME+ SAP, 2015-2025) has been politically endorsed to date by 26 countries and 8 overseas territories from the Wider Caribbean/CLME+ region. It aims to assist the region in achieving its’ long-term vision for the marine environment, through 6 Strategies, 4 Sub-Strategies, and a total of 76 priority Actions.', 'sage' ); ?>
				</div>
				<div class="large-12 columns">&nbsp;</div>
				<div class="large-12 columns">
				<b><?php _e( 'Does your project/initiative contribute to any of the below CLME+ SAP (Sub)-Strategies? (note: for your entry to be valid, your project/initiative will need to contribute to at least one of the Actions from the dropdown list, for each selected (Sub-Strategy)', 'sage' ); ?></b>
             </div>
         </div>
          <?php 
		  $SapST=array('1','2','3','4','4A','4B','5','5A','5B','6');
		  $SapS= array( array('1.1','1.2','1.3','1.4','1.5','1.6','1.7','1.8','1.9','1.10','1.11'), 
		 		 array('2.1','2.2','2.3','2.4','2.5','2.6','2.7','2.8','2.9','2.10','2.11','2.12','2.13','2.14'), 
				 array('3.1','3.2','3.3','3.4','3.5','3.6','3.7'), 
				 array('4.1','4.2','4.3','4.4','4.5','4.6','4.7','4.8'),
				 array('4A.1','4A.2','4A.3','4A.4'),
				 array('4B.1','4B.2','4B.3','4B.4','4B.5'),
				 array('5.1','5.2','5.3','5.4','5.5','5.6'),
				 array('5A.1','5A.2','5A.3','5A.4','5A.5','5A.6'),
				 array('5B.1','5B.2','5B.3','5B.4'),
				 array('6.1','6.2','6.3','6.4','6.5','6.6','6.7','6.8','6.9','6.10','6.11')
				 );
		 
		 ?>
         <div class="row">
		 <div class="large-12 columns">&nbsp;</div>
            <div class="large-12 columns">
			
            	<div class="containerGroup">
				<h5><?php _e( 'Please hover the cursor over the icons for a brief description of each SAP Strategy', 'sage' ); ?></h5>
  
              
          <?php 
		  for ($j=0;$j<count($SapST);$j++){
			    //echo '<div class="row" id="sapTool'.strtolower($SapST[$j]).'" style="display:none;position:absolute;background-color:#666; color:#FFF;z-index:9999;padding:5px; border-radius: 25px;">'.__( getNameSAPstrategy($SapST[$j]), 'sage' ).'</div>';

		  }
		 ?>
         
                </div>
                
            </div>
             <div class="large-12 columns">&nbsp;</div>
         </div>
		  <div class="row">
            <div class="large-12 columns">
		 <h5><?php _e('Please click on the icons to select the actions under the correspondent strategy. Check as many boxes as necessary. You must select at least one action per strategy.', 'sage' );?></h5>
			</div>
		 </div>
		 <div class="row">
		 <div class="large-12 columns">&nbsp;</div>
            <div class="large-12 columns">
            	<div class="containerGroup" style="text-align: center;">

				 <div class="row" id="sapTool1" style=" left: 5%;display: none; position: absolute; background-color: rgb(102, 102, 102); color: rgb(255, 255, 255); z-index: 9999; padding: 5px; border-radius: 25px;"><div style="text-align:center;margin-top:-5px">S1: “Protection of the Marine Environment”</div></div>
				  <div class="row" id="sapTool2" style="left: 10%;display: none; position: absolute; background-color: rgb(102, 102, 102); color: rgb(255, 255, 255); z-index: 9999; padding: 5px; border-radius: 25px;"><div style="text-align:center;margin-top:-10px">S2: “Sustainable Fisheries”</div></div>
				  <div class="row" id="sapTool3" style="left: 15%;display: none; position: absolute; background-color: rgb(102, 102, 102); color: rgb(255, 255, 255); z-index: 9999; padding: 5px; border-radius: 25px;"><div style="text-align:center;margin-top:-10px">S3: “Integrated approach to Ocean Governance”</div></div>
				  <div class="row" id="sapTool4" style="left: 20%;display: none; position: absolute; background-color: rgb(102, 102, 102); color: rgb(255, 255, 255); z-index: 9999; padding: 5px; border-radius: 25px;"><div style="text-align:center;margin-top:-10px">S4: “EBM for Reef Sub-Ecosystem (and associated habitats)</div></div>
				  <div class="row" id="sapTool4a" style="left: 25%;display: none; position: absolute; background-color: rgb(102, 102, 102); color: rgb(255, 255, 255); z-index: 9999; padding: 5px; border-radius: 25px;"><div style="text-align:center;margin-top:-10px">S4A: “EAF for spiny lobster”</div></div>
				  <div class="row" id="sapTool4b" style="left: 30%;display: none; position: absolute; background-color: rgb(102, 102, 102); color: rgb(255, 255, 255); z-index: 9999; padding: 5px; border-radius: 25px;"><div style="text-align:center;margin-top:-10px">S4b: “EAF for queen conch”</div></div>
				  <div class="row" id="sapTool5" style="left: 40%;display: none; position: absolute; background-color: rgb(102, 102, 102); color: rgb(255, 255, 255); z-index: 9999; padding: 5px; border-radius: 25px;"><div style="text-align:center;margin-top:-10px">S5: “EAF for the Pelagic Sub-Ecosystem”</div></div>
				  <div class="row" id="sapTool5a" style="left: 50%;display: none; position: absolute; background-color: rgb(102, 102, 102); color: rgb(255, 255, 255); z-index: 9999; padding: 5px; border-radius: 25px;"><div style="text-align:center;margin-top:-10px">S5A: “EAF for flyingfish”</div></div>
				  <div class="row" id="sapTool5b" style="left: 55%;display: none; position: absolute; background-color: rgb(102, 102, 102); color: rgb(255, 255, 255); z-index: 9999; padding: 5px; border-radius: 25px;"><div style="text-align:center;margin-top:-10px">S5B: “EAF for large pelagics”</div></div>
				  <div class="row" id="sapTool6" style=" left: 60%;display: none; position: absolute; background-color: rgb(102, 102, 102); color: rgb(255, 255, 255); z-index: 9999; padding: 5px; border-radius: 25px;"><div style="text-align:center;margin-top:-10px">S6: “EBB/EAF for the Continental Shelf Sub-Ecosystem”</div></div>         

				</div>   
			</div>
		</div>			
          <div class="row">
            <div class="large-12 columns">
            	<div class="containerGroup">
                 
                   
				   
					  <label class="controlline control--checkbox" >
                       <img id="i_sap1" src="<?php bloginfo( 'template_url' ); ?>/dist/images/S1_ICON_C.fw.png" class="PPIF_S"  width="80px" height="auto" onclick="visualizar(this,'sap1');"  onmouseover="visualizarTitle('sapTool1',1);" onmouseout="visualizarTitle('sapTool1',0);" />
                        <input type="checkbox"  name="gcheSap"id="c_sap1" <?php if (count($pChecksap0)>0 && $pChecksap0[0]!=""){echo 'checked="checked"';}?>/>
                  
                      </label>
                      &nbsp;&nbsp;
                        <label class="controlline control--checkbox"> 
                        <img id="i_sap2" src="<?php bloginfo( 'template_url' ); ?>/dist/images/S2_ICON_C.fw.png" class="PPIF_S"  width="80px" height="auto" onclick="visualizar(this,'sap2');" onmouseover="visualizarTitle('sapTool2',1);" onmouseout="visualizarTitle('sapTool2',0);"/>
                        <input type="checkbox" name="gcheSap" id="c_sap2" <?php if (count($pChecksap1)>0 && $pChecksap1[0] !=""){echo 'checked="checked"';}?>/>
                        </label>
                        &nbsp;&nbsp;
                        <label class="controlline control--checkbox">
                         <img id="i_sap3" src="<?php bloginfo( 'template_url' ); ?>/dist/images/S3_ICON_C.fw.png" class="PPIF_S"  width="80px" height="auto" onclick="visualizar(this,'sap3');" onmouseover="visualizarTitle('sapTool3',1);" onmouseout="visualizarTitle('sapTool3',0);"/>
                         <input type="checkbox" name="gcheSap" id="c_sap3" <?php if (count($pChecksap2)>0 && $pChecksap2[0] !=""){echo 'checked="checked"';}?>/>
                         </label>
                         &nbsp;&nbsp;
                        <label class="controlline control--checkbox">
                        <img id="i_sap4" src="<?php bloginfo( 'template_url' ); ?>/dist/images/S4_ICON_C.fw.png" class="PPIF_S"  width="80px" height="auto" onclick="visualizar(this,'sap4');" onmouseover="visualizarTitle('sapTool4',1);" onmouseout="visualizarTitle('sapTool4',0);"/>
                        <input type="checkbox"  name="gcheSap" id="c_sap4" <?php if (count($pChecksap3)>0 && $pChecksap3[0] !=""){echo 'checked="checked"';}?>/>
                        </label>
                        &nbsp;&nbsp;
                        <label class="controlline control--checkbox">
                         <img id="i_sap4a" src="<?php bloginfo( 'template_url' ); ?>/dist/images/S4A_ICON_C.fw.png" class="PPIF_S"  width="80px" height="auto" onclick="visualizar(this,'sap4a');" onmouseover="visualizarTitle('sapTool4a',1);" onmouseout="visualizarTitle('sapTool4a',0);"/>
                         <input type="checkbox" name="gcheSap" id="c_sap4a" <?php if (count($pChecksap4)>0 && $pChecksap4[0] !=""){echo 'checked="checked"';}?>/>
                         </label>
                         &nbsp;&nbsp;
                        <label class="controlline control--checkbox">
                        <img id="i_sap4b" src="<?php bloginfo( 'template_url' ); ?>/dist/images/S4B_ICON_C.fw.png" class="PPIF_S"  width="80px" height="auto" onclick="visualizar(this,'sap4b');" onmouseover="visualizarTitle('sapTool4b',1);" onmouseout="visualizarTitle('sapTool4b',0);"/>
                        <input type="checkbox" name="gcheSap" id="c_sap4b" <?php if (count($pChecksap5)>0 && $pChecksap5[0] !=""){echo 'checked="checked"';}?>/>
                        </label>
                        &nbsp;&nbsp;
                        <label class="controlline control--checkbox">
                         <img id="i_sap5" src="<?php bloginfo( 'template_url' ); ?>/dist/images/S5_ICON_C.fw.png" class="PPIF_S"  width="80px" height="auto" onclick="visualizar(this,'sap5');" onmouseover="visualizarTitle('sapTool5',1);" onmouseout="visualizarTitle('sapTool5',0);"/>
                         <input type="checkbox"  name="gcheSap" id="c_sap5" <?php if (count($pChecksap6)>0 && $pChecksap6[0] !=""){echo 'checked="checked"';}?>/>
                         </label>
                         &nbsp;&nbsp;
                        <label class="controlline control--checkbox"> 
                        <img id="i_sap5a" src="<?php bloginfo( 'template_url' ); ?>/dist/images/S5A_ICON_C.fw.png" class="PPIF_S"  width="80px" height="auto" onclick="visualizar(this,'sap5a');" onmouseover="visualizarTitle('sapTool5a',1);" onmouseout="visualizarTitle('sapTool5a',0);"/>
                        <input type="checkbox" name="gcheSap" id="c_sap5a" <?php if (count($pChecksap7)>0 && $pChecksap7[0] !=""){echo 'checked="checked"';}?>/>
                        </label>
                        &nbsp;&nbsp;
                         <label class="controlline control--checkbox"> 
                         <img id="i_sap5b" src="<?php bloginfo( 'template_url' ); ?>/dist/images/S5B_ICON_C.fw.png" class="PPIF_S"  width="80px" height="auto" onclick="visualizar(this,'sap5b');" onmouseover="visualizarTitle('sapTool5b',1);" onmouseout="visualizarTitle('sapTool5b',0);"/>
                         <input type="checkbox" name="gcheSap" id="c_sap5b" <?php if (count($pChecksap8)>0 && $pChecksap8[0] !=""){echo 'checked="checked"';}?>/></label>
                         &nbsp;&nbsp;
						 
                          <label class="controlline control--checkbox">
						  
                           <img id="i_sap6" src="<?php bloginfo( 'template_url' ); ?>/dist/images/S6_ICON_C.fw.png" class="PPIF_S"  width="80px" height="auto" onclick="visualizar(this,'sap6');" onmouseover="visualizarTitle('sapTool6',1);" onmouseout="visualizarTitle('sapTool6',0);"/>
                           <input type="checkbox" name="gcheSap" id="c_sap6" <?php if (count($pChecksap9)>0 && $pChecksap9[0] !=""){echo 'checked="checked"';}?>/></label>
                        
                         
                   
				</div>
				
             </div>
         </div>

     
          <?php 
		 
		 
		 
		  for ($j=0;$j<count($SapST);$j++){
			  
		 ?>
         <div class="row" id="sap<?php echo strtolower($SapST[$j]);?>" style="display:none">
            <div class="large-12 columns">
            <br>
                <h4 style="display: flex;"><?php _e('SAP', 'sage' );?>&nbsp;-&nbsp;<?php _e( getNameSAPstrategy($SapST[$j]), 'sage' ); ?> </h4>
				<div class="control-group">
				<?php 
                        
                        for ($i=0;$i<count($SapS[$j]);$i++){
                            echo '<label class="control control--checkbox">'.__( getNameSAPstrategy($SapS[$j][$i]), 'sage' ).'<input type="checkbox" name="pChecksap'.$j.'[]" id="pChecksap'.$SapS[$j][$i].'" value="'.$SapS[$j][$i].'" ';
							if (in_array($SapS[$j][$i], ${"pChecksap".$j},true)){echo 'checked="checked" ';}
							echo '/><div class="control__indicator"></div></label>';
                                    
                        }
                        ?>
                </div>
             </div>
         </div>
		<?php } ?>
         
         <?php if ($peditFields==true) {?>
              <div class="row" style="padding-top:30px;">
            <div class="large-6 columns">
                 <h6><?php _e( ' HIGHLY RECOMMENDED: Please briefly list your project’s major achievements to date, in terms of its contributions to the implementation of the CLME+ SAP, in the box here below, and/or provide additional information by uploading a more detailed document', 'sage' ); ?></h6>
                 <textarea id="psapobs" name="psapobs">
                 <?php echo $psapobs; ?>
                 </textarea>
                
              
  
                
				</div>
                <div class="large-6 columns">
                
                 <?php

if( $psapofile) { 

if($psapofile['filename']<>""){

?>
                 
                 <div id="file6div" style="display:flex;"><a href="<?php echo $psapofile['url']; ?>"><?php echo $psapofile['filename']; ?></a>&nbsp;&nbsp;<div  class="remove-files-style" onclick="document.getElementById('file5div').style.display='block';document.getElementById('psapofile').disabled=false;document.getElementById('file6div').style.display='none';">delete</div></div>
                
                 	<div id="file5div" class="image-upload-wrap3" style="display:none;">
    					<input class="file-upload-input3" type='file' onchange="readURL3(this);" accept="*" name="psapofile" id="psapofile" disabled="disabled" />
   						 <div class="drag-text3">
      							<h3><?php _e( 'You can drag and drop a document here that further describes and/or contains link to these achievements', 'sage' ); ?> </h3>
   						 </div>
  					</div>
  					<div class="file-upload-content3">
    					<img class="file-upload-image3" src="#" alt="your file" />
   						 <div class="image-title-wrap3">
      						<button type="button" onclick="removeUpload3()" class="remove-image3"><?php _e( 'Remove file', 'sage' ); ?> <span class="image-title3"><?php _e( 'Uploaded File', 'sage' ); ?></span></button>
    					</div>
  					</div>
   <?php } else { ?>
      <div class="image-upload-wrap3" >
    					<input class="file-upload-input3" type='file' onchange="readURL3(this);" accept="*" name="psapofile" id="psapofile" />
   						 <div class="drag-text3">
      							<h3><?php _e( 'You can drag and drop a document here that further describes and/or contains link to these achievements', 'sage' ); ?> </h3>
   						 </div>
  					</div>
  					<div class="file-upload-content3">
    					<img class="file-upload-image3" src="#" alt="your file" />
   						 <div class="image-title-wrap3">
      						<button type="button" onclick="removeUpload3()" class="remove-image3"><?php _e( 'Remove file', 'sage' ); ?> <span class="image-title3"><?php _e( 'Uploaded File', 'sage' ); ?></span></button>
    					</div>
  		
          </div>
          <?php }} else { ?>
         
         <div class="image-upload-wrap3" >
    					<input class="file-upload-input3" type='file' onchange="readURL3(this);" accept="*" name="psapofile" id="psapofile" />
   						 <div class="drag-text3">
      							<h3><?php _e( 'You can drag and drop a document here that further describes and/or contains link to these achievements', 'sage' ); ?> </h3>
   						 </div>
  					</div>
  					<div class="file-upload-content3">
    					<img class="file-upload-image3" src="#" alt="your file" />
   						 <div class="image-title-wrap3">
      						<button type="button" onclick="removeUpload3()" class="remove-image3"><?php _e( 'Remove file', 'sage' ); ?> <span class="image-title3"><?php _e( 'Uploaded File', 'sage' ); ?></span></button>
    					</div>
  		
          </div>
         
         
          <?php } ?> 
          		

         </div>
         </div>
 <?php } ?> 
          <div class="row">
            <div class="large-12 columns">
            <br>
                <h4><?php _e('Sustainable Development Goals (SDGs)', 'sage' ); ?></h4>
                <h6><?php _e('In 2015, countries adopted the 2030 Agenda for Sustainable Development, with 17 associated “Sustainable Development Goals” (“SDGs”). Over the next thirteen years, with these new universal Goals, countries will mobilize efforts to end all forms of poverty, fight inequalities and tackle climate change, while ensuring that no one is left behind. In particular, Goal 14 focusses on Life in our Oceans and Seas.', 'sage' ); ?></h6>
             </div>
         </div>
         <div class="row">
            <div class="large-12 columns">
            <br>
        <h6> <?php _e('Which target(s) of Goal 14 does your initiative contribute to?', 'sage' ); ?></h6>
         	</div>
         </div>
          <?php 
		 $Goals= array( '',array('1.1','1.2','1.3','1.4','1.5','1.A','1.B'), 
		 		 array('2.1','2.2','2.3','2.4','2.5','2.A','2.B','2.C'), 
				 array('3.1','3.2','3.3','3.4','3.5','3.6','3.7','3.8','3.9','3.a','3.b','3.c','3.d'), 
				 array('4.1','4.2','4.3','4.4','4.5','4.6','4.7','4.a','4.b','4.c'),
				 array('5.1','5.2','5.3','5.4','5.5','5.6','5.a','5.b','5.c'),
				 array('6.1','6.2','6.3','6.4','6.5','6.6','6.a','6.b'),
				 array('7.1','7.2','7.3','7.a','7.b'),
				 array('8.1','8.2','8.3','8.4','8.5','8.6','8.7','8.8','8.9','8.10','8.a','8.b'),
				 array('9.1','9.2','9.3','9.4','9.5','9.a','9.b','9.c'),
				 array('10.1','10.2','10.3','10.4','10.5','10.6','10.7','10.a','10.b','10.c'),
				 array('11.1','11.2','11.3','11.4','11.5','11.6','11.7','11.a','11.b','11.c'),
				 array('12.1','12.2','12.3','12.4','12.5','12.6','12.7','12.8','12.a','12.b','12.c'),
				 array('13.1','13.2','13.3','13.a','13.b'),
				 array('14.1','14.2','14.3','14.4','14.5','14.6','14.7','14.a','14.b','14.c'),
				 array('15.1','15.2','15.3','15.4','15.5','15.6','15.7','15.8','15.9','15.a','15.b','15.c'),
				 array('16.1','16.2','16.3','16.4','16.5','16.6','16.7','16.8','16.9','16.10','16.a','16.b'),
				 array('17.1','17.2','17.3','17.4','17.5','17.6','17.7','17.8','17.9','17.10','17.11','17.12','17.13','17.14','17.15','17.16','17.17','17.18','17.19') );
				 ?>
         <div class="row" id="sdg14" style="display:block">
         <br>
            <div class="large-12 columns">
             <div style="float:left;">
                <div style="float:left;"><img src="<?php bloginfo( 'template_url' ); ?>/dist/images/sdg17/F_SDG_14.fw.png"  width="80px" height="auto" /></div> <div style="float:left; width:5%">&nbsp;</div> <div style="float:left; width:70%"><h4 style="display: flex;"><?php _e('Goal', 'sage' ); ?>&nbsp;-&nbsp;<?php _e(getNameSDG17(14), 'sage' );?></h4></div></div>
				<div class="control-group">
				<?php 
                        
                        for ($i=0;$i<count($Goals[14]);$i++){
                            echo '<label class="control control--checkbox">';
							//_e($Goals[14][$i], 'sage' );
							//echo ". ";
							_e(getNameSDG17($Goals[14][$i]), 'sage' );
							echo '<input type="checkbox" name="pChecksdg14[]" id="pChecksdg14" value="'.$Goals[14][$i].'" ';
							
							if (in_array($Goals[14][$i],$pChecksdg14,false)){echo 'checked="checked" ';}
							
							echo ' /><div class="control__indicator"></div> </label>';
                                    
                        }
                        ?>
                </div>
             </div>
         </div>
         <div class="row">
            <div class="large-12 columns">
            <br>
        <h6> <?php _e('Which (if any) of the other SDGs does this project contribute to?', 'sage' ); ?></h6>
         	</div>
             <div class="large-12 columns">
        &nbsp;
         	</div>
         </div>
 
         <div class="row">
            <div class="large-12 columns">
            	<div class="containerGroup">
<!--   
                        <label class="controlline controlline--checkbox"> 
                        <img id="i_sdg1" src="<?php bloginfo( 'template_url' ); ?>/dist/images/sdg17/F_SDG_1.fw.png" class="PPIF_S"  width="80px" height="auto" onclick="visualizar(this,'sdg1');" />               
                        <input type="checkbox" name="c_sdg" id="c_sdg1" <?php if (count($pChecksdg1)>0 && $pChecksdg1[0] !=""){echo 'checked="checked"';}?> />
                      </label>
                      <label class="controlline controlline--checkbox">
                      <img id="i_sdg2" src="<?php bloginfo( 'template_url' ); ?>/dist/images/sdg17/F_SDG_2.fw.png" class="PPIF_S"  width="80px" height="auto" onclick="visualizar(this,'sdg2');" />
                      <input type="checkbox" name="c_sdg" id="c_sdg2" <?php if (count($pChecksdg2)>0 && $pChecksdg2[0] !=""){echo 'checked="checked"';}?> />
                       
                      </label>
                      <label class="controlline controlline--checkbox">
                       <img id="i_sdg3" src="<?php bloginfo( 'template_url' ); ?>/dist/images/sdg17/F_SDG_3.fw.png" class="PPIF_S"  width="80px" height="auto" onclick="visualizar(this,'sdg3');" />
                       <input type="checkbox" name="c_sdg" id="c_sdg3" <?php if (count($pChecksdg3)>0 && $pChecksdg3[0] !=""){echo 'checked="checked"';}?>/>
                       
                      </label>
                      <label class="controlline controlline--checkbox">
                       <img id="i_sdg4" src="<?php bloginfo( 'template_url' ); ?>/dist/images/sdg17/F_SDG_4.fw.png" class="PPIF_S"  width="80px" height="auto" onclick="visualizar(this,'sdg4');" />
                       <input type="checkbox" name="c_sdg" id="c_sdg4" <?php if (count($pChecksdg4)>0 && $pChecksdg4[0] !=""){echo 'checked="checked"';}?>/>
                      
                      </label>
                      <label class="controlline controlline--checkbox">
                       <img id="i_sdg5" src="<?php bloginfo( 'template_url' ); ?>/dist/images/sdg17/F_SDG_5.fw.png" class="PPIF_S"  width="80px" height="auto" onclick="visualizar(this,'sdg5');" />
                       <input type="checkbox" name="c_sdg" id="c_sdg5" <?php if (count($pChecksdg5)>0 && $pChecksdg5[0] !=""){echo 'checked="checked"';}?>/>
                      
                      </label>
                      <label class="controlline controlline--checkbox">
                       <img id="i_sdg6" src="<?php bloginfo( 'template_url' ); ?>/dist/images/sdg17/F_SDG_6.fw.png" class="PPIF_S"  width="80px" height="auto" onclick="visualizar(this,'sdg6');" />
                       <input type="checkbox" name="c_sdg" id="c_sdg6" <?php if (count($pChecksdg6)>0 && $pChecksdg6[0] !=""){echo 'checked="checked"';}?>/>
                       
                      </label>
                      <label class="controlline controlline--checkbox">
                       <img id="i_sdg7" src="<?php bloginfo( 'template_url' ); ?>/dist/images/sdg17/F_SDG_7.fw.png" class="PPIF_S"  width="80px" height="auto" onclick="visualizar(this,'sdg7');" />
                       <input type="checkbox" name="c_sdg" id="c_sdg7" <?php if (count($pChecksdg7)>0 && $pChecksdg7[0] !=""){echo 'checked="checked"';}?>/>
                       
                      </label>
                      <label class="controlline controlline--checkbox">
                       <img id="i_sdg8" src="<?php bloginfo( 'template_url' ); ?>/dist/images/sdg17/F_SDG_8.fw.png" class="PPIF_S"  width="80px" height="auto" onclick="visualizar(this,'sdg8');" />
                      <input type="checkbox" name="c_sdg" id="c_sdg8" <?php if (count($pChecksdg8)>0 && $pChecksdg8[0] !=""){echo 'checked="checked"';}?>/>
                      
                      </label>
                      <label class="controlline controlline--checkbox">
                       <img id="i_sdg9" src="<?php bloginfo( 'template_url' ); ?>/dist/images/sdg17/F_SDG_9.fw.png" class="PPIF_S"  width="80px" height="auto" onclick="visualizar(this,'sdg9');" />
                       <input type="checkbox" name="c_sdg" id="c_sdg9" <?php if (count($pChecksdg9)>0 && $pChecksdg9[0] !=""){echo 'checked="checked"';}?>/> 
                      </label>
                      <label class="controlline controlline--checkbox">
                       <img id="i_sdg10" src="<?php bloginfo( 'template_url' ); ?>/dist/images/sdg17/F_SDG_10.fw.png" class="PPIF_S"  width="80px" height="auto" onclick="visualizar(this,'sdg10');" />
                       <input type="checkbox" name="c_sdg" id="c_sdg10" <?php if (count($pChecksdg10)>0 && $pChecksdg10[0] !=""){echo 'checked="checked"';}?>/>
                       
                      </label>
                      <label class="controlline controlline--checkbox">
                       <img id="i_sdg11" src="<?php bloginfo( 'template_url' ); ?>/dist/images/sdg17/F_SDG_11.fw.png" class="PPIF_S"  width="80px" height="auto" onclick="visualizar(this,'sdg11');" />
                       <input type="checkbox" name="c_sdg" id="c_sdg11" <?php if (count($pChecksdg11)>0 && $pChecksdg11[0] !=""){echo 'checked="checked"';}?>/>
                       
                      </label>
                      <label class="controlline controlline--checkbox">
                       <img id="i_sdg12" src="<?php bloginfo( 'template_url' ); ?>/dist/images/sdg17/F_SDG_12.fw.png" class="PPIF_S"  width="80px" height="auto" onclick="visualizar(this,'sdg12');" />
                       <input type="checkbox" name="c_sdg" id="c_sdg12" <?php if (count($pChecksdg12)>0 && $pChecksdg12[0] !=""){echo 'checked="checked"';}?>/>
                       
                      </label>
                      <label class="controlline controlline--checkbox">
                       <img id="i_sdg13" src="<?php bloginfo( 'template_url' ); ?>/dist/images/sdg17/F_SDG_13.fw.png" class="PPIF_S"  width="80px" height="auto" onclick="visualizar(this,'sdg13');" />
                       <input type="checkbox" name="c_sdg" id="c_sdg13" <?php if (count($pChecksdg13)>0 && $pChecksdg13[0] !=""){echo 'checked="checked"';}?>/>
                       
                      </label>
                      <label class="controlline controlline--checkbox">
                       <img id="i_sdg15" src="<?php bloginfo( 'template_url' ); ?>/dist/images/sdg17/F_SDG_15.fw.png" class="PPIF_S"  width="80px" height="auto" onclick="visualizar(this,'sdg15');" />
                       <input type="checkbox" name="c_sdg" id="c_sdg15" <?php if (count($pChecksdg15)>0 && $pChecksdg15[0] !=""){echo 'checked="checked"';}?>/>
                      </label>
                      <label class="controlline controlline--checkbox">
                       <img id="i_sdg16" src="<?php bloginfo( 'template_url' ); ?>/dist/images/sdg17/F_SDG_16.fw.png" class="PPIF_S"  width="80px" height="auto" onclick="visualizar(this,'sdg16');" />
                       <input type="checkbox" name="c_sdg" id="c_sdg16" <?php if (count($pChecksdg16)>0 && $pChecksdg16[0] !=""){echo 'checked="checked"';}?>/>
                   
                      </label>
                      <label class="controlline controlline--checkbox">
                       <img id="i_sdg17" src="<?php bloginfo( 'template_url' ); ?>/dist/images/sdg17/F_SDG_17.fw.png" class="PPIF_S"  width="80px" height="auto" onclick="visualizar(this,'sdg17');" />
                       <input type="checkbox" name="c_sdg" id="c_sdg17" <?php if (count($pChecksdg17)>0 && $pChecksdg17[0] !=""){echo 'checked="checked"';}?>/>
                      </label>
   -->
					<label class="controlline controlline--checkbox"> 
                        <img id="i_sdg1" src="<?php bloginfo( 'template_url' ); ?>/dist/images/sdg17/F_SDG_1.fw.png" class="PPIF_S"  width="80px" height="auto" onclick="visualizar(this,'sdg1');" style="margin-bottom: 0.5rem;"/>               
                        <input type="checkbox" name="c_sdg[]" id="c_sdg1"  value="1.1" <?php if (count($pChecksdg1)>0 && $pChecksdg1[0] !=""){echo 'checked="checked"';}?> />
                      </label>
                      &nbsp;&nbsp;
                      <label class="controlline controlline--checkbox">
                      <img id="i_sdg2" src="<?php bloginfo( 'template_url' ); ?>/dist/images/sdg17/F_SDG_2.fw.png" class="PPIF_S"  width="80px" height="auto"  onclick="visualizar(this,'sdg2');" style="margin-bottom: 0.5rem;"/>
                      <input type="checkbox" name="c_sdg[]" id="c_sdg2"   value="2.1" <?php if (count($pChecksdg2)>0 && $pChecksdg2[0] !=""){echo 'checked="checked"';}?> />
                       
                      </label>
                      &nbsp;&nbsp;
                      <label class="controlline controlline--checkbox">
                       <img id="i_sdg3" src="<?php bloginfo( 'template_url' ); ?>/dist/images/sdg17/F_SDG_3.fw.png" class="PPIF_S"  width="80px" height="auto"  onclick="visualizar(this,'sdg3');" style="margin-bottom: 0.5rem;"/>
                       <input type="checkbox" name="c_sdg[]" id="c_sdg3"  value="3.1"  <?php if (count($pChecksdg3)>0 && $pChecksdg3[0] !=""){echo 'checked="checked"';}?>/>
                       
                      </label>
                      &nbsp;&nbsp;
                      <label class="controlline controlline--checkbox">
                       <img id="i_sdg4" src="<?php bloginfo( 'template_url' ); ?>/dist/images/sdg17/F_SDG_4.fw.png" class="PPIF_S"  width="80px" height="auto" onclick="visualizar(this,'sdg4');" style="margin-bottom: 0.5rem;"/>
                       <input type="checkbox" name="c_sdg[]" id="c_sdg4"   value="4.1"  <?php if (count($pChecksdg4)>0 && $pChecksdg4[0] !=""){echo 'checked="checked"';}?>/>
                      
                      </label>
                      &nbsp;&nbsp;
                      <label class="controlline controlline--checkbox">
                       <img id="i_sdg5" src="<?php bloginfo( 'template_url' ); ?>/dist/images/sdg17/F_SDG_5.fw.png" class="PPIF_S"  width="80px" height="auto"  onclick="visualizar(this,'sdg5');" style="margin-bottom: 0.5rem;"/>
                       <input type="checkbox" name="c_sdg[]" id="c_sdg5"   value="5.1" <?php if (count($pChecksdg5)>0 && $pChecksdg5[0] !=""){echo 'checked="checked"';}?>/>
                      
                      </label>
                      &nbsp;&nbsp;
                      <label class="controlline controlline--checkbox">
                       <img id="i_sdg6" src="<?php bloginfo( 'template_url' ); ?>/dist/images/sdg17/F_SDG_6.fw.png" class="PPIF_S"  width="80px" height="auto"  onclick="visualizar(this,'sdg6');" style="margin-bottom: 0.5rem;"/>
                       <input type="checkbox" name="c_sdg[]" id="c_sdg6"   value="6.1" <?php if (count($pChecksdg6)>0 && $pChecksdg6[0] !=""){echo 'checked="checked"';}?>/>
                       
                      </label>
                      &nbsp;&nbsp;
                      <label class="controlline controlline--checkbox">
                       <img id="i_sdg7" src="<?php bloginfo( 'template_url' ); ?>/dist/images/sdg17/F_SDG_7.fw.png" class="PPIF_S"  width="80px" height="auto" onclick="visualizar(this,'sdg7');" style="margin-bottom: 0.5rem;"/>
                       <input type="checkbox" name="c_sdg[]" id="c_sdg7"   value="7.1" <?php if (count($pChecksdg7)>0 && $pChecksdg7[0] !=""){echo 'checked="checked"';}?>/>
                       
                      </label>
                      &nbsp;&nbsp;
                      <label class="controlline controlline--checkbox">
                       <img id="i_sdg8" src="<?php bloginfo( 'template_url' ); ?>/dist/images/sdg17/F_SDG_8.fw.png" class="PPIF_S"  width="80px" height="auto" onclick="visualizar(this,'sdg8');" style="margin-bottom: 0.5rem;"/>
                      <input type="checkbox" name="c_sdg[]" id="c_sdg8"   value="8.1" <?php if (count($pChecksdg8)>0 && $pChecksdg8[0] !=""){echo 'checked="checked"';}?>/>
                      
                      </label>
                      &nbsp;&nbsp;
                      <label class="controlline controlline--checkbox">
                       <img id="i_sdg9" src="<?php bloginfo( 'template_url' ); ?>/dist/images/sdg17/F_SDG_9.fw.png" class="PPIF_S"  width="80px" height="auto" onclick="visualizar(this,'sdg9');" style="margin-bottom: 0.5rem;"/>
                       <input type="checkbox" name="c_sdg[]" id="c_sdg9"   value="9.1" <?php if (count($pChecksdg9)>0 && $pChecksdg9[0] !=""){echo 'checked="checked"';}?>/> 
                      </label>
                      &nbsp;&nbsp;
                      <label class="controlline controlline--checkbox">
                       <img id="i_sdg10" src="<?php bloginfo( 'template_url' ); ?>/dist/images/sdg17/F_SDG_10.fw.png" class="PPIF_S"  width="80px" height="auto"  onclick="visualizar(this,'sdg10');" style="margin-bottom: 0.5rem;"/>
                       <input type="checkbox" name="c_sdg[]" id="c_sdg10"   value="10.1" <?php if (count($pChecksdg10)>0 && $pChecksdg10[0] !=""){echo 'checked="checked"';}?>/>
                       
                      </label>
                      &nbsp;&nbsp;
                      <label class="controlline controlline--checkbox">
                       <img id="i_sdg11" src="<?php bloginfo( 'template_url' ); ?>/dist/images/sdg17/F_SDG_11.fw.png" class="PPIF_S"  width="80px" height="auto"  onclick="visualizar(this,'sdg11');" style="margin-bottom: 0.5rem;"/>
                       <input type="checkbox" name="c_sdg[]" id="c_sdg11"   value="11.1" <?php if (count($pChecksdg11)>0 && $pChecksdg11[0] !=""){echo 'checked="checked"';}?>/>
                       
                      </label>
                      &nbsp;&nbsp;
                      <label class="controlline controlline--checkbox">
                       <img id="i_sdg12" src="<?php bloginfo( 'template_url' ); ?>/dist/images/sdg17/F_SDG_12.fw.png" class="PPIF_S"  width="80px" height="auto" onclick="visualizar(this,'sdg12');" style="margin-bottom: 0.5rem;"/>
                       <input type="checkbox" name="c_sdg[]" id="c_sdg12"   value="12.1" <?php if (count($pChecksdg12)>0 && $pChecksdg12[0] !=""){echo 'checked="checked"';}?>/>
                       
                      </label>
                      &nbsp;&nbsp;
                      <label class="controlline controlline--checkbox">
                       <img id="i_sdg13" src="<?php bloginfo( 'template_url' ); ?>/dist/images/sdg17/F_SDG_13.fw.png" class="PPIF_S"  width="80px" height="auto"  onclick="visualizar(this,'sdg13');" style="margin-bottom: 0.5rem;"/>
                       <input type="checkbox" name="c_sdg[]" id="c_sdg13"   value="13.1" <?php if (count($pChecksdg13)>0 && $pChecksdg13[0] !=""){echo 'checked="checked"';}?>/>
                       
                      </label>
                      &nbsp;&nbsp;
                      <label class="controlline controlline--checkbox">
                       <img id="i_sdg15" src="<?php bloginfo( 'template_url' ); ?>/dist/images/sdg17/F_SDG_15.fw.png" class="PPIF_S"  width="80px" height="auto" onclick="visualizar(this,'sdg15');" style="margin-bottom: 0.5rem;"/>
                       <input type="checkbox" name="c_sdg[]" id="c_sdg15"   value="15.1" <?php if (count($pChecksdg15)>0 && $pChecksdg15[0] !=""){echo 'checked="checked"';}?>/>
                      </label>
                      &nbsp;&nbsp;
                      <label class="controlline controlline--checkbox">
                       <img id="i_sdg16" src="<?php bloginfo( 'template_url' ); ?>/dist/images/sdg17/F_SDG_16.fw.png" class="PPIF_S"  width="80px" height="auto" onclick="visualizar(this,'sdg16');" style="margin-bottom: 0.5rem;"/>
                       <input type="checkbox" name="c_sdg[]" id="c_sdg16"   value="16.1" <?php if (count($pChecksdg16)>0 && $pChecksdg16[0] !=""){echo 'checked="checked"';}?>/>
                   
                      </label>
                      &nbsp;&nbsp;
                      <label class="controlline controlline--checkbox">
                       <img id="i_sdg17" src="<?php bloginfo( 'template_url' ); ?>/dist/images/sdg17/F_SDG_17.fw.png" class="PPIF_S"  width="80px" height="auto" onclick="visualizar(this,'sdg17');" style="margin-bottom: 0.5rem;"/>
                       <input type="checkbox" name="c_sdg[]"  id="c_sdg17"  value="17.1"  <?php if (count($pChecksdg17)>0 && $pChecksdg17[0] !=""){echo 'checked="checked"';}?>/>
                      </label>
                      
				</div>
             </div>
         </div>
        
         
         <?php 
		  for ($j=1;$j<18;$j++){
		 ?>
         <?php if ($peditFields==true) {?>   
         <div class="row" id="sdg<?php echo $j;?>" style="display:none">
            <div class="large-12 columns">
            <br>
                <h4><span style=" display:flex;"><?php _e('Goal', 'sage' ); ?> - &nbsp;<?php _e(getNameSDG17($j), 'sage' ); ?></span></h4>
				<div class="control-group">
				<?php 
                        
                        for ($i=0;$i<count($Goals[$j]);$i++){
                            echo '<label class="control control--checkbox">';
							_e(getNameSDG17($Goals[$j][$i]), 'sage' );
							echo '<input type="checkbox" name="pChecksdg'.$j.'[]" id="pChecksdg'.$j.'" value="'.$Goals[$j][$i].'" ';
							if (in_array($Goals[$j][$i],  ${"pChecksdg".$j},false)){echo 'checked="checked"';}
							echo '/><div class="control__indicator"></div> </label>';
                                    
                        }
                        ?>
                </div>
             </div>
         </div>
         

         
         
         
         
		<?php 
		if ($j==13){$j++;}
		} }?>
		
        
        <?php if ($peditFields==true) {?>     
          <div class="row" style="padding-top:30px;">
            <div class="large-6 columns">
                 <h6><?php _e( 'HIGHLY RECOMMENDED: Please briefly list your project’s major achievements to date, in terms of its contributions to the implementation of the 2030 UN Sustainable Development Agenda (in particular SDG14) in the box here below, and/or provide additional information by uploading a more detailed document', 'sage' ); ?></h6>
                 
               <textarea id="psdgobs" name="psdgobs">
                 <?php echo $psdgobs; ?>
                 </textarea>
  
                
				</div>
                <div class="large-6 columns">
                
                
                 <?php

if( $psdgfile) { 

if($psdgfile['filename']<>""){
?>
                 
                 <div id="file8div" style="display:flex;"><a href="<?php echo $psdgfile['url']; ?>"><?php echo $psdgfile['filename']; ?></a>&nbsp;&nbsp;<div  class="remove-files-style" onclick="document.getElementById('file7div').style.display='block';document.getElementById('psdgfile').disabled=false;document.getElementById('file8div').style.display='none';">delete</div></div>
                
                 	<div id="file7div" class="image-upload-wrap4" style="display:none;">
                   
    					<input class="file-upload-input4" type='file' onchange="readURL4(this);" accept="*" name="psdgfile" id="psdgfile" disabled="disabled" />
   						 <div class="drag-text4">
      							<h3><?php _e( 'You can drag and drop a document here that further describes and/or contains link to these achievements', 'sage' ); ?> </h3>
   						 </div>
  					</div>
  					<div class="file-upload-content4">
    					<img class="file-upload-image4" src="#" alt="your image" />
   						 <div class="image-title-wrap4">
      						<button type="button" onclick="removeUpload4()" class="remove-image4"><?php _e( 'Remove file', 'sage' ); ?> <span class="image-title4"><?php _e( 'Uploaded File', 'sage' ); ?></span></button>
    					</div>
  					</div>
   <?php } else { ?>
          <div class="image-upload-wrap4">
    					<input class="file-upload-input4" type='file' onchange="readURL4(this);" accept="*" name="psdgfile" id="psdgfile" />
   						 <div class="drag-text4">
      							<h3><?php _e( 'You can drag and drop a document here that further describes and/or contains link to these achievements', 'sage' ); ?> </h3>
   						 </div>
  					</div>
  					<div class="file-upload-content4">
    					<img class="file-upload-image4" src="#" alt="your image" />
   						 <div class="image-title-wrap4">
      						<button type="button" onclick="removeUpload4()" class="remove-image4"><?php _e( 'Remove file', 'sage' ); ?> <span class="image-title4"><?php _e( 'Uploaded File', 'sage' ); ?></span></button>
    					</div>
  					</div>
        
        <?php }} else { ?>
       				 <div class="image-upload-wrap4">
    					<input class="file-upload-input4" type='file' onchange="readURL4(this);" accept="*" name="psdgfile" id="psdgfile" />
   						 <div class="drag-text4">
      							<h3><?php _e( 'You can drag and drop a document here that further describes and/or contains link to these achievements', 'sage' ); ?> </h3>
   						 </div>
  					</div>
  					<div class="file-upload-content4">
    					<img class="file-upload-image4" src="#" alt="your image" />
   						 <div class="image-title-wrap4">
      						<button type="button" onclick="removeUpload4()" class="remove-image4"><?php _e( 'Remove file', 'sage' ); ?> <span class="image-title4"><?php _e( 'Uploaded File', 'sage' ); ?></span></button>
    					</div>
  					</div>
        
        <?php } ?>
        </div>
         </div>
        <?php } ?>  
          <div class="row">
            <div class="large-12 columns">
            <br>
        <h4> <?php _e('Other Regional and Global Initiatives', 'sage' ); ?></h4>
         	</div>
             <div class="large-12 columns">
        &nbsp;
         	</div>
              <div class="large-12 columns">
        <h6><?php _e('Please indicate if your project contributes to any of the below:', 'sage' ); ?></h6>
         	</div>
             <div class="large-12 columns">
        &nbsp;
         	</div>
          </div>
        <div class="row">
            <div class="large-12 columns">
            	<div class="containerGroup">
				<?php
					$argsComm = array(
						'taxonomy'               => 'other_comm',
						'orderby'                => 'id',
						'order'                  => 'ASC',
						'hide_empty'             => false,
						'fields' 				=> 'all',
					);
					$the_queryComm = new WP_Term_Query($argsComm);
					//var_dump($pOtherComm);
					$idcons=1;
					foreach($the_queryComm->get_terms() as $termComm){
						//var_dump($termComm);
						$tempComm='<label class="control control--checkbox">'.$termComm->name.'<input type="checkbox" name="otherComm[]" id="otherComm_'.$idcons.'" value="'.$termComm->term_id.'"';
						if (in_array($termComm->term_id,$pOtherComm)){
							$tempComm=$tempComm.' checked="checked"';
						 }
						$tempComm=$tempComm.'/><div class="control__indicator"></div> </label>&nbsp;&nbsp;';
						echo $tempComm;
						$idcons++;
					} 

				?>	
       <!--<label class="control control--checkbox"><?php _e('LBS Protocol', 'sage' ); ?><input type="checkbox" name="otherComm[]" id="otherComm_1" value="LBS Protocol" <?php if (in_array('LBS Protocol',$pOtherComm)){echo 'checked="checked"';} ?>/><div class="control__indicator"></div> </label>&nbsp;&nbsp;
         <label class="control control--checkbox"><?php _e('SPAW Protocol', 'sage' ); ?><input type="checkbox" name="otherComm[]" id="otherComm_2" value="SPAW Protocol" <?php if (in_array('SPAW Protocol',$pOtherComm)){echo 'checked="checked"';} ?>/><div class="control__indicator"></div> </label>&nbsp;&nbsp;      
          <label class="control control--checkbox"><?php _e('Oil Spills Protocol', 'sage' ); ?><input type="checkbox" name="otherComm[]" id="otherComm_3" value="Oil Spills Protocol" <?php if (in_array('Oil Spills Protocol',$pOtherComm)){echo 'checked="checked"';} ?>/><div class="control__indicator"></div> </label>&nbsp;&nbsp; 
          <label class="control control--checkbox"><?php _e('SAMOA Pathway', 'sage' ); ?><input type="checkbox" name="otherComm[]" id="otherComm_4" value="SAMOA Pathway" <?php if (in_array('SAMOA Pathway',$pOtherComm)){echo 'checked="checked"';} ?>/><div class="control__indicator"></div> </label>&nbsp;&nbsp;
           <label class="control control--checkbox"><?php _e('SENDAI Pathway', 'sage' ); ?><input type="checkbox" name="otherComm[]" id="otherComm_6" value="SENDAI Pathway" <?php if (in_array('SENDAI Framework',$pOtherComm)){echo 'checked="checked"';} ?>/><div class="control__indicator"></div> </label>&nbsp;&nbsp;
          
          <label class="control control--checkbox"><?php _e('OECS ECROP', 'sage' ); ?><input type="checkbox" name="otherComm[]" id="otherComm_5" value="OECS ECROP" <?php if (in_array('OECS ECROP',$pOtherComm)){echo 'checked="checked"';} ?>/><div class="control__indicator"></div> </label>&nbsp;&nbsp;
          
          <label class="control control--checkbox"><?php _e('CCAD ERAM', 'sage' ); ?><input type="checkbox" name="otherComm[]" id="otherComm_6" value="CCAD ERAM" <?php if (in_array('CCAD ERAM',$pOtherComm)){echo 'checked="checked"';} ?>/><div class="control__indicator"></div> </label>&nbsp;&nbsp;
          
          <label class="control control--checkbox"><?php _e('CBD Strategic Plan', 'sage' ); ?><input type="checkbox" name="otherComm[]" id="otherComm_7" value="CBD Strategic Plan" <?php if (in_array('CBD Strategic Plan',$pOtherComm)){echo 'checked="checked"';} ?>/><div class="control__indicator"></div> </label>&nbsp;&nbsp;
		  <label class="control control--checkbox"><?php _e('C-SAP', 'sage' ); ?><input type="checkbox" name="otherComm[]" id="otherComm_8" value="C-SAP" <?php if (in_array('C-SAP',$pOtherComm)){echo 'checked="checked"';} ?>/><div class="control__indicator"></div> </label>-->
       			</div>
         	 </div>
         </div>
         
         <?php
		//TODO - create radiobox for Post COVID-19 Recovery, Sargassum and Plastics and Marine Debris 
		//TODO - create textareas for Post COVID-19 Recovery, Sargassum and Plastics and Marine Debris - make same as "Brief Description" (line 397)
		//TODO - write javascript to display corresponding selection from radiobox - hide/display
		?>
		
           <?php if ($peditFields==true) {?>
         <div class="row" style="padding-top:30px;">
            <div class="large-6 columns">
                 <h6><?php _e( 'HIGHLY RECOMMENDED: please briefly list your project’s major achievements to date, in terms of its contributions to the implementation of any of these initiatives, in the box here below, and/or provide additional information by uploading a more detailed document', 'sage' ); ?></h6>
               <textarea id="potherobs" name="potherobs">
                 <?php echo $potherobs; ?>
                 </textarea>
  
                
				</div>
                <div class="large-6 columns">
                
                
                  <?php
if( $potherfile) { 


if($potherfile['filename']<>""){
?>
                 
                 <div id="file10div" style="display:flex;"><a href="<?php echo $potherfile['url']; ?>"><?php echo $potherfile['filename']; ?></a>&nbsp;&nbsp;<div  class="remove-files-style" onclick="document.getElementById('file9div').style.display='block';document.getElementById('potherfile').disabled=false;document.getElementById('file10div').style.display='none';">delete</div></div>
                
                 	<div id="file9div" class="image-upload-wrap5" style="display:none;">
               
    					<input class="file-upload-input5" type='file' onchange="readURL5(this);" accept="*" name="potherfile" id="potherfile" disabled="disabled" />
   						 <div class="drag-text5">
      							<h3><?php _e( 'You can drag and drop a document here that further describes and/or contains link to these achievements', 'sage' ); ?> </h3>
   						 </div>
  					</div>
  					<div class="file-upload-content5">
    					<img class="file-upload-image5" src="#" alt="your image" />
   						 <div class="image-title-wrap5">
      						<button type="button" onclick="removeUpload5()" class="remove-image5"><?php _e( 'Remove file', 'sage' ); ?> <span class="image-title5"><?php _e( 'Uploaded File', 'sage' ); ?></span></button>
    					</div>
  					</div>

         <?php } else { ?>
           <div class="image-upload-wrap5">
    					<input class="file-upload-input5" type='file' onchange="readURL5(this);" accept="*" name="potherfile" id="potherfile" />
   						 <div class="drag-text5">
      							<h3><?php _e( 'You can drag and drop a document here that further describes and/or contains link to these achievements', 'sage' ); ?> </h3>
   						 </div>
  					</div>
  					<div class="file-upload-content5">
    					<img class="file-upload-image5" src="#" alt="your image" />
   						 <div class="image-title-wrap5">
      						<button type="button" onclick="removeUpload5()" class="remove-image5"><?php _e( 'Remove file', 'sage' ); ?> <span class="image-title5"><?php _e( 'Uploaded File', 'sage' ); ?></span></button>
    					</div>
  					</div>
         <?php } } else { ?>
         
         
       					  <div class="image-upload-wrap5">
    					<input class="file-upload-input5" type='file' onchange="readURL5(this);" accept="*" name="potherfile" id="potherfile" />
   						 <div class="drag-text5">
      							<h3><?php _e( 'You can drag and drop a document here that further describes and/or contains link to these achievements', 'sage' ); ?> </h3>
   						 </div>
  					</div>
  					<div class="file-upload-content5">
    					<img class="file-upload-image5" src="#" alt="your image" />
   						 <div class="image-title-wrap5">
      						<button type="button" onclick="removeUpload5()" class="remove-image5"><?php _e( 'Remove file', 'sage' ); ?> <span class="image-title5"><?php _e( 'Uploaded File', 'sage' ); ?></span></button>
    					</div>
  					</div>
         
             <?php }?>
           </div>
         </div>
             <?php }?>
          <div class="row">
            <div class="large-12 columns">
            <br>
            <?php if ($peditFields==true){?>
           <center> <input value="<?php _e('Update your Project Profile', 'sage' ); ?>" type="submit" ></input></center>
             <?php }else{?>
             <center> <input value="<?php _e('SUBMIT FOR APPROVAL AND PUBLICATION', 'sage' ); ?>" type="submit" ></input></center>
              <?php }?>
 			<br>
             </div>
         </div>
         <div class="row">
            <div class="large-12 columns">
            <br>
			<h6> <?php _e('For new users: once your Project Profile has been submitted and approved, you will be provided with a User Name and Password. With this information, you will be able to access and edit your Project Profile at any stage. We kindly invite you to keep your Project Profile up to date, by e.g. registering any change in project implementation status or contact information, and by uploading major project achievements.', 'sage' ); ?></h6>
         	</div>
         </div>
       
        
		</form>
	</div>
</article>
<br>
<br>
<script language="JavaScript" type="text/javascript">
function validarPaises(){
		var op = document.getElementById("pcountries").getElementsByTagName("option");
	    var e = document.getElementById("pgscope");
	    var scopeVal = e.options[e.selectedIndex].value;

		if(scopeVal==309){	
			for (var i = 0; i < op.length; i++) {
				op[i].disabled = false;op[i].Selected = false;	
			}
		}
		if(scopeVal==365){
			for (var i = 0; i < op.length; i++) {
				 if(op[i].value < 409){op[i].disabled = false;} 	else{op[i].Selected = false;op[i].disabled = true;}
			}		
		}
		if(scopeVal==367){
			for (var i = 0; i < op.length; i++) {
				 if(op[i].value > 408){
					 op[i].disabled = false;} 	else{op[i].Selected = false;op[i].disabled = true;}
			}
			
			
		}
	
		
		
	
	
}
//Aplicar grupos a los paises
function asignarPaises(grupo){
	
	var op = document.getElementById("pcountries").getElementsByTagName("option");
	//limpiar y asignar valores
	switch(grupo) {
		 case 1:
			asignarSelectPaises(op,Cgroups1);	
			break;
		 case 2:
			asignarSelectPaises(op,Cgroups2);	
			break;
		 case 3:
			asignarSelectPaises(op,Cgroups3);	
			break;
		case 4:
			asignarSelectPaises(op,Cgroups4);	
			break;
		case 5:
			asignarSelectPaises(op,Cgroups5);	
			break;
		case 6:
			//limpiar radio button
			jQuery('input[name=fastgroups]').attr('checked',false);
			document.getElementById("fastgroups6").checked = true;
			cleanSelect(op);
			break;	
		}
	
}
function asignarSelectPaises(campo,datalista){
	for (var i = 0; i < campo.length; i++) {
			campo[i].disabled = false;
			//alert(datalista.indexOf(campo[i].value)+' - '+campo[i].value);
			if(datalista.indexOf(campo[i].value) !== -1){
				jQuery('.pcountries').data('fastselect').setSelectedOption(jQuery('.pcountries option[value='+campo[i].value+']').get(0))
			} else{
				jQuery('.pcountries').data('fastselect').removeSelectedOption(jQuery('.pcountries option[value='+campo[i].value+']').get(0))

			}			
		}
}
function cleanSelect(campo){
	for (var i = 0; i < campo.length; i++) {
		jQuery('.pcountries').data('fastselect').removeSelectedOption(jQuery('.pcountries option[value='+campo[i].value+']').get(0))		
	}
}	
this.document.forms["ppi_database"].onsubmit = function(e){
	
	var forma = document.forms["ppi_database"];
	var e = document.getElementById("pgscope");
	var scopeVal = e.options[e.selectedIndex].value;
	//alert(scopeVal);
	
	
	var countries = getSelectValues(document.getElementById("pcountries")) ;
	//var strstatus = document.getElementById('pgstatus').value;
	var strstatus = document.getElementById('pgstatus').options[document.getElementById('pgstatus').selectedIndex].value;
	//205 diable countries
	if(strstatus!=205 && strstatus!=813){
		
	//var countries = e2.split(',');
			if(scopeVal==309){
				if(countries.length != 1){
					alert("Check countries selection, if you have more than one country please select the correct scope");
					return false;
					}
			}
			if(scopeVal==365){
				if(countries.length <= 1){
					alert("Check countries selection, if you one have one country please select the correct scope");
					return false;
				}else{
					for (var i = 0; i < countries.length; i++) {
						 if(countries[i] > 408){	
						 alert("Check countries selection, please select the correct scope");
						 return false;}
					}

				}
			}
			if(scopeVal==367){
				if(countries.length <= 1){
					alert("Check countries selection, if you one have one country please select the correct scope");
					return false;
				}else{
					var region1=false;
					var region2=false;
					for (var i = 0; i < countries.length; i++) {
						 if(countries[i] > 408){region1=true;}
						 if(countries[i] < 409){region2=true;}
					}
					if(region1!=true  && region2 !=true){
					 alert("Check countries selection, please select the correct scope");return false;
					}

				}
			}
	}

if(forma.pChecksap0[0].checked==false && forma.pChecksap0[1].checked==false && forma.pChecksap0[2].checked==false &&
forma.pChecksap0[3].checked==false && forma.pChecksap0[4].checked==false && forma.pChecksap0[5].checked==false && forma.pChecksap0[6].checked==false && forma.pChecksap0[7].checked==false && forma.pChecksap0[8].checked==false && forma.pChecksap0[9].checked==false && forma.pChecksap0[10].checked==false && forma.pChecksap1[0].checked==false && forma.pChecksap1[1].checked==false && forma.pChecksap1[2].checked==false && forma.pChecksap1[3].checked==false && forma.pChecksap1[4].checked==false && forma.pChecksap1[5].checked==false && forma.pChecksap1[6].checked==false && forma.pChecksap1[7].checked==false && forma.pChecksap1[8].checked==false && forma.pChecksap1[9].checked==false && forma.pChecksap1[10].checked==false && forma.pChecksap1[11].checked==false && forma.pChecksap1[12].checked==false && forma.pChecksap2[0].checked==false && forma.pChecksap2[1].checked==false && forma.pChecksap2[2].checked==false && forma.pChecksap2[3].checked==false && forma.pChecksap2[4].checked==false && forma.pChecksap2[5].checked==false && forma.pChecksap2[6].checked==false && forma.pChecksap3[0].checked==false && forma.pChecksap3[1].checked==false && forma.pChecksap3[2].checked==false && forma.pChecksap3[3].checked==false && forma.pChecksap3[4].checked==false && forma.pChecksap3[5].checked==false && forma.pChecksap3[6].checked==false && forma.pChecksap3[7].checked==false && forma.pChecksap4[0].checked==false && forma.pChecksap4[1].checked==false && forma.pChecksap4[2].checked==false && forma.pChecksap4[3].checked==false && forma.pChecksap5[0].checked==false && forma.pChecksap5[1].checked==false && forma.pChecksap5[2].checked==false && forma.pChecksap5[3].checked==false && forma.pChecksap5[4].checked==false && forma.pChecksap6[0].checked==false && forma.pChecksap6[1].checked==false && forma.pChecksap6[2].checked==false && forma.pChecksap6[3].checked==false && forma.pChecksap6[4].checked==false && forma.pChecksap6[5].checked==false && forma.pChecksap7[0].checked==false && forma.pChecksap7[1].checked==false && forma.pChecksap7[2].checked==false && forma.pChecksap7[3].checked==false && forma.pChecksap7[4].checked==false && forma.pChecksap7[5].checked==false && forma.pChecksap8[0].checked==false && forma.pChecksap8[1].checked==false && forma.pChecksap8[2].checked==false && forma.pChecksap8[3].checked==false && forma.pChecksap9[0].checked==false && forma.pChecksap9[1].checked==false && forma.pChecksap9[2].checked==false && forma.pChecksap9[3].checked==false && forma.pChecksap9[4].checked==false && forma.pChecksap9[5].checked==false && forma.pChecksap9[6].checked==false && forma.pChecksap9[7].checked==false && forma.pChecksap9[8].checked==false && forma.pChecksap9[9].checked==false && forma.pChecksap9[10].checked==false)
		{
			
			alert('Please check at least one of the options in SAP Strategy Items');
			forma.pChecksap0[0].focus();
			return false;
		}
	if(forma.pChecksdg14[0].checked==false && forma.pChecksdg14[1].checked==false && forma.pChecksdg14[2].checked==false && forma.pChecksdg14[3].checked==false && forma.pChecksdg14[4].checked==false && forma.pChecksdg14[5].checked==false && forma.pChecksdg14[6].checked==false && forma.pChecksdg14[7].checked==false && forma.pChecksdg14[8].checked==false && forma.pChecksdg14[9].checked==false) {
			alert('Please check at least one of the options in SDG  GOAL 14');
			forma.pChecksdg14[0].focus();
			return false;
		}
	
	
	
		//alert("Sending info to the PPI database ......");


}
function getSelectValues(select) {
  var result = [];
  var options = select && select.options;
  var opt;

  for (var i=0, iLen=options.length; i<iLen; i++) {
    opt = options[i];

    if (opt.selected) {
      result.push(opt.value || opt.text);
    }
  }
  return result;
}
</script>
<style>
form:not(#adminbarsearch) input[type="number"], form:not(#adminbarsearch) input[type="search"], form:not(#adminbarsearch) input[type="text"], form:not(#adminbarsearch) input[type="password"], form:not(#adminbarsearch) input[type="date"], form:not(#adminbarsearch) input[type="datetime"], form:not(#adminbarsearch) input[type="datetime-local"], form:not(#adminbarsearch) input[type="month"], form:not(#adminbarsearch) input[type="week"], form:not(#adminbarsearch) input[type="email"], form:not(#adminbarsearch) input[type="tel"], form:not(#adminbarsearch) input[type="time"], form:not(#adminbarsearch) input[type="url"], form:not(#adminbarsearch) input[type="color"], form:not(#adminbarsearch) select, form:not(#adminbarsearch) textarea {margin: 0 0 1rem!important;}
form:not(#adminbarsearch) label {
    margin-bottom: 0rem!important;
    display: inline-block!important;

}
form:not(#adminbarsearch) input[type="submit"] {
    
    text-align: center;
    border: none;
    cursor: pointer;
    padding: 1.5625rem 2.5rem;
    background: #57c9e8;
    font-weight: 400;
    font-size: 1rem;
    font-family: Montserrat,!sans-serif important;
}
[type="submit"], [type="button"] {
    border-radius: 8px!important;
}
.containerGroup {
  width: 100%;
  height: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: left;
  align-items: center;
}
.control label {
	width: 100%!important;
}
.control-group {
  display: inline-block;
  vertical-align: top;
  background: #fff;
  text-align: left;
  /*box-shadow: 0 1px 2px rgba(0,0,0,0.1);*/
  padding-top:0px;
  padding-left:30px;
  padding-right:30px;
  padding-bottom:10px;
  width: 100%;
  height: auto;
  margin: 10px;
}
.controlline {
  display: inline-block;
  position: relative;
  padding-left:0px;
  margin-bottom: 10px;
  cursor: pointer;
  font-size: 14px;
  width:80px!important;
}
.control {
  display: block;
  position: relative;
  padding-left: 30px;
  margin-bottom: 10px;
  padding-top: 0.5rem;
  cursor: pointer;
  font-size: 14px;
}
.controlline  input {
  position: absolute;
  z-index: -1;
  opacity: 0;
}
.control input {
  position: absolute;
  z-index: -1;
  opacity: 0;
}
.control__indicator {
  position: absolute;
  top: 2px;
  left: 0;
  height: 20px;
  width: 20px;
  background: #e6e6e6;
}
.control--radio .control__indicator {
  border-radius: 50%;
}
.controlline :hover input ~ .control__indicator,
.controlline input:focus ~ .control__indicator {
  background: #ccc;
}
.control:hover input ~ .control__indicator,
.control input:focus ~ .control__indicator {
  background: #ccc;
}
.controlline input:checked ~ .control__indicator {
  background: #2aa1c0;
}
.control input:checked ~ .control__indicator {
  background: #2aa1c0;
}
.controlline:hover input:not([disabled]):checked ~ .control__indicator,
.controlline input:checked:focus ~ .control__indicator {
  background: #0e647d;
}
.control:hover input:not([disabled]):checked ~ .control__indicator,
.control input:checked:focus ~ .control__indicator {
  background: #0e647d;
}
.controlline input:disabled ~ .control__indicator {
  background: #e6e6e6;
  opacity: 0.6;
  pointer-events: none;
}
.control input:disabled ~ .control__indicator {
  background: #e6e6e6;
  opacity: 0.6;
  pointer-events: none;
}
.control__indicator:after {
  content: '';
  position: absolute;
  display: none;
}
.controlline input:checked ~ .control__indicator:after {
  display: block;
}
.control input:checked ~ .control__indicator:after {
  display: block;
}
.controlline--checkbox .control__indicator:after {
  left: 8px;
  top: 4px;
  width: 3px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.control--checkbox .control__indicator:after {
  left: 8px;
  top: 4px;
  width: 3px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.controlline--checkbox input:disabled ~ .control__indicator:after {
  border-color: #7b7b7b;
}
.control--checkbox input:disabled ~ .control__indicator:after {
  border-color: #7b7b7b;
}
.controlline--radio .control__indicator:after {
  left: 7px;
  top: 7px;
  height: 6px;
  width: 6px;
  border-radius: 50%;
  background: #fff;
}
.control--radio .control__indicator:after {
  left: 7px;
  top: 7px;
  height: 6px;
  width: 6px;
  border-radius: 50%;
  background: #fff;
}
.controlline--radio input:disabled ~ .control__indicator:after {
  background: #7b7b7b;
}
.control--radio input:disabled ~ .control__indicator:after {
  background: #7b7b7b;
}
.select {
  position: relative;
  display: inline-block;
  margin-bottom: 15px;
  width: 100%;
}
.select select {
  display: inline-block;
  width: 100%;
  cursor: pointer;
  padding: 10px 15px;
  outline: 0;
  border: 0;
  border-radius: 0;
  background: #e6e6e6;
  color: #7b7b7b;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}
.select select::-ms-expand {
  display: none;
}
.select select:hover,
.select select:focus {
  color: #000;
  background: #ccc;
}
.select select:disabled {
  opacity: 0.5;
  pointer-events: none;
}
.select__arrow {
  position: absolute;
  top: 16px;
  right: 15px;
  width: 0;
  height: 0;
  pointer-events: none;
  border-style: solid;
  border-width: 8px 5px 0 5px;
  border-color: #7b7b7b transparent transparent transparent;
}
.select select:hover ~ .select__arrow,
.select select:focus ~ .select__arrow {
  border-top-color: #000;
}
.select select:disabled ~ .select__arrow {
  border-top-color: #ccc;
}
:required {
  border-left-color: red!important;
}
.PPIF_S{
		filter: gray(1); /* IE5+ */
      -webkit-filter: grayscale(1); /* Webkit Nightlies & Chrome Canary */

	  box-shadow: 0rem 0rem 0rem 0rem rgba(38,38,39,.09)!important;
}

.PPIF_S:hover {
       filter: none;
      -webkit-filter: grayscale(0);
      -webkit-transform: scale(1.01);
	   box-shadow: 0rem 0rem 0rem 0rem rgba(38,38,39,.09)!important;
}
.PPIF_S_SELECT{
	  filter: none;
      -webkit-filter: grayscale(0);
      -webkit-transform: scale(1.01); 
	   box-shadow: 0rem 0rem 0rem 0rem rgba(38,38,39,.09)!important;
}
.file-upload{
  background-color: #ffffff;
  width: 600px; height:200px;
  margin: 0 auto;
  padding: 20px;
}

.file-upload-btn {
  width: 100%;
  margin: 0;
  color: #fff;
  background: #999;
  border: none;
  padding: 10px;
  border-radius: 4px;
  border-bottom: 4px solid #999;
  transition: all .2s ease;
  outline: none;
  text-transform: uppercase;
  font-weight: 700;
}

.file-upload-btn:hover {
  background: #999;
  color: #ffffff;
  transition: all .2s ease;
  cursor: pointer;
}

.file-upload-btn:active {
  border: 0;
  transition: all .2s ease;
}

.file-upload-content {
  display: none;
  text-align: center;
}

.file-upload-input {
  position: absolute;
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  outline: none;
  opacity: 0;
  cursor: pointer;
}

.image-upload-wrap {
  margin-top: 20px;
  border: 4px dashed #999;
  position: relative;
}

.image-dropping,
.image-upload-wrap:hover {
  background-color: #999;
  border: 4px dashed #ffffff;
}

.image-title-wrap {
  padding: 0 15px 15px 15px;
  color: #222;
}

.drag-text {
  text-align: center;
}

.drag-text h3 {
  font-weight: 100;
  text-transform: uppercase;
  padding: 60px 0;
}

.file-upload-image {
  max-height: 200px;
  max-width: 200px;
  margin: auto;
  padding: 20px;
}
.remove-files-style {
  width: 80px;
  text-align:center;
  margin: 0;
  color: #fff;
  background: #cd4535;
  border: none;
  padding: 5px;
  border-radius: 4px;
  transition: all .2s ease;
  outline: none;
  text-transform: uppercase;
  cursor: pointer;
  
}
.edit-profile-style {
  width: 80px;
  text-align:center;
  margin: 0;
  color: #fff!important;
  background:#096;
  border: none;
  padding: 5px;
  border-radius: 4px;
  transition: all .2s ease;
  outline: none;
  text-transform: uppercase;
  cursor: pointer!important;
  text-decoration:none!important;
  
}

.remove-image {
  width: 200px;
  margin: 0;
  color: #fff;
  background: #cd4535;
  border: none;
  padding: 10px;
  border-radius: 4px;
  border-bottom: 4px solid #b02818;
  transition: all .2s ease;
  outline: none;
  text-transform: uppercase;
  font-weight: 700;
}

.remove-image:hover {
  background: #c13b2a;
  color: #ffffff;
  transition: all .2s ease;
  cursor: pointer;
}

.remove-image:active {
  border: 0;
  transition: all .2s ease;
}

.file-upload2 {
  background-color: #ffffff;
  width: 600px;
  margin: 0 auto;
  padding: 20px;
}

.file-upload-btn2 {
  width: 100%;
  margin: 0;
  color: #fff;
  background: #999;
  border: none;
  padding: 10px;
  border-radius: 4px;
  border-bottom: 4px solid #999;
  transition: all .2s ease;
  outline: none;
  text-transform: uppercase;
  font-weight: 700;
}

.file-upload-btn2:hover {
  background: #999;
  color: #ffffff;
  transition: all .2s ease;
  cursor: pointer;
}

.file-upload-btn2:active {
  border: 0;
  transition: all .2s ease;
}

.file-upload-content2 {
  display: none;
  text-align: center;
}

.file-upload-input2 {
  position: absolute;
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  outline: none;
  opacity: 0;
  cursor: pointer;
}

.image-upload-wrap2 {
  margin-top: 20px;
  border: 4px dashed #999;
  position: relative;
}

.image-dropping2,
.image-upload-wrap2:hover {
  background-color: #999;
  border: 4px dashed #ffffff;
}

.image-title-wrap2 {
  padding: 0 15px 15px 15px;
  color: #222;
}

.drag-text2 {
  text-align: center;
}

.drag-text2 h3 {
  font-weight: 100;
  text-transform: uppercase;
  padding: 60px 0;
}

.file-upload-image2 {
  max-height: 200px;
  max-width: 200px;
  margin: auto;
  padding: 20px;
}

.remove-image2 {
  width: 200px;
  margin: 0;
  color: #fff;
  background: #cd4535;
  border: none;
  padding: 10px;
  border-radius: 4px;
  border-bottom: 4px solid #b02818;
  transition: all .2s ease;
  outline: none;
  text-transform: uppercase;
  font-weight: 700;
}

.remove-image2:hover {
  background: #c13b2a;
  color: #ffffff;
  transition: all .2s ease;
  cursor: pointer;
}

.remove-image2:active {
  border: 0;
  transition: all .2s ease;
}

.file-upload3 {
  background-color: #ffffff;
  width: 600px;
  margin: 0 auto;
  padding: 20px;
}

.file-upload-btn3 {
  width: 100%;
  margin: 0;
  color: #fff;
  background: #999;
  border: none;
  padding: 10px;
  border-radius: 4px;
  border-bottom: 4px solid #999;
  transition: all .2s ease;
  outline: none;
  text-transform: uppercase;
  font-weight: 700;
}

.file-upload-btn3:hover {
  background: #999;
  color: #ffffff;
  transition: all .2s ease;
  cursor: pointer;
}

.file-upload-btn3:active {
  border: 0;
  transition: all .2s ease;
}

.file-upload-content3 {
  display: none;
  text-align: center;
}

.file-upload-input3 {
  position: absolute;
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  outline: none;
  opacity: 0;
  cursor: pointer;
}

.image-upload-wrap3 {
  margin-top: 20px;
  border: 4px dashed #999;
  position: relative;
}

.image-dropping3,
.image-upload-wrap3:hover {
  background-color: #999;
  border: 4px dashed #ffffff;
}

.image-title-wrap3 {
  padding: 0 15px 15px 15px;
  color: #222;
}

.drag-text3 {
  text-align: center;
}

.drag-text3 h3 {
  font-weight: 100;
  text-transform: uppercase;
  padding: 60px 0;
}

.file-upload-image3 {
  max-height: 200px;
  max-width: 200px;
  margin: auto;
  padding: 20px;
}

.remove-image3 {
  width: 200px;
  margin: 0;
  color: #fff;
  background: #cd4535;
  border: none;
  padding: 10px;
  border-radius: 4px;
  border-bottom: 4px solid #b02818;
  transition: all .2s ease;
  outline: none;
  text-transform: uppercase;
  font-weight: 700;
}

.remove-image3:hover {
  background: #c13b2a;
  color: #ffffff;
  transition: all .2s ease;
  cursor: pointer;
}

.remove-image3:active {
  border: 0;
  transition: all .2s ease;
}
.file-upload4 {
  background-color: #ffffff;
  width: 600px;
  margin: 0 auto;
  padding: 20px;
}

.file-upload-btn4 {
  width: 100%;
  margin: 0;
  color: #fff;
  background: #999;
  border: none;
  padding: 10px;
  border-radius: 4px;
  border-bottom: 4px solid #999;
  transition: all .2s ease;
  outline: none;
  text-transform: uppercase;
  font-weight: 700;
}

.file-upload-btn4:hover {
  background: #999;
  color: #ffffff;
  transition: all .2s ease;
  cursor: pointer;
}

.file-upload-btn4:active {
  border: 0;
  transition: all .2s ease;
}

.file-upload-content4 {
  display: none;
  text-align: center;
}

.file-upload-input4 {
  position: absolute;
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  outline: none;
  opacity: 0;
  cursor: pointer;
}

.image-upload-wrap4 {
  margin-top: 20px;
  border: 4px dashed #999;
  position: relative;
}

.image-dropping4,
.image-upload-wrap4:hover {
  background-color: #999;
  border: 4px dashed #ffffff;
}

.image-title-wrap4 {
  padding: 0 15px 15px 15px;
  color: #222;
}

.drag-text4 {
  text-align: center;
}

.drag-text4 h3 {
  font-weight: 100;
  text-transform: uppercase;
  padding: 60px 0;
}

.file-upload-image4 {
  max-height: 200px;
  max-width: 200px;
  margin: auto;
  padding: 20px;
}

.remove-image4 {
  width: 200px;
  margin: 0;
  color: #fff;
  background: #cd4535;
  border: none;
  padding: 10px;
  border-radius: 4px;
  border-bottom: 4px solid #b02818;
  transition: all .2s ease;
  outline: none;
  text-transform: uppercase;
  font-weight: 700;
}

.remove-image4:hover {
  background: #c13b2a;
  color: #ffffff;
  transition: all .2s ease;
  cursor: pointer;
}

.remove-image4:active {
  border: 0;
  transition: all .2s ease;
}

.file-upload5 {
  background-color: #ffffff;
  width: 600px;
  margin: 0 auto;
  padding: 20px;
}

.file-upload-btn5 {
  width: 100%;
  margin: 0;
  color: #fff;
  background: #999;
  border: none;
  padding: 10px;
  border-radius: 4px;
  border-bottom: 4px solid #999;
  transition: all .2s ease;
  outline: none;
  text-transform: uppercase;
  font-weight: 700;
}

.file-upload-btn5:hover {
  background: #999;
  color: #ffffff;
  transition: all .2s ease;
  cursor: pointer;
}

.file-upload-btn5:active {
  border: 0;
  transition: all .2s ease;
}

.file-upload-content5 {
  display: none;
  text-align: center;
}

.file-upload-input5 {
  position: absolute;
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  outline: none;
  opacity: 0;
  cursor: pointer;
}

.image-upload-wrap5 {
  margin-top: 20px;
  border: 4px dashed #999;
  position: relative;
}

.image-dropping5,
.image-upload-wrap5:hover {
  background-color: #999;
  border: 4px dashed #ffffff;
}

.image-title-wrap5 {
  padding: 0 15px 15px 15px;
  color: #222;
}

.drag-text5 {
  text-align: center;
}

.drag-text5 h3 {
  font-weight: 100;
  text-transform: uppercase;
  padding: 60px 0;
}

.file-upload-image5 {
  max-height: 200px;
  max-width: 200px;
  margin: auto;
  padding: 20px;
}

.remove-image5 {
  width: 200px;
  margin: 0;
  color: #fff;
  background: #cd4535;
  border: none;
  padding: 10px;
  border-radius: 4px;
  border-bottom: 4px solid #b02818;
  transition: all .2s ease;
  outline: none;
  text-transform: uppercase;
  font-weight: 700;
}

.remove-image5:hover {
  background: #c13b2a;
  color: #ffffff;
  transition: all .2s ease;
  cursor: pointer;
}

.remove-image5:active {
  border: 0;
  transition: all .2s ease;
}

input[type="date"]::before{
   color: #ffffff;
   content: attr(placeholder) ": ";
}
input[type="date"]:focus::before {
   content: "" !important;
}
.rojofield{
	border-left-color: red!important;
}
.fstElement{
	border:.125rem solid #f1f1f1;
	min-height: 3.125rem;
}	
	
</style>
<script>
reviewsaps('sap1');
reviewsaps('sap2');
reviewsaps('sap3');
reviewsaps('sap4');
reviewsaps('sap4a');
reviewsaps('sap4b');
reviewsaps('sap5');
reviewsaps('sap5a');
reviewsaps('sap5b');
reviewsaps('sap6');
reviewsaps2('sdg1');
reviewsaps2('sdg2');
reviewsaps2('sdg3');
reviewsaps2('sdg4');
reviewsaps2('sdg5');
reviewsaps2('sdg6');
reviewsaps2('sdg7');
reviewsaps2('sdg8');
reviewsaps2('sdg9');
reviewsaps2('sdg10');
reviewsaps2('sdg11');
reviewsaps2('sdg12');
reviewsaps2('sdg13');
reviewsaps2('sdg15');
reviewsaps2('sdg16');
reviewsaps2('sdg17');



function readURL(input) {
  if (input.files && input.files[0]) {

    var reader = new FileReader();

    reader.onload = function(e) {
      jQuery('.image-upload-wrap').hide();

      jQuery('.file-upload-image').attr('src', e.target.result);
      jQuery('.file-upload-content').show();

      jQuery('.image-title').html(input.files[0].name);
    };

    reader.readAsDataURL(input.files[0]);

  } else {
    removeUpload();
  }
}

function removeUpload() {
  jQuery('.file-upload-input').replaceWith(jQuery('.file-upload-input').clone());
  jQuery('.file-upload-content').hide();
  jQuery('.image-upload-wrap').show();
  jQuery('.file-upload-input').val("");
}

jQuery('.image-upload-wrap').bind('dragover1', function () {
		jQuery('.image-upload-wrap').addClass('image-dropping');
	});
	jQuery('.image-upload-wrap').bind('dragleave1', function () {
		jQuery('.image-upload-wrap').removeClass('image-dropping');
});
function readURL2(input) {
  if (input.files && input.files[0]) {

    var reader = new FileReader();

    reader.onload = function(e) {
      jQuery('.image-upload-wrap2').hide();

      jQuery('.file-upload-image2').attr('src', e.target.result);
      jQuery('.file-upload-content2').show();

      jQuery('.image-title2').html(input.files[0].name);
    };

    reader.readAsDataURL(input.files[0]);

  } else {
    removeUpload2();
  }
}

function removeUpload2() {
  jQuery('.file-upload-input2').replaceWith(jQuery('.file-upload-input2').clone());
  jQuery('.file-upload-content2').hide();
  jQuery('.image-upload-wrap2').show();
  jQuery('.file-upload-input2').val("");
}
jQuery('.image-upload-wrap2').bind('dragover2', function () {
		jQuery('.image-upload-wrap2').addClass('image-dropping2');
	});
	jQuery('.image-upload-wrap2').bind('dragleave2', function () {
		jQuery('.image-upload-wrap2').removeClass('image-dropping2');
});
function readURL3(input) {
  if (input.files && input.files[0]) {

    var reader = new FileReader();

    reader.onload = function(e) {
      jQuery('.image-upload-wrap3').hide();

      jQuery('.file-upload-image3').attr('src', e.target.result);
      jQuery('.file-upload-content3').show();

      jQuery('.image-title3').html(input.files[0].name);
    };

    reader.readAsDataURL(input.files[0]);

  } else {
    removeUpload3();
  }
}

function removeUpload3() {
  jQuery('.file-upload-input3').replaceWith(jQuery('.file-upload-input3').clone());
  jQuery('.file-upload-content3').hide();
  jQuery('.image-upload-wrap3').show();
  jQuery('.file-upload-input3').val("");
}
jQuery('.image-upload-wrap3').bind('dragover3', function () {
		jQuery('.image-upload-wrap3').addClass('image-dropping3');
	});
	jQuery('.image-upload-wrap3').bind('dragleave3', function () {
		jQuery('.image-upload-wrap3').removeClass('image-dropping3');
});

function readURL4(input) {
  if (input.files && input.files[0]) {

    var reader = new FileReader();

    reader.onload = function(e) {
      jQuery('.image-upload-wrap4').hide();

      jQuery('.file-upload-image4').attr('src', e.target.result);
      jQuery('.file-upload-content4').show();

      jQuery('.image-title4').html(input.files[0].name);
    };

    reader.readAsDataURL(input.files[0]);

  } else {
    removeUpload4();
  }
}

function removeUpload4() {
  jQuery('.file-upload-input4').replaceWith(jQuery('.file-upload-input4').clone());
  jQuery('.file-upload-content4').hide();
  jQuery('.image-upload-wrap4').show();
  jQuery('.file-upload-input4').val("");
}
jQuery('.image-upload-wrap4').bind('dragover4', function () {
		jQuery('.image-upload-wrap4').addClass('image-dropping4');
	});
	jQuery('.image-upload-wrap4').bind('dragleave4', function () {
		jQuery('.image-upload-wrap4').removeClass('image-dropping4');
});
function readURL5(input) {
  if (input.files && input.files[0]) {

    var reader = new FileReader();

    reader.onload = function(e) {
      jQuery('.image-upload-wrap5').hide();

      jQuery('.file-upload-image5').attr('src', e.target.result);
      jQuery('.file-upload-content5').show();

      jQuery('.image-title5').html(input.files[0].name);
    };

    reader.readAsDataURL(input.files[0]);

  } else {
    removeUpload5();
  }
}

function removeUpload5() {
  jQuery('.file-upload-input5').replaceWith(jQuery('.file-upload-input5').clone());
  jQuery('.file-upload-content5').hide();
  jQuery('.image-upload-wrap5').show();
  jQuery('.file-upload-input5').val("");
}
jQuery('.image-upload-wrap5').bind('dragover5', function () {
		jQuery('.image-upload-wrap5').addClass('image-dropping5');
	});
	jQuery('.image-upload-wrap5').bind('dragleave5', function () {
		jQuery('.image-upload-wrap5').removeClass('image-dropping5');
});



	
	
</script>
<script type="text/javascript">
function allowDrop(ev) {
  ev.preventDefault();
}
function startRead(evt) {
	alert("entreR");
    //vt.stopPropagation();
    evt.preventDefault();
}
function startReadFromDrag(evt) {
	evt.preventDefault();
	fdl=0;
	var file = evt.dataTransfer.files[0];
	
	reader = new FileReader();
	reader.onload = function(e) {
			 	jQuery('.image-upload-wrap').hide();
				jQuery('.file-upload-image').attr('src', e.target.result);
      			jQuery('.file-upload-content').show();
				jQuery('.image-title').html(file.name);
		        //jQuery('#pstatusfile').val(e.target.result);
				//'#pstatusfile')[0].files = file;
				//document.getElementById('pstatusfile').value = e.target.result;
	
    };
	document.getElementById('pstatusfile').files = evt.dataTransfer.files;
	reader.readAsDataURL(file);
	
	
	
	
	if( document.getElementById("pstatusfile").files.length == 0 ){
				console.log("NO FILES");
			}else{console.log("YES FILES");}
	
	
	
	
		
}
StatusDates();
//document.getElementsByClassName('fstElement fstMultipleMode fstNoneSelected')[0].classList.add("rojofield"); 
</script>
<?php



	
	
	
	
	
	
	
	

