function checkstyleSmall(){
   setActiveStyleSheet('Smallstyle'); 
   return false;
}

function checkstyleMedium(){
   setActiveStyleSheet('Medstyle'); 
   return false;
}

function checkstyleLarge(){
   setActiveStyleSheet('Largestyle'); 
   return false;
}

function setActiveStyleSheet(title) {
  var i, a, main;
  setTextSize(title);
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
      a.disabled = true;
      if(a.getAttribute("title") == title) a.disabled = false;
    }
  }
}

function getActiveStyleSheet() {
  var i, a;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title") && !a.disabled) return a.getAttribute("title");
  }
  return null;
}

function getPreferredStyleSheet() {
  var i, a;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1
       && a.getAttribute("rel").indexOf("alt") == -1
       && a.getAttribute("title")
       ) return a.getAttribute("title");
  }
  return null;
}

function setTextSize(value) {
  window.name=value;
}

function getTextSize() {
  return window.name;
}

window.onload = function(e) {
var textSize = getTextSize();
	   if (textSize == "Smallstyle")
		{
			var title = "Smallstyle";
		}
		else if (textSize == "Largestyle")
		{
			var title = "Largestyle";
		}
		else
		{
			 var title = "Medstyle";
		}

	
  setActiveStyleSheet(title);
}

window.onunload = function(e) {
  var title = getActiveStyleSheet();
  setTextSize(title);
}
	var textSize = getTextSize();
	if (textSize == "Smallstyle")
		{
			var title = "Smallstyle";
		}
		else if (textSize == "Largestyle")
		{
			var title = "Largestyle";
		}
if (title==null || title=="undefined"){
	title="Medstyle";
	
	}
 setActiveStyleSheet(title);
