var min=1;
var max=18;
function increaseFontSize() {
   var p = document.getElementsByTagName('p');
   for(i=0;i<p.length;i++) {
      if(p[i].style.fontSize) { var s = parseInt(p[i].style.fontSize.replace("em","")); } else { var s = 1; }
      if(s!=max) { s += 0.2; }
      p[i].style.fontSize = s+"em"
   }
   var p = document.getElementsByClassName('content');
   for(i=0;i<p.length;i++) {
      if(p[i].style.fontSize) { var s = parseInt(p[i].style.fontSize.replace("em","")); } else { var s = 1; }
      if(s!=max) { s += 0.2; }
      p[i].style.fontSize = s+"em"
   }
}
function decreaseFontSize() {
   var p = document.getElementsByTagName('p');
   for(i=0;i<p.length;i++) {
      if(p[i].style.fontSize) { var s = parseInt(p[i].style.fontSize.replace("em","")); } else { var s = 1; }
      if(s!=min) { s -= 0.2; }
      p[i].style.fontSize = s+"em"
   }   
   var p = document.getElementsByClassName('content');
   for(i=0;i<p.length;i++) {
      if(p[i].style.fontSize) { var s = parseInt(p[i].style.fontSize.replace("em","")); } else { var s = 1; }
      if(s!=min) { s -= 0.2; }
      p[i].style.fontSize = s+"em"
   }   
}
function changecss(theClass,element,value) {
	//documentation for this script at http://www.shawnolson.net/a/503/
	 var cssRules;
	 if (document.all) {
	  cssRules = 'rules';
	 }
	 else if (document.getElementById) {
	  cssRules = 'cssRules';
	 }
	 for (var S = 0; S < document.styleSheets.length; S++){
	  for (var R = 0; R < document.styleSheets[S][cssRules].length; R++) {
	   if (document.styleSheets[S][cssRules][R].selectorText == theClass) {
	    document.styleSheets[S][cssRules][R].style[element] = value;
	   }
	  }
	 }	
}

function switchWhite(){
	switchWhiteBg();
	changecss('.content','color','white');
}
function switchBlack(){
	switchBlackBg();
	changecss('.content','color','black');
}
function switchBlackBg(){
  var divs = document.getElementsByTagName("DIV");
  for(var i = 0; i < divs.length; i++){
    if(divs[i].className == "ctbg2")
      divs[i].className = "ctbg1";
  }
}
	
function switchWhiteBg(){
  var divs = document.getElementsByTagName("DIV");
  for(var i = 0; i < divs.length; i++){
    if(divs[i].className == "ctbg1")
      divs[i].className = "ctbg2";
    else if(divs[i].className == "ctbg2")
      divs[i].className = "ctbg2";
  }
}

function switchStyle(){
  // return array of all DIV elements
  var divs = document.getElementsByTagName("DIV");
  // Iterate through all DIVs in array
  for(var i = 0; i < divs.length; i++){
    // If current DIV is using "textDefault" styling,
    // change it to use "textAlternate" styling
    if(divs[i].className == "ctbg1")
      divs[i].className = "ctbg2";
    // If current DIV is using "textAlternate" styling,
    // change it back to use "textDefault" styling
    else if(divs[i].className == "ctbg2")
      divs[i].className = "ctbg1";
  }
}

function random_text()
{
var r_text = new Array ();
r_text[0] = '<p>"Careers must be understood backwards; but they must be lived forward."</p><p>Kierkegaard<br \>(adapted – the actual quote refers to "life", not "careers")</p>';
r_text[1] = '<p>"It seems essential, in relationships and all tasks, that we concentrate only on what is most significant and important."</p><p>Kierkegaard</p>';
r_text[2] = '<p>"Principles and rules are intended to provide a thinking man with a frame of reference." </p><p>Clausewitz</p>';
r_text[3] = '<p>"Entrepreneurs are simply those who understand that there is little difference between obstacle and opportunity and are able to turn both to their advantage." </p><p>Machiavelli</p>';
r_text[4] = '<p>"One change always leaves the way open for the establishment of others." </p><p>Machiavelli</p>';
r_text[5] = '<p>"The first method for estimating the intelligence of a ruler is to look at the men he has around him." </p><p>Machiavelli</p>';
r_text[6] = '<p>"The question is, then, do we try to make things easy on ourselves or do we try to make things easy on our customers, whoever they may be?" </p><p>Machiavelli</p>';
r_text[7] = '<p>"There is nothing more difficult to take in hand, more perilous to conduct, or more uncertain in its success, than to take the lead in the introduction of a new order of things." </p><p>Machiavelli</p>';
r_text[8] = '<p>"Who wishes to be obeyed must know how to command." </p><p>Machiavelli</p>';
r_text[9] = '<p>"Politics is the art of looking for trouble, finding it everywhere, diagnosing it incorrectly and applying the wrong remedies."</p><p>Groucho Marx</p>';
r_text[10] = '<p>"Opportunities multiply as they are seized."</p><p>Sun Tzu</p>';
r_text[11] = '<p>"Strategy without tactics is the slowest route to victory. Tactics without strategy is the noise before defeat."</p><p>Sun Tzu</p>';
r_text[12] = '<p>"To see victory only when it is within the ken of the common herd is not the acme of excellence."</p><p>Sun Tzu</p>';
r_text[13] = '<p>"It\'s absolutely impossible but it has possibilities."</p><p>Sam Goldwyn</p>';
r_text[14] = '<p>"Never make forecasts, especially about the future."</p><p>Sam Goldwyn</p>';
r_text[15] = '<p>"You never get a second chance to make a first impression."</p><p>Sam Goldwyn</p>';
r_text[16] = '<p>"Non solum fumo speculisque, sed etiam tintinnabulis fistulisque factum est."</p><p>Allegedly a senior civil servant on a major NHS IT programme.</p>';
r_text[17] = '<p>"Man has such a predilection for systems and abstract deductions that he is ready to distort the truth intentionally, he is ready to deny the evidence of his own senses in order to justify his logic.” </p><p>Dostoevsky</p>';
r_text[18] = '<p>"Not everything that counts can be counted and not everything that can be counted counts."</p><p>Einstein</p>';
r_text[19] = '<p>"If we want things to stay as they are, things will have to change."</p><p>Giuseppe di Lampedusa</p>';
r_text[20] = '<p>"Man has such a predilection for systems and abstract deductions that he is ready to distort the truth   intentionally, he is ready to deny the evidence of his own senses in order to justify his logic."</p><p>Dostoevsky</p>';
var i = Math.round(20*Math.random());

document.write(r_text[i]);
}

