var corp = [
"Corp/adobe.jpg",
"Corp/apple.gif",
"Corp/berkeley.gif",
"Corp/denic.gif",
"Corp/google.gif",
"Corp/ibm.gif",
"Corp/india.gif",
"Corp/microsoft.jpg",
"Corp/mono.gif",
"Corp/oracle.jpg",
"Corp/sap.jpg",
"Corp/snltr.gif",
"Corp/sun.gif",
"Corp/sybase.jpg",
"Corp/tamil.jpg",
"Corp/yahoo.gif"
];
var assoc = [
"Assoc/bulac.jpg",
"Assoc/columbia.jpg",
"Assoc/compart.gif",
"Assoc/core.jpg",
"Assoc/deco.jpg",
"Assoc/digicert.gif",
"Assoc/everson.jpg",
"Assoc/exlibris.jpg",
"Assoc/founder.jpg",
"Assoc/inno.jpg",
"Assoc/lds.jpg",
"Assoc/linotype.jpg",
"Assoc/nokia.jpg",
"Assoc/oclc.jpg",
"Assoc/perl.jpg",
"Assoc/sas.gif",
"Assoc/sil.jpg",
"Assoc/sony.jpg",
"Assoc/tavultesoft.gif",
"Assoc/teradata.gif",
"Assoc/ubs.jpg",
"Assoc/uniserv.jpg",
"Assoc/utilika.gif",
"Assoc/verisign.gif",
"Assoc/vtls.jpg",
"Assoc/wenlin.jpg",
"Assoc/zhong.gif"
];


function showLogos () {
	// show the title text
	document.getElementById('membertitle').style.display = 'block';

	// create basic structure
	var div1 = document.getElementById('memberIcon1');
	var div2 = document.getElementById('memberIcon2');
	
	var a1 = div1.appendChild( document.createElement('a') );
	var a2 = div2.appendChild( document.createElement('a') );
	
	var img1 = a1.appendChild( document.createElement('img') );
		img1.width = "120";
		img1.height = "80";
		img1.alt = "Corporate logo";
		img1.className = "logo";
	var img2 = a2.appendChild( document.createElement('img') );
		img2.width = "120";
		img2.height = "80";
		img2.alt = "Corporate or Associate logo";
		img2.className = "logo";

	// select the logos
	var corpAssoc = corp.concat(assoc);
	var numlogos = corpAssoc.length;
	var numcorps = corp.length;
	//var numlogos=42;
	//var numcorps=15;

	// make a random choice of which 2 logos to display
	var randomnum1=Math.floor(Math.random()*numcorps);
	var randomnum2=Math.floor(Math.random()*numlogos);
	var whichimage1=randomnum1;
	var whichimage2=randomnum2;

	if (whichimage1>=numcorps) {
		whichimage1=0;
		}
	if (whichimage2>=numlogos) {
		whichimage2=0;
		}

	while (whichimage2==whichimage1) {
		randomnum2=Math.floor(Math.random()*numlogos);
		whichimage2=randomnum2;
		}

	if (whichimage2>=numlogos) {
		whichimage2=0;
		}

	var logo1 = corp[whichimage1];
	var logo2 = corpAssoc[whichimage2];
	
	// assign values to relevant attributes
	img1.src = "http://www.unicode.org/LogoImg/"+logo1;
	img2.src = "http://www.unicode.org/LogoImg/"+logo2;
	
	a1.href = "cgi-bin/memberRedirect.pl?"+logo1;
	a2.href = "cgi-bin/memberRedirect.pl?"+logo2;
	}
	
	
		

// Now do quotes...

function showQuote () {
	// create basic structure
	var block = document.getElementById('rotatingquote');
	var quotespan = block.appendChild( document.createElement('span') );
		quotespan.className = 'quotespan';
	block.appendChild( document.createTextNode(' (') );
	var linkspan = block.appendChild( document.createElement('span') );
		linkspan.className = 'linkspan';
	var thelink = linkspan.appendChild( document.createElement('a') );
	var morespan = thelink.appendChild( document.createElement('span') );
		morespan.className = 'quotemore';
	var text = morespan.appendChild( document.createTextNode('more') );
	block.appendChild( document.createTextNode(')') );
	
	// get the quotes into an array
	var quotations = document.getElementById('quotations');
	var quoteArray = quotations.getElementsByTagName('p');
	
	// get the quote fragids into an array
	var personlink = document.getElementById('personlink');
	var linkArray = personlink.getElementsByTagName('div');
	
	// make a random choice of which quote to display
	var numquotes=quoteArray.length;

	var randomnum3=Math.floor(Math.random()*numquotes);
	var whichquote=randomnum3;

	if (whichquote>=numquotes) {
		whichquote=0; 
		}

	var thequote = quoteArray[whichquote];
	var theperson = linkArray[whichquote].firstChild.data;

	// assign values to markup
	while (thequote.childNodes.length > 0) { 
		quotespan.appendChild( thequote.firstChild );
		}
	
	//var thetext = quotespan.appendChild( document.createTextNode(thequote+'\u00A0') );
	thelink.href = 'http://www.unicode.org/press/quotations.html#'+theperson;
	}
