

var cntr1 = 0;
var cntr2 = 0;
var clrs = new Array()
clrs[0] = "BLACK";
clrs[1] = "RED";
clrs[2] = "BLUE";
clrs[3] = "PINK"; 
clrs[4] = "GREEN";
clrs[5] = "ORANGE";
clrs[6] = "YELLOW";
clrs[7] = "WHITE";
clrs[8] = "GRAY";
clrs[9] = "BROWN";
clrs[10] = "PURPLE";
clrs[11] = "WHITE";
//clrs[11] = "RED WHITE BLUE";
//clrs[12] = "PINK";
//clrs[13] = "YELLOW";
//clrs[14] = "WHITE";
//clrs[15] = "GRAY";
//clrs[16] = "BROWN";
//clrs[17] = "PURPLE";
//clrs[18] = "WHITE";
//clrs[19] = "burlywood";
//clrs[20] = "#D3BA82";
//clrs[21] = "#3F4D56";
//clrs[22] = "#676A71";
//clrs[23] = "WHITE";
/*clrs[7] = "#58443D";*/


function placeFocus() {
txt1 = window.document.getElementById("text1");
txt2 = document.getElementById("text2");
txt3 = document.getElementById("text3");
txt4 = document.getElementById("text4");
//txt5 = document.getElementById("text5");
txt6 = document.getElementById("text6");
txt7 = document.getElementById("text7");
txt8 = document.getElementById("text8");
txt9 = document.getElementById("text9");
//txt10 = document.getElementById("text10");


if (document.forms.length > 0) {
var field = document.forms[0];
for (i = 0; i < field.length; i++) {
if ((field.elements[i].type == "text") || (field.elements[i].type == "textarea") || (field.elements[i].type.toString().charAt(0) == "s")) {
document.forms[0].elements[i].focus();
break;
         }
      }
   }
}

function clickd(object)
{
 if (object.id == "ss1") {
   cntr1++;
   if (cntr1 == clrs.length) { cntr1=0;}
   object.style.borderColor=clrs[cntr1];
   clrset = document.getElementById("s1");
   clrset.options[cntr1].selected = true;
 }
 if (object.id == "ss2") {
   cntr2++;
   if (cntr2 == clrs.length) { cntr2=0;}
   object.style.borderColor=clrs[cntr2];
   clrset = document.getElementById("s2");
   clrset.options[cntr2].selected = true;
 }
 if (object.id == "s1") {
    clrset = document.getElementById("ss1");
    clrset.style.borderColor=clrs[object.selectedIndex];
    cntr1=object.selectedIndex;
 }
 if (object.id == "s2") {
    clrset = document.getElementById("ss2");
    clrset.style.borderColor=clrs[object.selectedIndex];
    cntr2=object.selectedIndex;
 }
}

function check(object,lin)
{

 text=centline(object,lin);
 len = text.length;

 text = text.substring(0,object.maxLength);
 if (len==object.maxLength) {
 	alert("Maximum length "+object.maxLength+" characters reached");
 }
 var goodChars="ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789&'.-,#@*:/+$%?";
 goodChars=goodChars+(String.fromCharCode(160));
 text = text.toUpperCase();
 for(var i=0; i<len; i++) {
  for(var j=0; j<goodChars.length; j++) {
   if(goodChars.charAt(j)==text.charAt(i)) {
    break;
   }
   else {
    if(j==(goodChars.length-1)) {
      alert( text.charAt(i)+"  NOT Available");
 	text = text.substring(0,i)+text.substring(i+1,len--);
	i--;
    }
   } 
  }
 }
 object.value = text;
 if (object.name == "Line1") {txt1.innerHTML = text;}
 if (object.name == "Line2") {txt2.innerHTML = text;}
 if (object.name == "Line3") {txt3.innerHTML = text;}
 if (object.name == "Line4") {txt4.innerHTML = text;}
 //if (object.name == "option5|L5") {txt5.innerHTML = text;}
 /*if (object.name == "Line6") {txt6.innerHTML = text;}
 if (object.name == "Line7") {txt7.innerHTML = text;}
 if (object.name == "Line8") {txt8.innerHTML = text;}
 if (object.name == "Line9") {txt9.innerHTML = text;}*/
// if (object.name == "option11|L5") {txt10.innerHTML = text;}
}

function centline2323(object,lin){
  cid=document.getElementById(("c"+lin));
  txtset = document.getElementById("l"+lin);
  results = txtset.value;
  len = Math.floor((15-results.length)/2);
  reptxt = /^\xA0*/igm;
  
  if (cid.checked) 
  {
	cid.value = "on";
      results = results.replace(reptxt, '');
	for(var i=0; i<len; i++) 
	{
    		results = String.fromCharCode(80)+results;
	}
  }
    else 
  {
	if (cid.value == "on") 
	{
		cid.value = "off";
      	results = results.replace(reptxt, '');
	}
  }

    
//  results = txtset.value + len;
  return(results);
}



function centline(object,lin){
  cid=document.getElementById(("c"+lin));
  txtset = document.getElementById("l"+lin);
  results = txtset.value;
  reptxt = /^\xA0*/igm;

///////////////////////////////////////
///////////////////////////////////////

if(navigator.appName.toUpperCase()=="MICROSOFT INTERNET EXPLORER")
{
  if (cid.checked) 
  {
	cid.value = "on";
    results = results.replace(reptxt, '');
	len = Math.floor((15-results.length)/2);
	for(var i=0; i<len; i++) 
	{
    	results = String.fromCharCode(160)+results;
	}
  }
  else 
  {
	if (cid.value == "on") 
	{
		cid.value = "off";
      	results = results.replace(reptxt, '');
	}
  }
}

///////////////////////////////////////
///////////////////////////////////////


  return(results);
}

function ordersp() {
  for(var i=1; i<11; i++) {
	txtset = document.getElementById("l"+i);
	results = txtset.value;
	reptxt = /\xA0/igm;
	results = results.replace(reptxt, '^');
	txtset.value = results;
  }
}

function noenter() {
  if (window.event && window.event.keyCode == 13)
    {return !(window.event && window.event.keyCode == 13);}
  if (window.event.keyCode >= 97 && window.event.keyCode <= 122)
    {window.event.keyCode = window.event.keyCode-32;}
  if (window.event.keyCode == 32)
    {window.event.keyCode = 160;}
}

