function get_random()

{

    var ranNum= Math.floor(Math.random()*1);

    return ranNum;

}



function get_random_quote()

{

    var ranNum= Math.floor(Math.random()*7);

    return ranNum;

}



function getaPhoto()

{

   var whichPhoto=get_random();



    var images=new Array(1)

     //images[0]="images/splashimage_small.jpg";

     images[0]="images/cityvision.jpg";

  

   return(images[whichPhoto]);

}



function getaQuote()

{

   var whichQuote=get_random_quote();



    var quotes=new Array(8)

     quotes[0]="\"If I believe I cannot do something, it makes me incapable of doing it...... But when I believe I can, then I acquire the ability to do it even if I didn't have it in the beginning\". - Mahatma Gandhi";

     quotes[1]="\"If a requirement was misunderstood, all modeling decisions based on that requirement are invalid, the code written is also in question, and the testing efforts are now verifying the application under the wrong conditions\"   - Scott Ambler, Agile Modeling ";

     quotes[2]="\"It is neither the strongest or the most intelligent that survive but those species that are able to ADAPT to change\". - Charles Darwin";

     quotes[3]="\"If you can't describe what you are doing as a process, you don't know what you are doing!\" - William Edward Demings";

     quotes[4]="\"Why is there always extra time and money to do the project again but never adequate time to listen, analyze, design and build well?\" - Law of Impatience";

     quotes[5]="\"We try to solve the problem by rushing through the design process so that enough time is left at the end of the project to uncover the errors that were made because we rushed through the design process.\" - Glenford Myers";

     quotes[6]="\"I would have written a shorter letter but I ran out of time\" - Mark Twain ";

     quotes[7]="\"Always drink upstream from the herd\" - Will Rogers  ";
	 
	 quotes[8]="\"Impossible is not a fact, only an opinion\" - Anon";
	  
	 quotes[9]="\"Beware of undertaking too much at start. Be content with a little. Allow for accidents. Allow for human nature, especially your own.\" - Arnold Bennett  ";


  

   return(quotes[whichQuote]);

}

  

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(){

	/*

  var photo=getCookie('photo');

	if (photo!=""){

  		var photosrc = photo;

	}

	else {

  		var photosrc = getaPhoto();

    	setCookie('photo',photosrc,1);

	}

  document.getElementById('mainimage').style.backgroundImage="url("+photosrc+")";

  document.getElementById('printmainimage').src=photosrc;

  */

	

	var quote=getCookie('quote');

	if (quote!=""){

  		var quotehtml = quote;

	}

	else {

	  	var quotehtml = getaQuote();

 	   setCookie('quote',quotehtml,1);

	}

  	document.getElementById('quote').innerHTML=quotehtml;

}