Location: PHPKode > projects > PBBoard > PBBoard_v2.1.4/Upload/look/styles/forum/main/templates/gradient_form.tpl
<style>
select, input { font-size:8pt; font-family:tahoma;}
</style>
<script language="javascript">
// 1001 Astuces hide@address.com , la Source JavaScript!!
// http://www.namani.net
var browser = "unknown";
var version = 0;
if (navigator.userAgent.indexOf("Opera") >= 0)
 browser = "opera";
else if (navigator.userAgent.indexOf("obot") >= 0)
 browser = "robot";
else if (navigator.appName.indexOf("etscape") >= 0)
 browser = "netscape";
else if (navigator.appName.indexOf("icrosoft") >= 0)
 browser = "msie";
version = parseFloat(navigator.appVersion);
if (isNaN(version)) version = 0;
if ((browser == "msie")&&(version == 2)) version = 3;
var tohex = new Array(256);
var hex = "0123456789ABCDEF";
var count = 0;
for (x=0; x<16; x++) {
 for (y=0; y<16; y++) {
 tohex[count] = hex.charAt(x) + hex.charAt(y);
 count++;
 }
}
function ColorCode(hexcode) {
  if (hexcode.length == 7) {
    this.r = parseInt(hexcode.substring(1,3),16);
    this.g = parseInt(hexcode.substring(3,5),16);
    this.b = parseInt(hexcode.substring(5,7),16);
  }
  else if (hexcode.length == 6) {
    this.r = parseInt(hexcode.substring(0,2),16);
    this.g = parseInt(hexcode.substring(2,4),16);
    this.b = parseInt(hexcode.substring(4,6),16);
  }
  else {
    this.r = this.g = this.b = 0;
    alert("Error: ColorCode constructor failed");
  }
  if (isNaN(this.r)||isNaN(this.g)||isNaN(this.b))
    alert("Error: ColorCode constructor failed");
}
function ColorList(hexcodes) {
  var i = 0;
  var c = 0;
  this.codes = new Array(Math.round(hexcodes.length/7));
  while (i < hexcodes.length) {
    if (isNaN(parseInt(hexcodes.substring(i,i+6),16))) ++i;
    else {
      this.codes[c] = new ColorCode(hexcodes.substring(i,i+6));
      i += 7;
      ++c;
    }
  }
  this.len = c;
}
function interpolate (x1, y1, x3, y3, x2) {
  if (x3 == x1) return y1
  else return (x2-x1)*(y3-y1)/(x3-x1) + y1
}
function lowcolorindex (x, y, z) {
  if (y == 1) return 0
  else return Math.floor( (x*(z-1))/(y-1) )
}
function hicolorindex (x, y, z, low) {
  if ( low*(y-1) == x*(z-1) ) return low
  else if (y == 1) return 0
  else return Math.floor( (x*(z-1))/(y-1) + 1 )
}
function gradient(thetext) {
  var grad="";
  var thecolors=getValue(clr1);
  thecolors+=getValue(clr2);
  thecolors+=getValue(clr3);
  thecolors+=getValue(clr4);
  thecolors+=getValue(clr5);
  thecolors=thecolors.substr(1);
  if (((browser == "netscape")||(browser == "msie")||(browser == "opera"))&&(version>=3.0)) {
    var colors = new ColorList(thecolors);
    if (colors.len<2) return  thetext;
    var numcolors = colors.len;
    var numchars = thetext.length;
    var rr = 0;
    var gg = 0;
    var bb = 0;
    var lci = 0; //lower color index
    var hci = 0; //high color index
    for (i=0; i<numchars; ++i) {
      lci = lowcolorindex(i, numchars, numcolors);
      hci = hicolorindex(i, numchars, numcolors, lci);
      rr = Math.round(interpolate( lci/(numcolors-1), colors.codes[lci].r, hci/(numcolors-1), colors.codes[hci].r, i/(numchars-1)));
      gg = Math.round(interpolate( lci/(numcolors-1), colors.codes[lci].g, hci/(numcolors-1), colors.codes[hci].g, i/(numchars-1)));
      bb = Math.round(interpolate( lci/(numcolors-1), colors.codes[lci].b, hci/(numcolors-1), colors.codes[hci].b, i/(numchars-1)));
      if (browser == "opera") {
        rr = 255 - rr;
        gg = 255 - gg;
        bb = 255 - bb;
      }
        grad+=thetext.charAt(i).fontcolor(tohex[rr]+tohex[gg]+tohex[bb]);
    }
  }
  else
    grad=thetext;
  return grad;
}
// 1001 Astuces hide@address.com -->
function gradient_template() {
  var i, t=template.options[template.selectedIndex].value.split(",");
  clr1.selectedIndex=t[0];
  clr2.selectedIndex=t[1];
  clr3.selectedIndex=t[2];
  clr4.selectedIndex=t[3];
  clr5.selectedIndex=t[4];
  template.selectedIndex=0;
  gradient_preview();
}
function getValue(clr) {
  if (clr.options[clr.selectedIndex].value=="")
    return "";
  else
    return " "+clr.options[clr.selectedIndex].value;
}
function gradient_preview() {
  preview.innerHTML="<FONT FACE=arial SIZE=4><B>"+gradient("{$lang['Preview_gradation']}")+"</B></FONT>";
}
function gradient_accept() {
  var r = clr1.value + " " + clr2.value + " " + clr3.value + " " + clr4.value + " " + clr5.value;
  r = r.replace(/^[ ]+/, "").replace(/[ ]+$/, "")
  window.returnValue = r;
  window.close();
}
</script>
</head>
<body  bgcolor="#D9DDDC">
<table id="frm" align="center" border="0"><tr><td align="center" nowrap>
		<select style="width:40px" id="clr1" onchange="document.body.focus();gradient_preview();">
		    <option value="">x
            <option value="000000" style="background-color:black"></option>
            <option value="FFFFFF" style="background-color:white"></option>
            <option value="00BFFF" style="background-color:skyblue"></option>
			<option value="4169E1" style="background-color:royalblue"></option>
			<option value="0000FF" style="background-color:blue"></option>
			<option value="00008B" style="background-color:darkblue"></option>
			<option value="FFA500" style="background-color:orange"></option>
			<option value="FF6347" style="background-color:tomato"></option>
			<option value="FF7F50" style="background-color:coral"></option>
			<option value="FF4500" style="background-color:orangered"></option>
			<option value="DC143C" style="background-color:crimson"></option>
			<option value="FF0000" style="background-color:red"></option>
			<option value="B22222" style="background-color:firebrick"></option>
			<option value="8B0000" style="background-color:darkred"></option>
			<option value="008000" style="background-color:green"></option>
			<option value="32CD32" style="background-color:limegreen"></option>
			<option value="2E8B57" style="background-color:seagreen"></option>
			<option value="FF1493" style="background-color:deeppink"></option>
			<option value="800080" style="background-color:purple"></option>
			<option value="4B0082" style="background-color:indigo"></option>
			<option value="DEB887" style="background-color:burlywood"></option>
			<option value="F4A460" style="background-color:sandybrown"></option>
			<option value="A0522D" style="background-color:sienna"></option>
			<option value="D2691E" style="background-color:chocolate"></option>
			<option value="008080" style="background-color:teal"></option>
			<option value="C0C0C0" style="background-color:silver"></option>
            <option value="808080" style="background-color:gray"></option>
        </select>
		<select style="width:40px" id="clr2" onchange="document.body.focus();gradient_preview();">
		    <option value="">x
            <option value="000000" style="background-color:black" ></option>
            <option value="FFFFFF" style="background-color:white"></option>
            <option value="00BFFF" style="background-color:skyblue"></option>
			<option value="4169E1" style="background-color:royalblue"></option>
			<option value="0000FF" style="background-color:blue"></option>
			<option value="00008B" style="background-color:darkblue"></option>
			<option value="FFA500" style="background-color:orange"></option>
			<option value="FF6347" style="background-color:tomato"></option>
			<option value="FF7F50" style="background-color:coral"></option>
			<option value="FF4500" style="background-color:orangered"></option>
			<option value="DC143C" style="background-color:crimson"></option>
			<option value="FF0000" style="background-color:red"></option>
			<option value="B22222" style="background-color:firebrick"></option>
			<option value="8B0000" style="background-color:darkred"></option>
			<option value="008000" style="background-color:green"></option>
			<option value="32CD32" style="background-color:limegreen"></option>
			<option value="2E8B57" style="background-color:seagreen"></option>
			<option value="FF1493" style="background-color:deeppink"></option>
			<option value="800080" style="background-color:purple"></option>
			<option value="4B0082" style="background-color:indigo"></option>
			<option value="DEB887" style="background-color:burlywood"></option>
			<option value="F4A460" style="background-color:sandybrown"></option>
			<option value="A0522D" style="background-color:sienna"></option>
			<option value="D2691E" style="background-color:chocolate"></option>
			<option value="008080" style="background-color:teal"></option>
			<option value="C0C0C0" style="background-color:silver"></option>
            <option value="808080" style="background-color:gray"></option>
        </select>
		<select style="width:40px" id="clr3" onchange="document.body.focus();gradient_preview();">
		    <option value="">x
            <option value="000000" style="background-color:black" ></option>
            <option value="FFFFFF" style="background-color:white"></option>
            <option value="00BFFF" style="background-color:skyblue"></option>
			<option value="4169E1" style="background-color:royalblue"></option>
			<option value="0000FF" style="background-color:blue"></option>
			<option value="00008B" style="background-color:darkblue"></option>
			<option value="FFA500" style="background-color:orange"></option>
			<option value="FF6347" style="background-color:tomato"></option>
			<option value="FF7F50" style="background-color:coral"></option>
			<option value="FF4500" style="background-color:orangered"></option>
			<option value="DC143C" style="background-color:crimson"></option>
			<option value="FF0000" style="background-color:red"></option>
			<option value="B22222" style="background-color:firebrick"></option>
			<option value="8B0000" style="background-color:darkred"></option>
			<option value="008000" style="background-color:green"></option>
			<option value="32CD32" style="background-color:limegreen"></option>
			<option value="2E8B57" style="background-color:seagreen"></option>
			<option value="FF1493" style="background-color:deeppink"></option>
			<option value="800080" style="background-color:purple"></option>
			<option value="4B0082" style="background-color:indigo"></option>
			<option value="DEB887" style="background-color:burlywood"></option>
			<option value="F4A460" style="background-color:sandybrown"></option>
			<option value="A0522D" style="background-color:sienna"></option>
			<option value="D2691E" style="background-color:chocolate"></option>
			<option value="008080" style="background-color:teal"></option>
			<option value="C0C0C0" style="background-color:silver"></option>
            <option value="808080" style="background-color:gray"></option>
        </select>
		<select style="width:40px" id="clr4" onchange="document.body.focus();gradient_preview();">
		    <option value="">x
            <option value="000000" style="background-color:black" ></option>
            <option value="FFFFFF" style="background-color:white"></option>
            <option value="00BFFF" style="background-color:skyblue"></option>
			<option value="4169E1" style="background-color:royalblue"></option>
			<option value="0000FF" style="background-color:blue"></option>
			<option value="00008B" style="background-color:darkblue"></option>
			<option value="FFA500" style="background-color:orange"></option>
			<option value="FF6347" style="background-color:tomato"></option>
			<option value="FF7F50" style="background-color:coral"></option>
			<option value="FF4500" style="background-color:orangered"></option>
			<option value="DC143C" style="background-color:crimson"></option>
			<option value="FF0000" style="background-color:red"></option>
			<option value="B22222" style="background-color:firebrick"></option>
			<option value="8B0000" style="background-color:darkred"></option>
			<option value="008000" style="background-color:green"></option>
			<option value="32CD32" style="background-color:limegreen"></option>
			<option value="2E8B57" style="background-color:seagreen"></option>
			<option value="FF1493" style="background-color:deeppink"></option>
			<option value="800080" style="background-color:purple"></option>
			<option value="4B0082" style="background-color:indigo"></option>
			<option value="DEB887" style="background-color:burlywood"></option>
			<option value="F4A460" style="background-color:sandybrown"></option>
			<option value="A0522D" style="background-color:sienna"></option>
			<option value="D2691E" style="background-color:chocolate"></option>
			<option value="008080" style="background-color:teal"></option>
			<option value="C0C0C0" style="background-color:silver"></option>
            <option value="808080" style="background-color:gray"></option>
        </select>
		<select style="width:40px" id="clr5" onchange="document.body.focus();gradient_preview();">
		    <option value="">x
            <option value="000000" style="background-color:black" ></option>
            <option value="FFFFFF" style="background-color:white"></option>
            <option value="00BFFF" style="background-color:skyblue"></option>
			<option value="4169E1" style="background-color:royalblue"></option>
			<option value="0000FF" style="background-color:blue"></option>
			<option value="00008B" style="background-color:darkblue"></option>
			<option value="FFA500" style="background-color:orange"></option>
			<option value="FF6347" style="background-color:tomato"></option>
			<option value="FF7F50" style="background-color:coral"></option>
			<option value="FF4500" style="background-color:orangered"></option>
			<option value="DC143C" style="background-color:crimson"></option>
			<option value="FF0000" style="background-color:red"></option>
			<option value="B22222" style="background-color:firebrick"></option>
			<option value="8B0000" style="background-color:darkred"></option>
			<option value="008000" style="background-color:green"></option>
			<option value="32CD32" style="background-color:limegreen"></option>
			<option value="2E8B57" style="background-color:seagreen"></option>
			<option value="FF1493" style="background-color:deeppink"></option>
			<option value="800080" style="background-color:purple"></option>
			<option value="4B0082" style="background-color:indigo"></option>
			<option value="DEB887" style="background-color:burlywood"></option>
			<option value="F4A460" style="background-color:sandybrown"></option>
			<option value="A0522D" style="background-color:sienna"></option>
			<option value="D2691E" style="background-color:chocolate"></option>
			<option value="008080" style="background-color:teal"></option>
			<option value="C0C0C0" style="background-color:silver"></option>
            <option value="808080" style="background-color:gray"></option>
        </select>&nbsp;
        <select id="template" onchange="document.body.focus();gradient_template();">
           <option value="3,4,5,0,0">{$lang['Choose_the_design_is_ready']}
           <option value="3,4,5,0,0">1
           <option value="14,12,9,0,0">2
           <option value="6,8,15,20,0">3
           <option value="21,24,23,0,0">4
		   <option value="10,20,5,1,22">5
        </select>
<p id="preview" align="center">{$lang['Preview_gradation']}</p>
<input type=button value="{$lang['Ok']}" onclick="gradient_accept()">&nbsp;
<input type=button value="{$lang['Cancel']}" onclick="window.close();">
</td></tr></table>
<script>
  template.selectedIndex=3;
  gradient_template();
</script>
Return current item: PBBoard