//var tags = new Array( 'div','td','tr','p','b','table','strong','emphasis','a','h1','h2','h3','pre','sub','sup','i','th','cp','ul','ol','li','dt','dd');
var tags = new Array( 'div','font','td','p','b','table','a','h1','h2','h3','pre','sub','sup','i','th','cp','ul','ol','li','dt','dd');
var pixelArray =  new Array('10','12','13','14','16','18','20');
var emArray =  new Array('0.7','0.9','1.0','1.5','2.0','2.5','3');
var initSize = 2;

/* This script and many more are available free online at 
   The JavaScript Source!! http://javascript.internet.com 
   Set up the image files to be used. */
var theImages = new Array() // do not change this

theImages[0] = 'images/logo_urbanfuturesside.gif'
theImages[1] = 'images/logo_keenan.gif'
theImages[2] = 'images/logo_mathisconsultinggroup.gif'
theImages[3] = 'images/logo_intellibridge.gif'
theImages[4] = 'images/logo_willdanfinancial.gif'
theImages[5] = 'images/logo_piperjaffrayside.gif'
theImages[6] = 'images/logo_rwgside.gif'
theImages[7] = 'images/logo_stoneyoungbergside.gif'
theImages[8] = 'images/logo_trackdownside.gif'
theImages[9] = 'images/logo_HdLside.gif'
theImages[10] = 'images/logo_delarosaside.gif'
theImages[11] = 'images/logo_daroldpieperside.gif'
theImages[12] = 'images/logo_murrayassociatesside.gif' 
theImages[13] = 'images/logo_rcraigscottside.gif'
theImages[14] = 'images/logo_kosmontside.gif'
theImages[15] = 'images/logo_Gonsalves195side.gif'
theImages[16] = 'images/logo_pars.gif'
theImages[17] = 'images/logo_tbco.gif' 
theImages[18] = 'images/logo_edge.gif' 
theImages[19] = 'images/logo_pmf.gif' 

// do not edit anything below this line

var j = 0
var p = theImages.length;
var preBuffer = new Array()
for (i = 0; i < p; i++){
   preBuffer[i] = new Image()
   preBuffer[i].src = theImages[i]
}
var whichImage = Math.round(Math.random()*(p-1));
function showImage(){
	//document.write('<img src="'+theImages[whichImage]+'">');
	if(whichImage==0){
		document.write('<a href ="http://www.urbanfuturesinc.com" target="_blank"><img src="'+theImages[whichImage]+'" border=0></a>');
	}
	else if(whichImage==1){
		document.write('<a href ="http://www.keenan.com"><img src="'+theImages[whichImage]+'" border=0></a>');
	}
	else if(whichImage==2){
	document.write('<a href ="http://www.MathisAssociates.com" target="_blank"><img src="'+theImages[whichImage]+'" border=0></a>');
	}
	else if(whichImage==3){
	document.write('<a href ="http://www.intellibridgepartners.com" target="_blank"><img src="'+theImages[whichImage]+'" border=0></a>');
	}
	else if(whichImage==4){
	document.write('<a href ="http://www.muni.com" target="_blank"><img src="'+theImages[whichImage]+'" border=0></a>');
	}
	else if(whichImage==5){
	document.write('<a href ="http://www.piperjaffray.com" target="_blank"><img src="'+theImages[whichImage]+'" border=0></a>');
	}
	else if(whichImage==6){
	document.write('<a href ="http://www.rwglaw.com" target="_blank"><img src="'+theImages[whichImage]+'" border=0></a>');
	}
	else if(whichImage==7){
	document.write('<a href ="http://www.styo.com" target="_blank"><img src="'+theImages[whichImage]+'" border=0></a>');
	}
	else if(whichImage==8){
	document.write('<a href ="http://www.trackdownmanagement.net" target="_blank"><img src="'+theImages[whichImage]+'" border=0></a>');
	}
	else if(whichImage==9){
	document.write('<a href ="http://www.hdlcompanies.com" target="_blank"><img src="'+theImages[whichImage]+'" border=0></a>');
	}
	else if(whichImage==10){
	document.write('<a href ="http://www.ejdelarosa.com" target="_blank"><img src="'+theImages[whichImage]+'" border=0></a>');
	}
	else if(whichImage==11){
	document.write('<a href ="http://www.pieperlaw.com"><img src="'+theImages[whichImage]+'" border=0></a>');
	}
	else if(whichImage==12){
	document.write('<a href ="http://www.bobmurrayassoc.com" target="_blank"><img src="'+theImages[whichImage]+'" border=0></a>');
	}
	else if(whichImage==13){
	document.write('<a href ="http://www.publicexeclaw.com" target="_blank"><img src="'+theImages[whichImage]+'" border=0></a>');
	}
	else if(whichImage==14){
	document.write('<a href ="http://www.kosmont.com" target="_blank"><img src="'+theImages[whichImage]+'" border=0></a>');
	}
	else if(whichImage==15){
	document.write('<a href ="http://www.gonsalvi.com"><img src="'+theImages[whichImage]+'" border=0></a>');
	}
	else if(whichImage==16){
	document.write('<a href ="http://www.pars.org/"><img src="'+theImages[whichImage]+'" border=0></a>');
	}
	else if(whichImage==17){
	document.write('<a href ="http://www.tbcrecruiting.com"><img src="'+theImages[whichImage]+'" border=0></a>');
	}
	else if(whichImage==18){
	document.write('<a href ="http://www.edge-dev.com/"><img src="'+theImages[whichImage]+'" border=0></a>');
	}
	else if(whichImage==19){
	document.write('<a href ="http://www.pfm.com/"><img src="'+theImages[whichImage]+'" border=0></a>');
	}
}
// end JavaScript Source code

