/*RANDOM CONTENT SCRIPT*/
/*
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;
     }
   }
}


<!--
var doAlerts=true;
function changeSheets(whichSheet){
  whichSheet=whichSheet-1;
  if(document.styleSheets){
    var c = document.styleSheets.length;
    if (doAlerts) alert('Change to Style '+(whichSheet+1));
    for(var i=0;i<c;i++){
      if(i!=whichSheet){
        document.styleSheets[i].disabled=true;
      }else{
        document.styleSheets[i].disabled=false;
      }
    }
  }
}
//-->
*/
$(document).ready(function() {
						   
						   
						   
function changeStyle(title) {
var lnks = document.getElementsByTagName('link');
for (var i = lnks.length - 1; i >= 0; i--) {
if (lnks[i].getAttribute('rel').indexOf('style')> -1 && lnks[i].getAttribute('title')) {
lnks[i].disabled = true;
if (lnks[i].getAttribute('title') == title) lnks[i].disabled = false;
}}} 


var randval = Math.floor(Math.random()*6);
switch (randval) {
	case 0:
		var content='<img src="assets/images/nutshell.gif" alt="In a nutshell: Good design makes money, boosts performance, speeds up growth and improves the bottom line." title="In a nutshell: Good design makes money, boosts performance, speeds up growth and improves the bottom line." />';
		
		
		document.body.className = 'bodyblack';
		document.getElementById('brand').className = 'brand';
		document.getElementById('clock').className = 'clock';
		document.getElementById('copy').className = 'copy';
		//changeStyle('black');
		$("link[rel=stylesheet]").attr({href : "assets/css/pnav_white.css"});
		
	
	break;
	case 1:
		var content='<img src="assets/images/sales_graph_curve.png" alt="There is no curve so beautiful as a rising sales graph." title="There is no curve so beautiful as a rising sales graph." />';
		
		document.body.className = 'bodywhite';
		document.getElementById('brand').className = 'brand2';
		//changeStyle('white');
		document.getElementById('clock').className = 'clock2';
		$("link[rel=stylesheet]").attr({href : "assets/css/pnav_grey.css"});
		document.getElementById('copy').className = 'copy1';
		
	break;
	case 2:
		var content='<img src="assets/images/good_design_is_quantifiable.png" alt="Good design is a quantifiable benefit, not a cost. Its value can be measured economically, socially and environmentally." title="Good design is a quantifiable benefit, not a cost. Its value can be measured economically, socially and environmentally." />';
		
		
		document.body.className = 'bodywhite';
		document.getElementById('brand').className = 'brand2';
		//changeStyle('white');
		document.getElementById('clock').className = 'clock2';
		$("link[rel=stylesheet]").attr({href : "assets/css/pnav_grey.css"});
		document.getElementById('copy').className = 'copy1';
		
	break;
	case 3:
		var content='<img src="assets/images/creativity_generates_ideas.png" alt="Creativity generates ideas and innovation exploits them. Good design connects the two." title="Creativity generates ideas and innovation exploits them. Good design connects the two." />';
		
		document.body.className = 'bodyorange';
		document.getElementById('brand').className = 'brand3';
		//changeStyle('orange');
		document.getElementById('clock').className = 'clock';
		$("link[rel=stylesheet]").attr({href : "assets/css/pnav_orange.css"});
		document.getElementById('copy').className = 'copy';
		
	break;
	case 4:
		var content='<img src="assets/images/people_really_nice.png" alt="The people are really nice here. and other nasty rumours about us." title="The people are really nice here. and other nasty rumours about us." />';
		
		document.body.className = 'bodywhite';
		document.getElementById('brand').className = 'brand2';
		//changeStyle('white');
		document.getElementById('clock').className = 'clock2';
		$("link[rel=stylesheet]").attr({href : "assets/css/pnav_grey.css"});
		document.getElementById('copy').className = 'copy1';
		
	break;
	default:
		var content='<img src="assets/images/design_enhance_content.png" alt="Design is used to enhance content, not to decorate or hide it." title="Design is used to enhance content, not to decorate or hide it." />';
	
		document.body.className = 'bodyorange';
		document.getElementById('brand').className = 'brand3';
		//changeStyle('orange');
		document.getElementById('clock').className = 'clock';
		$("link[rel=stylesheet]").attr({href : "assets/css/pnav_orange.css"});
		document.getElementById('copy').className = 'copy';
}

var element = document.getElementById("randomcontent");
element.innerHTML = content;
/*END OF RANDOM CONTENT SCRIPT*/
});
