<?php // Themes Options Menu

$themename = "Exhibit";
$dirname = "exhibit";
$shortname = "theme";
$page_handle = $shortname . '-options';
$options = array (

array(	"name" =>  __('General Settings'),
      	"type" => "title"),

		array(	"type" => "open",
      	"id" => $shortname."_general_settings"),
 
		array(
		"name" => __('Theme Skin', 'gp_lang'),
        "desc" => __('Choose the theme skin (can be overridden on individual posts/pages).', 'gp_lang'),
        "id" => $shortname."_skin",
        "std" => "Light",
		"options" => array('Light', 'Dark'),
        "type" => "select"),
        
		array("type" => "divider"),
		
		array(
		"name" => __('Logo URL', 'gp_lang'),
        "desc" => __('Enter a custom logo URL (e.g. <code>http://www.example.com/images/imagename.jpg</code>).', 'gp_lang'),
        "id" => $shortname."_logo",
        "std" => "",
        "extras" => "uploadbutton",
		"type" => "text"),
		
		array(
		"name" => __('Logo Text', 'gp_lang'),
        "desc" => __('Enter custom logo text if you do not want to use a logo image.', 'gp_lang'),
        "id" => $shortname."_logo_text",
        "std" => "",
        "extras" => "",
		"type" => "text"),
    
		array("type" => "divider"),

		array(
		"name" => __('Tagline', 'gp_lang'),
        "desc" => __('Enter a tagline to the right of your logo.', 'gp_lang'),
        "id" => $shortname."_tagline",
        "std" => "",
        "extras" => "",
		"type" => "text"),

		array("type" => "divider"),
		
		array(
		"name" => __('TimThumb Image Resizer', 'gp_lang'),
        "desc" => __('If the images are not working on the website try disabling this option. <em>Note: This will mean the images will no longer be automatically cropped proportionally.</em>', 'gp_lang'),
        "id" => $shortname."_timthumb",
        "std" => __('Enable', 'gp_lang'),
		"options" => array(__('Enable', 'gp_lang'), __('Disable', 'gp_lang')),
        "type" => "radio"),
        
		array("type" => "divider"), 
		
        array(
		"name" => __('Favicon URL (.ico)', 'gp_lang'),
        "desc" => __('Type the URL of the favicon image (.ico, 16x16 or 32x32)', 'gp_lang'),
        "id" => $shortname."_favicon_ico",
        "std" => "",
        "extras" => "uploadbutton",
		"type" => "text"),

        array(
		"name" => __('Favicon URL (.png)', 'gp_lang'),
        "desc" => __('Type the URL of the favicon image (.png, 16x16 or 32x32)', 'gp_lang'),
        "id" => $shortname."_favicon_png",
		"std" => "",
        "extras" => "uploadbutton",
		"type" => "text"),
        
         array(
		"name" => __('Apple Icon URL (.png)', 'gp_lang'),
        "desc" => __('Type the URL of the apple icon image (.png, 57x57), used for display on the Apple iPhone', 'gp_lang'),
        "id" => $shortname."_apple_icon",
        "std" => "",
        "extras" => "uploadbutton",
		"type" => "text"),

		array("type" => "divider"),
		
		array(  
		"name" => __('RSS Feed Button', 'gp_lang'),
        "desc" => __('Display the RSS feed button with the default RSS feed or enter a custom feed below.'),
        "id" => $shortname."_rss_button",
        "std" => __('Enable', 'gp_lang'),
		"options" => array(__('Enable', 'gp_lang'), __('Disable', 'gp_lang')),
        "type" => "radio"),
        
		array(
		"name" => __('RSS URL', 'gp_lang'),
        "id" => $shortname."_rss",
        "std" => "",
        "extras" => "",
		"desc" => "",
		"type" => "text"),
        
        array(
		"name" => __('Facebook URL', 'gp_lang'),
        "id" => $shortname."_facebook",
        "std" => "",
        "extras" => "",
		"desc" => "",
		"type" => "text"),
 
        array(
		"name" => __('Vimeo URL', 'gp_lang'),
        "id" => $shortname."_vimeo",
        "std" => "",
        "extras" => "",
		"desc" => "",
		"type" => "text"),
		
        array(
		"name" => __('Twitter URL', 'gp_lang'),
        "id" => $shortname."_twitter",
        "std" => "",
        "extras" => "",
		"desc" => "",
		"type" => "text"),

        array(
		"name" => __('Delicious URL', 'gp_lang'),
        "id" => $shortname."_delicious",
        "std" => "",
        "extras" => "",
		"desc" => "",
		"type" => "text"),
		
        array(
		"name" => __('YouTube URL', 'gp_lang'),
        "id" => $shortname."_youtube",
        "std" => "",
        "extras" => "",
		"desc" => "",
		"type" => "text"),
		
        array(
		"name" => __('Digg URL', 'gp_lang'),
        "id" => $shortname."_digg",
        "std" => "",
        "extras" => "",
		"desc" => "",
		"type" => "text"),    
		
        array(
		"name" => __('Dribbble', 'gp_lang'),
        "id" => $shortname."_dribbble",
        "std" => "",
        "extras" => "",
		"desc" => "",
		"type" => "text"),

		array("type" => "divider"), 
		
		array(
		"name" => "Header Content",
        "desc" => "Enter the content you want to display in your header (e.g. Google advertisements).",
        "id" => $shortname."_header_content",
        "std" => "",
        "type" => "textarea"),
        
		array("type" => "divider"), 

		array(
		"name" => "Left Footer Content",
        "desc" => "Enter the content you want to display in your footer to the left (e.g. copyright text).",
        "id" => $shortname."_footer_content_left",
        "std" => "",
        "type" => "textarea"),

		array(
		"name" => "Right Footer Content",
        "desc" => "Enter the content you want to display in your footer to the right (e.g. social links).",
        "id" => $shortname."_footer_content_right",
        "std" => "",
        "type" => "textarea"),
        
		array("type" => "divider"), 
		
		array(
		"name" => "Scripts",
        "desc" => "Enter any scripts that need to be embedded into the theme (e.g. Google Analytics).",
        "id" => $shortname."_scripts",
        "std" => "",
        "type" => "textarea"),
        
		array("type" => "close"),	

array(	"name" => __('Homepage Settings', 'gp_lang'),
		"type" => "title"),

		array(	"type" => "open",
      	"id" => $shortname."_homepage_settings"),

		array(
		"name" => __('Category Type', 'gp_lang'),
        "desc" => __('Choose to display a post or portfolio category on the homepage.', 'gp_lang'),
        "id" => $shortname."_home_category_type",
        "std" => "Portfolio Category",
        "options" => array('Portfolio Category', 'Post Category'),
        "type" => "select"),
        
		array(
		"name" => __('Portfolio Category', 'gp_lang'),
        "desc" => __('Choose a portfolio category to display on the homepage.', 'gp_lang'),
        "id" => $shortname."_home_portfolio_category",
        "std" => "",
        "type" => "taxonomy_select"),

		array(
		"name" => __('Post Category', 'gp_lang'),
        "desc" => __('Choose a post category to display on the homepage.', 'gp_lang'),
        "id" => $shortname."_home_post_category",
        "std" => "",
        "type" => "category_select"),
        
		array("type" => "divider"),
		
		array(  
		"name" => "Image Width",
        "desc" => "The image width.",
        "id" => $shortname."_home_image_width",
        "std" => "200",
        "type" => "dimension"),

  		array(  
		"name" => "Image Height",
        "desc" => "The image height.",
        "id" => $shortname."_home_image_height",
        "std" => "200",
        "type" => "dimension"),
        
		array("type" => "divider"),

		array(  
		"name" => __('Text Display', 'gp_lang'),
        "desc" => __('Choose whether to display a limited or full text display.', 'gp_lang'),
        "id" => $shortname."_home_text_display",
        "std" => 'Limited',
		"options" => array('Limited', 'Full'),
        "type" => "select"),
         
		array("type" => "divider"),
		
        array(
		"name" => "Excerpt Length",
        "desc" => "The number of characters in item excerpts.",
        "id" => $shortname."_home_excerpt_length",
        "std" => "40",
        "type" => "text_small"),

		array("type" => "divider"),
		
		array(  
		"name" => __('Order Options', 'gp_lang'),
        "desc" => __('Choose whether to display the order options at the top of the page.', 'gp_lang'),
        "id" => $shortname."_home_order_options",
        "std" => __('Enable', 'gp_lang'),
		"options" => array(__('Enable', 'gp_lang'), __('Disable', 'gp_lang')),
        "type" => "radio"),

		array("type" => "divider"),
		
		array(  
		"name" => __('Page Navigation', 'gp_lang'),
        "desc" => __('Choose where to display the page navigation.', 'gp_lang'),
        "id" => $shortname."_home_page_nav",
        "std" => 'Top & Bottom',
		"options" => array('Top & Bottom', 'Top', 'Bottom', 'Disable'),
        "type" => "select"),
        
		array("type" => "divider"),
		
		array(  
		"name" => __('Page Title', 'gp_lang'),
        "desc" => __('Choose whether to display the page title.', 'gp_lang'),
        "id" => $shortname."_home_page_title",
        "std" => __('Enable', 'gp_lang'),
		"options" => array(__('Enable', 'gp_lang'), __('Disable', 'gp_lang')),
        "type" => "radio"),
        
		array("type" => "close"),
		
array(	"name" => __('Post Category Settings', 'gp_lang'),
		"type" => "title"),

		array(	"type" => "open",
      	"id" => $shortname."_post_settings"),
		
		array(  
		"name" => "Image Width",
        "desc" => "The image width.",
        "id" => $shortname."_category_image_width",
        "std" => "200",
        "type" => "dimension"),

  		array(  
		"name" => "Image Height",
        "desc" => "The image height.",
        "id" => $shortname."_category_image_height",
        "std" => "200",
        "type" => "dimension"),
        
		array("type" => "divider"),

		array(  
		"name" => __('Text Display', 'gp_lang'),
        "desc" => __('Choose whether to display a limited or full text display.', 'gp_lang'),
        "id" => $shortname."_category_text_display",
        "std" => 'Limited',
		"options" => array('Limited', 'Full'),
        "type" => "select"),
         
		array("type" => "divider"),
		
        array(
		"name" => "Excerpt Length",
        "desc" => "The number of characters in item excerpts.",
        "id" => $shortname."_category_excerpt_length",
        "std" => "40",
        "type" => "text_small"),

		array("type" => "divider"),
		
		array(  
		"name" => __('Order Options', 'gp_lang'),
        "desc" => __('Choose whether to display the order options at the top of the page.', 'gp_lang'),
        "id" => $shortname."_category_order_options",
        "std" => __('Enable', 'gp_lang'),
		"options" => array(__('Enable', 'gp_lang'), __('Disable', 'gp_lang')),
        "type" => "radio"),

		array("type" => "divider"),
		
		array(  
		"name" => __('Page Navigation', 'gp_lang'),
        "desc" => __('Choose where to display the page navigation.', 'gp_lang'),
        "id" => $shortname."_category_page_nav",
        "std" => 'Top & Bottom',
		"options" => array('Top & Bottom', 'Top', 'Bottom', 'Disable'),
        "type" => "select"),
        
		array("type" => "divider"),
		
		array(  
		"name" => __('Page Title', 'gp_lang'),
        "desc" => __('Choose whether to display the page title.', 'gp_lang'),
        "id" => $shortname."_category_page_title",
        "std" => __('Enable', 'gp_lang'),
		"options" => array(__('Enable', 'gp_lang'), __('Disable', 'gp_lang')),
        "type" => "radio"),
        
		array("type" => "close"),

array(	"name" => __('Portfolio Category Settings', 'gp_lang'),
		"type" => "title"),

		array(	"type" => "open",
      	"id" => $shortname."_portfolio_settings"),

        array(
		"name" => "Portfolio Item Slug",
        "desc" => "The slug used in portfolio item URLs. <strong>After saving this page, go to <em>Settings -> Permalinks</em> and resave the page twice.</strong>",
        "id" => $shortname."_portfolio_slug",
        "std" => "portfolio",
        "type" => "text"),

        array(
		"name" => "Portfolio Category Slug",
        "desc" => "The slug used in portfolio category URLs. <strong>After saving this page, go to <em>Settings -> Permalinks</em> and resave the page twice.</strong>",
        "id" => $shortname."_portfolio_cat_slug",
        "std" => "portfolios",
        "type" => "text"),
        
		array("type" => "divider"),
		
		array(  
		"name" => "Image Width",
        "desc" => "The image width.",
        "id" => $shortname."_portfolio_image_width",
        "std" => "200",
        "type" => "dimension"),

  		array(  
		"name" => "Image Height",
        "desc" => "The image height.",
        "id" => $shortname."_portfolio_image_height",
        "std" => "200",
        "type" => "dimension"),
        
		array("type" => "divider"),

		array(  
		"name" => __('Text Display', 'gp_lang'),
        "desc" => __('Choose whether to display a limited or full text display.', 'gp_lang'),
        "id" => $shortname."_portfolio_text_display",
        "std" => 'Limited',
		"options" => array('Limited', 'Full'),
        "type" => "select"),
         
		array("type" => "divider"),
		
        array(
		"name" => "Excerpt Length",
        "desc" => "The number of characters in item excerpts.",
        "id" => $shortname."_portfolio_excerpt_length",
        "std" => "40",
        "type" => "text_small"),

		array("type" => "divider"),
		
		array(  
		"name" => __('Order Options', 'gp_lang'),
        "desc" => __('Choose whether to display the order options at the top of the page.', 'gp_lang'),
        "id" => $shortname."_portfolio_order_options",
        "std" => __('Enable', 'gp_lang'),
		"options" => array(__('Enable', 'gp_lang'), __('Disable', 'gp_lang')),
        "type" => "radio"),

		array("type" => "divider"),
		
		array(  
		"name" => __('Page Navigation', 'gp_lang'),
        "desc" => __('Choose where to display the page navigation.', 'gp_lang'),
        "id" => $shortname."_portfolio_page_nav",
        "std" => 'Top & Bottom',
		"options" => array('Top & Bottom', 'Top', 'Bottom', 'Disable'),
        "type" => "select"),
        
		array("type" => "divider"),
		
		array(  
		"name" => __('Page Title', 'gp_lang'),
        "desc" => __('Choose whether to display the page title.', 'gp_lang'),
        "id" => $shortname."_portfolio_page_title",
        "std" => __('Enable', 'gp_lang'),
		"options" => array(__('Enable', 'gp_lang'), __('Disable', 'gp_lang')),
        "type" => "radio"),
        
		array("type" => "close"),
		
array(	"name" => __('Style Settings', 'gp_lang'),
		"type" => "title"),

		array(	"type" => "open",
      	"id" => $shortname."_style_settings"),

		array(
		"name" => __('Page Background Image', 'gp_lang'),
        "desc" => __('Background image URL (<code>e.g. http://www.example.com/images/imagename.jpg</code>).', 'gp_lang'),
        "id" => $shortname."_page_bg_image",
        "std" => "",
        "extras" => "uploadbutton",
		"type" => "text"),

 		array(  
		"name" => __('Page Background Color', 'gp_lang'),        
        "id" => $shortname."_page_bg_color",
        "std" => "",
        "type" => "colorpicker"),

		array(  
		"name" => __('Horizontal Background Position', 'gp_lang'),
        "desc" => __('', 'gp_lang'),
        "id" => $shortname."_page_bg_h_position",
        "std" => 'Left',
		"options" => array('Left', 'Center', 'Right'),
        "type" => "select"),

		array(  
		"name" => __('Vertical Background Position', 'gp_lang'),
        "desc" => __('', 'gp_lang'),
        "id" => $shortname."_page_bg_v_position",
        "std" => 'Top',
		"options" => array('Top', 'Center', 'Bottom'),
        "type" => "select"),
        
		array(  
		"name" => __('Background Repeat', 'gp_lang'),
        "desc" => __('', 'gp_lang'),
        "id" => $shortname."_page_bg_repeat",
        "std" => 'No Repeat',
		"options" => array('No Repeat', 'Tile', 'Tile Horizontally', 'Tile Vertically'),
        "type" => "select"),
 
 		array(  
		"name" => __('Background Attachment', 'gp_lang'),
        "desc" => __('', 'gp_lang'),
        "id" => $shortname."_page_bg_attachment",
        "std" => 'Scroll',
		"options" => array('Scroll', 'Fixed'),
        "type" => "select"),     
        
       array("type" => "divider"),
       
 		array(  
		"name" => __('Body Text Color', 'gp_lang'),        
        "id" => $shortname."_body_text_color",
        "std" => "",
        "type" => "colorpicker"),
        
 		array(  
		"name" => __('Body Link Color', 'gp_lang'),        
        "id" => $shortname."_body_link_color",
        "std" => "",
        "type" => "colorpicker"),

 		array(  
		"name" => __('Body Link Hover Color', 'gp_lang'),       
        "id" => $shortname."_body_link_hover_color",
        "std" => "",
        "type" => "colorpicker"),       
        
        array("type" => "divider"),
        		
 		array(  
		"name" => __('Heading Text Color', 'gp_lang'),        
        "id" => $shortname."_heading_text_color",
        "std" => "",
        "type" => "colorpicker"),

 		array(  
		"name" => __('Heading Link Color', 'gp_lang'),        
        "id" => $shortname."_heading_link_color",
        "std" => "",
        "type" => "colorpicker"),

 		array(  
		"name" => __('Heading Link Hover Color', 'gp_lang'),        
        "id" => $shortname."_heading_link_hover_color",
        "std" => "",
        "type" => "colorpicker"),

		array("type" => "divider"),

 		array(  
		"name" => __('Logo Text Color', 'gp_lang'),        
        "id" => $shortname."_logo_text_color",
        "std" => "",
        "type" => "colorpicker"),
        
		array("type" => "divider"),

 		array(  
		"name" => __('Tagline Text Color', 'gp_lang'),        
        "id" => $shortname."_tagline_text_color",
        "std" => "",
        "type" => "colorpicker"),
        
		array("type" => "divider"),
		
 		array(  
		"name" => __('Sidebar Navigation Link Color', 'gp_lang'),        
        "id" => $shortname."_sidebar_nav_link_color",
        "std" => "",
        "type" => "colorpicker"),
        
 		array(  
		"name" => __('Sidebar Navigation Link Active/Hover Color', 'gp_lang'),        
        "id" => $shortname."_sidebar_nav_link_active_hover_color",
        "std" => "",
        "type" => "colorpicker"),

 		array(  
		"name" => __('Sidebar Navigation Heading Color', 'gp_lang'),        
        "id" => $shortname."_sidebar_nav_heading_color",
        "std" => "",
        "type" => "colorpicker"), 

		array("type" => "divider"),

		array(  
		"name" => __('Social Link Color', 'gp_lang'),       
        "id" => $shortname."_social_link_color",
        "std" => "",
        "type" => "colorpicker"),

		array(  
		"name" => __('Social Link Hover Color', 'gp_lang'),       
        "id" => $shortname."_social_link_hover_color",
        "std" => "",
        "type" => "colorpicker"),
        
		array("type" => "divider"),

		array(  
		"name" => __('Post Meta Link Color', 'gp_lang'),       
        "id" => $shortname."_post_meta_link_color",
        "std" => "",
        "type" => "colorpicker"),

 		array(  
		"name" => __('Post Meta Link Hover Color', 'gp_lang'),       
        "id" => $shortname."_post_meta_link_hover_color",
        "std" => "",
        "type" => "colorpicker"),
        
 		array(  
		"name" => __('Comment Meta Text Color', 'gp_lang'),       
        "id" => $shortname."_comment_meta_text_color",
        "std" => "",
        "type" => "colorpicker"),
        
		array("type" => "divider"),
		
 		array(  
		"name" => __('Widget Heading Text Color', 'gp_lang'),        
        "id" => $shortname."_widget_heading_text_color",
        "std" => "",
        "type" => "colorpicker"),

 		array(  
		"name" => __('Widget Text Color', 'gp_lang'),        
        "id" => $shortname."_widget_text_color",
        "std" => "",
        "type" => "colorpicker"),

 		array(  
		"name" => __('Widget Link Color', 'gp_lang'),        
        "id" => $shortname."_widget_link_color",
        "std" => "",
        "type" => "colorpicker"),
 
 		array(  
		"name" => __('Widget Link Hover Color', 'gp_lang'),        
        "id" => $shortname."_widget_link_hover_color",
        "std" => "",
        "type" => "colorpicker"),

		array("type" => "divider"),
		
 		array(  
		"name" => __('Box Background Color', 'gp_lang'),        
        "id" => $shortname."_box_bg_color",
        "std" => "",
        "type" => "colorpicker"),

 		array(  
		"name" => __('Box Border Color', 'gp_lang'),        
        "id" => $shortname."_box_border_color",
        "std" => "",
        "type" => "colorpicker"),

 		array(  
		"name" => __('Box Link Color', 'gp_lang'),        
        "id" => $shortname."_box_link_color",
        "std" => "",
        "type" => "colorpicker"),

 		array(  
		"name" => __('Box Link Hover Color', 'gp_lang'),        
        "id" => $shortname."_box_link_hover_color",
        "std" => "",
        "type" => "colorpicker"),
        
		array("type" => "divider"),

 		array(  
		"name" => __('Input Background Color', 'gp_lang'),        
        "id" => $shortname."_input_bg_color",
        "std" => "",
        "type" => "colorpicker"),

 		array(  
		"name" => __('Input Background Hover Color', 'gp_lang'),        
        "id" => $shortname."_input_bg_hover_color",
        "std" => "",
        "type" => "colorpicker"),
        
 		array(  
		"name" => __('Input Border Color', 'gp_lang'),        
        "id" => $shortname."_input_border_color",
        "std" => "",
        "type" => "colorpicker"),
        
 		array(  
		"name" => __('Input Text Color', 'gp_lang'),        
        "id" => $shortname."_input_text_color",
        "std" => "",
        "type" => "colorpicker"),
        
		array("type" => "divider"),
		
 		array(  
		"name" => __('Misc Background Color (Code Excerpts, Columns etc.)', 'gp_lang'),       
        "id" => $shortname."_misc_bg_color",
        "std" => "",
        "type" => "colorpicker"),

 		array(  
		"name" => __('Misc Border Color (Code Excerpts, Tables, Dividers etc.)', 'gp_lang'),        
        "id" => $shortname."_misc_border_color",
        "std" => "",
        "type" => "colorpicker"),
        
		array("type" => "close"),
		
array(	"name" => __('Font Settings', 'gp_lang'),
		"type" => "title"),

		array(	"type" => "open",
      	"id" => $shortname."_font_settings"),
		
  		array(  
		"name" => __('Body Text Size', 'gp_lang'),
        "desc" => __('Default value', 'gp_lang')." 12px.",
        "id" => $shortname."_body_text_size",
        "std" => "",
        "type" => "dimension"),

		array("type" => "divider"),

  		array(  
		"name" => __('H1 Text Size', 'gp_lang'),
        "desc" => __('Default value', 'gp_lang')." 26px.",
        "id" => $shortname."_h1_text_size",
        "std" => "",
        "type" => "dimension"),
        
  		array(  
		"name" => __('H2 Text Size', 'gp_lang'),
        "desc" => __('Default value', 'gp_lang')." 22px.",
        "id" => $shortname."_h2_text_size",
        "std" => "",
        "type" => "dimension"),
        
        array(  
		"name" => __('H3 Text Size', 'gp_lang'),
        "desc" => __('Default value', 'gp_lang')." 20px.",
        "id" => $shortname."_h3_text_size",
        "std" => "",
        "type" => "dimension"),
        
        array(  
		"name" => __('H4 Text Size', 'gp_lang'),
        "desc" => __('Default value', 'gp_lang')." 18px.",
        "id" => $shortname."_h4_text_size",
        "std" => "",
        "type" => "dimension"),
        
        array(  
		"name" => __('H5 Text Size', 'gp_lang'),
        "desc" => __('Default value', 'gp_lang')." 16px.",
        "id" => $shortname."_h5_text_size",
        "std" => "",
        "type" => "dimension"),
        
        array(  
		"name" => __('H6 Text Size', 'gp_lang'),
        "desc" => __('Default value', 'gp_lang')." 13px.",
        "id" => $shortname."_h6_text_size",
        "std" => "",
        "type" => "dimension"),

		array("type" => "divider"),

        array(  
		"name" => __('Logo Text Size', 'gp_lang'),
        "desc" => __('Default value', 'gp_lang')." 37px.",
        "id" => $shortname."_logo_text_size",
        "std" => "",
        "type" => "dimension"),
        
		array("type" => "divider"),

        array(  
		"name" => __('Tagline Text Size', 'gp_lang'),
        "desc" => __('Default value', 'gp_lang')." 12px.",
        "id" => $shortname."_tagline_text_size",
        "std" => "",
        "type" => "dimension"),
        
		array("type" => "divider"),
		
 		array(  
		"name" => __('Sidebar Navigation Text Size', 'gp_lang'),
        "desc" => __('Default value', 'gp_lang')." 12px.",
        "id" => $shortname."_sidebar_nav_text_size",
        "std" => "",
        "type" => "dimension"),

		array("type" => "divider"),

  		array(  
		"name" => __('Widget Heading Text Size', 'gp_lang'),
        "desc" => __('Default value', 'gp_lang')." 12px.",
        "id" => $shortname."_widget_heading_text_size",
        "std" => "",
        "type" => "dimension"),
        
  		array(  
		"name" => __('Widget Text Size', 'gp_lang'),
        "desc" => __('Default value', 'gp_lang')." 12px.",
        "id" => $shortname."_widget_text_size",
        "std" => "",
        "type" => "dimension"),

		array("type" => "divider"),
		
  		array(  
		"name" => __('Footer Text Size', 'gp_lang'),
        "desc" => __('Default value', 'gp_lang')." 11px.",
        "id" => $shortname."_footer_text_size",
        "std" => "",        
        "type" => "dimension"),
        
		array("type" => "close"),
		
array(	"name" => __('CSS Settings', 'gp_lang'),
		"type" => "title"),

		array(	"type" => "open",
      	"id" => $shortname."_css_settings"),
		
		array(
		"name" => __('Custom CSS', 'gp_lang'),
        "desc" => __('If you want to modify the theme style in some way add your own code here instead of editing the style sheets. <em>Note: You may have to add !important to your tags in some cases so it overwrites the default settings e.g. body {background: #000000 !important;}.</em>', 'gp_lang'),
        "id" => $shortname."_custom_css",
        "std" => "",
        "height" => "yes",
        "type" => "textarea"),

		array("type" => "close"),
		
array(	"name" => __('Import/Export Settings', 'gp_lang'),
		"type" => "title"),

		array(	"type" => "open",
      	"id" => $shortname."_importexport_settings"),
      	
		array(  
		"name" => "Export",
        "id" => $shortname."_import_export",
        "type" => "import_export"),
        
		array("type" => "close"),
	
);

