?><?php  function optpress_admin_options() { global $themename, $shortname, $options, $optpress_categories; ?>

<?php $hidden_anchor = $_REQUEST['hidden_anchor']; if ( $_REQUEST['saved'] ) echo '<div id="message" class="updated fade below-h2"><p><strong>'.$themename.' settings saved.</strong></p></div>'; if ( $_REQUEST['reset'] ) echo '<div id="message" class="updated fade below-h2"><p><strong>'.$themename.' settings reset.</strong></p></div>'; if ( $_REQUEST['error'] ) echo '<div id="message" class="updated fade below-h2"><p><strong>Sidebar already exists, please use a different name.</strong></p></div>'; if ( $_GET['upgraded'] ) ''; ?>
<?php $templatedir = get_bloginfo('template_directory'); ?>

<script type="text/javascript" src="<?=$templatedir?>/admin/scripts/easyTooltip.js"></script>
<link rel="stylesheet" href="<?=$templatedir?>/admin/scripts/css/facebox.css" type="text/css" />
<link rel="stylesheet" href="<?=$templatedir?>/admin/scripts/css/stylepanel.css" type="text/css" />
<script src="<?=$templatedir?>/admin/scripts/facebox.js" type="text/javascript"></script>
<script type="text/javascript" src="<?=$templatedir?>/colorpicker/jscolor/jscolor.js"></script>
<script src="<?=$templatedir?>/lib/admin/js/ajaxupload.js" type="text/javascript"></script>
<script src="<?=$templatedir?>/lib/admin/js/adminupload.js" type="text/javascript"></script>
<script type="text/javascript">
function str_replace (search, replace, subject, count) {
var i = 0, j = 0, temp = '', repl = '', sl = 0, fl = 0,
			f = [].concat(search),
			r = [].concat(replace),
			s = subject,
			ra = r instanceof Array, sa = s instanceof Array;
	s = [].concat(s);
	if (count) {
		this.window[count] = 0;
	}
 
	for (i=0, sl=s.length; i < sl; i++) {
		if (s[i] === '') {
			continue;
		}
		for (j=0, fl=f.length; j < fl; j++) {
			temp = s[i]+'';
			repl = ra ? (r[j] !== undefined ? r[j] : '') : r[0];
			s[i] = (temp).split(f[j]).join(repl);
			if (count && s[i] !== temp) {
				this.window[count] += (temp.length-s[i].length)/f[j].length;}
		}
	}
	return sa ? s : s[0];
}	
</script>
<style>
table.optpress-options { margin-left:10px; }
#wpbody-content fieldset { border:1px solid #E1E1E1;margin:0 16px 20px;padding:10px 20px 0 5px;width:753px; background-color:#FFF; }
#wpbody-content legend { background-color:#F1F1F1;border:1px solid #E1E1E1;font-size:110%;font-weight:bold;margin-left:20px;padding:4px 8px;text-align:center;width:190px; }
textarea, input[type="text"], input[type="password"], input[type="file"], input[type="reset"], select {
background-color:#FFFFFF;
border-color:#DFDFDF;
}
input[type="submit"],input[type="button"]{margin-top:15px;margin-bottom:15px;font-weight:bold;font-size:14px;}
.licensebutton{background-color:#44a012!important;color:#ffffff !important;;text-shadow: #1e430a 1px 1px 0px;padding:15px!important;border:1px solid #39860f!important;cursor:pointer!important;}
.licensebutton:hover{cursor:pointer!important;background-color:#35830a!important;}
.field-left {
float:left;
padding:5px 10px 5px 0;
width:450px;
}
.field-right {
-x-system-font:none;
color:#666666;
float:left;
font-family:arial,helvetica,sans-serif;
font-size:12px;
font-size-adjust:none;
font-stretch:normal;
font-style:normal;
font-variant:normal;
font-weight:normal;
line-height:normal;
padding:5px 0;
width:250px;
}
.fieldtitle {
border-bottom:1px solid #F5F5F5;
font-family:arial,helvetica,sans-serif;
font-size:14px;
font-size-adjust:none;
font-stretch:normal;
font-style:normal;
font-variant:normal;
font-weight:bold;
height:17px;
line-height:normal;
margin-bottom:5px;
padding:5px 0;
}
.fieldsection {
margin:8px 20px;
}
input.field_txt, select.field_select {
-moz-background-clip:border;
-moz-background-inline-policy:continuous;
-moz-background-origin:padding;
background:#F5F5F5 none repeat scroll 0 0;
border-color:#9A9A9A #DADADA #CDCDCD #A7A7A7;
border-style:solid;
border-width:1px;
padding:4px;
width:350px;
}
label, #your-profile label + a {
vertical-align:middle;
}
label {
cursor:pointer;
}
.submit { clear:both; margin:5px 20px; }
.clr {
clear:both;
}
#wrapper{padding-top:10px;padding-left:0;width:780px;}

.clear{clear:both;}

.admin-logo{
	padding-left:0px;
	}
.admin-menu {
     margin: 10px 0 0px 0px;
    padding: 0;
    width: 780px;
	background:#020202;
}
.admin-menu ul {
    list-style: none outside none;
    margin: 0;
    padding: 0;
}
.admin-menu ul li {
    float: left;
    margin: 0;
    padding: 0;}
	
	.admin-menu ul li a {
		font-size:11px;
    color: #ffffff;
    display: block;
     font-family: "Lucida Grande","Lucida Sans Unicode",Helvetica,Arial,Verdana,sans-serif;
    height: 35px;
    line-height: 35px;
    padding: 2px 10px 3px;
    text-decoration: none;
}
.admin-menu ul li a:hover {
    background: none repeat scroll 0 0 #0e91c9;
	color:#ffffff;
}

.page-heading{    font-family: "Lucida Grande","Lucida Sans Unicode",Helvetica,Arial,Verdana,sans-serif;
display:block;
width:765px;background:#0E91C9;color:#ffffff;padding-left:15px;padding-bottom:10px;border:0px;
font-size:20px;padding-top:15px;padding-bottom:15px;margin-bottom:15px;}

.page-content-left{
 font-family: "Lucida Grande","Lucida Sans Unicode",Helvetica,Arial,Verdana,sans-serif;
    color: #333333;
    font-size: 12px;
    line-height: 19px;
	width:480px;float:left;
	border:1px solid #f2f2f2;
	padding:16px;
	background:#ffffff;
	margin-bottom:15px;
	}
	
	.page-content-right{
		 font-family: "Lucida Grande","Lucida Sans Unicode",Helvetica,Arial,Verdana,sans-serif;
    color: #57708a;
    font-size: 12px;
    line-height: 19px;
	width:210px;float:left;
	border:1px solid #f0f6fb;
	padding:16px;
background:#f3f9ff;
margin-left:15px;
margin-bottom:15px;
		
	}
	.section-heading{    font-family: "Lucida Grande","Lucida Sans Unicode",Helvetica,Arial,Verdana,sans-serif;
display:block;
width:100%;
padding-bottom:6px;
border-bottom:1px solid #e5e5e5;
font-size:15px;padding-top:5px;margin-bottom:15px;font-weight:bold;}

.page-content-right h3{margin-bottom:10px;margin-top:0px;font-family:"Palatino Linotype", "Book Antiqua", Palatino, serif;font-style:italic;font-size:14px;}

.page-content-full{
	
	 font-family: "Lucida Grande","Lucida Sans Unicode",Helvetica,Arial,Verdana,sans-serif;
    color: #333333;
    font-size: 12px;
    line-height: 19px;
	width:750px;
	border:1px solid #f2f2f2;
	padding:16px;
	background:#ffffff;
	
}

.text-right {
    color: #777777;
    float: left;
     font-family: "Lucida Grande","Lucida Sans Unicode",Helvetica,Arial,Verdana,sans-serif;
    padding: 0px 0;
    width: 250px;
	margin-left:20px;
	font-size:12px;

	
}

.text-left {
    color: #666666;
    float: left;
     font-family: "Lucida Grande","Lucida Sans Unicode",Helvetica,Arial,Verdana,sans-serif;
    padding: 0px 0;
    width: 480px;
	font-size:12px;

}

.text-description{    color: #999999;
    float: left;
     font-family: "Lucida Grande","Lucida Sans Unicode",Helvetica,Arial,Verdana,sans-serif;
    padding: 0px 0;
    width: 740px;
	font-size:11px;font-style:inherit;
	clear:both;}
.updated, .login .message {
width:763px;
}
.toplink{color:#666666;padding-left:20px;float:left;}
.toplink a:hover{color:#333333;text-decoration:underline;}
.toplink a{color:#666666;text-decoration:none;}
.selected1{background:#0e91c9;}
</style>
<div id="templateinfo" style="padding-left:16px;">

<div id="wrapper">
<div style="float:right;width:450px;padding-top:40px;"><div class="toplink"><a href="admin.php?page=op_instant_pages"><img style="padding-top:2px;" class="admin-logo" src="<?php echo $templatedir; ?>/images/logoip.png"></a></div><div class="toplink"><a href="http://www.optimizepress.com/dashboard" target="_blank">Training & Support Dashboard</a></div>  <div class="toplink"><a href="http://optimizepress.com/affiliates" target="_blank">Affiliates</a></div><div style="clear:both;"></div></div>
<img width="262" height="101" class="admin-logo" src="<?php echo $templatedir; ?>/images/oplogo.png">

<div class="admin-menu">
			<ul>
			<li class="selected1"><a href="admin.php?page=OptimizePress-options">General Settings</a></li>
            <li><a href="admin.php?page=OptimizePress-membershipconfigs">Membership Settings</a></li>
            <li><a href="admin.php?page=OptimizePress-blogconfigs">Blog Settings</a></li>
            <li><a href="admin.php?page=OptimizePress-salesconfigs">Sales Letter Nav</a></li>
            <li><a href="admin.php?page=OptimizePress-squeezeconfigs">Squeeze Nav</a></li>
            <li><a href="admin.php?page=OptimizePress-seo">SEO</a></li>
            <li><a href="admin.php?page=admin-configs">Funnel Config</a></li>
            <li><a href="admin.php?page=funnel-settings">Funnel Page Setup</a></li>
			</ul>
			<br style="clear: left;">
  </div>
<span class="page-heading">OptimizePress Settings</span>
<div class="clear"></div>
</div>


        <?php  	$LicDomain = $_SERVER['HTTP_HOST']; 	$keypost = $_POST['keypost']; 	if ($keypost ==1) {  $CheckKey = CheckLicenseAdmin($_POST['lickey'], $LicDomain);  if ($CheckKey == 1) {  echo '<font color="red">There appears to be a problem with your license. Please ensure you have licensed your domain correctly following the instructions in the members area. Contact check <a href="http://www.optimizepress.com/support">Support Site</a> for more help</font>';  } elseif ($CheckKey == 2) {  echo '<font color="red">There appears to be a problem with your license. Please ensure you have licensed your domain correctly following the instructions in the members area. Contact check <a href="http://www.optimizepress.com/support">Support Site</a> for more help</font>';  } elseif ($CheckKey == 3) {  update_option( 'OptimizePress_active', '1' );  update_option( 'OptimizePress_licensekey', $_REQUEST['lickey'] );  echo '<font color="green">Thank you! Your theme has been activated successfully.</font><br />';  } 	} 	 CheckLicenseFileAdmin(); 	  ?>
    
    </div><!--Close templateinfo-->

<form method="post" acceptCharset="UTF-8" action="">
	
<input id="hidden_anchor" type="hidden" name="hidden_anchor" value="" />

<?php  $get_options = get_option($shortname.'_general_settings'); $tooltips = ''; $videotips = ''; foreach ($options as $value) { $id = $value['id']; $selector = ($value['selector']) ? ' class="selector"' : '';  $tooltips .= ( $value[ 'help' ] ) ? '				jQuery("#'.$value['id'].'_help").easyTooltip();' : ''; $videotips .= ( $value[ 'videotxt' ] ) ? '				jQuery("#'.$value['id'].'_video").easyTooltip();' : '';  switch ( $value['type'] ) { 	 case "opentab": ?>
<div id="<?php echo $value['id']; ?>" class="fieldset_block">
<?php  break; case "closetab": ?>
</div>
<?php  break; case "title_h2": ?>
<table class="form-table optpress-options">
<?php  break; case "title_h3": ?>
<h3><?php echo $value['name']; ?></h3>
<table class="form-table optpress-options">
<?php  break; case "close": ?>
</table>
<?php  break; case 'openfieldset': ?>
<fieldset class="<?php echo $value['class']; ?>">
<?php  break; case 'closefieldset': ?>
</fieldset>
<?php   break;  case 'opentddiv': ?>
<td>
<?php   break; case 'closetddiv': ?>
</td></tr>
<div style="clear:both;"></div>
<?php   break; case 'divcolor': ?>
<div id="op_<?php echo $value['id']; ?>" class="fieldsection">
				<div class="fieldtitle"><label for="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></label></div>
				<div class="field-left">
					<input type="text" value="<?php echo stripslashes(htmlspecialchars($get_options[$id])); ?>" id="<?php echo $value['id']; ?>" name="<?php echo $value['id']; ?>" style="width: 70px;" class="color" size="<?php echo $value['size']; ?>" autocomplete="off"><br>
<?php echo ( $value[ 'help' ] ) ? ' <span class="help" id="' . $value[ 'id' ] .'_help" title="' . $value[ 'help' ] . '"> </span>' : ''; echo ( $value[ 'videotxt' ] ) ? ' <a href="' . $value[ 'videolink' ] .'" target="_blank"><span class="video" id="' . $value[ 'id' ] .'_video" title="' . $value[ 'videotxt' ] . '"> </span></a>' : ''; ?>
				</div>
				<div class="field-right"><?php echo $value['desc']; ?></div>
				<div class="clr"></div>
</div>
<?php  break; case 'text': ?>
<div id="op_<?php echo $value['id']; ?>" class="fieldsection">
				<div class="fieldtitle"><label for="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></label></div>
				<div class="field-left">
					<input type="text" value="<?php echo ( is_array(get_option($shortname.'_general_settings')) ) ? stripslashes(htmlspecialchars($get_options[$id])) : $value['std']; ?>" class="field_txt" id="<?php echo $value['id']; ?>" name="<?php echo $value['id']; ?>"><br>
<?php echo ( $value[ 'help' ] ) ? ' <span class="help" id="' . $value[ 'id' ] .'_help" title="' . $value[ 'help' ] . '"> </span>' : ''; echo ( $value[ 'videotxt' ] ) ? ' <a href="' . $value[ 'videolink' ] .'" target="_blank"><span class="video" id="' . $value[ 'id' ] .'_video" title="' . $value[ 'videotxt' ] . '"> </span></a>' : ''; ?>
				</div>
				<div class="field-right"><?php echo $value['desc']; ?></div>
				<div class="clr"></div>
</div>
<?php   break; case 'color': ?>
<div id="op_<?php echo $value['id']; ?>" class="fieldsection">
				<div class="fieldtitle"><label for="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></label></div>
				<div class="field-left">
					<input size="<?php echo $value['size']; ?>" style="width:70px;" class="color" name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>" type="text" value="<?php echo ( $get_options[$id]=="" ) ? ( (($value['default'])!="") ? $value['default'] : '' ) : stripslashes(htmlspecialchars($get_options[$id])); ?>" /><br>
<?php echo ( $value[ 'help' ] ) ? ' <span class="help" id="' . $value[ 'id' ] .'_help" title="' . $value[ 'help' ] . '"> </span>' : ''; echo ( $value[ 'videotxt' ] ) ? ' <a href="' . $value[ 'videolink' ] .'" target="_blank"><span class="video" id="' . $value[ 'id' ] .'_video" title="' . $value[ 'videotxt' ] . '"> </span></a>' : ''; ?>
				</div>
				<div class="field-right"><?php echo $value['desc']; ?></div>
				<div class="clr"></div>
</div>
<?php   break; case 'textarea': ?>
<div id="op_<?php echo $value['id']; ?>" class="fieldsection">
				<div class="fieldtitle"><label for="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></label></div>
				<div class="field-left">
					<textarea name="<?php echo $value['id']; ?>" cols="50" rows="7"><?php if ( $get_options[$id] != "") { echo stripslashes($get_options[$id]); } else { echo $value['std']; } ?></textarea><br>
<?php echo ( $value[ 'help' ] ) ? ' <span class="help" id="' . $value[ 'id' ] .'_help" title="' . $value[ 'help' ] . '"> </span>' : ''; echo ( $value[ 'videotxt' ] ) ? ' <a href="' . $value[ 'videolink' ] .'" target="_blank"><span class="video" id="' . $value[ 'id' ] .'_video" title="' . $value[ 'videotxt' ] . '"> </span></a>' : ''; ?>
				</div>
				<div class="field-right"><?php echo $value['desc']; ?></div>
				<div class="clr"></div>
</div>
<?php  break; case "checkbox": ?>
<div id="op_<?php echo $value['id']; ?>" class="fieldsection">
				<div class="fieldtitle"<?php echo ($value['name']!="") ? '' : ' style="height:0;"'; ?>><label for="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></label></div>
				<div class="field-left">
					<?php if($get_options[$id.'_tick']=="0"){ $checked = ""; }else{ if(empty($get_options[$id.'_tick']) && $value['default']=="checked") { $checked = "checked=\"checked\""; } elseif(empty($get_options[$id.'_tick']) && $value['default']=="") { $checked = ""; } else { $checked = "checked=\"checked\""; } } ?>
<input type="checkbox" name="<?php echo $value['id']; ?>" onclick="this.form.<?php echo $value['id'].'_tick'; ?>.value = (this.checked ? 1 : 0)" id="<?php echo $value['id']; ?>" <?php echo $checked; ?> />&nbsp;<span style="color:#666666;font-size:12px;font-family:arial,helvetica,sans-serif;"><?php echo $value['desc']; ?></span><input name="<?php echo $value['id'].'_tick'; ?>" id="<?php echo $value['id'].'_tick'; ?>" type="hidden" value="<?php echo $get_options[$id.'_tick']; ?>" />
<?php echo ( $value[ 'help' ] ) ? ' <span class="help" id="' . $value[ 'id' ] .'_help" title="' . $value[ 'help' ] . '"> </span>' : ''; echo ( $value[ 'videotxt' ] ) ? ' <a href="' . $value[ 'videolink' ] .'" target="_blank"><span class="video" id="' . $value[ 'id' ] .'_video" title="' . $value[ 'videotxt' ] . '"> </span></a>' : ''; ?>
				</div>
				<div class="field-right"></div>
				<div class="clr"></div>
</div>
<?php  break; case 'select_align': ?>
<div id="op_<?php echo $value['id']; ?>" class="fieldsection">
    <div class="fieldtitle"><label for="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></label></div>
    <div class="field-left">
        <select id="<?php echo $value['id']; ?>" name="<?php echo $value['id']; ?>" style="width:125px;"><br>
        <?php  while (list ($i, $val) = each ($value['options'])) {  $selected = ( $get_options[$id] == $val ) ? 'selected="selected"' : '';  if( $get_options[$id] == "" ) {  $checked = ( ( $value[ 'default_value' ] ) == $val ) ? 'selected="selected"' : '';  }  echo '<option '.$selected.' '.$checked.' value="'.$val.'">'.$val.'</option>';   }  ?>
        </select>
<?php echo ( $value[ 'help' ] ) ? ' <span class="help" id="' . $value[ 'id' ] .'_help" title="' . $value[ 'help' ] . '"> </span>' : ''; echo ( $value[ 'videotxt' ] ) ? ' <a href="' . $value[ 'videolink' ] .'" target="_blank"><span class="video" id="' . $value[ 'id' ] .'_video" title="' . $value[ 'videotxt' ] . '"> </span></a>' : ''; ?>
    </div>
    <div class="field-right"><?php echo $value['desc']; ?></div>
    <div class="clr"></div>
</div>
<?php break; case 'file': ?>
<tr valign="top" <?php if ($value['selector']) {echo 'id="toggle_click" class="selected_categories"';} if ( ($get_options['homepage_slider'] == 'custom' || $get_options['homepage_slider'] == 'flash' || $get_options['homepage_slider'] == '') && ($value['selector']) ){echo ' style="display:none"';} ?>>
<th align="left"><?php echo $value['name']; ?></th>
<td><input size="<?php echo $value['size']; ?>" name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php echo stripslashes(htmlspecialchars($get_options[$id])); ?>" />
<?php echo ( $value[ 'help' ] ) ? ' <span class="help" id="' . $value[ 'id' ] .'_help" title="' . $value[ 'help' ] . '"> </span>' : ''; echo ( $value[ 'videotxt' ] ) ? ' <a href="' . $value[ 'videolink' ] .'" target="_blank"><span class="video" id="' . $value[ 'id' ] .'_video" title="' . $value[ 'videotxt' ] . '"> </span></a>' : ''; ?>
<br /><span><?php echo $value['desc']; ?></span></td>
</tr>
<?php if(get_option($value['id'] .'_images')) { ?>
<tr valign="top">
<th align="left">
</th>
<td>
<?php  echo '<label>Uploaded Images:</label><img style="vertical-align:text-top;" src="' . get_option($value['id'] .'_images').'">'; ?>
</td>
</tr>
<?php } ?>
<?php  break; case 'upload': ?>
<div id="<?php echo $value['id']; ?>_upload-field" class="fieldsection">

				<div class="fieldtitle"><label for="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></label></div>
				<div class="field-left">
					<input type="text" value="<?php echo ($value['id']=="custom_logo_upload_images" || $value['id']=="header_img_images") ? ((!empty($get_options[$id])) ? htmlspecialchars($get_options[$id]) : get_option($value['id']) ) : htmlspecialchars($get_options[$id]); ?>" class="field_txt uploaded_url" id="<?php echo $value['id']; ?>" name="<?php echo $value['id']; ?>"><br><br><span class="image_upload_button button " id="<?php echo $value['id']; ?>_upload-btn">Upload Image</span>
				<input type="hidden" class="ajax_action_url" value="<?php echo admin_url("admin-ajax.php"); ?>" name="<?php echo $value['id']; ?>_action"></div>
				<div class="field-right"><?php echo $value['desc']; ?></div>
				<div class="clr"></div>
</div>
	
<?php break; case "exclude_include_checkbox": ?>
<tr valign="top">
<td align="left" style="margin-bottom:0;padding-bottom:0;"><div class="fieldtitle"><label for="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></label></div></td><tr>
</tr><tr>
<td id="<?php echo $value['id']; ?>" class="optpress_box_select">
<?php if($get_options[$id]){ $checked = "checked=\"checked\""; }else{ $checked = "";} ?>
<?php foreach ($value['options'] as $optpress_pgid => $optpress_pgname) { if ($optpress_pgname !='') { echo '<div style="border:1px solid #cccccc;margin-right:4px;margin-bottom:4px;padding:4px;white-space:nowrap;float:left;width:120px;overflow:hidden;"><input type="checkbox" name="'.$optpress_pgid.'" id="'.$value['id'].'_'.$optpress_pgid.'" class="select_' .$value['id']. '" /> '.$optpress_pgname.'</div>'; } } ?>

<div style="clear:both"></div>
<input style="width:400px;visibility:hidden;margin:0;padding:0;border:0;height:0;" readonly="readonly" name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>" type="text" value="<?php if ( $get_options[$id] != '') { echo stripslashes($get_options[$id]); } else { echo $value['std']; } ?>" />
<br /><span><?php echo $value['desc']; ?></span>
<?php echo ( $value[ 'help' ] ) ? ' <span class="help" id="' . $value[ 'id' ] .'_help" title="' . $value[ 'help' ] . '"> </span>' : ''; echo ( $value[ 'videotxt' ] ) ? ' <a href="' . $value[ 'videolink' ] .'" target="_blank"><span class="video" id="' . $value[ 'id' ] .'_video" title="' . $value[ 'videotxt' ] . '"> </span></a>' : ''; ?>
</td>
</tr>
<?php break; case "submit": ?>
<div class="submit optpress-submit"><input class="button-primary" type="submit" name="updategen" value="Save changes"/><input type="hidden" name="action" value="save" /><br />
<span style="font-size:11px"><strong>IMPORTANT:</strong> If you are licensing your site, click the "Submit/Submit Query" button at the top of this page, not the "Save Changes" button</span>
</div>

<?php break; } } ?>
</form>

	<script type="text/javascript">
    jQuery(document).ready(function(){
        jQuery("span.help").each(function(){
            jQuery(this).html("<a rel=\"facebox\" href=\"#"+str_replace("_help", "", jQuery(this).attr("id") )+"\"><img src=\"<?=$templatedir?>/admin/scripts/images/op-help-icon.png\" border=\"0\" style=\"width:16px;height:16px;vertical-align:middle;\"></a>"); // load help icons
        });
        jQuery("span.video").each(function(){
            jQuery(this).html("<span rel=\"facebox\" href=\"#"+str_replace("_video", "", jQuery(this).attr("id") )+"\"><img src=\"<?=$templatedir?>/admin/scripts/images/tutorial-icon.png\" border=\"0\" style=\"width:16px;height:16px;vertical-align:middle;\"></span>"); // load help icons
        });
        <?php echo $tooltips; ?>
        <?php echo $videotips; ?>
    });
    </script>

<?php  }   function optpress_add_admin_options() { 	global $themename, $shortname, $options ,$page_handle; 	$hidden_anchor = $_REQUEST['hidden_anchor']; 	$send = $_GET['page']; 	if ( $_GET['page'] == $page_handle ) { 	if ( 'save' == $_REQUEST['action'] ) { 	    foreach ($_POST as $key => $value) {  if ( preg_match("/flash_slider_/", $key) ) {  $options_slider[$key] = $value;	  }  if ( preg_match("/custom_slider_/", $key) ) {  $options_slider_custom[$key] = $value;  }    delete_option( $shortname.'_flash_slider');  delete_option( $shortname.'_custom_slider');  update_option( $shortname.'_flash_slider', $options_slider);  update_option( $shortname.'_custom_slider', $options_slider_custom);  }      $gen_i = 0;  foreach ($options as $value) {   if($value['id'] != 'sidebar_generator_0'){  if($value['type'] == 'file') {    $gensettingupload = new CI_Up_Mark();  if(!is_dir(WP_CONTENT_DIR .'/uploads')) {  mkdir(WP_CONTENT_DIR .'/uploads', 0777);  }  if(!is_dir(WP_CONTENT_DIR .'/uploads/normal')) {  mkdir(WP_CONTENT_DIR .'/uploads/normal', 0777);  }  if(!is_dir(WP_CONTENT_DIR .'/uploads/thumbs')) {  mkdir(WP_CONTENT_DIR .'/uploads/thumbs', 0777);  }  $dirname = WP_CONTENT_DIR .'/uploads';  $dir = get_bloginfo('home').'/wp-content/uploads';  $gensettingupload->set_FPath($dirname."/");  $gensettingupload->filepaththumb = $dirname."/thumbs/";  $gensettingupload->filepathnormal = $dirname."/normal/";  $gensettingupload->set_File($value['id']);  $myimage = 'images';  $imagename = '';  if($_FILES[$value['id']]['name']!=""){  if($gensettingupload->is_ImageFile()==true){  $imagename = $gensettingupload->do_UploadFile();  update_option( $value['id'].'_'.$myimage, $dir.'/'.$imagename );  update_option( $value['id'].'_'.$myimage.'_thumbs', $dir.'/thumbs/'.$imagename );  update_option( $value['id'].'_'.$myimage.'_normal', $dir.'/normal/'.$imagename );  }  }  unset($gensettingupload);  }  $options_array[$value['id']] = $_REQUEST[ $value['id'] ];   }  $gen_i++;  }  $options_array['activate_header_sitewide_tick'] = $_REQUEST[ 'activate_header_sitewide_tick' ];   $options_array['footer_poweredby_tick'] = $_REQUEST[ 'footer_poweredby_tick' ];   $options_array['footerlinkstarget_tick'] = $_REQUEST[ 'footerlinkstarget_tick' ];   $options_array['activatefooterdisclaimermsg_tick'] = $_REQUEST[ 'activatefooterdisclaimermsg_tick' ];   update_option( $shortname.'_general_settings', $options_array);      global $wpdb, $shortname;  $postids_meta = $wpdb->get_results("SELECT post_id FROM $wpdb->postmeta WHERE meta_key = '_launchpage_showlinkstovideospages'", ARRAY_A);  $launch_pages_array = array();  if ( is_array($postids_meta) ){  foreach ($postids_meta as $key => $value) {  $launch_pages_array[] = $value['post_id'];  }  }  $launchpages_count = count($launch_pages_array);  $i=0;  while($i<$launchpages_count) {  $getshowlinksvideos = $wpdb->get_results("SELECT meta_value FROM $wpdb->postmeta WHERE meta_key = '_launchpage_showlinkstovideospages' AND post_id = '".$launch_pages_array[$i]."'", ARRAY_A);  $myshowlinksvideos = array();  if ( is_array($getshowlinksvideos) ){  foreach ($getshowlinksvideos as $key => $value) {  $myshowlinksvideos = explode(",", $value['meta_value']);  }  }  $options = array( array( "id" => "video1_setup", "name" => "video1_setup", "type" => "" ), array( "id" => "video2_setup", "name" => "video2_setup", "type" => "" ), array( "id" => "video3_setup", "name" => "video3_setup", "type" => "" ), array( "id" => "video4_setup", "name" => "video4_setup", "type" => "" ), array( "id" => "video5_setup", "name" => "video5_setup", "type" => "" ), array( "id" => "video6_setup", "name" => "video6_setup", "type" => "" ), array( "id" => "video7_setup", "name" => "video7_setup", "type" => "" ), array( "id" => "video8_setup", "name" => "video8_setup", "type" => "" ) );   $get_options = get_option($shortname.'_general_settings');  $check_funnels_array = array();  foreach ($options as $value) {  $id = $value['id'];  if(stripslashes($get_options[$id])!="") {  $check_funnels_array[] = stripslashes($get_options[$id]);  }  }  $result = array_diff($myshowlinksvideos, $check_funnels_array);   foreach ($result as $key => $value) {  unset($myshowlinksvideos[$key]);   }  $myshowlinksvideos = implode(",", $myshowlinksvideos);        update_post_meta( $launch_pages_array[$i], '_launchpage_showlinkstovideospages', $myshowlinksvideos );   $i++;  } 	     header("Location: admin.php?page=$send&saved=true$hidden_anchor");  die;  } else if( 'reset' == $_REQUEST['action'] ) {  foreach ($options as $value) {  delete_option( $value['id'] ); }  header("Location: admin.php?page=$send&reset=true$hidden_anchor");  die;  } 	}  add_menu_page($themename." Settings", $themename, 'edit_themes', $page_handle, 'optpress_admin_options');  add_submenu_page($page_handle, __('General Settings'), __('General Settings'), 'edit_themes', $page_handle, 'optpress_admin_options');  add_submenu_page( $page_handle, 'Instant Pages', 'Instant Pages', '10', 'op_instant_pages', 'ss_pagegenerator_config');  add_submenu_page( $page_handle, 'Membership Page Settings', 'Membership Options', '10', $themename.'-membershipconfigs', 'ss_mmb_config');  add_submenu_page( $page_handle, 'Blog Page Settings', 'Blog Options', '10', $themename.'-blogconfigs', 'ss_blg_config');  add_submenu_page( $page_handle, 'SEO Settings', 'SEO Options', '10', $themename.'-seo', 'ss_seo_config');  add_submenu_page( $page_handle, 'Sales Letter Navbar', 'Sales Letter Navbar', '10', $themename.'-salesconfigs', 'ss_sln_config');  add_submenu_page( $page_handle, 'Squeeze Page Settings', 'Squeeze Page Navbar', '10', $themename.'-squeezeconfigs', 'ss_spn_config');  add_submenu_page( $page_handle, 'Configuration', 'Funnel Config', '10', 'admin-configs', 'ss_adm_config');  add_submenu_page( $page_handle, 'Funnel Settings', 'Funnel Page Setup', '10', 'funnel-settings', 'ss_funnel_setup');   }  function ajax_update_widgets($sidebar_id) { 	$get_widgets = wp_get_sidebars_widgets(); 	unset( $get_widgets['array_version'] );  	$before_delete = true; $i=0; 	foreach ($get_widgets as $key => $value) {  if( !preg_match('/optpress_sidebar-([0-9]+)/', $key) ) {  $update_widgets[$key] = $value;   }  if( preg_match('/optpress_sidebar-([0-9]+)/', $key) ) {  if($key == "optpress_sidebar-$sidebar_id") {  $before_delete = false; $inactive_widgets = $value; }  if( ($key != "optpress_sidebar-$sidebar_id") && ($before_delete == true) ) {  $update_widgets[$key] = $value; }   if( ($key != "optpress_sidebar-$sidebar_id") && ($before_delete == false) ) {  $update_widgets['optpress_sidebar-'.$i] = $value; }  $i++;  } 	} 	$update_widgets['wp_inactive_widgets'] = array_merge($inactive_widgets, (array) $update_widgets['wp_inactive_widgets']); 	wp_set_sidebars_widgets($update_widgets); }  function ajax_sidebar_rm() {	 	global $shortname, $wpdb; 	$sidebar = $_POST['sidebar']; 	$sidebar_id = $_POST['sidebar_id']; 	$sidebar_name = $_POST['sidebar_name']; 	$pieces = explode(",", $sidebar);  	foreach ($pieces as $key => $value) {  if($value != '')  $options_sidebar_rm[ $value ] = $value;  }  update_option( $shortname.'_sidebar_generator', $options_sidebar_rm);  ajax_update_widgets($sidebar_id);   $sidebar_meta = $wpdb->get_results("SELECT post_id FROM $wpdb->postmeta WHERE meta_value = '$sidebar_name'", ARRAY_A);  if ( is_array($sidebar_meta) ){  foreach ($sidebar_meta as $key => $value) {  delete_post_meta($value['post_id'], 'selected_sidebar');  } 	} }  function ss_pagegenerator_config() { 	global $themename; 	include 'page_generator.php'; } function ss_mmb_config() { 	global $themename; 	include 'mmb_config.php'; } function ss_blg_config() { 	global $themename; 	include 'blg_config.php'; }  function ss_sln_config() { 	global $themename; 	include 'sln_config.php'; }  function ss_spn_config() { 	global $themename; 	include 'spn_config.php'; }  function ss_seo_config() { 	global $themename; 	include 'seo_config.php'; }   function ss_funnel_setup() { 	global $themename; 	include 'adm_funnel_setup.php'; } function ss_adm_config() { 	global $themename; 	include 'adm_config.php'; }  add_action('wp_ajax_op_ajax_post_action', 'op_ajax_callback'); function op_ajax_callback() {  global $wpdb;    if ( isset($_POST['type']) ) {  if ( $_POST['type'] == 'upload' ) {  $clickedID = $_POST['data'];  $filename = $_FILES[$clickedID];  $filename['name'] = preg_replace('/[^a-zA-Z0-9._\-]/', '', $filename['name']);   $override['test_form'] = false;  $override['action'] = 'wp_handle_upload';   $uploaded_file = wp_handle_upload( $filename, $override );   $upload_tracking[] = $clickedID;   if (!empty($uploaded_file['error'])) {  echo 'Upload Error: ' . $uploaded_file['error'];   } else {   echo $uploaded_file['url'];   }    die;  }  } }  add_action('wp_ajax_sidebar_rm', 'ajax_sidebar_rm'); add_action('wp_ajax_show_hide_pgs', 'ajax_show_hide_pgs'); add_action('admin_menu', 'optpress_add_admin_options');  ?>
#myGallery, #myGallerySet, #flickrGallery {
width: 585px;
height: 400px;
z-index:5;
border: 1px solid #000;
}

.jdGallery .slideInfoZone
{
background: #000;
color: #fff;
}

.jdGallery .slideElement
{
width: 100%;
height: 100%;
background-color: #000;
background-repeat: no-repeat;
background-position: center center;
background-image: url('img/loading-bar-black.gif');
}

.jdGallery .loadingElement
{
width: 100%;
height: 100%;
position: absolute;
left: 0;
top: 0;
background-color: #000;
background-repeat: no-repeat;
background-position: center center;
background-image: url('img/loading-bar-black.gif');
}

.jdGallery .slideInfoZone h2
{
padding: 0 !important;
font-size: 14px !important;
background-color: #000 !important;
margin: 2px 5px !important;
font-weight: bold !important;
color: #fff !important;
background-image: none !important;
text-align: left !important;
}

.jdGallery .slideInfoZone p
{
padding: 0 !important;
background-color: #000 !important;
font-size: 11px !important;
margin: 2px 5px !important;
color: #fff !important;
background-image: none !important;
text-align: left !important;
}

.jdGallery a.carouselBtn, .jdGallery a.carouselBtn:hover, .jdGallery a.carouselBtn:active
{
position: absolute;
bottom: 0;
right: 30px;
height: 20px;
/*width: 100px; background: url('img/carousel_btn.gif') no-repeat;*/
text-align: center;
padding: 0 10px;
font-size: 13px;
background: #000;
color: #fff !important;
cursor: pointer;
}

.jdGallery .carousel
{
position: absolute;
width: 100%;
margin: 0px;
left: 0;
top: 0;
height: 115px;
background: #000;
color: #fff;
text-indent: 0;
overflow: hidden;
}

.jdGallery .carousel .carouselInner .thumbnail, .jdExtCarousel .carouselInner .thumbnail
{
cursor: pointer;
background: #000;
background-position: center center;
float: left;
border: solid 1px #000;
}

.jdGallery .carousel .wallButton, .jdExtCarousel .wallButton
{
font-size: 10px;
position: absolute;
bottom: 5px;
right: 10px;
padding: 1px 2px;
margin: 0;
background: #000;
border: 1px solid #000;
cursor: pointer;
}

.jdGallery .carousel .label .number, .jdExtCarousel .label .number
{
color: #fff;
}

.jdGallery a
{
font-size: 100%;
text-decoration: none;
color: #fff;
}

/* Gallery Sets */

.jdGallery a.gallerySelectorBtn
{
z-index: 15;
position: absolute;
top: 0;
left: 30px;
height: 20px;
/*width: 100px; background: url('img/carousel_btn.gif') no-repeat;*/
text-align: center;
padding: 0 10px;
font-size: 13px;
background: #000;
color: #fff;
cursor: pointer;
opacity: .4;
-moz-opacity: .4;
-khtml-opacity: 0.4;
filter:alpha(opacity=40);
}

.jdGallery .gallerySelector
{
z-index: 20;
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
background: #000;
}

.jdGallery .gallerySelector h2
{
margin: 0;
padding: 10px 20px 10px 20px;
font-size: 20px;
line-height: 30px;
color: #fff;
}

.jdGallery .gallerySelector .gallerySelectorInner div.galleryButton
{
margin-left: 10px;
margin-top: 10px;
border: 1px solid #000;
padding: 5px;
height: 40px;
color: #fff;
cursor: pointer;
float: left;
}

.jdGallery .gallerySelector .gallerySelectorInner div.hover
{
background: #000;
}

.jdGallery .gallerySelector .gallerySelectorInner div.galleryButton div.preview
{
background: #000;
background-position: center center;
float: left;
border: none;
width: 40px;
height: 40px;
margin-right: 5px;
}

.jdGallery .gallerySelector .gallerySelectorInner div.galleryButton p.info
{
margin: 0;
padding: 0;
font-size: 12px;
font-weight: normal;
color: #fff;
}
