<?php
/*require_once( '../../../../../wp-load.php' );*/
/*Header("Content-type: text/css");*/
$PIE_URL=THEME_INCLUDES.'/PIE/PIE.htc';
$color = theme_get_option('color');
$theme_color =array();
$bg_image = '';
$bg_position = '';
$bg_repeat = '';
$page_repeat='';
$page_position='';
$menu_top = '';
$menu_bg = '';
$menu_divide = '';
$slide_bar_bg = '';
$slide_on_image = '';
$footer_image = '';
$footer_position = '';
$footer_repeat = '';
$footer_link = '';
$image_doc ='';
$image_link ='';
$image_play ='';
$image_zoom ='';
$faq_open_large='';
$faq_open='';
$faq_close_large='';
$faq_close='';
$back_on='';
$ffwd_on='';
$accordion_down='';
$accordion='';
$search_button='';
$widget_back='';
$widget_prev='';
if($color['default_color'] && $color['default_color']!='default'){
	$RES_DIR = THEME_COLOR_DIR.'/'.$color['default_color'];
	$RES_URI = '../colors/'.$color['default_color'];
	$theme_color = include_once($RES_DIR.'/color.php');

	$menu_top = 'background: url("'.$RES_URI.'/nav-child-top.png") no-repeat scroll center top transparent;';
	$menu_bg = 'background: url("'.$RES_URI.'/nav-child-bg.png") repeat scroll 0 0 transparent;';
	$menu_divide ='background: url("'.$RES_URI.'/menu-divider.png") no-repeat scroll 0 50% transparent;';
	$slide_bar_bg = 'background:url('.$RES_URI.'/nav-span-background.png) repeat-x scroll 0 0 transparent;';
	$slide_on_image = 'background:url('.$RES_URI.'/slideon.png) no-repeat scroll center top transparent;';
	$footer_link = 'background:url('.$RES_URI.'/footer-bullet.png) no-repeat scroll 0 8px transparent;';
	$image_doc = 'background-image:url("'.$RES_URI.'/overlay-doc.png");';
	$image_link = 'background-image:url("'.$RES_URI.'/overlay-link.png");';
	$image_play = 'background-image:url("'.$RES_URI.'/overlay-play.png");';
	$image_zoom = 'background-image:url("'.$RES_URI.'/overlay-zoom.png");';
	$faq_open_large = 'background: url('.$RES_URI.'/faq-open-large.png) no-repeat top right #FFFFFF;';
	$faq_open = 'background: url('.$RES_URI.'/faq-open.png) no-repeat top right #FFFFFF;';
	$faq_close_large = 'background: url('.$RES_URI.'/faq-close-large.png) no-repeat top right #FFFFFF;';
	$faq_close = 'background: url('.$RES_URI.'/faq-close.png) no-repeat top right #FFFFFF;';
	$back_on= 'background: url('.$RES_URI.'/arrow-back_on.png) no-repeat 50% 60%;';
	$ffwd_on = 'background: url('.$RES_URI.'/arrow-ffwd_on.png) no-repeat 50% 60%;';
	$widget_back = 'background:url('.$RES_URI.'/widget-back.png) no-repeat;';
	$widget_prev = 'background:url('.$RES_URI.'/widget-prev.png) no-repeat;';
	$accordion_down='background:url('.$RES_URI.'/accordion-down-icon.png) no-repeat scroll 0 center transparent;';
	$accordion='background:url('.$RES_URI.'/accordion-icon.png) no-repeat scroll center 0 transparent;';
	$search_button ='background: url('.$RES_URI.'/button-search.png) no-repeat;';
	if(theme_get_option('background','custom_background')){
		$default_image = theme_get_option('background','bg_image');
		if($default_image == 'default')
				$default_image = 'fantasy';
	
		$bg_image	 = theme_get_option('background','page_image');
		$bg_image	 = theme_parse_image($bg_image,null,true);
		$bg_image = empty($bg_image)?'background-image:url('.$RES_URI.'/bg-'.$default_image.'.jpg);':'background-image:url('.$bg_image['media'].');';
		$page_position = theme_get_option('background','page_position');
		$page_position = 'background-position:'.$page_position.';';
		$page_repeat   = theme_get_option('background','page_repeat');
		$page_repeat   = 'background-repeat:'.$page_repeat.';';

		$footer_image  = theme_get_option('background','footer_image');
		$footer_position =theme_get_option('background','footer_position');
		$footer_repeat =theme_get_option('background','footer_repeat');
		$footer_image	 = theme_parse_image($footer_image,null,true);
		$footer_image = empty($footer_image)?'background-image:url('.$RES_URI.'/bg-'.$default_image.'.jpg);':'background-image:url('.$footer_image['media'].');';
		$footer_position ='background-position:'.$footer_position.';';
		$footer_repeat = 'background-repeat:'.$footer_repeat.';';
	}else{
		$bg_image = theme_get_option('background','bg_image');
		if(!empty($bg_image) && $bg_image == 'no_image'){
			$footer_image = 'background-image:none;';
			$bg_image = 'background-image:none;'; 
		}else{
			if($bg_image == 'default')
				$bg_image = 'fantasy';
			$footer_image = 'background-image:url('.$RES_URI.'/bg-'.$bg_image.'.jpg);';
			$bg_image = 'background-image:url('.$RES_URI.'/bg-'.$bg_image.'.jpg);';
			$page_position ='background-position:top center;';
			$page_repeat = 'background-repeat:no-repeat;';
			$footer_position ='background-position:center center;';
			$footer_repeat = 'background-repeat:no-repeat;';
		}
	}
}
$tag = false;
if($color['default_color'] =='default')
	$tag = true;

