
<h1><?= $this->translate('#search#') ?></h1>
<div class="row">
<div id="cse" class="col-xs-12 col-lg-10 col-lg-offset-1">Loading</div>
</div>
<?php
$this->headScript()->appendFile('http://www.google.com/jsapi');
$this->headLink()->appendStylesheet('http://www.google.com/cse/style/look/default.css');

$this->inlineScript()->captureStart(); ?>
  google.load('search', '1', {language : '<?= $this->locale() ?>'});
  $(document).ready(function(){
    var customSearchControl = new google.search.CustomSearchControl('<?php echo Alfred_Hod::options('services/google/cse/key') ?>');
    customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET);
    customSearchControl.draw('cse');


<?php if($this->q):?>

	$('input.gsc-input').focus();
	$('input.gsc-input').attr('value',"<?= $this->escape($this->q) ?>");
	$('input.gsc-search-button').click();

<?php endif;?>



});
<?php $this->inlineScript()->captureEnd(); ?>
