// attrib.js - public attribution script for ambin.com
// version: 11/1/2009
// copyright 2009 amalgamated binaries, inc., all rights reserved
var cssNode   = document.createElement('link');
cssNode.type  = 'text/css';
cssNode.rel   = 'stylesheet';
cssNode.href  = 'http://www.ambin.com/public/attrib.css';
cssNode.media = 'screen';
cssNode.title = 'dynamicLoadedSheet';
document.getElementsByTagName("head")[0].appendChild(cssNode);
function hexcheck(str)
{ var pound="#";
  var lpound=str.indexOf(pound);
  var semi=";";
  var lsemi=str.indexOf(semi);
  var lstr=str.length;
  if ((lpound==-1) || (lpound!=0)) return false;
  if (lstr<=6) return false;
  if (lstr>=9) return false;
  if ((lstr==7) && (lsemi!=-1)) return false;
  if ((lstr==8) && (lsemi!=7)) return false;
  return true;
}
function semicheck(str)
{ var semi=";";
  var lsemi=str.indexOf(semi);
  var lstr=str.length;
  if (lsemi!=(lstr-1)) return false;
  return true;
}
function attribx(x)
{ switch(x) {
  case 0: if (document.getElementById) document.getElementById('attrib').innerHTML = "&nbsp;"; break;
  default: if (document.getElementById) document.getElementById('attrib').innerHTML = "WEB SITE DESIGN BY AMALGAMATED BINARIES, INC.<br />Digital Design for the World Wide Web"; break; }
}
function attrib(c)
{ var st = '<a class="attrib" href="http://www.ambin.com" onmouseover="attribx(1);" onmouseout="attribx(0);"><img src="http://www.ambin.com/public/attrib.png" /></a><p id="attrib" class="attribtext" ';
  if (c!=0)
  {
   if (!hexcheck(c))
   { if (!semicheck(c)) { st += 'style="color:'+c+';"'; } else st += 'style="color:'+c+'"'; }
   else { if (!semicheck(c)) { st += 'style="color:'+c+';"'; } else st += 'style="color:'+c+'"'; }
  }
  st += '>&nbsp;</p>';
  document.write(st);
}

