<html>
<head>
<title>OrenWeb Чат</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
<link rel="STYLESHEET" type="text/css" href="http://chat/designes/rozmova/style.css">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251"></head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" rightmargin="0" bottommargin="0" marginwidth="0" marginheight="0">
<SCRIPT src="http://chat/designes/rozmova/tabsheets.js"></SCRIPT><LINK rel="stylesheet" type="text/css" href="http://chat/designes/rozmova/tabsheets.css"/> <DT>Дополнительные возможности</DT>
<DD>
<DIV class="reducer">
<TABLE>
<TR>
<TD><STRONG>Возможности:</STRONG>
</TD>
</TR> <TR>
<TD nowrap><script>
function AnimationIterator(strElementName , fForvard , r1 , g1 , b1 , r2, g2, b2 , nMilliSecondsTimeout)
{
var currentElement = null;
var nAnimationCounter = 0;
var nFinalElement = arrayColorsHolder[strElementName].length - 1;
var fInnerDirection = null;
//Define the moving direction
if(fForvard)
{
fInnerDirection = !arrayAnimationDirectionHolder[strElementName];
}
else
{
fInnerDirection = arrayAnimationDirectionHolder[strElementName];
}
nAnimationCounter = arrayAnimationCountersHolder[strElementName];
for(var j = 0; j <= nFinalElement ; j++ )
{
//Get element within the text container
currentElement = document.getElementById(strElementName + '_animated_child_' + j);
if(currentElement) // if current element exists
{
//set span's color
currentElement.style.color = 'rgb(' +
arrayColorsHolder[strElementName][nAnimationCounter]['red'] + ','+
arrayColorsHolder[strElementName][nAnimationCounter]['green'] + ','+
arrayColorsHolder[strElementName][nAnimationCounter]['blue'] +
')';
// Rule of painting. -- BEGIN
if(fInnerDirection)
{
if(nAnimationCounter < nFinalElement )
{
nAnimationCounter ++ ;
}
else
{
fInnerDirection = ! fInnerDirection;
}
}
else
{
if(nAnimationCounter > 0 )
{
nAnimationCounter --;
}
else
{
fInnerDirection = ! fInnerDirection;
}
}
// Rule of painting. -- END
}
else
{
window.status = 'Text container "' + strElementName + '" is modified or not initialized';
return;
}
}
// Rule of painting. -- BEGIN
if(arrayAnimationDirectionHolder[strElementName])
{
if(arrayAnimationCountersHolder[strElementName] < nFinalElement )
{
arrayAnimationCountersHolder[strElementName] ++ ;
}
else
{
arrayAnimationDirectionHolder[strElementName] = ! arrayAnimationDirectionHolder[strElementName];
}
}
else
{
if(arrayAnimationCountersHolder[strElementName] > 0 )
{
arrayAnimationCountersHolder[strElementName] --;
}
else
{
arrayAnimationDirectionHolder[strElementName] = ! arrayAnimationDirectionHolder[strElementName];
}
}
// Rule of painting. -- END
//Launch the next iteration
if(nMilliSecondsTimeout > 0 )
{
window.setTimeout('AnimationIterator("' +
strElementName +
'", '+ fForvard.toString() +
', ' + r1.toString() +
', ' + g1.toString() +
', ' + b1.toString() +
', ' + r2.toString() +
', ' + g2.toString() +
', ' + b2.toString() +
', ' + nMilliSecondsTimeout.toString() +
' )', nMilliSecondsTimeout);
}
}
function parse_rgb(rgb){
var r=0;
var g=0;
var b=0;
// alert(rgb.charAt(1));
r=hexToDec(rgb.charAt(1)+rgb.charAt(2));
g=hexToDec(rgb.charAt(2)+rgb.charAt(3));
b=hexToDec(rgb.charAt(4)+rgb.charAt(5));
}
var convert = new Array();
var hexbase = new Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F");
var value=0;
for (x=0; x<16; x++)
for (y=0; y<16; y++) {
convert[value] = hexbase[x] + hexbase[y];
value++;
}
function hexToDec(hex){
value=0;
while (true){
if (convert[value].toUpperCase()== hex.toUpperCase()) break;
value++;
}
return value;
}
function redraw(start_c,end_c){
ColorGradientText('tested_disp',hexToDec(start_c.charAt(1)+start_c.charAt(2)),hexToDec(start_c.charAt(3)+start_c.charAt(4)),hexToDec(start_c.charAt(5)+start_c.charAt(6)),hexToDec(end_c.charAt(1)+end_c.charAt(2)),hexToDec(end_c.charAt(3)+end_c.charAt(4)),hexToDec(end_c.charAt(5)+end_c.charAt(6)));
}
var arrayColorsHolder = new Array();
var arrayAnimationDirectionHolder = new Array();
var arrayAnimationCountersHolder = new Array();
function ColorGradientText(strElementName , r1 , g1 , b1 , r2, g2, b2)
{
var textContainer = document.getElementById(strElementName);
if(textContainer === null)
{
window.status += 'Text container "' + strElementName + '" is not defined.';
return;
}
var strText = textContainer.innerText || textContainer.textContent ;
if(!strText)
{
window.status += 'Text container "' + strElementName + '" is empty.';
return;
}
arrayColorsHolder [strElementName] = new Array();
var nLetersCount = strText.length;
// Define steps for creating color gradient
var steps = new Array ();
steps['red'] = (r2 - r1) / nLetersCount ;
steps['green'] = (g2 - g1) / nLetersCount ;
steps['blue'] = (b2 - b1) / nLetersCount ;
// Generate array of color values
for( var i = 0; i < strText.length ; i++ )
{
arrayColorsHolder[strElementName][i] = new Array();
arrayColorsHolder[strElementName][i]['red'] = Math.round(r1 + steps['red']*i) ;
arrayColorsHolder[strElementName][i]['green'] = Math.round(g1 + steps['green']*i);
arrayColorsHolder[strElementName][i]['blue'] = Math.round(b1 + steps['blue']*i) ;
}
// Set initial values for harmonic oscillations emulator
arrayAnimationDirectionHolder[strElementName] = true;
arrayAnimationCountersHolder [strElementName] = 0;
//Split original string. Result of this operation is the chain of span elements.
var strResultString = '';
for(var j = 0; j < strText.length ; j++ )
{
strResultString += '<span id="'+
strElementName + '_animated_child_' + j +
'" >' + strText.charAt(j) +'</span>';
}
//Fill container by <span>s
document.getElementById(strElementName).innerHTML = "<b>"+strResultString+"</b>";
AnimationIterator(strElementName , 0, r1 , g1 , b1 , r2, g2, b2 , 0);
}
</script>
<form action="act_submit.php" method="post" name="actions">
<input type="Hidden" name="action_name" value="gradient">
<input type="Hidden" name="param[set]" value="1">
<input type="Hidden" name="session" value="497ac75fe19c4dd579a4da17eb542c12">
<table>
<tr>
<td colspan="2"><b>Градиентный цвет текста</b></td>
</tr>
<tr>
<td colspan="2">(задается 1 раз)</td>
</tr>
<tr>
<td>Стартовый цвет:</td>
<td><select name="start_color" style="{width:70px;height: 25px;}" onchange="redraw(this.options[this.selectedIndex].style.backgroundColor,end_color.options[end_color.selectedIndex].style.backgroundColor);">
<option value="0" selected style="background:maroon; color:maroon">Бордовый</option>
<option value="1" style="background:#0066FF; color:#0066FF">Небесный</option>
<option value="2" style="background:tan; color:tan">Загар</option>
<option value="3" style="background:green; color:green">Зеленый</option>
<option value="4" style="background:firebrick; color:firebrick">Кирпичный</option>
<option value="5" style="background:lightcoral; color:lightcoral">Кораловый</option>
<option value="6" style="background:brown; color:brown">Коричневый</option>
<option value="7" style="background:red; color:red">Красный</option>
<option value="8" style="background:#DAA520; color:#DAA520">Золотой</option>
<option value="9" style="background:salmon; color:salmon">Лосось</option>
<option value="10" style="background:seagreen; color:seagreen">Морской волны</option>
<option value="11" style="background:olive; color:olive">Оливковый</option>
<option value="12" style="background:darkorange; color:darkorange">Оранжевый</option>
<option value="13" style="background:orchid; color:orchid">Орхидея</option>
<option value="14" style="background:peru; color:peru">Перу</option>
<option value="15" style="background:purple; color:purple">Пурпуровый</option>
<option value="16" style="background:deeppink; color:deeppink">Розовый</option>
<option value="17" style="background:gray; color:gray">Серый</option>
<option value="18" style="background:blue; color:blue">Синий</option>
<option value="19" style="background:plum; color:plum">Слива</option>
<option value="20" style="background:blueviolet; color:blueviolet">Фиолетовый</option>
<option value="21" style="background:magenta; color:magenta">Фуксин</option>
<option value="22" style="background:#008080; color:#008080">Бирюзовый</option>
<option value="23" style="background:black; color:black">Основной</option>
<option value="24" style="background:chocolate; color:chocolate">Шоколадный</option>
<option value="25" style="background:#000080; color:#000080">Темно-синий</option>
</select>
</td>
<td>Конечный цвет:</td>
<td><select name="end_color" style="{width:70px;height: 25px;}" onchange="redraw(start_color.options[start_color.selectedIndex].style.backgroundColor,this.options[this.selectedIndex].style.backgroundColor);">
<option value="0" selected style="background:maroon; color:maroon">Бордовый</option>
<option value="1" style="background:#0066FF; color:#0066FF">Небесный</option>
<option value="2" style="background:tan; color:tan">Загар</option>
<option value="3" style="background:green; color:green">Зеленый</option>
<option value="4" style="background:firebrick; color:firebrick">Кирпичный</option>
<option value="5" style="background:lightcoral; color:lightcoral">Кораловый</option>
<option value="6" style="background:brown; color:brown">Коричневый</option>
<option value="7" style="background:red; color:red">Красный</option>
<option value="8" style="background:#DAA520; color:#DAA520">Золотой</option>
<option value="9" style="background:salmon; color:salmon">Лосось</option>
<option value="10" style="background:seagreen; color:seagreen">Морской волны</option>
<option value="11" style="background:olive; color:olive">Оливковый</option>
<option value="12" style="background:darkorange; color:darkorange">Оранжевый</option>
<option value="13" style="background:orchid; color:orchid">Орхидея</option>
<option value="14" style="background:peru; color:peru">Перу</option>
<option value="15" style="background:purple; color:purple">Пурпуровый</option>
<option value="16" style="background:deeppink; color:deeppink">Розовый</option>
<option value="17" style="background:gray; color:gray">Серый</option>
<option value="18" style="background:blue; color:blue">Синий</option>
<option value="19" style="background:plum; color:plum">Слива</option>
<option value="20" style="background:blueviolet; color:blueviolet">Фиолетовый</option>
<option value="21" style="background:magenta; color:magenta">Фуксин</option>
<option value="22" style="background:#008080; color:#008080">Бирюзовый</option>
<option value="23" style="background:black; color:black">Основной</option>
<option value="24" style="background:chocolate; color:chocolate">Шоколадный</option>
<option value="25" style="background:#000080; color:#000080">Темно-синий</option>
</select>
</td>
<Td id="tested_disp"><strong>Съешь еще этих мягких французских булочек</strong></TD>
<Td><input type="Submit" class="input_button" value="OK"></TD>
</tr>
</table>
</form>
</TD>
</TR> </TABLE></div>
</dd><SCRIPT>function shop_submit(itemID,what){
document.shop.itemID.value=itemID;
document.shop.what.value=what;
document.shop.submit();
}
</SCRIPT>
</body>
</html>