function setActiveStylesheet(title) {
	//new code for images
	switch (title){
   case "Standard" :
      document.getElementById("normal").src="images/normal_active.gif";
	  document.getElementById("larger").src="images/larger_inactive.gif";
      document.getElementById("largest").src="images/largest_inactive.gif";
	  break;
   case "Medium" :
      document.getElementById("normal").src="images/normal_inactive.gif";
	  document.getElementById("larger").src="images/larger_active.gif";
      document.getElementById("largest").src="images/largest_inactive.gif";
      break;
	case "Large" :
      document.getElementById("normal").src="images/normal_inactive.gif";
	  document.getElementById("larger").src="images/larger_inactive.gif";
      document.getElementById("largest").src="images/largest_active.gif";
      break;

	//   default : statement;
	} 
// end of new code
	linksFound=document.getElementsByTagName("link");
	for (i=0;i<linksFound.length;i++){
		thisLink=linksFound[i];
		if (thisLink.getAttribute("rel").indexOf("style")> -1 && thisLink.getAttribute("title")) {
			thisLink.disabled=true;
			if (thisLink.getAttribute("title")==title){
				thisLink.disabled=false;
			}
		}
	}
}

function getActiveStylesheet() {
	linksFound=document.getElementsByTagName("link");
	for (i=0;i<linksFound.length;i++){
		thisLink=linksFound[i];
		if (thisLink.getAttribute("rel").indexOf("style")> -1 && thisLink.getAttribute("title") && !thisLink.disabled) {
			return thisLink.getAttribute("title");
		}
	}
}

function getPreferredStylesheet() {
	linksFound=document.getElementsByTagName("link");
	for (i=0;i<linksFound.length;i++){
		thisLink=linksFound[i];
		if (thisLink.getAttribute("rel").indexOf("style")> -1 && thisLink.getAttribute("rel").indexOf("alt") == -1 && thisLink.getAttribute("title")) {
			return thisLink.getAttribute("title");
		}
	}
}

/*function cookieVal(cookieName) {
	thisCookie=document.cookie.split(";");
	for (i=0;i<thisCookie.length;i++) {
		if (comparison=indexOf(thisCookie[i].split("=")[0],cookieName)
		 if(cookieName==thisCookie[i].split("=")[0]){
			 return thisCookie[i].split("=")[1];
		 }
	 }
	 return ""
}
*/
function cookieVal(c_name){
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=");
  if (c_start!=-1)
    { 
    c_start=c_start + c_name.length+1; 
    c_end=document.cookie.indexOf(";",c_start);
    if (c_end==-1) c_end=document.cookie.length;
    return unescape(document.cookie.substring(c_start,c_end));
    } 
  }
return "";
}


/*window.onload=function() {
	thisCookie=cookieVal("style");
	
	if(thisCookie) {
		title=thisCookie;
	}
	else {
		title=getPreferredStylesheet();
	}
	setActiveStylesheet(title);
}

window.onunload=function(){
	expireDate= new Date;
	expireDate.setYear(expireDate.getFullYear()+1);
	document.cookie="style="+getActiveStylesheet()+";expires="+expireDate.toGMTString()+";path=/";
}*/
