isNS = document.layers?true:false;
isIE = navigator.appName.indexOf("Microsoft") != -1
isNS6=document.getElementById&&!isIE?true:false;

function Newdiv2(window, id, body, left, top, width, height, zIndex, absolute) {
    this.window = window;
    this.id     = id;
    this.body   = body;
    var d = window.document;
    d.writeln('<STYLE TYPE="text/css">#' + id + ' {');
	if (absolute) d.write('position:absolute;');
	else          d.write('position:relative;');
    if (left)   d.write('left:'  + left  + ';');
    if (top)    d.write('top:'   + top   + ';');
    if (width)  d.write('width:' + width + ';');
	if (height) d.write('height:' + height + ';');
	if (zIndex) d.write('z-index:' + zIndex + ';');
    d.writeln('}</STYLE>');
}

if (isNS) {
    Newdiv2.prototype.output             = function()      { var d = this.window.document;d.writeln('<DIV ID="' + this.id + '">');d.writeln(this.body);d.writeln("</DIV>");this.layer = d[this.id];}
    Newdiv2.prototype.moveTo             = function(x,y)   { this.layer.moveTo(x,y); }
    Newdiv2.prototype.moveBy             = function(x,y)   { this.layer.moveBy(x,y); }
    Newdiv2.prototype.show               = function()      { this.layer.visibility = "show"; }
    Newdiv2.prototype.hide               = function()      { this.layer.visibility = "hide"; }
    Newdiv2.prototype.setZ               = function(z)     { this.layer.zIndex = z; }
    Newdiv2.prototype.setBgColor         = function(color) { this.layer.bgColor = color; }
    Newdiv2.prototype.setBgImage         = function(image) { this.layer.background.src = image;}
    Newdiv2.prototype.getX               = function() { return this.layer.left; }
    Newdiv2.prototype.getY               = function() { return this.layer.top; } //was right .. ??
    Newdiv2.prototype.getWidth           = function() { return this.layer.width; }
    Newdiv2.prototype.getHeight          = function() { return this.layer.height; }
    Newdiv2.prototype.getZ               = function() { return this.layer.zIndex; }
    Newdiv2.prototype.isVisible          = function() { return this.layer.visibility == "show"; }
    Newdiv2.prototype.setBody            = function() { for(var i = 0; i < arguments.length; i++) this.layer.document.writeln(arguments[i]);this.layer.document.close();}
    Newdiv2.prototype.addEventHandler    = function(eventname, handler) {this.layer.captureEvents(Newdiv2._eventmasks[eventname]); var newdivel = this;this.layer[eventname] = function(event) { return handler(newdivel, event.type, event.x, event.y, event.which, event.which,((event.modifiers & Event.SHIFT_MASK) != 0),((event.modifiers & Event.CTRL_MASK)  != 0),((event.modifiers & Event.ALT_MASK)   != 0));}}
    Newdiv2.prototype.removeEventHandler = function(eventname)          {this.layer.releaseEvents(Newdiv2._eventmasks[eventname]);delete this.layer[eventname];}
    Newdiv2.prototype.centerX            = function() {this.layer.moveTo(Math.round((window.pageXOffset+document.width-100)/2),this.layer.top)}
    Newdiv2._eventmasks                  = {onabort:Event.ABORT,onblur:Event.BLUR,onchange:Event.CHANGE,onclick:Event.CLICK,ondblclick:Event.DBLCLICK, ondragdrop:Event.DRAGDROP,onerror:Event.ERROR, onfocus:Event.FOCUS,onkeydown:Event.KEYDOWN,onkeypress:Event.KEYPRESS,onkeyup:Event.KEYUP,onload:Event.LOAD,onmousedown:Event.MOUSEDOWN,onmousemove:Event.MOUSEMOVE, onmouseout:Event.MOUSEOUT,onmouseover:Event.MOUSEOVER, onmouseup:Event.MOUSEUP,onmove:Event.MOVE,onreset:Event.RESET,onresize:Event.RESIZE,onselect:Event.SELECT,onsubmit:Event.SUBMIT,onunload:Event.UNLOAD};
}

