<?php
/*----------------------------------------------------------------------
#Youjoomla Styleeswitch  - 
# ----------------------------------------------------------------------
# Copyright (C) 2007 You Joomla. All Rights Reserved.
# Designed by: You Joomla
# License: Copyright
# Website: http://www.youjoomla.com
------------------------------------------------------------------------*/

defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
if (file_exists( $mosConfig_absolute_path.'/components/com_virtuemart/virtuemart_parser.php' )) {
session_name('virtuemart');
} else {
    
}




session_start();
$mystyles = array();


$mystyles['red']['file'] = "red.css";
$mystyles['blue']['file'] = "blue.css";
$mystyles['green']['file'] = "green.css"; // default




$mystyles['green']['label'] = '<img src="'.$mosConfig_live_site.'/templates/'.$mainframe->getTemplate().'/images/green.png" height="13px" width="19px" alt="Green" title="Green" />';
$mystyles['red']['label'] = '<img src="'.$mosConfig_live_site.'/templates/'.$mainframe->getTemplate().'/images/red.png" height="13px" width="19px" alt="Red" title="Red" />';
$mystyles['blue']['label'] = '<img src="'.$mosConfig_live_site.'/templates/'.$mainframe->getTemplate().'/images/blue.png" height="13px" width="19px" alt="Blue" title="Blue" />';







if (isset($_GET['change_css']) && $_GET['change_css'] != "") {
    $_SESSION['css'] = $_GET['change_css'];
} else {
    $_SESSION['css'] = (!isset($_SESSION['css'])) ? $default_color : $_SESSION['css'];
}
switch ($_SESSION['css']) {
    case "green":
    $css_file = "green.css";
   
    break;
    case "red":
    $css_file = "red.css";
   
    break;
	case "blue":
    $css_file = "blue.css";

     break;
	default:
    $css_file = "template_css.css";
	
}



//
//function style_switcher() {
//while(list($key, $val) = each($mystyles)){
// echo "<a href='".$_SERVER['PHP_SELF']."?change_css=".$key."' title='".$val["label"]."'>".$val["label"]."</a>";
//}
//}
//FONT SWITCH

$myfont = array();


$myfont['small']['file'] = "9px";
$myfont['medium']['file'] = "12px";
$myfont['large']['file'] = "14px"; // default

$myfont['small']['label'] = '<img src="'.$mosConfig_live_site.'/templates/'.$mainframe->getTemplate().'/images/small.png" height="13px" width="19px" alt="Small" title="Small" />';
$myfont['medium']['label'] = '<img src="'.$mosConfig_live_site.'/templates/'.$mainframe->getTemplate().'/images/medium.png" height="13px" width="19px" alt="Medium" title="Medium" />';

$myfont['large']['label'] = '<img src="'.$mosConfig_live_site.'/templates/'.$mainframe->getTemplate().'/images/large.png" height="13px" width="19px" alt="Large" title="Large" />';




if (isset($_GET['change_font']) && $_GET['change_font'] != "") {
    $_SESSION['font'] = $_GET['change_font'];
} else {
    $_SESSION['font'] = (!isset($_SESSION['font'])) ? $default_font : $_SESSION['font'];
}
switch ($_SESSION['font']) {
    case "small":
    $css_font = "9px";
    break;
    case "medium":
    $css_font = "12px";
    break;
	case "large":
    $css_font = "14px";
    break;
    default:
    $css_font = "12px";
}

//WIDTH SWITCH


$mywidth = array();


$mywidth['wide']['file'] = "1000px";
$mywidth['narrow']['file'] = "776px";
$mywidth['fluid']['file'] = "99%"; // default

$mywidth['narrow']['label'] = '<img src="'.$mosConfig_live_site.'/templates/'.$mainframe->getTemplate().'/images/narrow.png" height="13px" width="19px" alt="Narrow" title="Narrow" />';
$mywidth['wide']['label'] = '<img src="'.$mosConfig_live_site.'/templates/'.$mainframe->getTemplate().'/images/wide.png" height="13px" width="19px" alt="Wide" title="Wide" />';
$mywidth['fluid']['label'] = '<img src="'.$mosConfig_live_site.'/templates/'.$mainframe->getTemplate().'/images/fluid.png" height="13px" width="19px" alt="Fluid" title="Fluid" />';




if (isset($_GET['change_width']) && $_GET['change_width'] != "") {
    $_SESSION['width'] = $_GET['change_width'];
} else {
    $_SESSION['width'] = (!isset($_SESSION['width'])) ? $default_width : $_SESSION['width'];
}
switch ($_SESSION['width']) {
    case "wide":
    $css_width = "1000px";
	$mainbg ="mainbg";
    break;
    case "narrow":
    $css_width = "776px";
	$mainbg ="mainbg-n";
    break;
	case "fluid":
    $css_width = "99%";
	$mainbg ="mainbg-f";
    break;
    default:
    $css_width = "1000px";
}

?>