<?php  
foreach ($homearr as $k=>$v) {  
 // pre($v);
$bgcolor=$bgimg='';
$bgrepeat= 'no-repeat';
$bgposi= 'center center';
$bgsize= 'cover';
$bgattach = 'fixed';
$stylev= '';
$titlefg = 'notitle';
 
$cssname = $cssstyle = $reganchor =  $dmpadT  = $dmpadB = '';
 
$textstyle222 = web_despdecode($v['textstyle']);

$arr_cfg = web_despdecode($v['arr_cfg']);
$bscntarr = explode('==#==',$arr_cfg);
 if(count($bscntarr)>1){
      foreach ($bscntarr as   $bsvalue) {
         if(strpos($bsvalue, ':##')){
           $bsvaluearr = explode(':##',$bsvalue);
           $bsccc = $bsvaluearr[0];
           $$bsccc = $bsvaluearr[1];
         }
      }
  }
 //pre($bscntarr);


$pidnamehere=$v['pidname'];
$pid=$v['pid'];$tid=$v['id'];
 $effect = $v['effect'];

$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.'"';
}



  if($bgimg<>'') $cssname = $cssname.' dmbgimg';

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


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



echo '<div id="'.$anchorv.'" class="jtregionbox '.$cssname.$wowtop.'" '.$stylev.'>';
 //if(dmlogin())  dmeditlink($pid,$tid,'jtregion');  
 
        if(substr($effect,0,7)=='jthome_') $file = JTHOMEROOT.$effect.'.php';
        else   $file = TEMPLATEROOT.$effect.'.php';
       // echo $file;
 
 
              if(checkfile($file))  require  $file; 

echo '</div>';
 
echo $textstyle222;
 
if($textstyle222<>''){
  echo '<style>';
  echo $textstyle222;
  echo '</style>';
}

  //------------------------ 
}

?>