<?php  
foreach ($result_subreg as $k=>$v) {  
 
$bgcolor=$bgimg='';
$bgrepeat= 'no-repeat';
$bgposi= 'center center';
$bgsize= 'cover';
$bgattach = 'fixed';
$stylev= '';
$titlefg = 'notitle';

$arr_cfg=$v['arr_cfg'];  $format = $v['format'];
$reganchor= $cssname = $dmpadT = $dmpadB ='';
$bscntarr = explode('==#==',$arr_cfg);
     if(count($bscntarr)>1){
          foreach ($bscntarr as   $bsvalue) {
             if(strpos($bsvalue, ':##')){
               $bsvaluearr = explode(':##',$bsvalue);
               $bsccc = $bsvaluearr[0];
               $$bsccc=$bsvaluearr[1];
             }
          }
      }
$pidnamehere=$v['pidname'];
$pid=$v['pid'];$tid=$v['id'];$format=$v['format']; 

$cssstyle1 = $cssstyle2 = '';
if($dmpadT<>'') $cssstyle1 = 'padding-top:'.$dmpadT.'px;';
if($dmpadB<>'') $cssstyle2 = 'padding-bottom:'.$dmpadB.'px;';

$cssstyle = $cssstyle1.$cssstyle2.$cssstyle;


if($cssstyle<>'' || $bgcolor<>'' || $bgimg<>''){
 $stylebg = regionbg($bgcolor,$bgimg,$bgrepeat,$bgposi,$bgsize,$bgattach);
 if($cssstyle=='')   $stylev =  'style = "'.$stylebg.'"';
  else $stylev =  'style = "'.$stylebg.' '.$cssstyle.'"';
}


$anchorv = $reganchor==''?'region'.$tid:$reganchor;
//-------------
 ?>


<?php // class  block is for js or hover edit link
$wowtop = '';
if($haswow=='y') $wowtop = ' wow fadeInUp'; 
  


echo '<div id="'.$anchorv.'" class="regionbox '.$cssname.$wowtop.'" '.$stylev.'>';
if(dmlogin())  dmeditlink($pid,$tid,'regionblock');  
 
subreg_echocnt($v,$haswow);

echo '</div>';
 
	//------------------------ 
}


?>