////////////////////////////////////////////////////////////////////////////////
// Copyright © 2001-2003, OneRiver Media
//
// new_window.js
//
// Main Site Version 1.0 - launch date: 01.21.02
// Codec Page Version 4.0 - original launch date: 02.18.02
// All imagery and content property of OneRiver Media
////////////////////////////////////////////////////////////////////////////////


/**
  * You may use this code for free on any web page provided that 
  * these comment lines and the following credit remain in the code.
  * textBar2 color fader from http://www.javascript-fx.com
  */
function getColor(start, end, percent){
	function hex2dec(hex){return(parseInt(hex,16));}
	function dec2hex(dec){return (dec < 16 ? "0" : "") + dec.toString(16);}
	var pc = percent/100;
	var r1 = hex2dec(start.slice(0,2)), g1=hex2dec(start.slice(2,4)), b1=hex2dec(start.slice(4,6));
	var r2 = hex2dec(end.slice(0,2)),   g2=hex2dec(end.slice(2,4)),   b2=hex2dec(end.slice(4,6));
	var r  = Math.floor(r1+(pc*(r2-r1)) + .5), g= Math.floor(g1+(pc*(g2-g1)) + .5), b= Math.floor(b1+(pc*(b2-b1)) + .5);
	return("#" + dec2hex(r) + dec2hex(g) + dec2hex(b));
}
function textBar2(theText, c1, c2){
	var str = "", l2 = theText.length/2;
	for(var x=0 ; x<l2 ; x++)
		str += "<font color='" + getColor(c1, c2, Math.floor(100*x/l2)) +"'>"+theText.charAt(x)+"</font>";
	for(var x=l2; x<theText.length ; x++)
		str += "<font color='" + getColor(c2, c1, Math.floor(100*(x-l2)/l2)) +"'>"+theText.charAt(x)+"</font>";
	return str;
}