function mytheme_add_admin() {

    global $themename, $dirname, $shortname, $options;

			
    if ( isset($_GET['page']) && $_GET['page'] == basename(__FILE__) ) {

        if (isset($_REQUEST['action']) && 'save' == $_REQUEST['action'] ) {

                foreach ($options as $value) {
                    update_option( $value['id'], $_REQUEST[ $value['id'] ] ); }

                foreach ($options as $value) {
                    if( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ]  ); } else { delete_option( $value['id'] ); } }

                header("Location: themes.php?page=theme-options.php&saved=true");
                die;

        } else if(isset($_REQUEST['action']) && 'reset' == $_REQUEST['action'] ) {

            foreach ($options as $value) {
                delete_option( $value['id'] ); }

            header("Location: themes.php?page=theme-options.php&reset=true");
            die;

        }

		else if(isset($_REQUEST['action']) && 'export' == $_REQUEST['action'] ) export_settings();
		else if(isset($_REQUEST['action']) && 'import' == $_REQUEST['action'] ) import_settings();

    }

    add_theme_page(__('Theme Options', 'gp_lang'), __('Theme Options', 'gp_lang'), 'edit_themes', basename(__FILE__), 'mytheme_admin');

}

function mytheme_admin() {

    global $themename, $dirname, $shortname, $options;

    if (isset($_REQUEST['saved']) && $_REQUEST['saved'] ) echo '<div id="message" class="updated"><p><strong>'.__('Options Saved', 'gp_lang').'</strong></p></div>';
    if (isset($_REQUEST['saved']) && $_REQUEST['reset'] ) echo '<div id="message" class="updated"><p><strong>'.__('Options Reset', 'gp_lang').'</strong></p></div>';

?>

		
<?php
echo '<link rel="stylesheet" href="'.get_template_directory_uri().'/lib/admin/css/admin.css" type="text/css" media="screen" />
<script type="text/javascript" src="'.get_template_directory_uri().'/lib/admin/js/jquery.tabs.js"></script>
<script type="text/javascript" src="'.get_template_directory_uri().'/lib/admin/js/jquery.color.picker.js"></script>';
?>

<div id="theme-options-container" class="wrap">
	
<?php screen_icon('options-general'); ?>
<h2><?php _e('Theme Options', 'gp_lang'); ?></h2>

<ul id="theme-option-links">
	<li><a href="http://www.ghostpool.com/help/<?php echo $dirname; ?>/changelog.html" target="_blank"><?php _e('Changelog/Updates', 'gp_lang'); ?></a></li>
	<li><a href="http://www.ghostpool.com/help/<?php echo $dirname; ?>/help.html" target="_blank"><?php _e('Help File', 'gp_lang'); ?></a></li>
	<li><a href="http://www.themeforest.net/user/GhostPool/portfolio?ref=GhostPool" target="_blank"><?php _e('More Themes', 'gp_lang'); ?></a></li>
</ul>

<form method="post">
	
<div class="theme-buttons-top submit">	
	<input name="save" type="submit" value="<?php _e('Save Changes', 'gp_lang'); ?>" />
	<input type="hidden" name="action" value="save" />
</div>

<div class="clear"></div>

<div id="panels">

<?php foreach ($options as $value) {
switch ( $value['type'] ) {
case "open":
?>

<?php break;
case "close":
?>

</div>

<?php break;
case "title":
?>

	<div class="panel option-tab" title="<?php echo $value['name']; ?>">

<?php break;
case "header":
?>

	<div class="option option-header">
		<h3><?php echo $value['name']; ?></h3>
		<div class="option-desc"><?php echo $value['desc']; ?></div>
	</div>

<?php break;
case "divider":
?>

<div class="divider"></div>

<?php break;
case 'text':
?>
	
	<div class="option">
		<h3><?php echo $value['name']; ?></h3>
		<input name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if ( get_option( $value['id'] ) != "") { echo get_option( $value['id'] ); } else { echo $value['std']; } ?>" class="theme-input" />
		<?php if($value['extras'] == "uploadbutton") { ?><a href="media-upload.php?post_id=&amp;type=image&amp;TB_iframe=true&amp;width=640&amp;height=500" id="add_image" class="thickbox button" title='Add an Image' onclick="return false;"><?php _e('Get Image', 'gp_lang'); ?></a><?php } ?>
		<div class="option-desc"><?php echo $value['desc']; ?></div>
	</div>

<?php break;
case 'text_small':
?>

	<div class="option">
		<h3><?php echo $value['name']; ?></h3>
		<input name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>" type="text" value="<?php if ( get_option( $value['id'] ) != "") { echo get_option( $value['id'] ); } else { echo $value['std']; } ?>" class="theme-input text-small" />
		<div class="option-desc"><?php echo $value['desc']; ?></div>
	</div>

<?php break;
case 'dimension':
?>
	
	<div class="option dimensions">
		<h3><?php echo $value['name']; ?></h3>
		<input name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>" type="text" value="<?php if ( get_option( $value['id'] ) != "") { echo get_option( $value['id'] ); } else { echo $value['std']; } ?>" class="theme-input" /><span>px</span>
		<div class="option-desc"><?php echo $value['desc']; ?></div>
	</div>

<?php
break;

case 'textarea':
?>

	<div class="option">
		<h3><?php echo $value['name']; ?></h3>
		<textarea name="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" cols="" rows="" class="theme-textarea<?php if($value['height'] == "yes") { ?> large-textarea<?php } ?>"><?php if ( get_option( $value['id'] ) != "") { echo stripslashes(get_option( $value['id'] )); } else { echo $value['std']; } ?></textarea>
		<div class="option-desc"><?php echo $value['desc']; ?></div>
	</div>

<?php
break;
case 'select':
?>
	
	<div class="option">
		<h3><?php echo $value['name']; ?></h3>
		<select class="theme-select" name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>"><?php foreach ($value['options'] as $option) { ?><option value="<?php echo $option; ?>" <?php if ( get_option( $value['id'] ) == $option) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option><?php } ?></select>
		<div class="option-desc"><?php echo $value['desc']; ?></div>
	</div>

<?php
break;
case 'taxonomy_select':
?>
	
	<div class="option">
		<h3><?php echo $value['name']; ?></h3>
		<?php $terms = get_terms('portfolio_categories', 'hide_empty=0'); ?>
		<select class="theme-select" name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>"><option value=''><?php _e('All', 'gp_lang'); ?></option><?php foreach ($terms as $term): ?><option value="<?php echo $term->slug; ?>" <?php if ( get_option( $value['id'] ) ==  $term->slug) { echo ' selected="selected"'; } ?>><?php echo $term->name; ?></option><?php endforeach; ?></select>
		<div class="option-desc"><?php echo $value['desc']; ?></div>
	</div>	

<?php
break;
case 'category_select':
?>
	
	<div class="option">
		<h3><?php echo $value['name']; ?></h3>
		<?php $terms = get_terms('category', 'hide_empty=0'); ?>
		<select class="theme-select" name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>"><option value=''><?php _e('All', 'gp_lang'); ?></option><?php foreach ($terms as $term): ?><option value="<?php echo $term->slug; ?>" <?php if ( get_option( $value['id'] ) ==  $term->slug) { echo ' selected="selected"'; } ?>><?php echo $term->name; ?></option><?php endforeach; ?></select>
		<div class="option-desc"><?php echo $value['desc']; ?></div>
	</div>	


<?php
break;
case "checkbox":
?>
   
<div class="option <?php if($value['extras'] == "multi") { ?>multi-checkbox<?php } ?>">
	<h3><?php echo $value['name']; ?></h3>
	<?php if(get_option($value['id'])){ $checked = "checked=\"checked\""; }else{ $checked = ""; } ?><input class="theme-checkbox" type="checkbox" name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>" value="true" <?php echo $checked; ?> />
	<div class="theme-checkbox-desc"><?php echo $value['desc']; ?></div>
</div>

<?php        
break;
case "radio":
?>

	<div class="option">
		<h3><?php echo $value['name']; ?></h3>	
		<?php foreach ($value['options'] as $key=>$option) {
		$radio_setting = get_option($value['id']);
		if($radio_setting != ''){
			if ($key == get_option($value['id']) ) {
				$checked = "checked=\"checked\"";
				} else {
					$checked = "";
				}
		}else{
			if($key == $value['std']){
				$checked = "checked=\"checked\"";
			}else{
				$checked = "";
			}
		}?>
			<div class="theme-radio-wrapper">
			<input type="radio" name="<?php echo $value['id']; ?>" id="<?php echo $value['id'] . $key; ?>" value="<?php echo $key; ?>" <?php echo $checked; ?> /><label for="<?php echo $value['id'] . $key; ?>"><?php echo $option; ?></label>
			</div>	
		<?php } ?>
		<div class="option-desc"><?php echo $value['desc']; ?></div>
	</div>

<?php        
break;
case "colorpicker":
?>

  <div class="option option-colorpicker">
    <h3><?php echo $value['name']; ?></h3>
    <div class="section">
      <div class="element">
        <script type="text/javascript">
        jQuery(document).ready(function($) {  
          $("#<?php echo $value['id']; ?>").ColorPicker({
            onSubmit: function(hsb, hex, rgb) {
            	$("#<?php echo $value['id']; ?>").val("#"+hex);
            },
            onBeforeShow: function () {
            	$(this).ColorPickerSetColor(this.value);
            	return false;
            },
            onChange: function (hsb, hex, rgb) {
            	$("#cp_<?php echo $value['id']; ?> div").css({"backgroundColor":"#"+hex, "backgroundImage": "none", "borderColor":"#"+hex});
            	$("#cp_<?php echo $value['id']; ?>").prev("input").attr("value", "#"+hex);
            }
          })	
          .bind('keyup', function(){
            $(this).ColorPickerSetColor(this.value);
          });
        });
        </script>
        <input type="text" name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>" value="<?php if ( get_option( $value['id'] ) != "") { echo get_option( $value['id'] ); } else { echo $value['std']; } ?>" class="cp_input" />
        <div id="cp_<?php echo $value['id']; ?>" class="cp_box">
          <div style="background-color:<?php if ( get_option( $value['id'] ) != "") { echo get_option( $value['id'] ); } else { echo '#fff'; } ?>;<?php if ( get_option( $value['id'] ) != "") { echo 'background-image:none; border-color:' . get_option($value['id']) . ';'; } ?>"> 
          </div>
        </div> 
      </div>
      <div class="clear"></div>
      <div class="option-desc"><?php _e('Click the text box for color picker.', 'gp_lang'); ?></div>
    </div>
  </div>

<?php        
break;
case "import_export":
?>

	</form>

	<div class="option submit">
	
		<h3><?php _e('Import Theme Settings', 'gp_lang'); ?></h3>
		<div class="option-desc"><?php _e('If you have a back up of your theme settings you can import them below.', 'gp_lang'); ?></div>
		
		<form method="post" enctype="multipart/form-data">
		<p><input type="file" name="file" id="file" />
		<input type="submit" name="import" value="<?php _e('Upload', 'gp_lang'); ?>" /></p>
		<input type="hidden" name="action" value="import" />
		</form>
	
	</div>
	
	<div class="divider"></div>
	
	<div class="option submit">
	
		<h3><?php _e('Export Theme Settings', 'gp_lang'); ?></h3>
		<div class="option-desc"><?php _e('If you want to create a back up of all your theme settings click the Export button below. <em>Note: This option only backs up your theme settings and not your post/page data.</em>', 'gp_lang'); ?></div>
		
		<form method="post">
		<p><input name="export" type="submit" value="<?php _e('Export Theme Settings', 'gp_lang'); ?>" /></p>
		<input type="hidden" name="action" value="export" />
		</form>	
	
	</div>

<?php        
break;
}}
?>

</div>

<div class="clear"></div>

<div class="theme-buttons-bottom submit">
	
	<form method="post" onSubmit="if(confirm('<?php _e('Are you sure you want to reset all the theme settings?', 'gp_lang'); ?>')) return true; else return false;">
	<input name="reset" type="submit" value="<?php _e('Reset', 'gp_lang'); ?>" />
	<input type="hidden" name="action" value="reset" />
	</form>

</div>

<div class="clear"></div>

<?php } 

