<script type="text/javascript">
function NewsLetterPopup( url, name, widgets, openerUrl )
{
	var host = location.hostname;
	var popupWin = window.open( url, name, widgets );
	
	if ( popupWin && popupWin.opener ) {
		if ( openerUrl )
		{
			popupWin.opener.location = openerUrl;
			popupWin.focus();
		}
		popupWin.opener.top.name = "opener";
	}
}

</script>
<?php
$query = "SELECT * FROM news_group WHERE active='yes' AND news_group_id='$news_group_id'";
$result = @mysql_query ($query);
$count=1;
$line = mysql_fetch_assoc($result);
$form_action = '';
if(isset($target) && $target<>""){
    $form_action = "$pathcentral/newsletter_action.php";
}
else{
    $form_action = $path . 'newsletter_action.php';
}

$optres['css'][] = $path . "assets/css/bootstrap-dialog.min.css";
$optres['js'][] = $path . "assets/js/bootstrap-dialog.min.js";
?>
<form action="<?=$form_action;?>" method="post" id="NewsLetterForm">
    <div class="box box-warning">
        <div class="box-header text-left with-border">
          <i class="fa fa-envelope text-warning"></i> <b><?=$line["title_en"];?></b>
        </div>
        <div class="box-body">
            <p><?=$line["description_en"];?></p>
            <div class="form-group has-feedback">
                <input type="email" class="form-control input-sm" placeholder="Email" value="" name="EmailAddress" id="EmailAddress">
                <span class="glyphicon glyphicon-envelope form-control-feedback"></span>
            </div>
            <hr>
            <button type="submit" class="btn btn-primary btn-sm" onclick="NewsLetterPopup('','newsletter','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=300,height=100')">Subscribe</button>
        </div>
    </div>
    <input name="domain_id" type="hidden" id="domain_id" value="<?=$domain_id;?>"/>
    <input name="news_group_id" type="hidden" id="news_group_id" value="<?=$news_group_id;?>"/>
</form>