function fontSizer(inc,unit) {
	if (!document.getElementById)
		return;
	var size = initSize;
	size += inc;
	
	if (size < 0 ) {
		size = 0;
	}
	if (size > 6 ) {
		size = 6;
	}
	initSize = size;
	storeFontSize(size);
	 
	getBody = document.getElementsByTagName('body')[0];
	for (i = 0 ; i < tags.length ; i++ ) {
		getallTags = getBody.getElementsByTagName(tags[i]);
		for (k = 0 ; k < getallTags.length ; k++)
		getallTags[k].style.fontSize = (unit=='px') ? pixelArray[size]+unit: emArray[size]+unit;
	}
}

// loads cookie value font size
function loadFontSize() {
	var fontSize = readFontSize();
	var size;
	
	if (fontSize != null) {
		var cookieValue; //= fontSize.length - 1;
		fontSize = fontSize.substring(cookieValue);
		
		size = fontSize;
		var unit='px';
		//initSize = size;
		getBody = document.getElementsByTagName('body')[0];
		for (i = 0 ; i < tags.length ; i++ ) {
			getallTags = getBody.getElementsByTagName(tags[i]);
			for (k = 0 ; k < getallTags.length ; k++)
			getallTags[k].style.fontSize = (unit=='px') ? pixelArray[size]+unit: emArray[size]+unit;
		}
	}
	else { 
		initSize = 2;
		size = initSize;
	}

	storeFontSize(size);
	
}

// stores font size in a cookie
function storeFontSize(fontsize) {
	
	//expire cookie
	document.cookie = "site_pref=; expires=13/06/1900 00:00:00; path=/";
		
    var pref = fontsize;    
    var date = new Date();
    
   // date.setTime(date.getTime()+(30*24*60*60*1000));
    //var expires = "expires=" + date.toGMTString();
    //document.cookie = "site_pref=" + pref + "; " + expires + "; path=/";
    document.cookie = "site_pref=" + pref + "; path=/";
    return;
}
	

// reads font size from cookie
function readFontSize() {
    
	var nameEQ = "site_pref=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}