if (function_exists('wp_enqueue_style')) {
	wp_enqueue_script('jquery-ui-core');
	wp_enqueue_script('jquery-ui-sortable');		
	wp_enqueue_script('thickbox');
	wp_enqueue_style('thickbox');
}

add_action('admin_menu', 'mytheme_add_admin'); 

// Export Theme Settings
function export_settings() {
	global $options;
	header("Cache-Control: public, must-revalidate");
	header("Pragma: hack");
	header("Content-Type: text/plain");
	header('Content-Disposition: attachment; filename="theme-options-'.date("dMy").'.dat"');
	foreach ($options as $value) $theme_settings[$value['id']] = get_option( $value['id'] );	
	echo serialize($theme_settings);
}

// Import Theme Settings
function import_settings() {
	global $options;
	if ($_FILES["file"]["error"] > 0) {
		echo "Error: " . $_FILES["file"]["error"] . "<br />";
	} else {
		$rawdata = file_get_contents($_FILES["file"]["tmp_name"]);		
		$theme_settings = unserialize($rawdata);		
		foreach ($options as $value) {
			if ($theme_settings[$value['id']]) {
				update_option( $value['id'], $theme_settings[$value['id']] );
				$$value['id'] = $theme_settings[$value['id']];
			} else {
				if ($value['type'] == 'checkbox_multiple') $$value['id'] = array();
				else $$value['id'] = $value['std'];
			}
		}
		
	}
	if (in_array('cacheStyles', get_option('theme_misc'))) cache_settings();
	wp_redirect($_SERVER['PHP_SELF'].'?page=theme-options.php');
}

?>