foreach($color as $key => $value){
	if($tag){
		$color[$key] = '';
	}elseif(empty($color[$key])){
		if(array_key_exists($key,$theme_color))
			$color[$key] = $theme_color[$key];
		else
			$color[$key]='transparent';
	}
}
if($color['toggle_close'] == 'transparent'){
	$color['toggle_close'] = $color['toggle_open'];
}
if($color['toggle_title'] == 'transparent'){
	$color['toggle_title'] = $color['toggle_open'];
}
$color['blog_image_overlay_ie']='';
if(!empty($color['blog_image_overlay']) && $color['blog_image_overlay']!='transparent'){
	$color['blog_image_overlay_ie']=substr($color['blog_image_overlay'],1,6);
	$color['blog_image_overlay_ie']="\n".'filter:  progid:DXImageTransform.Microsoft.gradient(startColorStr="#CC'.$color['blog_image_overlay_ie'].'", EndColorStr="#CC'.$color['blog_image_overlay_ie'].'"); /* IE6,IE7 */'
		."\n".'-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorStr=\'#CC'.$color['blog_image_overlay_ie'].'\', EndColorStr=\'#CC'.$color['blog_image_overlay_ie'].'\')"; /* IE8 */';
	$color['blog_image_overlay']=change_rgba($color['blog_image_overlay'],'0.8');
}

$color['image_frame_ie'] = '';
if(!empty($color['image_frame']) && $color['image_frame']!='transparent'){
	$color['image_frame_ie']=substr($color['image_frame'],1,6);
	$color['image_frame_ie']="\n".'filter:  progid:DXImageTransform.Microsoft.gradient(startColorStr="#66'.$color['image_frame_ie'].'", EndColorStr="#66'.$color['image_frame_ie'].'"); /* IE6,IE7 */'
		."\n".'-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorStr=\'#66'.$color['image_frame_ie'].'\', EndColorStr=\'#66'.$color['image_frame_ie'].'\')"; /* IE8 */';
	$color['image_frame']=change_rgba($color['image_frame'],'0.4');
}

