function setActiveStyleSheet(title) 
{
  	var i, a, main;
  	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;
    		}
  	}
	
  	for(i=0; (a = document.getElementsByTagName("a")[i]); i++) 
	{
    	  if(a.getAttribute("id") == 'small')
	  {
	    if(title == 'small')
	    {
	      a.className = 'activeinput';
	    }
	    else
	    {
	      a.className = 'foo';
	    }
    	  }
    	  else if(a.getAttribute("id") == 'medium')
	  {
	    if(title == 'medium')
	    {
	      a.className = 'activeinput';
	    }
	    else
	    {
	      a.className = 'foo';
	    }
    	  }
    	  else if(a.getAttribute("id") == 'large')
	  {
	    if(title == 'large')
	    {
	      a.className = 'activeinput';
	    }
	    else
	    {
	      a.className = 'foo';
	    }
    	  }
  	}

	sendPropertyChange("ub?cmd=su&"+"i=dfont|"+title);
}

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;
}

var xmlhttp=false;
function sendPropertyChange(command)
{
    /*@cc_on @*/
    /*@if (@_jscript_version >= 5)
    try {
    xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
    try {
    xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    } catch (E) {
    xmlhttp = false;
    }
    }
    @end @*/
    if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
	xmlhttp = new XMLHttpRequest();
    }

    xmlhttp.open("POST", command, true);
    xmlhttp.onreadystatechange=httpsend;
    xmlhttp.send(null);
}

function httpsend()
{ 
    if(xmlhttp.readyState == 4 && xmlhttp.status == 200)
    {
	result = xmlhttp.responseText;
	if(result.indexOf("PMIDOK:") == 0)
	{
	  linkpmid(result.substr(7));
	}
	else if(result.indexOf("PMIDBAD:") == 0)
	{
	  alert(result.substr(8));
	}
    }
}