if (isIE) {
    Newdiv2.prototype.output             = function()                   { var d = this.window.document;d.writeln('<DIV ID="' + this.id + '">');d.writeln(this.body);d.writeln("</DIV>");this.element = d.all[this.id];this.style = this.element.style;}
    Newdiv2.prototype.moveTo             = function(x,y)                { this.style.pixelLeft = x;this.style.pixelTop = y;}
    Newdiv2.prototype.moveBy             = function(x,y)                { this.style.pixelLeft += x;this.style.pixelTop += y;}
    Newdiv2.prototype.show               = function()                   { this.style.visibility = "visible"; }
    Newdiv2.prototype.hide               = function()                   { this.style.visibility = "hidden"; }
    Newdiv2.prototype.setZ               = function(z)                  { this.style.zIndex = z; }
    Newdiv2.prototype.setBgColor         = function(color)              { this.style.backgroundColor = color; }
    Newdiv2.prototype.setBgImage         = function(image)              { this.style.backgroundImage = image;}
    Newdiv2.prototype.getX               = function()                   { return this.style.pixelLeft; }
    Newdiv2.prototype.getY               = function()                   { return this.style.pixelRight; }
    Newdiv2.prototype.getWidth           = function()                   { return this.style.width; }
    Newdiv2.prototype.getHeight          = function()                   { return this.style.height; }
    Newdiv2.prototype.getZ               = function()                   { return this.style.zIndex; }
    Newdiv2.prototype.isVisible          = function()                   { return this.style.visibility == "visible"; }
    Newdiv2.prototype.setBody            = function()                   { var body = "";for(var i = 0; i < arguments.length; i++) {body += arguments[i] + "\n";}this.element.innerHTML = body;}
    Newdiv2.prototype.addEventHandler    = function(eventname, handler) { var NewDiv = this;this.element[eventname] = function() { var e = Newdiv2.window.event;e.cancelBubble = true;return handler(Newdiv2, e.type, e.x, e.y, e.button, e.keyCode, e.shiftKey, e.ctrlKey, e.altKey); }}
    Newdiv2.prototype.removeEventHandler = function(eventname)          { delete this.element[eventname];}
	Newdiv2.prototype.centerX            = function()                   { this.style.pixelLeft=Math.round((document.body.clientWidth+document.body.scrollLeft-300)/2)}
}

/*
 * The following was written by:
 *   Dario Guzik
 *      Spam unfriendly email address: dguzik AT bigfoot DOT com
 */
if (isNS6) {
    Newdiv2.prototype.output             = function()                   { var d = this.window.document;d.writeln('<DIV ID="' + this.id + '">');d.writeln(this.body);d.writeln("</DIV>");this.element = d.getElementById(this.id);this.style = this.element.style;}
    Newdiv2.prototype.moveTo             = function(x,y)                { this.style.pixelLeft = x;this.style.pixelTop = y;}
    Newdiv2.prototype.moveBy             = function(x,y)                { this.style.pixelLeft += x;this.style.pixelTop += y;}
    Newdiv2.prototype.show               = function()                   { this.style.visibility = "visible"; }
    Newdiv2.prototype.hide               = function()                   { this.style.visibility = "hidden"; }
    Newdiv2.prototype.setZ               = function(z)                  { this.style.zIndex = z; }
    Newdiv2.prototype.setBgColor         = function(color)              { this.style.backgroundColor = color; }
    Newdiv2.prototype.setBgImage         = function(image)              { this.style.backgroundImage = image;}
    Newdiv2.prototype.getX               = function()                   { return this.style.pixelLeft; }
    Newdiv2.prototype.getY               = function()                   { return this.style.pixelRight; }
    Newdiv2.prototype.getWidth           = function()                   { return this.style.width; }
    Newdiv2.prototype.getHeight          = function()                   { return this.style.height; }
    Newdiv2.prototype.getZ               = function()                   { return this.style.zIndex; }
    Newdiv2.prototype.isVisible          = function()                   { return this.style.visibility == "visible"; }
    Newdiv2.prototype.setBody            = function()                   { var body = "";for(var i = 0; i < arguments.length; i++) {body += arguments[i] + "\n";}this.element.innerHTML = body;}
    Newdiv2.prototype.addEventHandler    = function(eventname, handler) { var NewDiv = this;this.element[eventname] = function() { var e = Newdiv2.window.event;e.cancelBubble = true;return handler(NewDiv, e.type, e.x, e.y, e.button, e.keyCode, e.shiftKey, e.ctrlKey, e.altKey); }}
    Newdiv2.prototype.removeEventHandler = function(eventname)          { delete this.element[eventname];}
  Newdiv2.prototype.centerX            = function()                   { this.style.pixelLeft=Math.round((document.body.clientWidth+document.body.scrollLeft-300)/2)}
}

function addBanner(abannerHTML, abannerArray){
  abannerArray[abannerArray.length?abannerArray.length:0]=abannerHTML;
}

function doIt(atype) {
	if (atype == "company") {
		companycount++;
		companycount%=companybanners.length;
		companydiv.setBody(companybanners[companycount]);
	}
	else {
		sponsorcount++;
		sponsorcount%=sponsorbanners.length;
		sponsordiv.setBody(sponsorbanners[sponsorcount]);
	}
}



var companybanners = new Array();
var sponsorbanners = new Array();
var companydiv, sponsordiv;
var companycount=0; /* which one to start with */
var sponsorcount=0;
var companytype, sponsortype;