$color['menu_border']=array_key_exists('menu_border',$theme_color) ? $theme_color['menu_border'] : '';
$color['portfolio_item_hover_stop']=empty($color['portfolio_item_hover']) ? '' :change_rgba($color['portfolio_item_hover'],'0');
$color['portfolio_item_hover']=empty($color['portfolio_item_hover']) ? '' :change_rgba($color['portfolio_item_hover'],'1');
if(!empty($color['portfolio_carousel_box'])&&$color['portfolio_carousel_box']!='transparent'){
	$color['portfolio_carousel_box_stop'] = change_rgba($color['portfolio_carousel_box'],'0');
	$color['portfolio_carousel_box'] = "
		background:".$color['portfolio_carousel_box'].";\n
		background: -moz-linear-gradient(top,  ".$color['portfolio_carousel_box']." 0%, ".$color['portfolio_carousel_box_stop']." 100%); \n
		background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,".$color['portfolio_carousel_box']."), color-stop(100%,".$color['portfolio_carousel_box_stop'].")); \n
		background: -webkit-linear-gradient(top,  ".$color['portfolio_carousel_box']." 0%,".$color['portfolio_carousel_box_stop']." 100%); \n
		background: -o-linear-gradient(top,  ".$color['portfolio_carousel_box']." 0%,".$color['portfolio_carousel_box_stop']." 100%); \n
		background: -ms-linear-gradient(top,  ".$color['portfolio_carousel_box']." 0%,".$color['portfolio_carousel_box_stop']." 100%); \n
		background: linear-gradient(top,  ".$color['portfolio_carousel_box']." 0%,".$color['portfolio_carousel_box_stop']." 100%); ";
}else{
	$color['portfolio_carousel_box'] = "";
}
$slide_height=theme_get_option('slideshow','height');
$media_frame='';
$media_position='';
if(theme_get_option('slideshow','anything_used_custom_frame')){
	$media_frame_src = theme_get_option('slideshow','anything_custom_frame');
	$image_src = theme_parse_image($media_frame_src,null,false);
	if(!empty($image_src)){
		$media_frame_src = theme_resize($image_src['media'],430,'',$image_src['method']);
		$media_frame='background:url('.$media_frame_src['url'].') no-repeat;';
	}else{
		$media_frame='background:none';
	}
	
	$media_top= theme_get_option('slideshow','any_media_top');
	$media_left= theme_get_option('slideshow','any_media_left');
	$media_position = 'background-position:'.$media_top.'px '.$media_left.'px;';
}
$media_height= theme_get_option('slideshow','anything_media_height');
$media_width= theme_get_option('slideshow','anything_media_width');

$custom_css =  stripslashes(theme_get_option('custom','custom_css'));
$flow_border_width = theme_get_option('slideshow', 'flow_border_width');
$flow_border_width = !empty($flow_border_width)?'border-width:'.$flow_border_width.'px':'';
$flow_border_color = theme_get_option('slideshow', 'flow_border_color');
$flow_border_color = !empty($flow_border_color)?'border-color:'.$flow_border_color:'';
/* font settings */
$font = theme_get_option('font');
$font['font_family']=stripslashes($font['font_family']);

$posts_gap = theme_get_option('blog','posts_gap');
$lightbox_social = theme_get_option('general','display_social');
if(!$lightbox_social)
	$lightbox_social = '.pp_social{display:none}';
else
	$lightbox_social = '';

if(theme_get_option('general','boxed_layout') =='true'){
	$body_bg = theme_get_option('general','boxed_outter');
	if(!empty($body_bg)){
		$image_src = theme_parse_image($body_bg,null,true);
		$body_bg = empty($image_src) ? 'background-image:none;' : 'background-image:url('.$image_src['media'].');';
	}else{
		$body_bg ='background-image:none;';
	}
	$body_position = theme_get_option('general','boxed_position',true);
	$body_position = empty($body_position) ? '':'background-position:'.$body_position.';';
	$body_repeat = theme_get_option('general','boxed_repeat',true);
	$body_repeat = empty($body_repeat) ? '':'background-repeat:'.$body_repeat.';';
	$body_attach = theme_get_option('general','boxed_fixed',true);
	$body_attach = $body_attach? 'background-attachment:fixed;': 'background-attachment:scroll;';
	$body_repeat = $body_repeat."\n".$body_attach;
	$body_color = $color['boxed_layout_bg'];
}else{
	$body_position = $page_position;
	$body_repeat = $page_repeat;
	$body_bg = $bg_image;
	$body_color = $color['page_bg'];
}
if(class_exists( 'Woocommerce' ) && theme_get_option('woocommerce', 'woocommerce')){
	$woocommerce_custom = include_once( THEME_FUNCTIONS . '/woocommerce_skin.php' );	
	$custom_css = $woocommerce_custom . "\n" .$custom_css;
}
return  <<<CSS
body{
	{$body_bg}
	{$body_position}
	{$body_repeat}
	background-color:{$body_color};
	font-family: {$font['font_family']};
	

}
#boxstyle-wrap{
	{$bg_image}
	{$bg_position}
	{$bg_repeat}
	background-color:{$color['page_bg']};
	box-shadow:0 0 8px {$color['boxed_layout_shadow']};
}
#carousel .carousel-feature {
	{$flow_border_color};
	{$flow_border_width};
}
#slideshow{
	height:{$slide_height}px;
}
#slidetext{
	height:{$slide_height}px;
}
#slidelist{
	background-color:{$color['anything_media_bg']};
}

