function styleswitch(mode, setstyle){
    var i, a;
	var stylepath = './templates/universatil/css/styles-switcher/';
    // setting the path to the CSS directory
    var cookcolor = Cookie.get('Color');
	var cookfontsize = Cookie.get('FontSize');
	var cookwidth = Cookie.get('Width');

	// getting current cookie value for the stylesheet 
   /* if (cookcolor != Cookie.get('Color') || cookfontsize != Cookie.get('FontSize') || cookwidth != Cookie.get('Width')) {
                              for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
                              if(a.getAttribute("rel").indexOf('style') != -1
                              && a.getAttribute("media").indexOf('screen') != -1
                              && a.getAttribute("title")
                              // find default stylesheet, which is defined in the head section of the document
                              ) {
							  	if (a.getAttribute("title").indexOf('style') != -1) {
	                                cookcolor = a.getAttribute("title"); 
    	                            Cookie.set('Color', cookcolor, {duration:365, path:'/'});
								}
								
								if (a.getAttribute("title").indexOf('font-size') != -1) {
									cookfontsize = a.getAttribute("title"); 
									Cookie.set('FontSize', cookfontsize, {duration:365, path:'/'});
								}
								
								if (a.getAttribute("title").indexOf('width') != -1) {
									cookwidth = a.getAttribute("title"); 
									Cookie.set('Width', cookwidth, {duration:365, path:'/'});
								}
                                //set the default stylesheet as a cookie value
                                }
                               }
                             } */

    switch (mode) {
                  case 'set':

                    
                    // loads the new stylesheet
					if (setstyle.indexOf("style") != -1) {
						new Asset.css(stylepath + setstyle +'.css', {id: setstyle});
						new Asset.css(stylepath + cookfontsize +'.css', {id: cookfontsize});
						new Asset.css(stylepath + cookwidth +'.css', {id: cookwidth});
	                    Cookie.set('Color', setstyle, {duration:365, path:'/'});
						
						
					}
					if (setstyle.indexOf("font-size") != -1) {
						new Asset.css(stylepath + cookcolor +'.css', {id: cookcolor});						
						new Asset.css(stylepath + setstyle +'.css', {id: setstyle});						
						new Asset.css(stylepath + cookwidth +'.css', {id: cookwidth});	
						Cookie.set('FontSize', setstyle, {duration:365, path:'/'});
					
					}
					if (setstyle.indexOf("width") != -1) {
						new Asset.css(stylepath + cookcolor +'.css', {id: cookcolor});
						new Asset.css(stylepath + cookfontsize +'.css', {id: cookfontsize});						
						new Asset.css(stylepath + setstyle +'.css', {id: setstyle});					
						Cookie.set('Width', setstyle, {duration:365, path:'/'});
						
					}
                    // sets the active stylesheet into a cookie value
                  break;
                case 'noset':
                    new Asset.css(stylepath + setstyle +'.css', {id: setstyle});
                    // only apply the new stylesheet, without saving it in a cookie value
                    break;
                default:

					//setstyle = cookcolor;
					if(Cookie.get('Color') == cookcolor || Cookie.get('FontSize') == cookfontsize || Cookie.get('Width') == cookwidth)
					{
	                    new Asset.css(stylepath + cookcolor +'.css', {id: cookcolor});
	                    new Asset.css(stylepath + cookfontsize +'.css', {id: cookfontsize});
	                    new Asset.css(stylepath + cookwidth +'.css', {id: cookwidth});
					}
                    // sets the current cookie value as active stylesheet
                   break;
				   }

 /* // only for this page the demonstration of the active stylesheets
  var cookcolor = Cookie.get("Color");
  var cookfontsize = Cookie.get("FontSize");
  var cookwidth = Cookie.get("Width");

  $("log_cookcolor").setHTML(cookcolor);  
  $("log_cookfontsize").setHTML(cookfontsize);  
  $("log_cookwidth").setHTML(cookwidth); */

  // ....
  return null;
  }
  window.addEvent('domready', styleswitch);
