window.onload = commonJS;

function commonJS() {
	colorRows();
	initRolloversNew();
}

function initRolloversNew() {
	if (!document.getElementById) return
	
	var aPreLoad = new Array();
	var sTempSrc;
	elm = document.getElementsByTagName("div");

	for (var j = 0; j < elm.length; j++) {
		if (elm[j].className == 'imgover') {
			a=elm[j].getElementsByTagName("a");
			for(k=0;k<a.length;k++){
				if((aImages=a[k].getElementsByTagName("img"))!=null){
					for(i=0;i<aImages.length;i++){
						if(aImages[i].className != 'imgactive'){
							var src = aImages[i].getAttribute('src');
							var ftype = src.substring(src.lastIndexOf('.'), src.length);
							var hsrc = src.replace(ftype, '_o'+ftype);

							aImages[i].setAttribute('hsrc', hsrc);
							
							aPreLoad[i] = new Image();
							aPreLoad[i].src = hsrc;
							
							aImages[i].onmouseover = function() {
								sTempSrc = this.getAttribute('src');
								this.setAttribute('src', this.getAttribute('hsrc'));
							}	
							
							aImages[i].onmouseout = function() {
								if (!sTempSrc) sTempSrc = this.getAttribute('src').replace('_o'+ftype, ftype);
								this.setAttribute('src', sTempSrc);
							}
						}
					}
				}
			}
		}
	}
}



function colorRows() {
	table=document.getElementsByTagName("table");
	for(i=0;i<table.length;i++){
		if(table[i].className=='coloredRow'){
			tr=table[i].getElementsByTagName('tr');
			for (j=0;j<tr.length;j++) {
				if(j%2){
					tr[j].className='rowTint';
				}
			}
		}
	}
}


function flash(swf, width, height){
	document.open();
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="');
	document.write(width);
	document.write('" height="');
	document.write(height);
	document.writeln('" align="middle">');
	document.writeln('<param name="allowScriptAccess" value="sameDomain" />');
	document.write('<param name="movie" value="');
	document.write(swf);
	document.writeln('" />');
	document.writeln('<param name="quality" value="high" />');
	document.write('<embed src="');
	document.write(swf);
	document.write('" quality="high" width="');
	document.write(width);
	document.write('" height="');
	document.write(height);
	document.writeln('" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	document.writeln('</object>');
}