#slideimage{
	height:{$slide_height}px;
}
#slideimage .slideframe{
	{$media_frame}
	{$media_position}
}
#slidelist {
	width:{$media_width}px;
	height:{$media_height}px;
}
#slideload{
	width:{$media_width}px;
	height:{$media_height}px;
}
#site_name{
	font-size:{$font['logo_text']}px;
}
#heading .nav-span {
	{$slide_bar_bg}
}
#slideshownav li a.activeSlide {
	{$slide_on_image}
}
.main{
	color:{$color['page']};
	font-size: {$font['page']}px;
}
#content-area h1{
	color:{$color['page_h1']};
	font-size:{$font['h1']}px;
}
#content-area h2{
	color:{$color['page_h2']};
	font-size:{$font['h2']}px;
}
#content-area h3{
	color:{$color['page_h3']};
	font-size:{$font['h3']}px;
}
#content-area h4{
	color:{$color['page_h4']};
	font-size:{$font['h4']}px;
}
#content-area h5{
	color:{$color['page_h5']};
	font-size:{$font['h5']}px;
}
#content-area h6{
	color:{$color['page_h6']};
	font-size:{$font['h6']}px;
}
.main a, .main a:visited {
	color: {$color['page_link']};
}
.main a:hover, .main a:active {
	color: {$color['page_link_active']};
}
#top-bar .welcome{
	color:{$color['welcome_text']};
}
#bar-menu a{
	color:{$color['menu_top_text']};
}
#bar-menu a:hover {
	color:{$color['menu_top_hover_text']};
}
#site_name{
	color:{$color['site_name_text']};
}
#site_description{
	color:{$color['site_desc_text']};
}
#dropmenu ul {
	{$menu_top}
}
#dropmenu ul a {
	{$menu_bg}
	border-color:{$color['menu_border']};
}
#dropmenu a{
    {$menu_divide}
	color:{$color['menu_nav_text']};
}
#dropmenu a:hover {
	color:{$color['menu_nav_hover_text']};
}
#dropmenu .current-menu-item>a,#dropmenu .current-menu-ancestor>a{
	color:{$color['menu_nav_current_text']};
}
.cont-vert-description p,.cont-vert-description h2,.heading-inner .page-title{
	color:{$color['feature_header']} !important;
}
.heading-inner a:hover,.heading-inner a:active {
	color:{$color['feature_link_active']};
}
h1.vert-position-title{
	font-size:{$font['feature_heading']}px;
}
.heading-inner .page-description,.heading-inner h2{
	font-size:{$font['feature_introduce']}px;
}
#breadcrumbs{
	color:{$color['breadcrumbs']};
}
#breadcrumbs a, #breadcrumbs a:visited {
	color: {$color['breadcrumbs_link']};
}
#breadcrumbs a:hover, #breadcrumbs a:active {
	color: {$color['breadcrumbs_active']};
}
#content h2.post-entry-title{
	font-size:{$font['entry_title']}px;
}
#content h2.post-title-overimage{
	font-size:{$font['blog_featured_title']}px;
}
.post{
	margin-bottom:{$posts_gap}px;
}
.post-comments-bubble a {
	color: {$color['blog_bubble']} !important;
}
.post-image-overlay{
	background-color:{$color['blog_image_overlay']};
	{$color['blog_image_overlay_ie']}
}
.post-title-slug .inner-vert a,.post-title-slug .inner-vert a:visited {
	color:{$color['blog_list_feature']} !important;
}
.post-title-slug .inner-vert a:hover,.post-title-slug .inner-vert a:active {
	color:{$color['blog_list_hover']} !important;
}
.pagenavi a,.pagenavi a:hover {
	background-color: {$color['page_nav_bg']};
	color:{$color['page_nav_text']} !important;
}
.pagenavi a:active,.pagenavi span.current{
	background-color: {$color['page_nav_bg_current']};
	color:{$color['page_nav_text_current']} !important;
}
.divider, .divider_line, .entry .entry_meta,#sidebar .widget li,#sidebar .widget_pages ul ul,#about_the_author .author_content {
	border-color: {$color['divider_line']};
}
.main ul.tabs a, .main ul.mini_tabs a{
	background:{$color['tab_bg']};
	color:{$color['tab_text']} !important;
}
.main ul.tabs li a.current, .main ul.mini_tabs li a.current{
	background:{$color['tab_current_bg']};
	color:{$color['tab_current_text']} !important;
}
.accordion .tab{
	border-color:{$color['accordion_border']};
	background-color: {$color['accordion_bg']};
	color: {$color['accordion_title_text']};
}
.accordion .tab:hover {
	background-color:{$color['accordion_bg_hover']};
    border-color:{$color['accordion_active_border']};
    color:{$color['accordion_title_active_text']};
}
.accordion .tab.current{
	background-color:{$color['accordion_title_bg_text']};
    border-color:{$color['accordion_active_border']};
    color:{$color['accordion_title_active_text']};
}
.accordion .tab.current:hover {
	background-color:{$color['accordion_title_bg_text']};
    border-color:{$color['accordion_active_border']};
    color:{$color['accordion_title_active_text']};
}
.accordion .pane{
	background-color:{$color['accordion_bg']};
	border-color:{$color['accordion_border']};
    color:{$color['accordion_text']};
}
ul.portfolio-list li:hover {
	background:{$color['portfolio_item_hover']};
	background: -moz-linear-gradient(top,  {$color['portfolio_item_hover']} 0%, {$color['portfolio_item_hover_stop']} 100%); /* FF3.6+ */
	background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,{$color['portfolio_item_hover']}), color-stop(100%,{$color['portfolio_item_hover_stop']})); /* Chrome,Safari4+ */
	background: -webkit-linear-gradient(top,  {$color['portfolio_item_hover']} 0%,{$color['portfolio_item_hover_stop']} 100%); /* Chrome10+,Safari5.1+ */
	background: -o-linear-gradient(top,  {$color['portfolio_item_hover']} 0%,{$color['portfolio_item_hover_stop']} 100%); /* Opera 11.10+ */
	background: -ms-linear-gradient(top,  {$color['portfolio_item_hover']} 0%,{$color['portfolio_item_hover_stop']} 100%); /* IE10+ */
	background: linear-gradient(top,  {$color['portfolio_item_hover']} 0%,{$color['portfolio_item_hover_stop']} 100%); /* W3C */
}
.portfolio-content.carousel-box{
	{$color['portfolio_carousel_box']}
}
ul.portfolio-list .portfolio_image a{
	border-color:{$color['portfolio_image_border']};
}
ul.portfolio-list .portfolio_image a:hover {
	border-color:{$color['portfolio_image_hover_border']};
}
ul#portfolio-filter a{
	background-color:{$color['portfolio_header_bg']}; 
	color:{$color['portfolio_header_text']} !important;
}
ul#portfolio-filter a.current{
	background-color:{$color['portfolio_header_current_bg']}; 
	color:{$color['portfolio_header_current_text']} !important;
}
ul#portfolio-filter a:hover ,ul#portfolio-filter a.current:hover {
	background-color:{$color['portfolio_header_hover_bg']}; 
}
.image_frame a{
	border-color:{$color['image_border']};
}
.image_frame a:hover {
	border-color:{$color['image_hover_border']};
}
.image_frame:hover {
	background:{$color['image_frame']};
	{$color['image_frame_ie']}

}
.gallery .gallery-image-wrap{
	border-color:{$color['image_border']};
}
.gallery .gallery-image-wrap:hover {
	border-color:{$color['image_hover_border']};
}
.gallery .gallery-icon:hover {
	background:{$color['image_frame']};
	{$color['image_frame_ie']}
}
#content .portfolio_title h4{
	font-size: {$font['portfolio_title']}px;
}
#sidebar h3.widgettitle {
	font-size: {$font['widget_title']}px;
}
#sidebar a,#sidebar a:visited {
	color:{$color['sidebar_link']};
}
#sidebar a:hover,#sidebar a:active {
	color:{$color['sidebar_link_active']};
}
#sidebar .sidepanel .current-cat a,#sidebar .sidepanel .current_page_item a {
	color:{$color['sidebar_link_current']} !important;
}
#footer{
	{$footer_image}
	{$footer_position}
	{$footer_repeat}
	background-color:{$color['footer_bg']};
}
#footer-link-columns {
	color:{$color['footer_text']};
	font-size:{$font['footer_text']}px;
}
#footer-link-columns ul li {
	{$footer_link}
}
#footer-link-columns a{
	color:{$color['footer_link']};
}
#footer-link-columns a:hover {
	color:{$color['footer_hover_link']};
}
#footer-link-columns h3.widgettitle{
	color:{$color['footer_title']};
	font-size: {$font['footer_title']}px;
}
#footer-link-columns .widget_contact_form .contact_form .text_input,
#footer-link-columns .widget_contact_form .contact_form .textarea{
	color:{$color['footer_text']};
}
#footer-bottom .copy {
	color:{$color['copyright_text']};
	font-size:{$font['copyright']}px;
}
#footer-bottom .copy a{
	color:{$color['copyright_link_text']};
}
#footer .menu-main-container{
	font-size:{$font['footer_menu']}px;
}
#footer .menu-main-container a,#footer .menu-main-container a:visited {
	color:{$color['sub_footer_right']};
}
#footer .menu-main-container a:hover,#footer .menu-main-container a:active {
	color:{$color['sub_footer_right_hover']};
}
#footer-bottom .widget a {
	color:{$color['sub_footer_right']};
}
#footer-bottom .widget a:hover,#footer-bottom .widget a:active {
	color:{$color['sub_footer_right_hover']};
}
.main .flickr_wrap .flickr_badge_image:hover {
	background-color:{$color['image_frame']};
	{$color['image_frame_ie']}
}
.main .flickr_wrap .flickr_badge_image img{
	border-color:{$color['image_border']};
}
.main .flickr_wrap .flickr_badge_image img:hover {
	border-color:{$color['image_hover_border']};
}
.toggler.normal .accTogglerOpen{
	{$faq_close}
}
.toggler.normal .accToggler{
    {$faq_open}
}
.toggler.large .accTogglerOpen{
    {$faq_close_large}
}
.toggler.large .accToggler{
    {$faq_open_large}
}
#sidebar .widget-slider-back{
	{$widget_back}
}
#sidebar .widget-slider-forward{
	{$widget_prev}
}
#slideshowprev:hover {
	{$back_on}
}
#slideshownext:hover {
	{$ffwd_on}
}
.accordion .tab.current .icon{
	{$accordion_down}
}
.accordion .tab .icon{
	{$accordion}
}
.image_icon_zoom .image_overlay{
	{$image_zoom}
}
.image_icon_play .image_overlay{
	{$image_play}
}
.image_icon_doc .image_overlay{
	{$image_doc}
}
.image_icon_link .image_overlay{
	{$image_link}
}
#searchform #searchsubmit {
	{$search_button}
}
form input:focus, form textarea:focus{
    border-color: {$color['form_focus']};
}
form input:hover, form textarea:hover {
    border-color: {$color['form_focus']};
}
.toggler .accTogglerOpen,
.toggler .accToggler{
	color:{$color['toggle_title']};
}
.toggler .opentext{
	color:{$color['toggle_open']};
}
.toggler .closetext{
	color:{$color['toggle_close']};
}
{$lightbox_social}
.button{
	behavior:url({$PIE_URL});
}
.pagenavi a,.pagenavi span.current{
	behavior:url({$PIE_URL});
}
.main blockquote{
	behavior:url({$PIE_URL});
}
{$custom_css}
CSS;
?>

