<?php
//This code is copyright (c) ViciSoft SL, all rights reserved.
//The contents of this file are protected under law as the intellectual property 
//of ViciSoft SL. Any use, reproduction, disclosure or copying of any kind 
//without the express and written permission of ViciSoft SL is forbidden.
//Author: Vince Reid, vincereid@gmail.com

$version=@filemtime('css/ectcart.css');

if(function_exists('getadminsettings')){
	$GLOBALS['alreadygotadmin']=getadminsettings();
}

if(@$GLOBALS['googletagid']!=''){
print '<script async src="https://www.googletagmanager.com/gtag/js?id=' . $GLOBALS['googletagid'] . '"></script>
<script>
	window.dataLayer = window.dataLayer || [];
	function gtag(){dataLayer.push(arguments);}
	gtag(\'js\', new Date());
	gtag(\'config\', \'' . $GLOBALS['googletagid'] . '\');
</script>'."\n";
}

$inlinestyle='';
if(!@isset($GLOBALS['ectqbuystyle'])) $GLOBALS['ectqbuystyle']=1;
if(!@isset($GLOBALS['ectproductstyle'])) $GLOBALS['ectproductstyle']=1;
if(!@isset($GLOBALS['ectdetailstyle'])) $GLOBALS['ectdetailstyle']=1;
if(@$GLOBALS['categorycolumns']=='') $GLOBALS['categorycolumns']=2;
if(@$GLOBALS['productcolumns']=='') $GLOBALS['productcolumns']=$GLOBALS['ectproductstyle']==2?3:2;

if(@$GLOBALS['quickbuylayout']==''){
	if(@$GLOBALS['ectqbuystyle']==1)
		$GLOBALS['quickbuylayout']="productimage,productname,discounts,instock,reviewstars,productid,sku,description,options,listprice,price,currency,detaillink,addtocartquant";
	if(@$GLOBALS['ectqbuystyle']==2)
		$GLOBALS['quickbuylayout']="productimage,productname,instock,reviewstars,productid,manufacturer,description,options,listprice,price,currency,detaillink,addtocartquant";
	if(@$GLOBALS['ectqbuystyle']==3)
		$GLOBALS['quickbuylayout']="productimage,productname,instock,reviewstars,productid,manufacturer,description,options,listprice,price,currency,detaillink,addtocartquant";
}
if(@$GLOBALS['productpagelayout']==''){
	if(@$GLOBALS['ectproductstyle']==1)
		$GLOBALS['productpagelayout']="productimage,productname,discounts,reviewstars,instock,listprice,price,detaillink,quickbuy";
	elseif(@$GLOBALS['ectproductstyle']==2)
		$GLOBALS['productpagelayout']="productimage,productname,discounts,reviewstars,instock,description,listprice,price,currency,detaillink,quickbuy";
	elseif(@$GLOBALS['ectproductstyle']==3)
		$GLOBALS['productpagelayout']="productimage,productname,discounts,reviewstars,options,listprice,price,instock,detaillink,addtocart";
	elseif(@$GLOBALS['ectproductstyle']==4)
		$GLOBALS['productpagelayout']='productimage,productname,listprice,discounts,price,currency,reviewstars,description,quickbuy';
}
if(@$GLOBALS['detailpagelayout']==''){
	if(@$GLOBALS['ectdetailstyle']==1)
		$GLOBALS['detailpagelayout']="navigation,productimage,productname,discounts,listprice,price,currency,instock,reviewstarslarge,shortdescription,options,addtocartquant,productid,manufacturer,sku,dateadded,description,previousnext,searchwords,socialmedia,reviews";
	elseif(@$GLOBALS['ectdetailstyle']==2)
		$GLOBALS['detailpagelayout']="navigation,productimage,reviewstarslarge,productname,discounts,shortdescription,listprice,price,currency,instock,productid,manufacturer,sku,dateadded,options,addtocartquant,description,previousnext,searchwords,socialmedia,reviews";
	elseif(@$GLOBALS['ectdetailstyle']==3)
		$GLOBALS['detailpagelayout']="navigation,productname,discounts,productimage,instock,reviewstarslarge,shortdescription,productid,manufacturer,sku,dateadded,listprice,price,currency,options,addtocartquant,description,previousnext,searchwords,socialmedia,reviews";
	elseif(@$GLOBALS['ectdetailstyle']==4)
		$GLOBALS['detailpagelayout']="navigation,productimage,reviewstarslarge,productid,productname,discounts,manufacturer,sku,dateadded,listprice,price,currency,instock,description,options,addtocartquant,previousnext,searchwords,socialmedia,reviews";
}

if(@$GLOBALS['themebackground']=='black'){
	$inlinestyle.='div.reviewprod,div.scwrap,div.scprice,div.sccarttotal,div.minicartcnt,div.ectsoftwrapper,div.qbuywrapper,div.tabpanelcontent,ul.TabbedPanelsTabGroup > li.TabbedPanelsTab,div.minimailsignup,select.prodfilter:not([multiple]), select.prodoption:not([multiple]){background-color:#000;color: #FFF;}';
	$inlinestyle.='a.ectlink:link,a.ectlink:visited,a.ectlink:active,li.ectmenuhassub1 > a{color:#EEE;}';
	$inlinestyle.='div.detaildescription,div.detailshortdescription{color:#FFF;background-color:#000}';
	$inlinestyle.='div.detailname h1{color:#FFF;}';
	$inlinestyle.='div.prodprice,div.prodid,div.prodcurrency,div.prodsku,div.proddateadded,div.prodmanufacturer,div.proddescription,div.ectbreadcrumb,div.catdesc{color:#EEE;}';
	$inlinestyle.='div.detailprice,div.detailid,div.detailcurrency,div.detailsku,div.detaildateadded,div.detailmanufacturer,div.reviews,div.previousnext,div.optiontext{color:#EEE;}';
}
	
if(@$GLOBALS['categorycolumns']>1){
	$inlinestyle.="div.category{width:" . ((100/$GLOBALS['categorycolumns'])-1) . "%;}\n";
	$inlinestyle.="@media screen and (max-width: 800px) {div.category{width:" . ((100/($GLOBALS['categorycolumns']-1))-1) . "%;}}\n";
	if(@$GLOBALS['categorycolumns']>2)
		$inlinestyle.="@media screen and (max-width: 480px) {div.category{width:99%;}}\n";
}
if(@$GLOBALS['productcolumns']>1){
	$inlinestyle.="div.product{width:" . ((100/$GLOBALS['productcolumns'])-1) . "%;}\n";
	$inlinestyle.="@media screen and (max-width: 800px) {div.product{width:" . ((100/($GLOBALS['productcolumns']-1))-1) . "%;}}\n";
	if(@$GLOBALS['productcolumns']>2)
		$inlinestyle.="@media screen and (max-width: 480px) {div.product{width:99%;}}\n";
}

		if(! @$GLOBALS['noectcartfiles']){ ?>
<link href="css/ectcart.css?ver=<?php print $version?>" rel="stylesheet" type="text/css" />
<script src="js/ectcart.js?ver=<?php print $version?>"></script>
<?php	}
		if(@$GLOBALS['ectqbuystyle']!=0||@$GLOBALS['ectproductstyle']!=0||@$GLOBALS['ectdetailstyle']!=0){ ?>
<link href="css/ectstylebase.css?ver=<?php print $version?>" rel="stylesheet" type="text/css" />
<?php	}else
			$inlinestyle='';
		if(@$GLOBALS['ectproductstyle']!=0){ ?>
<link href="css/ectstyleproduct<?php print $GLOBALS['ectproductstyle']?>.css?ver=<?php print $version?>" rel="stylesheet" type="text/css" />
<?php	}
		if(@$GLOBALS['ectqbuystyle']!=0){ ?>
<link href="css/ectstyleqbuy<?php print $GLOBALS['ectqbuystyle']?>.css?ver=<?php print $version?>" rel="stylesheet" type="text/css" />
<?php	}
		if(@$GLOBALS['ectdetailstyle']!=0){ ?>
<link href="css/ectstyledetails<?php print $GLOBALS['ectdetailstyle']?>.css?ver=<?php print $version?>" rel="stylesheet" type="text/css" />
<?php	}
if($inlinestyle!='')
	print "<style>" . $inlinestyle . "</style>\n";
?>
