﻿//<![CDATA[
<!--Activate Cloaking

var STYLE_PREFIX = 'style-';
var myActSheet;
/*document.write('<link rel="STYLESHEET" type="text/css" href="' + GetTheme() + '">');*/

function SetSheet(psvalue) {
	var l = document.getElementsByTagName('link'), i, o, t;
	var sc = document.getElementById('dmainstyle'), croptxt = STYLE_PREFIX, sopt= sc.options;
	myActSheet = psvalue;
	for(i=0;(o=l[i]);i++) {
		if( 'alternate stylesheet'===o.getAttribute('rel') && ( t=o.getAttribute('title') ) )
			{       
				o.disabled=true;
				o.disabled=(t!==psvalue); 
			}
	}
	psvalue = psvalue.substring(croptxt.length);
	for (var i=0; i<sopt.length; i++){
		if (sopt[i].value==psvalue){ if (sopt[i].tagName=="OPTION") sopt[i].selected=true; break; }
	}

}

function GetDefaultTheme() { return '1';}

function GetTheme() {
	var retVal = GetCookie ('MF_Theme');	
	if (retVal==null) { return GetDefaultTheme();}
	return retVal;
}

function SetTheme(MF_Style)
   {
      var expdate = new Date ();
      expdate.setTime(expdate.getTime() + (24 * 60 * 60 * 1000 * 365)); 
      SetCookie('MF_Theme', MF_Style, expdate);
      return false;
   }

function change_style(p_val) {
	if(p_val!='TDefault') set_style(p_val);
//	document.getElementById('dmainstyle').selectedIndex=0;
	return true;
	SetTheme(STYLE_PREFIX+p_val);
	location.reload();
}

function set_style(p_val) {
	SetTheme(p_val);
	SetSheet(STYLE_PREFIX+p_val);
}

//Deactivate Cloaking-->
//]]>

