<?php
//title Highlight Optin Form
//Do not change this line unless you're making a new form

//($opt_is_secured_page);

$images_href = plugins_url('/opt/optin_forms/images/');

if(isset($opt_form_data)) { $opt_form_data_new = $opt_form_data; }

	if($opt_link_id=='') { $opt_link_id = 0; }	
	
	$opt_link_id = intval($opt_link_id);
	
	if($opt_link_id!=0) { $facebook = opt_is_camp_fb_en($opt_link_id); } else { unset($facebook); }
	
	unset($opt_form_data);	
	
	//---------------------------------------------------------
	
	//Default form fields
	$opt_form_data['show_email_field']=1;
	
	//Default placeholder text
	$opt_form_data['email-placeholder']='Enter your email address';
	$opt_form_data['name-placeholder']='Enter your name';
	$opt_form_data['phone-placeholder']='Enter your phone number';
	$opt_form_data['address1-placeholder']='Enter your street address';
	$opt_form_data['address2-placeholder']='Enter your your secondary street address';
	$opt_form_data['state-placeholder']='Enter your state or province';
	$opt_form_data['zip-placeholder']='Enter your postal or zip code';
	$opt_form_data['country-placeholder']='Enter your country';
	
	
	//Overall layout
	$opt_form_data['overlay_bg_color']='#000000';
	$opt_form_data['overlay_opacity']='80';
	$opt_form_data['form_bg_color']='#fff';
	$opt_form_data['form_padding']='10px 0 0 0';
	$opt_form_data['form_width']='600px';
	
	//Header
	$opt_form_data['header_text'] = 'Secured content';
	$opt_form_data['header_success_text'] = 'Success!';
	$opt_form_data['header_waiting_text'] = 'Waiting for confirmation';
	$opt_form_data['header_line-height']='1.3';
	$opt_form_data['header_text-font']='"Helvetica Neue", Helvetica, "Open Sans", Arial';
	$opt_form_data['header_text-fontsize']='23';
	$opt_form_data['header_text-color']='#000000';	
	$opt_form_data['header_text-align']='left';	
	$opt_form_data['header_text-bold']='font-weight:bold;';	
	$opt_form_data['header_text-italic']='';	
	
	//Subheader
	$opt_form_data['subheader_text'] = 'Enter your email address below and press continue for instant access!';
	$opt_form_data['subheader_success_text'] = 'Thanks for subscribing! You\'ll be redirected in a couple seconds.';
	$opt_form_data['subheader_waiting_text'] = 'Click the confirmation link in your email to finalize your subscription!';
	$opt_form_data['subheader_margin']='0';	
	$opt_form_data['subheader_line-height']='1.5';
	$opt_form_data['subheader_text-font']='"Droid Sans", "Open Sans", Arial';
	$opt_form_data['subheader_text-fontsize']='16';
	$opt_form_data['subheader_text-color']='#333333';	
	$opt_form_data['subheader_text-align']='left';	
	$opt_form_data['subheader_text-bold']='';	
	$opt_form_data['subheader_text-italic']='';	
	
	//Form Field	
	$opt_form_data['field-border-color'] = '#B3C4CB';
	$opt_form_data['field-vertical-padding'] = '15';
	
	//Submit Button	
	$opt_form_data['button_text'] = 'Get Instant Access';
	$opt_form_data['button_type'] = '3d';
	$opt_form_data['button_color'] = '#DD3D36';
	$opt_form_data['button_border_radius'] = 3;
	
	//Finetext
	$opt_form_data['finetext_text'] = 'We respect your privacy. We do not sell or share your information with anyone.';
	$opt_form_data['finetext_line-height']='1.7';
	$opt_form_data['finetext_margin']='10px 0 0 0';
	$opt_form_data['finetext_text-font']='"Droid Sans", "Open Sans", Arial';
	$opt_form_data['finetext_text-color']='#aaaaaa';
	$opt_form_data['finetext_text-fontsize']='11';
	$opt_form_data['finetext_text-align']='center';	
	$opt_form_data['finetext_text-bold']='';	
	$opt_form_data['finetext_text-italic']='';		
		
	//Waiting Header
	$opt_form_data['header_waiting_text'] = 'Waiting for confirmation';
	$opt_form_data['header_waiting_line-height']='1.3';
	$opt_form_data['header_waiting_text-font']='"Helvetica Neue", Helvetica, "Open Sans", Arial';
	$opt_form_data['header_waiting_text-fontsize']='23';
	$opt_form_data['header_waiting_text-color']='#000000';	
	$opt_form_data['header_waiting_text-align']='left';	
	$opt_form_data['header_waiting_text-bold']='font-weight:bold;';	
	$opt_form_data['header_waiting_text-italic']='';	
	
	//Waiting Body
	$opt_form_data['subheader_waiting_text'] = 'Click the confirmation link in your email to finalize your subscription!';
	$opt_form_data['subheader_waiting_margin']='0';	
	$opt_form_data['subheader_waiting_line-height']='1.5';
	$opt_form_data['subheader_waiting_text-font']='"Droid Sans", "Open Sans", Arial';
	$opt_form_data['subheader_waiting_text-fontsize']='16';
	$opt_form_data['subheader_waiting_text-color']='#333333';	
	$opt_form_data['subheader_waiting_text-align']='left';	
	$opt_form_data['subheader_waiting_text-bold']='';	
	$opt_form_data['subheader_waiting_text-italic']='';	
	
	//Waiting Footer
	$opt_form_data['waiting_text']='This page will be redirected automatically once you\'re confirmed';
	$opt_form_data['waiting_line-height']='1.7';
	$opt_form_data['waiting_margin']='10px 0 0 0';
	$opt_form_data['waiting_text-font']='"Droid Sans", "Open Sans", Arial';
	$opt_form_data['waiting_text-color']='#222222';
	$opt_form_data['waiting_text-fontsize']='15';
	$opt_form_data['waiting_text-align']='left';	
	$opt_form_data['waiting_text-bold']='font-weight:bold;';	
	$opt_form_data['waiting_text-italic']='';	
	
	//Success Header
	$opt_form_data['header_success_text'] = 'Success!';
	$opt_form_data['header_success_line-height']='1.3';
	$opt_form_data['header_success_text-font']='"Helvetica Neue", Helvetica, "Open Sans", Arial';
	$opt_form_data['header_success_text-fontsize']='23';
	$opt_form_data['header_success_text-color']='#000000';	
	$opt_form_data['header_success_text-align']='left';	
	$opt_form_data['header_success_text-bold']='font-weight:bold;';	
	$opt_form_data['header_success_text-italic']='';	
	
	//Success Body
	$opt_form_data['subheader_success_text'] = 'Thanks for subscribing! You\'ll be redirected in a couple seconds.';
	$opt_form_data['subheader_success_margin']='0';	
	$opt_form_data['subheader_success_line-height']='1.5';
	$opt_form_data['subheader_success_text-font']='"Droid Sans", "Open Sans", Arial';
	$opt_form_data['subheader_success_text-fontsize']='16';
	$opt_form_data['subheader_success_text-color']='#333333';	
	$opt_form_data['subheader_success_text-align']='left';	
	$opt_form_data['subheader_success_text-bold']='';	
	$opt_form_data['subheader_success_text-italic']='';	
	
	//Success Footer
	$opt_form_data['redirect_text']='One moment while you\'re redirected...';
	$opt_form_data['redirect_text_line-height']='1.7';
	$opt_form_data['redirect_text_margin']='10px 0 0 0';
	$opt_form_data['redirect_text-font']='"Droid Sans", "Open Sans", Arial';
	$opt_form_data['redirect_text-color']='#222222';
	$opt_form_data['redirect_text-fontsize']='15';
	$opt_form_data['redirect_text-align']='left';	
	$opt_form_data['redirect_text-bold']='font-weight:bold;';	
	$opt_form_data['redirect_text-italic']='';	
	
	if($return_form_data_only===1) { return; }
	
