

function changefontM() {
document.getElementById('font1').href = 'themes/Sugar/fonts.larger.css';

font = 'larger';
setCookie('font',font,365);

}

function changefontS() {
document.getElementById('font1').href = 'themes/Sugar/fonts.normal.css';

font = 'normal';
setCookie('font',font,365);

}

function changefontL() {
document.getElementById('font1').href = 'themes/Sugar/fonts.largest.css';

font = 'largest';
setCookie('font',font,365);

}
function changegreen() {
document.getElementById('stylesheet1').href = 'themes/Sugar/colors.green.css';


color = 'green';
setCookie('color',color,365);

}


function changeorange() {
document.getElementById('stylesheet1').href = 'themes/Sugar/colors.orange.css';


color = 'orange';
setCookie('color',color,365);

}


function changered() {
document.getElementById('stylesheet1').href = 'themes/Sugar/colors.red.css';
color = 'red';
setCookie('color',color,365);
}

function changepurple() {
document.getElementById('stylesheet1').href = 'themes/Sugar/colors.purple.css';
color = 'purple';
setCookie('color',color,365);

}

function changegray() {
document.getElementById('stylesheet1').href = 'themes/Sugar/colors.gray.css';

color = 'gray';
setCookie('color',color,365);


}

function changedefault() {
document.getElementById('stylesheet1').href = 'themes/Sugar/colors.sugar.css';

color = 'sugar';
setCookie('color',color,365);
}

function changeblue() {
document.getElementById('stylesheet1').href = 'themes/Sugar/colors.blue.css';

color = 'blue';
setCookie('color',color,365);
}



function getCookie(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 "";
}

function setCookie(c_name,value,expiredays)
{
var exdate=new Date();
exdate.setDate(exdate.getDate()+expiredays);
document.cookie=c_name+ "=" +escape(value)+
((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}

function checkCookie()
{


font=getCookie('font');

     if (font=="normal")
  {
document.getElementById('font1').href = 'themes/Sugar/fonts.normal.css';
  }
    else if (font=="larger")
  {
document.getElementById('font1').href = 'themes/Sugar/fonts.larger.css';
  } 
  
      else if (font=="largest")
  {
document.getElementById('font1').href = 'themes/Sugar/fonts.largest.css';
  } 
    
else
  {
   
document.getElementById('font1').href = 'themes/Sugar/fonts.normal.css';
    }




color=getCookie('color');
//document.write(color);
  if (color=="green")
  {
 document.getElementById('stylesheet1').href = 'themes/Sugar/colors.green.css';
  }
   else if (color=="gray")
  {
 document.getElementById('stylesheet1').href = 'themes/Sugar/colors.gray.css';
  }
  
     else if (color=="red")
  {
 document.getElementById('stylesheet1').href = 'themes/Sugar/colors.red.css';
  }
 
    else if (color=="purple")
  {
 document.getElementById('stylesheet1').href = 'themes/Sugar/colors.purple.css';
  } 
  
       else if (color=="orange")
  {
 document.getElementById('stylesheet1').href = 'themes/Sugar/colors.orange.css';
  }
  
     else if (color=="blue")
  {
 document.getElementById('stylesheet1').href = 'themes/Sugar/colors.blue.css';
  }
    else if (color=="sugar")
  {
 document.getElementById('stylesheet1').href = 'themes/Sugar/colors.sugar.css';
  } 
    
else
  {
   
    document.getElementById('stylesheet1').href = 'themes/Sugar/colors.red.css';
    }
 
}
