// JavaScript Document
/*
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 HexToDec(Input)
{

   Input = Input.toUpperCase();
   
   Input = Input.substring(1, 7);

   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;
   
   var rgb = x + '-' + y + '-' + z ;
   return rgb ;
}
*/
// create palette
function toHex(n){
	var hexChars = "0123456789ABCDEF";
	if (n == 0) return "00";
	var j, k;
	var temp = "";
	while (n != 0){
		j = n % 16;
		n = (n - j)/16;
		temp = hexChars.charAt(j) + temp;
	}
	if (temp.length < 2){
		temp = "0" + temp;
	}
	return temp;
}

function showalign(why) {
	if (why == 'yes') {
		document.getElementById('cboFontAlign').style.visibility = 'visible';
		document.getElementById('cboFontSize').style.width = '70px';
	} else {
		document.getElementById('cboFontAlign').style.visibility = 'hidden';
		document.getElementById('cboFontSize').style.width = document.getElementById('cboFontName').style.width ;
	}
}