if(isset($opt_form_data_new)) { $opt_form_data = array_merge($opt_form_data,$opt_form_data_new); }


/*//Load existing settings
if($opt_link_id!=0 && $wpdb) {




}*/


?>
<style type="text/css">

@import url(https://fonts.googleapis.com/css?family=Droid+Sans);

.optin_reset {
	padding:0;
	margin:0;
	border:none;
	line-height:inherit;
	border-radius: 0;
	box-shadow:none;
}

.optin_link_overlay<?php echo  $opt_link_id  ; ?> {
	
	/* Positioning */
	position:fixed;
	top:0;
	left:0;
	
	/* Sizing */
	width:100%;
	height:100%;
	
	/* Effects */
	opacity:<?php echo  $opt_form_data['overlay_opacity']/100  ; ?>;
	filter:Alpha(opacity=<?php echo  $opt_form_data['overlay_opacity']  ; ?>);
	z-index:1000000;
	background:<?php echo  $opt_form_data['overlay_bg_color'];  ; ?>;

	display:none;

}

.optin_link_form<?php echo  $opt_link_id  ; ?> {
	
	/* Positioning */
	margin-left:auto;
	margin-right:auto;	
	
	/* Sizing */
	max-width:<?php echo  $opt_form_data['form_width']  ; ?>;	
	
	/* Spacing */
	padding:<?php echo  $opt_form_data['form_padding']  ; ?>;
	
	/* Effects */	
	z-index:1020000;
	opacity:1.0;
	background:<?php echo  $opt_form_data['form_bg_color']  ; ?>;
	filter:Alpha(opacity=100);
	box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
	border-left:4px solid rgb(221, 61, 54);
	
}

.optin_link_form_container<?php echo  $opt_link_id  ; ?> {
	
	/* Positioning */
	position:fixed;
	left:5%;
	right:5%;
	top:24%;
	
	/* Effects */	
	z-index:1010000;

	display:none;
	
}

.optin_link_form_header<?php echo $opt_link_id; ?> {

	font-weight: bold; 
	font-family: <?php echo  $opt_form_data['header_text-font']; ?>; 
	color: <?php echo  $opt_form_data['header_text-color']; ?>;
	font-size: <?php echo  $opt_form_data['header_text-fontsize']; ?>px; 
	line-height: <?php echo  $opt_form_data['header_line-height']; ?>;
	text-align: <?php echo $opt_form_data['header_text-align'] ?>; 
	display:block;
	padding:10px 0 7px 0;
	margin:0;
	border-bottom:1px #eee solid;
	<?php echo $opt_form_data['header_text-bold'] ?>
	<?php echo $opt_form_data['header_text-italic'] ?>
	
}

.optin_link_form_subheader<?php echo $opt_link_id; ?> {
	
	color: <?php echo  $opt_form_data['subheader_text-color']; ?>;
	font-size: <?php echo  $opt_form_data['subheader_text-fontsize']; ?>px; 
	text-align: <?php echo $opt_form_data['subheader_text-align'] ?>; 
	font-family: <?php echo  $opt_form_data['subheader_text-font']; ?>; 
	line-height: <?php echo  $opt_form_data['subheader_line-height']; ?>; 
	margin: <?php echo  $opt_form_data['subheader_margin']; ?>; 
	padding-top:10px;
	<?php echo $opt_form_data['subheader_text-bold'] ?>
	<?php echo $opt_form_data['subheader_text-italic'] ?>

}

.optin_link_form_finetext<?php echo $opt_link_id; ?> {
	
	background: none repeat scroll 0% 0%; 
	background-color: <?php echo  $opt_form_data['finetext_background-color']; ?>;
	
	color: <?php echo  $opt_form_data['finetext_text-color']; ?>;
	font-size: <?php echo  $opt_form_data['finetext_text-fontsize']; ?>; 
	text-align: <?php echo  $opt_form_data['finetext_text-align']; ?>; 
	font-family: <?php echo  $opt_form_data['finetext_text-font']; ?>; 
	line-height: <?php echo  $opt_form_data['finetext_line-height']; ?>; 
	margin: <?php echo  $opt_form_data['finetext_margin']; ?>; 
	<?php echo $opt_form_data['finetext_text-bold'] ?>
	<?php echo $opt_form_data['finetext_text-italic'] ?>
	padding-bottom:10px !important;

	
}


.optin_link_form_poweredby<?php echo  $opt_link_id  ; ?> {
		
	margin-top:15px;
	opacity:0.5;
	filter:Alpha(opacity=50);
	display:block;
	float:left;
	text-align:center;
	width:100%;
	display:none;
	
}

.optin_link_form_poweredby<?php echo  $opt_link_id  ; ?>:hover {
		
	opacity:1.0;
	filter:Alpha(opacity=100);
	
}


.optin_link_form_field<?php echo $opt_link_id; ?> {
	
	text-shadow: none !important; 
	border-radius: 0px !important; 
	font-family: "Droid Sans", "Open Sans", Arial !important; 
	font-size: 15px !important; 
	max-width:525px !important;
	width:100% !important;
	margin:0;
	margin-top:5px; 
	line-height:1 !important;
	background: none repeat scroll 0px 0px rgb(255, 255, 255) !important; 
	color: rgb(17, 17, 17) !important; 
	padding: <?php echo $opt_form_data['field-vertical-padding'] ?>px 2% !important; 
	box-shadow: none !important; 
	border: 1px solid <?php echo $opt_form_data['field-border-color'] ?> !important; 
		
}

.optin_link_form_field_error<?php echo  $opt_link_id  ; ?> {
	
	text-shadow: none !important; 
	border-radius: 0px !important; 
	font-family: "Droid Sans", "Open Sans", Arial !important; 
	font-size: 15px !important; 
	display: inline !important; 
	width:96.5% !important;
	margin:0; 
	background: none repeat scroll 0px 0px rgb(255, 100, 100 !important); 
	color: rgb(17, 17, 17) !important; 
	padding: 15px 2% !important; 
	box-shadow: none !important; 
	border: 1px solid #f00 !important; 
		
}



.optin_link_form_redirecting<?php echo  $opt_link_id  ; ?> {
	
  background-color: #FFFAEC;
  border: 1px solid #FFD79F;
  color:#222;
  font-family: "Droid Sans","Open Sans",Arial;
  font-size: 15px;
  font-weight: bold;
  padding: 10px;
  margin-top:10px;
	
}

.optin_link_form_redirecting_link<?php echo  $opt_link_id  ; ?> {
	
	color:rgb(80, 127, 164);
	text-decoration:none;
	font-weight:bold;
	
}

.optin_link_form_redirecting_link<?php echo  $opt_link_id  ; ?>:hover {
	
	color:#222;
	
}

.optin_bottom_container<?php echo  $opt_link_id  ; ?> {
	text-align: right;
	margin:0;
	width: 100%;
	border-radius:0;
	line-height: 56px;
	vertical-align:middle;
	display:block;
}

.optin_link_no_thanks<?php echo  $opt_link_id  ; ?>:link {
	
  color: #9F9F9F;
  font-family: "Droid Sans","Open Sans",Arial;
  font-size: 13px;
  line-height:13px;
  vertical-align:middle;
  padding:15px;
  position:relative;
  top:6px;
  text-decoration: none;
  display:inline-block;
}

.optin_link_no_thanks<?php echo  $opt_link_id  ; ?>:hover {
	
  color: #777;
  font-family: "Droid Sans","Open Sans",Arial;
  font-size: 13px;
  line-height:13px;
  padding:15px;
  position:relative;
  top:6px;
  text-decoration: none;
  display:inline-block;
	
}

.optin_font<?php echo  $opt_link_id  ; ?> {

  font-family: "Droid Sans","Open Sans",Arial;	
	
}

.optin_link_form_header_waiting<?php echo $opt_link_id; ?> {

	font-weight: bold; 
	font-family: <?php echo  $opt_form_data['header_waiting_text-font']; ?>; 
	color: <?php echo  $opt_form_data['header_waiting_text-color']; ?>;
	font-size: <?php echo  $opt_form_data['header_waiting_text-fontsize']; ?>px; 
	line-height: <?php echo  $opt_form_data['header_line-height']; ?>;
	text-align: <?php echo $opt_form_data['header_waiting_text-align'] ?>; 
	display:block;
	padding:10px 0 7px 0;
	margin:0;
	border-bottom:1px #eee solid;
	<?php echo $opt_form_data['header_waiting_text-bold'] ?>
	<?php echo $opt_form_data['header_waiting_text-italic'] ?>
	
}

.optin_link_form_subheader_waiting<?php echo $opt_link_id; ?> {
	
	color: <?php echo  $opt_form_data['subheader_waiting_text-color']; ?>;
	font-size: <?php echo  $opt_form_data['subheader_waiting_text-fontsize']; ?>px; 
	text-align: <?php echo $opt_form_data['subheader_waiting_text-align'] ?>; 
	font-family: <?php echo  $opt_form_data['subheader_waiting_text-font']; ?>; 
	line-height: <?php echo  $opt_form_data['subheader_line-height']; ?>; 
	margin: <?php echo  $opt_form_data['subheader_waiting_margin']; ?>; 
	padding-top:10px;
	<?php echo $opt_form_data['subheader_waiting_text-bold'] ?>
	<?php echo $opt_form_data['subheader_waiting_text-italic'] ?>

}

.optin_link_form_redirect_waiting<?php echo $opt_link_id; ?> {
	
	background-color: #FFFAEC;
	border: 1px solid #FFD79F;
	padding: 10px;
	margin-top:10px;
	color: <?php echo  $opt_form_data['waiting_text-color']; ?>;
	font-size: <?php echo  $opt_form_data['waiting_text-fontsize']; ?>; 
	text-align: <?php echo  $opt_form_data['waiting_text-align']; ?>; 
	font-family: <?php echo  $opt_form_data['waiting_text-font']; ?>; 
	line-height: <?php echo  $opt_form_data['waiting_line-height']; ?>; 
	margin: <?php echo  $opt_form_data['waiting_margin']; ?>; 
	<?php echo $opt_form_data['waiting_text-bold'] ?>
	<?php echo $opt_form_data['waiting_text-italic'] ?>
	

	
}

.optin_link_form_header_success<?php echo $opt_link_id; ?> {

	font-weight: bold; 
	font-family: <?php echo  $opt_form_data['header_success_text-font']; ?>; 
	color: <?php echo  $opt_form_data['header_success_text-color']; ?>;
	font-size: <?php echo  $opt_form_data['header_success_text-fontsize']; ?>px; 
	line-height: <?php echo  $opt_form_data['header_line-height']; ?>;
	text-align: <?php echo $opt_form_data['header_success_text-align'] ?>; 
	display:block;
	padding:10px 0 7px 0;
	margin:0;
	border-bottom:1px #eee solid;
	<?php echo $opt_form_data['header_success_text-bold'] ?>
	<?php echo $opt_form_data['header_success_text-italic'] ?>
	
}

.optin_link_form_subheader_success<?php echo $opt_link_id; ?> {
	
	color: <?php echo  $opt_form_data['subheader_success_text-color']; ?>;
	font-size: <?php echo  $opt_form_data['subheader_success_text-fontsize']; ?>px; 
	text-align: <?php echo $opt_form_data['subheader_success_text-align'] ?>; 
	font-family: <?php echo  $opt_form_data['subheader_success_text-font']; ?>; 
	line-height: <?php echo  $opt_form_data['subheader_line-height']; ?>; 
	margin: <?php echo  $opt_form_data['subheader_success_margin']; ?>; 
	padding-top:10px;
	<?php echo $opt_form_data['subheader_success_text-bold'] ?>
	<?php echo $opt_form_data['subheader_success_text-italic'] ?>

}

.optin_link_form_redirect_success<?php echo $opt_link_id; ?> {
	
	background-color: #FFFAEC;
	border: 1px solid #FFD79F;
	padding: 10px;
	margin-top:10px;
	color: <?php echo  $opt_form_data['redirect_text-color']; ?>;
	font-size: <?php echo  $opt_form_data['redirect_text-fontsize']; ?>; 
	text-align: <?php echo  $opt_form_data['redirect_text-align']; ?>; 
	font-family: <?php echo  $opt_form_data['redirect_text-font']; ?>; 
	line-height: <?php echo  $opt_form_data['redirect_line-height']; ?>; 
	margin: <?php echo  $opt_form_data['redirect_margin']; ?>; 
	<?php echo $opt_form_data['redirect_text-bold'] ?>
	<?php echo $opt_form_data['redirect_text-italic'] ?>
	

	
}

</style>

<div id="optin_link_overlay<?php echo  $opt_link_id  ; ?>" class="optin_link_overlay<?php echo  $opt_link_id  ; ?>"><?php echo  opt_poweredby()  ; ?></div>

<div id="optin_link_form_container<?php echo  $opt_link_id  ; ?>" onMouseover="opt_form_hover(<?php echo $opt_link_id ; ?>,<?php echo $opt_split_test_item_id ; ?>);" onClick="opt_form_click(<?php echo $opt_link_id ; ?>,<?php echo $opt_split_test_item_id ; ?>);" class="optin_link_form_container<?php echo  $opt_link_id  ; ?>">

	<div id="optin_link_form<?php echo  $opt_link_id  ; ?>" class="optin_link_form<?php echo  $opt_link_id  ; ?>">
    
        <div style="margin:0 30px 10px 30px;">
        	
                <img src="<?php echo $images_href ; ?>close.png" id="optin_link_form_close<?php echo $opt_link_id ; ?>" onClick="opt_form_close(<?php echo $opt_link_id ; ?>,<?php echo $opt_split_test_item_id ; ?>);" style="box-shadow: none; cursor: pointer; display: inline-block; float: right;  margin-right: -19px; margin-top: 11px;">
            
            <div id="optin_link_header_text<?php echo  $opt_link_id  ; ?>" class="optin_link_form_header<?php echo  $opt_link_id  ; ?>" style=" <?php if($opt_form_data['header_text'] == '') { echo 'display:none';  }?> ">
                <?php echo  $opt_form_data['header_text']  ; ?>
            </div>      
            
            <div id="optin_link_subheader_text<?php echo  $opt_link_id  ; ?>" class="optin_link_form_subheader<?php echo  $opt_link_id  ; ?>" style=" <?php if($opt_form_data['subheader_text'] == '') { echo 'display:none';  }?> ">
                <?php echo  $opt_form_data['subheader_text']  ; ?>
            </div> 
			
            
            <div id="optin_link_name_field_container<?php echo $opt_link_id; ?>">   
            
            <?php if($opt_form_data['show_name_field'] == 1) { ?>
      		<input type="text" name="name" placeholder="<?php echo $opt_form_data['name-placeholder'] ?>" value="<?php if(isset($_GET['optinlinks_name'])) { echo $_GET['optinlinks_name']; } ?>" class="optin_link_form_field<?php echo $opt_link_id; ?>" id="optin_link_form_name<?php echo $opt_link_id; ?>">
            <?php } ?>
                            
            </div>
			
            <div id="optin_link_email_field_container<?php echo $opt_link_id; ?>">   
            
            <?php if($opt_form_data['show_email_field'] == 1) { ?>
            <input type="email" name="email" placeholder="<?php echo $opt_form_data['email-placeholder'] ?>" value="<?php if(isset($_GET['optinlinks_email'])) { echo $_GET['optinlinks_email']; } ?>" class="optin_link_form_field<?php echo $opt_link_id; ?>" id="optin_link_form_email<?php echo $opt_link_id; ?>">        
            <?php } ?>    
            
            </div>                
            
            <div id="optin_link_phone_field_container<?php echo $opt_link_id; ?>">               
            
            <?php if($opt_form_data['show_phone_field'] == 1) { ?>
            <input type="text" name="phone" placeholder="<?php echo $opt_form_data['phone-placeholder'] ?>" value="<?php if(isset($_GET['optinlinks_email'])) { echo $_GET['optinlinks_email']; } ?>" class="optin_link_form_field<?php echo $opt_link_id; ?>" id="opt_custom_phone_<?php echo $opt_link_id; ?>"> 
            <?php } ?>
            
            </div>       
            
            <div id="optin_link_address1_field_container<?php echo $opt_link_id; ?>">               
            
            <?php if($opt_form_data['show_address1_field'] == 1) { ?>
            <input type="text" name="address1" placeholder="<?php echo $opt_form_data['address1-placeholder'] ?>" value="<?php if(isset($_GET['optinlinks_email'])) { echo $_GET['optinlinks_email']; } ?>" class="optin_link_form_field<?php echo $opt_link_id; ?>" id="opt_custom_address1_<?php echo $opt_link_id; ?>"> 
            <?php } ?>
            
            </div>       
            
            <div id="optin_link_address2_field_container<?php echo $opt_link_id; ?>">               
            
            <?php if($opt_form_data['show_address2_field'] == 1) { ?>
            <input type="text" name="address2" placeholder="<?php echo $opt_form_data['address2-placeholder'] ?>" value="<?php if(isset($_GET['optinlinks_email'])) { echo $_GET['optinlinks_email']; } ?>" class="optin_link_form_field<?php echo $opt_link_id; ?>" id="opt_custom_address2_<?php echo $opt_link_id; ?>"> 
            <?php } ?>
            
            </div>       
            
            <div id="optin_link_state_field_container<?php echo $opt_link_id; ?>">               
            
            <?php if($opt_form_data['show_state_field'] == 1) { ?>
            <input type="text" name="state" placeholder="<?php echo $opt_form_data['state-placeholder'] ?>" value="<?php if(isset($_GET['optinlinks_email'])) { echo $_GET['optinlinks_email']; } ?>" class="optin_link_form_field<?php echo $opt_link_id; ?>" id="opt_custom_state_<?php echo $opt_link_id; ?>"> 
            <?php } ?>
            
            </div>       
            
            <div id="optin_link_zip_field_container<?php echo $opt_link_id; ?>">               
            
            <?php if($opt_form_data['show_zip_field'] == 1) { ?>
            <input type="text" name="zip" placeholder="<?php echo $opt_form_data['zip-placeholder'] ?>" value="<?php if(isset($_GET['optinlinks_email'])) { echo $_GET['optinlinks_email']; } ?>" class="optin_link_form_field<?php echo $opt_link_id; ?>" id="opt_custom_zip_<?php echo $opt_link_id; ?>"> 
            <?php } ?>
            
            </div>       
            
            <div id="optin_link_country_field_container<?php echo $opt_link_id; ?>">               
            
            <?php if($opt_form_data['show_country_field'] == 1) { ?>
            <input type="text" name="country" placeholder="<?php echo $opt_form_data['country-placeholder'] ?>" value="<?php if(isset($_GET['optinlinks_email'])) { echo $_GET['optinlinks_email']; } ?>" class="optin_link_form_field<?php echo $opt_link_id; ?>" id="opt_custom_country_<?php echo $opt_link_id; ?>"> 
            <?php } ?>
            
            </div>       
            
            <div id="optin_link_custom1_field_container<?php echo $opt_link_id; ?>">               
            
            <?php if($opt_form_data['show_custom1_field'] == 1) { ?>
            <input type="text" name="custom1" placeholder="<?php echo $opt_form_data['custom1-placeholder'] ?>" value="<?php if(isset($_GET['optinlinks_email'])) { echo $_GET['optinlinks_email']; } ?>" class="optin_link_form_field<?php echo $opt_link_id; ?>" id="opt_custom_custom1_<?php echo $opt_link_id; ?>"> 
            <?php } ?>
            
            </div>       
            
            <div id="optin_link_custom2_field_container<?php echo $opt_link_id; ?>">               
            
            <?php if($opt_form_data['show_custom2_field'] == 1) { ?>
            <input type="text" name="custom2" placeholder="<?php echo $opt_form_data['custom2-placeholder'] ?>" value="<?php if(isset($_GET['optinlinks_email'])) { echo $_GET['optinlinks_email']; } ?>" class="optin_link_form_field<?php echo $opt_link_id; ?>" id="opt_custom_custom2_<?php echo $opt_link_id; ?>"> 
            <?php } ?>
            
            </div>       
            
            <div id="optin_link_custom3_field_container<?php echo $opt_link_id; ?>">               
            
            <?php if($opt_form_data['show_custom3_field'] == 1) { ?>
            <input type="text" name="custom3" placeholder="<?php echo $opt_form_data['custom3-placeholder'] ?>" value="<?php if(isset($_GET['optinlinks_email'])) { echo $_GET['optinlinks_email']; } ?>" class="optin_link_form_field<?php echo $opt_link_id; ?>" id="opt_custom_custom3_<?php echo $opt_link_id; ?>"> 
            <?php } ?>
            
            </div>          
            
            <div id="optin_link_custom4_field_container<?php echo $opt_link_id; ?>">               
            
            <?php if($opt_form_data['show_custom4_field'] == 1) { ?>
            <input type="text" name="custom4" placeholder="<?php echo $opt_form_data['custom4-placeholder'] ?>" value="<?php if(isset($_GET['optinlinks_email'])) { echo $_GET['optinlinks_email']; } ?>" class="optin_link_form_field<?php echo $opt_link_id; ?>" id="opt_custom_custom4_<?php echo $opt_link_id; ?>"> 
            <?php } ?>
            
            </div>       
            
            <div id="optin_link_custom5_field_container<?php echo $opt_link_id; ?>">               
            
            <?php if($opt_form_data['show_custom5_field'] == 1) { ?>
            <input type="text" name="custom5" placeholder="<?php echo $opt_form_data['custom5-placeholder'] ?>" value="<?php if(isset($_GET['optinlinks_email'])) { echo $_GET['optinlinks_email']; } ?>" class="optin_link_form_field<?php echo $opt_link_id; ?>" id="opt_custom_custom5_<?php echo $opt_link_id; ?>"> 
            <?php } ?>
            
            </div>
                              
            
            <span>
         
       <div style="margin-top:5px;">      
        
 		<?php if($facebook!==false) { ?>
        
        <span id="optin_link_facebook_button<?php echo $opt_link_id; ?>">
        
        	<?php echo opt_facebook_button(intval($opt_link_id),opt_button_generator($opt_form_data['button_type'],'optinlink',$opt_form_data['button_color'],$opt_form_data['button_border_radius'],'','<div style="position:absolute"><img src="'.$images_href.'facebook.png" style="position:relative; left:-30px; top:-2px;" ></div><span style="display:inline-block; padding-left:6px;">'.$opt_form_data['button_text'].'</span>')) ?>
        
        </span>
        
        <?php } ?>

        
        <span id="optin_link_form_button<?php echo $opt_link_id; ?>" style="margin-top:10px;">
        <?php 
		
		if(isset($opt_form_data['button_text'])) { 
            
			
            echo opt_button_generator($opt_form_data['button_type'],'submit',$opt_form_data['button_color'],$opt_form_data['button_border_radius'],$opt_link_id,$opt_form_data['button_text'],'style="margin-top:10px; font-size:18px; margin-left:auto; margin-right:auto;"');
			
			if($facebook!==false) { echo opt_facebook_button($opt_link_id,'<img src="'.$images_href.'facebook.png" style="position:relative; left:10px; top:8px;" >'); } 
                    
		} 
		
		?>
        </span>
        
            </span>
			<?php if($opt_optin_not_required) { ?>
            <a href="javascript:void(0)" class="optin_link_no_thanks<?php echo  $opt_link_id  ; ?>" id="optin_link_form_no_thanks<?php echo $opt_link_id ; ?>" onClick="opt_form_no_thanks(<?php echo $opt_link_id ; ?>);" style="position:relative; top:0px;">No thanks</a>
            <?php } ?>
        
        </div>    
        </div>
        <div class="optin_bottom_container<?php echo  $opt_link_id  ; ?>">
        
            <div id="optin_link_form_processing<?php echo  $opt_link_id  ; ?>" style="font-style:italic; display:none; text-align:center; margin-left:30px;">Processing<span id="optin_link_process_dots<?php echo  $opt_link_id  ; ?>" class="optin_font<?php echo  $opt_link_id  ; ?>"></span></div>   
                     
            <div id="optin_link_form_error<?php echo  $opt_link_id  ; ?>" style="color:#f00; display:none; text-align:center; margin-left:30px;" class="optin_font<?php echo  $opt_link_id  ; ?>">Invalid details, please check your info.<span id="optin_link_process_dots<?php echo  $opt_link_id  ; ?>"></span></div>  
        
        </div>
        
        <div id="optin_link_finetext_text<?php echo  $opt_link_id  ; ?>" class="optin_link_form_finetext<?php echo  $opt_link_id  ; ?>" style=" <?php if($opt_form_data['finetext_text'] == '') { echo 'display:none';  }?> ">
            <?php echo  $opt_form_data['finetext_text']  ; ?>
        </div>  
        
        <?php if( current_user_can('edit_posts') && (empty($_GET['page']) || (isset($_GET['page']) && $_GET['page']!='opt/admin_pages/opt_admin_forms.php'))) { ?>
        
            <div style="background-color:#fee; padding:10px;">
                <div style="color:#f00; font-weight:bold;">You are currently logged in as an admin.</div>
                Stats will not track, if you wish to test your tracking please either log out of Wordpress, use incognito mode on your browser, or use a different browser.
        	</div>
        
        <?php } ?>
        
    </div>
	<div id="optin_link_form_waiting<?php echo $opt_link_id; ?>" class="optin_link_form<?php echo $opt_link_id; ?>" style="display:none;">
    
        <div style="margin:0 30px 0 30px; padding-bottom:30px;">
            
            <div style="float:right; margin-top:6px; margin-right:-20px;">
                <img src="<?php echo $images_href ; ?>loading.gif" style="box-shadow:none;" class="optin_reset" id="optin_link_waiting_image<?php echo $opt_link_id; ?>">
            </div>
            
            <div id="optin_link_header_waiting_text<?php echo $opt_link_id; ?>" class="optin_link_form_header_waiting<?php echo $opt_link_id; ?>" style=" <?php if($opt_form_data['header_waiting_text'] == '') { echo 'display:none';  }?> ">
                <?php echo  $opt_form_data['header_waiting_text']; ?>
            </div>
            
            <div id="optin_link_subheader_waiting_text<?php echo $opt_link_id; ?>" class="optin_link_form_subheader_waiting<?php echo $opt_link_id; ?>" style=" <?php if($opt_form_data['subheader_waiting_text'] == '') { echo 'display:none';  }?> ">
                <?php echo  $opt_form_data['subheader_waiting_text']; ?>
            </div>          
            
            <div id="optin_link_waiting_text<?php echo $opt_link_id; ?>" class="optin_link_form_redirect_waiting<?php echo $opt_link_id; ?>" style=" <?php if($opt_form_data['waiting_text'] == '') { echo 'display:none';  }?> ">        	
                <?php echo  $opt_form_data['waiting_text']; ?> <a href="" style="display:none;" id="optin_link_form_redirecting_link<?php echo $opt_link_id; ?>" class="optin_link_form_redirecting_link<?php echo $opt_link_id; ?>">http://www.yoursite.com/yoursecurelink</a>
            </div>  
        
   		</div>
    
    </div>
    
	<div id="optin_link_form_success<?php echo $opt_link_id; ?>" class="optin_link_form<?php echo $opt_link_id; ?>" style="display:none;">
    
        <div style="margin:0 30px 0 30px; padding-bottom:30px;">
            
            <div style="float:right; margin-top:6px; margin-right:-20px;">
                <img src="<?php echo $images_href ; ?>loading.gif" style="box-shadow:none;" class="optin_reset" id="optin_link_success_image<?php echo $opt_link_id; ?>">
            </div>
            
            <div id="optin_link_header_success_text<?php echo $opt_link_id; ?>" class="optin_link_form_header_success<?php echo $opt_link_id; ?>" style=" <?php if($opt_form_data['header_success_text'] == '') { echo 'display:none';  }?> ">
                <?php echo  $opt_form_data['header_success_text']; ?>
            </div>
            
            <div id="optin_link_subheader_success_text<?php echo $opt_link_id; ?>" class="optin_link_form_subheader_success<?php echo $opt_link_id; ?>" style=" <?php if($opt_form_data['subheader_success_text'] == '') { echo 'display:none';  }?> ">
                <?php echo  $opt_form_data['subheader_success_text']; ?>
            </div>           
            
            <div id="optin_link_redirect_text<?php echo $opt_link_id; ?>" class="optin_link_form_redirect_success<?php echo $opt_link_id; ?>" style=" <?php if($opt_form_data['redirect_text'] == '') { echo 'display:none';  }?> ">        	
                <?php echo  $opt_form_data['redirect_text']; ?> <a href="" style="display:none;" id="optin_link_form_redirecting_link<?php echo $opt_link_id; ?>" class="optin_link_form_redirecting_link<?php echo $opt_link_id; ?>">http://www.yoursite.com/yoursecurelink</a>
            </div>    
            
            <div id="optin_link_form_accessing<?php echo $opt_link_id; ?>" class="optin_link_form_redirecting<?php echo $opt_link_id; ?>" style="display:none;">
                <?php echo  $opt_form_data['access_text']; ?>
            </div>  
        
   		</div>
    
    </div>
    
</div>
<script type="text/javascript">opt_form_onload(<?php echo  $opt_link_id  ; ?>);</script>
<?php
/*
Don't remove this. The code needs to be in php mode at the end here for eval to work,
and it needs some kind of statement before the closing tag, but we don't have any more php to run, hence 1==1. 
*/  
1==1;
?>