<?
$v = $wb->SiteProps->GetGroupParameter('StickySideBar');
if ($v['StickySideBar']) {
	if ($v['StickySideBar.Bar'])
		$wb->QUEUE_EXTERN->AddEndScriptFile(DESIGNREGJSEND.'topicBar.js');
	else
		$wb->QUEUE_EXTERN->AddEndScriptFile(DESIGNREGJSEND.'sideBar.js');
	$wb->QUEUE_EXTERN->AddEndScriptFile(DESIGNREGJSEND.'stickyBar.js');
	$Design->RegCss["stickybar"]["css"] = true; 
}
if ($Design->RegJsFile['responsiveImg']) {
	$wb->QUEUE_EXTERN->AddScriptFile(DESIGNREGJS.'jquery.responsImg.js');
}

if ($Design->RegCss['movetotop']['css']) {
	$wb->QUEUE_EXTERN->AddEndScriptFile(DESIGNREGJSEND.'movetotop.js');
}
if ($Design->RegCss['modal']['css']) {
	$wb->QUEUE_EXTERN->AddScriptFile(DESIGNREGJS.'transition.js');
	$wb->QUEUE_EXTERN->AddScriptFile(DESIGNREGJS.'modal.js');
}
if ($Design->RegCss['contentslider']['css']) {
	$wb->QUEUE_EXTERN->AddScriptFile(DESIGNREGJSEND.'jquery.liquid-slider.src.js');
}

if ($Design->RegCss['pagination']['css']) {
	$script = file_get_contents(PAGINATIONCLASS);
	$s = unserialize(file_get_contents(DESIGNREGCSS.'vtd.pagination.replace.php'));
	$script = str_replace($s['search'],$s['replace'],$script);
	file_put_contents($wb->SYS_PROJECT.'/output/assets/sentra_scripts/vtd.pagination.php',$script);	
}

if ($Design->RegCss['accordion']['css']) {	
	$script = file_get_contents(DESIGNREGJS.'jquery.toggleElements.src.js');
	$s = unserialize(file_get_contents(DESIGNREGCSS.'vtd.accordion.replace.php'));
	$script = str_replace($s['search'],$s['replace'],$script);	
	$wb->QUEUE_EXTERN->AddEndScript($script);
	RegisterAccordion();
}

if ($Design->RegCss['tab']['css']) {
	$script = file_get_contents(DESIGNREGJS.'jquery.responsiveTabs.js');
	$s = unserialize(file_get_contents(DESIGNREGCSS.'vtd.tab.replace.php'));
	$script = str_replace($s['search'],$s['replace'],$script);
	file_put_contents($PATH.'/settings/jquery.responsiveTabs.js',$script);
	$wb->QUEUE_EXTERN->AddEndScript($script);
	RegisterTab();
}

// Get all styles which were registered during site rendering
$css = '';
foreach ($Design->RegCss as $key => $val) {
	foreach ($Design->RegCss[$key] as $k => $v)	{
	if ($Design->RegCss[$key][$k])
		$css .= file_get_contents(DESIGNREGCSS.$key.'.'.$k.'.css');
	}
}
RegPlugCssVarString($css);
?>