function inverse(theString)
{
	if(theString.length<6||theString.length>6){
	window.alert('You Must Enter a six digit color code')
	document.rin.reset();
	return false;
	}
	a=theString.slice(0,2);
	b=theString.slice(2,4);
	c=theString.slice(4,6);
	a1=16*giveHex(a.slice(0,1));
	a2=giveHex(a.slice(1,2));
	a=a1+a2;
	b1=16*giveHex(b.slice(0,1));
	b2=giveHex(b.slice(1,2));
	b=b1+b2;
	c1=16*giveHex(c.slice(0,1));
	c2=giveHex(c.slice(1,2));
	c=c1+c2;
	newColor=DecToHex(255-a)+""+DecToHex(255-b)+""+DecToHex(255-c)
	myText="<center><table cellspacing='4' cellpadding='0' border='0' height='120' width='300'><tr><td bgcolor='#"
	+""+newColor+"'><center><font color='#"+theString+"' size=4>Background Color is #"+newColor+"<br>Text Color is #"+theString+"<"
	+"\/font><\/center><\/td><\/tr><tr><td bgcolor='#"+theString+"'><center><font color='#"
	+""+newColor+"' size=4>Background Color is #"+theString+"<br>Text Color is #"+newColor+"</font><\/center><\/td><\/tr><\/table><\/center>"
	stat.innerHTML=myText

}
var hexbase="0123456789ABCDEF";
function DecToHex(number) {
          return hexbase.charAt((number>> 4)& 0xf)+ hexbase.charAt(number& 0xf);
        }
function giveHex(s){
	s=s.toUpperCase();
	return parseInt(s,16);
}
	

//################################
// funtion: colorpop()
// decs: displays a pre-defined set of colors
function colorpop(numberof) {
color=open("","color","resizable=1,width=450,height=180,top=0,left=50");
color.document.write('<HTML>\n'+
'<HEAD>\n'+
'  \n'+
'\n'+
'<SCRIPT LANGUAGE="JavaScript"><!--\n'+
'// color-chart copyright 1999-2002 ricocheting <ricocheting@hotmail.com>\n'+
'// can not be used without permission\n\n'+
'function generate(){\n'+
'if(document.ok.ko.value){\n'+
'window.opener.document.myForm.'+numberof+'.value=document.ok.ko.value;}\n'+
'window.close();\n'+
'}\n'+
'//-->\n'+
'</'+'SCRIPT>\n'+
'\n'+
'</HEAD>\n'+
'<BODY>\n'+
'<SCRIPT LANGUAGE="JavaScript">\n'+
'<!--\n'+
'var HexD = new Array(\'00\', \'33\', \'66\', \'99\', \'CC\', \'FF\'); \n'+
'\n'+
'document.write(\'<center><table cellspacing=0 cellpadding=0 border=0><tr><td bgcolor="#000000"><table cellspacing=1 cellpadding=0 border=0><tr>\');\n'+
'\n'+
'for(i=0; i<=5; i++){\n'+
'\n'+
'var temp = (i%6);\n'+
'var current = HexD[temp];\n'+
'\n'+
'\n'+
'for(b_i=0; b_i<=5; b_i++){\n'+
'\n'+
'var b_temp = (b_i%6);\n'+
'var b_current = HexD[b_temp];\n'+
'\n'+
'for(c_i=0; c_i<=5; c_i++){\n'+
'\n'+
'var c_temp = (c_i%6);\n'+
'var c_current = HexD[c_temp];\n'+
'var all = c_current+\'\'+b_current+\'\'+current;\n'+
'document.write(\'<td bgcolor="#\'+all+\'">\'+\n'+
'\'<a href="javascript:void(document.ok.ko.value=\\\'\'+all+\'\\\')"><img src="colors.gif" width=10 height=10 border=0></a></td>\');\n'+
'}\n'+
'\n'+
'}\n'+
'if(i<5){document.write(\'</tr><tr>\');}\n'+
'}\n'+
'\n'+
'document.write(\'</tr></table></td></tr></table></center>\');\n'+
'\n'+
'//--> </'+'SCRIPT>\n'+
'\n'+
'<center><p>Click your mouse on the color you want to find the inverse of<br><FORM name="ok">\n'+
'  <INPUT type=text name="ko"> &nbsp; \n'+
'<input type="button" value="Save &amp; Close" onclick="generate();" \n'+
'</FORM></center>\n'+
'</BODY></HTML>\n');

}//end function colorpop()

//end -->