<?php
// ADD IN AUCTION
define('WLT_COUPON',true);

// TURN OFF DEFAULT PRICE SEARCH
define('DEFAULTS_PRICE_SEARCH',false);

// ADD IN TOOLTIP JS TO FOOTER
function fextra(){   if(!defined('IS_MOBILEVIEW')){ ?>
<script>
jQuery(document).ready(function(){
jQuery('.thumbs span').tooltip();
});
</script>
<?php } }
add_action('wp_footer','fextra');
 
// HOOK ADMIN STYLES TO INCLUDE CHILD THEME STYLING
function _ct_new_styles($c){ global $CORE, $STRING;

		if(isset($_POST['shownewcode']) && $_POST['shownewcode'] == "save" && isset($GLOBALS['CORE_THEME']['colors']['header']) && strlen($GLOBALS['CORE_THEME']['colors']['header']) > 1){
			$STRING .= "#core_menu_wrapper .row, #wlt_smalldevicemenubar a.b1 { background:".$CORE->ValidateCSS($GLOBALS['CORE_THEME']['colors']['header'])."; border:0px; }";
		 	 
			 
			$STRING .= " #core_middle_column .panel-default>.panel-heading { background:".$CORE->ValidateCSS($GLOBALS['CORE_THEME']['colors']['menubar'])."; }";
			$STRING .= "\n";
			 
	 	 		 
		}	
		
		// THIS ONLY HAPPENS WHEN WE USE THE PRE-DEFINED COLORS
		// SO WE COULD USE THIS TO HARD CODE ADDITONAL STYLING CHANEGS
		if(isset($_POST['shownewcode']) && $_POST['shownewcode'] == "save" && isset($GLOBALS['CORE_THEME']['colors']['header']) && strlen($GLOBALS['CORE_THEME']['colors']['header']) > 1){

		$STRING .= "#core_header_navigation .row { background:transparent; }";		
		}	 
		
return $c.$STRING;
}
add_action('hook_styles_code_filter','_ct_new_styles');


function _hook_header_searchbox(){ global $CORE;

if(isset($_GET['storeid'])){
$selid = $_GET['storeid'];
}else{
$selid = "";
}

ob_start();
?>
 

<form action="<?php echo get_home_url(); ?>/" method="get" class="nsearch hidden-sm hidden-xs">


<div class="row clearfix">
    <div class="col-md-4">    
 		<select class="form-control f1" name="stype">
        <option value="" <?php if(isset($_GET['stype'])){ selected( $_GET['stype'], "" );} ?>><?php echo $CORE->_e(array('coupons','48')); ?></option>
         <option value="1" <?php if(isset($_GET['stype'])){ selected( $_GET['stype'], 1 );} ?>><?php echo $CORE->_e(array('coupons','9')); ?></option>        
        <option value="2" <?php if(isset($_GET['stype'])){ selected( $_GET['stype'], 2 );} ?>><?php echo $CORE->_e(array('coupons','10')); ?></option>
        <option value="3" <?php if(isset($_GET['stype'])){ selected( $_GET['stype'], 3 );} ?>><?php echo $CORE->_e(array('coupons','11')); ?></option>       
        </select>
    </div>
    <div class="col-md-4">
    	 
        <select name="storeid"  class="form-control f2" ><option value=""><?php echo $CORE->_e(array('coupons','49')); ?></option><?php echo $CORE->categorylist(array($selid,false,true,"store")); ?></select>
        
    </div>
    <div class="col-md-4">
        <div class="ss">
            <button type="submit" class="sb"><i class="glyphicon glyphicon-search"></i></button>
            <input type="text" name="s" placeholder="<?php echo $CORE->_e(array('button','11','flag_noedit')); ?>" value="<?php echo esc_attr(isset($_GET['s']) ? $_GET['s'] : ""); ?>">               
        </div>
    </div>
</div> 
 

</form>


<?php
return ob_get_clean();
}
add_action('hook_header_searchbox','_hook_header_searchbox');
?>