<!--

var colors = new Array('00','33','66','99','CC','FF');
var color_palettes = [];


function runClock() {
	theTime = window.setTimeout("runClock()",100);
	var today = new Date();
	var display=  "   .::  ::.   " + "--" + today.toLocaleString() + "--"; 
	status=display;
}

function buka_jendela1(alamat_url, lebar, tinggi)
{
	var_parameter="toolbar=no, location=no, directories=no, menubar=no, status=yes, resizable=no, width=" + lebar + ", height=" + tinggi + "";

	window.open(alamat_url, "", var_parameter)
}

function buka_jendela2(alamat_url)
{
	var_parameter="toolbar=no, location=no, directories=no, menubar=no, scrollbars=yes, status=yes, resizable=yes";

	window.open(alamat_url, "", var_parameter)
}

function tutup_jendela()
{
	window.close()
}

function toggleon(id)
{
	  var elm = document.getElementById(id);
	  var disp = elm.style.display;
	  //elm.style.display = (!disp || disp == "")? "none" : "";

      elm.style.display = "";
}

function toggleoff(id)
{
	  var elm = document.getElementById(id);
	  var disp = elm.style.display;
	  //elm.style.display = (!disp || disp == "")? "none" : "";

     elm.style.display = "none";
}


function closePalette(id)
{
	var elm = document.getElementById(id);
	if (!elm) return;
	elm.style.display="none";
}

function showPalette(id)
{
	var elm = document.getElementById(id);
	if (!elm) return;
	elm.style.display="block";
}

function closeAllPalettes()
{
	for (var i=0; i<color_palettes.length; i++)
	{
		closePalette(color_palettes[i]);
	}
}

function colorPalette(id)
{
	var seq = color_palettes.length;
	if (!id) id = "MonxShop_" + seq;
	var clickhandler = id + "_OnSelect";
	var mousehandler = id + "_OnMouseOver";

	document.write('<table cellspacing="0" cellpadding="0" class="palette" id="' + id + '">');
	for (i = 5; i >= 0; i--) {
		document.write('<tr>');
		for (j = 5; j >= 0; j--) {
			for (k= 5; k >= 0; k--) {
				var col = colors[i]+colors[j]+colors[k];

				var a = '<td nowrap="true" style="background: #'+col+';">' +
				'<a href="#" class="nothing" title="'+ col + '" ' + 


				'onclick="if (typeof(' + clickhandler + ') != \'undefined\') {' + 
				clickhandler + '(this)}; closePalette(\'' + id + 
				'\'); return false;" ' +

				
				'onmouseover="if (typeof(' + mousehandler + ') != \'undefined\') {' + 
				mousehandler + '(this)};" ' +

				'></a><\/td>';

				document.write(a);
			}
		}
		document.write('<\/tr>');
	}
	document.write('<\/table>');

	color_palettes[seq] = id;
}


function HexToDec()
{
   Input = window.document.forms['Warna'].elements['HexInput'].value;
   Input = Input.toUpperCase();

   a = GiveDec(Input.substring(0, 1));
   b = GiveDec(Input.substring(1, 2));
   c = GiveDec(Input.substring(2, 3));
   d = GiveDec(Input.substring(3, 4));
   e = GiveDec(Input.substring(4, 5));
   f = GiveDec(Input.substring(5, 6));

   x = (a * 16) + b;
   y = (c * 16) + d;
   z = (e * 16) + f;

   window.document.forms['Warna'].elements['RedOutput'].value = x;
   window.document.forms['Warna'].elements['GreenOutput'].value = y;
   window.document.forms['Warna'].elements['BlueOutput'].value = z;
}


function DecToHex()
{
   Red = window.document.forms['Warna'].elements['RedInput'].value;
   Green = window.document.forms['Warna'].elements['GreenInput'].value;
   Blue = window.document.forms['Warna'].elements['BlueInput'].value;

   a = GiveHex(Math.floor(Red / 16));
   b = GiveHex(Red % 16);
   c = GiveHex(Math.floor(Green / 16));
   d = GiveHex(Green % 16);
   e = GiveHex(Math.floor(Blue / 16));
   f = GiveHex(Blue % 16);

   z = a + b + c + d + e + f;

   window.document.forms['Warna'].elements['HexOutput'].value = z;
}

function GiveDec(Hex)
{
   if(Hex == "A")
      Value = 10;
   else
   if(Hex == "B")
      Value = 11;
   else
   if(Hex == "C")
      Value = 12;
   else
   if(Hex == "D")
      Value = 13;
   else
   if(Hex == "E")
      Value = 14;
   else
   if(Hex == "F")
      Value = 15;
   else
      Value = eval(Hex)
   return Value;
}

function GiveHex(Dec)
{
   if(Dec == 10)
      Value = "A";
   else
   if(Dec == 11)
      Value = "B";
   else
   if(Dec == 12)
      Value = "C";
   else
   if(Dec == 13)
      Value = "D";
   else
   if(Dec == 14)
      Value = "E";
   else
   if(Dec == 15)
      Value = "F";
   else
      Value = "" + Dec;
   return Value;
}

// -->