function MakeBanner(atype) {
	if (atype=="companies") {
addBanner("<a href='http://www.aboutus.org' target='_blank'><img border=0 alt='AboutUs' src='logos/aboutus.gif' width='145' height='57'></a>", companybanners);
addBanner("<a href='http://www.agilyx.com' target='_blank'><img border=0 alt='Agilyx' src='logos/agilyx.gif' width='145' height='57'></a>", companybanners);
addBanner("<a href='http://www.arcimoto.com' target='_blank'><img border=0 alt='Arcimoto' src='logos/arcimoto.gif' width='145' height='57'></a>", companybanners);
addBanner("<a href='http://www.athletepath.com' target='_blank'><img border=0 alt='Athletepath' src='logos/athletepath.gif' width='145' height='57'></a>", companybanners);
// emeritus 
addBanner("<a href='http://www.aricofoods.com' target='_blank'><img border=0 alt='Arico Foods' src='logos/arico.gif' width='145' height='57'></a>", companybanners);
// emeritus 
addBanner("<a href='http://www.assetexchange.com/' target='_blank'><img border=0 alt='AssetExchange' src='logos/assetexchange.gif' width='145' height='57'></a>", companybanners);
//addBanner("<a href='http://www.blacktonic.com/' target='_blank'><img border=0 alt='Black Tonic' src='logos/blacktonic.gif' width='145' height='57'></a>", companybanners);
addBanner("<a href='http://www.brassmagazine.com/' target='_blank'><img border=0 alt='brass' src='logos/brass.gif' width='145' height='57'></a>", companybanners);
// emeritus 
addBanner("<a href='http://www.cooleremail.com/' target='_blank'><img border=0 alt='CoolerEmail' src='logos/cooleremail.gif' width='145' height='57'></a>", companybanners);
addBanner("<a href='http://www.dedicatedmaps.com/' target='_blank'><img border=0 alt='Dedicated Maps' src='logos/dedicatedmaps.gif' width='145' height='57'></a>", companybanners);
// emeritus addBanner("<a href='http://www.dirtlogic.com' target='_blank'><img border=0 alt='Dirt Logic' src='logos/dirtlogic.gif' width='145' height='57'></a>", companybanners);
addBanner("<a href='http://www.edcaliber.com/' target='_blank'><img border=0 alt='Edcaliber' src='logos/edcaliber.gif' width='145' height='57'></a>", companybanners);
// emeritus 
addBanner("<a href='http://www.elevenwireless.com' target='_blank'><img border=0 alt='eleven Wireless' src='logos/elevenwireless.gif' width='145' height='57'></a>", companybanners);
// emeritus 
addBanner("<a href='http://www.eroi.com' target='_blank'><img border=0 alt='eROI' src='logos/eroi.gif' width='145' height='57'></a>", companybanners);
addBanner("<a href='http://www.gadgettrak.com/' target='_blank'><img border=0 alt='GadgetTrak' src='logos/gadgettrak.gif' width='145' height='57'></a>", companybanners);
// emeritus 
addBanner("<a href='http://www.jivesoftware.com' target='_blank'><img border=0 alt='Jive Software' src='logos/jivesoftware.gif' width='145' height='57'></a>", companybanners);
addBanner("<a href='http://www.journeygym.com' target='_blank'><img border=0 alt='journey gym' src='logos/journeygym.gif' width='145' height='57'></a>", companybanners);
// emeritus 
addBanner("<a href='http://www.keenmobility.com/' target='_blank'><img border=0 alt='Keen Mobility' src='logos/keen.gif' width='145' height='57'></a>", companybanners);
//addBanner("<a href='http://www.matradee.com/' target='_blank'><img border=0 alt='Matradee' src='logos/matradee.gif' width='145' height='57'></a>", companybanners);
addBanner("<a href='http://www.looptworks.com/' target='_blank'><img border=0 alt='LOOPTWORKS' src='logos/looptworks.gif' width='145' height='57'></a>", companybanners);
addBanner("<a href='http://www.mergertech.com/' target='_blank'><img border=0 alt='merger tech' src='logos/mergertech.gif' width='145' height='57'></a>", companybanners);
addBanner("<a href='http://www.paydici.com' target='_blank'><img border=0 alt='Paydici' src='logos/paydici.gif' width='145' height='57'></a>", companybanners);
addBanner("<a href='http://www.rapidprotocasting.com' target='_blank'><img border=0 alt='Rapid Protocasting' src='logos/rapidprotocasting.gif' width='145' height='57'></a>", companybanners);
addBanner("<a href='http://www.recesswellness.com' target='_blank'><img border=0 alt='Recess' src='logos/recessfitness.gif' width='145' height='57'></a>", companybanners);
addBanner("<a href='http://www.rhapline.com' target='_blank'><img border=0 alt='Rhapline' src='logos/rhapline.gif' width='145' height='57'></a>", companybanners);
// emeritus 
addBanner("<a href='http://www.rumblefish.cc/' target='_blank'><img border=0 alt='Rumblefish' src='logos/rumblefish.gif' width='145' height='57'></a>", companybanners);
addBanner("<a href='http://www.secondporch.com' target='_blank'><img border=0 alt='Second Porch' src='logos/secondporch.gif' width='145' height='57'></a>", companybanners);
addBanner("<a href='http://www.sevenplanet.com' target='_blank'><img border=0 alt='seven planet' src='logos/sevenplanet.gif' width='145' height='57'></a>", companybanners);
//addBanner("<a href='http://www.shishkaboom.com/' target='_blank'><img border=0 alt='ShishKaboom' src='logos/shishkaboom.gif' width='145' height='57'></a>", companybanners);
addBanner("<a href='http://www.sockittomesocks.com' target='_blank'><img border=0 alt='Sock it to Me' src='logos/sockit.gif' width='145' height='57'></a>", companybanners);
//addBanner("<a href='http://www.speakshop.com' target='_blank'><img border=0 alt='Speak Shop' src='logos/speakshop.gif' width='145' height='57'></a>", companybanners);
addBanner("<a href='http://www.supportland.com' target='_blank'><img border=0 alt='Supportland' src='logos/supportland.gif' width='145' height='57'></a>", companybanners);
addBanner("<a href='http://www.sweetspotdiabetes.com' target='_blank'><img border=0 alt='Sweet Spot Diabetes' src='logos/sweetspotdiabetes.gif' width='145' height='57'></a>", companybanners);
addBanner("<a href='http://www.showroomgarage.com' target='_blank'><img border=0 alt='Vault Brands' src='logos/vault.gif' width='145' height='57'></a>", companybanners);
// emeritus 
addBanner("<a href='http://www.versation.com/' target='_blank'><img border=0 alt='Versation' src='logos/versation.gif' width='145' height='57'></a>", companybanners);
// emeritus 
addBanner("<a href='http://www.vialanguage.com/' target='_blank'><img border=0 alt='viaLanguage' src='logos/vialanguage.gif' width='145' height='57'></a>", companybanners);
// emeritus 
addBanner("<a href='http://www.visionsite.com/' target='_blank'><img border=0 alt='VisionSite' src='logos/visionsite.gif' width='145' height='57'></a>", companybanners);
// emeritus 
addBanner("<a href='http://www.wired.md' target='_blank'><img border=0 alt='wired.MD' src='logos/wiredmd.gif' width='145' height='57'></a>", companybanners);


		companydiv = new Newdiv2(window, "companybanner", companybanners[0],0,0,145,57,0,false);
		companytype = "company"

		setInterval('doIt(companytype)',2000);
		companydiv.output();		
	}
	else {

		addBanner("<a href='http://www.pdx.edu/cecs/' target='_blank'><img border=0 alt='Maseeh College of Engineering & Computer Science at Portland State University' src='sponsors/rotate-psu_mcecs-logo.gif' width='145' height='57'></a>",sponsorbanners);
		addBanner("<a href='http://www.perkgrp.com' target='_blank'><img border=0 alt='Perkins &amp; Company' src='sponsors/rotate-perkins-logo.gif' width='145' height='57'></a>",sponsorbanners);
		addBanner("<a href='http://www.stoelrives.com' target='_blank'><img border=0 alt='Stoel Rives' src='sponsors/rotate-stoel-logo.gif' width='145' height='57'></a>",sponsorbanners);
		addBanner("<a href='http://www.umpquabank.com' target='_blank'><img border=0 alt='Umpqua' src='sponsors/rotate-umpqua-logo.gif' width='145' height='57'></a>",sponsorbanners);

		addBanner("<a href='http://www.apexcre.com' target='_blank'><img border=0 alt='Apex' src='sponsors/rotate-apex-logo.gif' width='145' height='57'></a>",sponsorbanners);
		addBanner("<a href='http://www.altolawgroup.com' target='_blank'><img border=0 alt='Alto' src='sponsors/rotate-alto-logo.gif' width='145' height='57'></a>",sponsorbanners);
		addBanner("<a href='http://www.xeniumhr.com' target='_blank'><img border=0 alt='Xenium' src='sponsors/rotate-xenium-logo.gif' width='145' height='57'></a>",sponsorbanners);
		
		sponsordiv = new Newdiv2(window, "sponsorbanner", sponsorbanners[0],0,0,145,57);
		sponsortype = "sponsor"
		
		setInterval('doIt(sponsortype)',2000);
		sponsordiv.output();
	}
}


