// JavaScript Document
document.writeln("<script language=\"JavaScript\">");
document.writeln("<!--");
document.writeln("function statusMessageObject(p,d) {");
document.writeln("  this.msg = MESSAGE");
document.writeln("  this.out = \" \"");
document.writeln("  this.pos = POSITION");
document.writeln("  this.delay = DELAY");
document.writeln("  this.i     = 0");
document.writeln("  this.reset = clearMessage");
document.writeln("}");
document.writeln("function clearMessage() {");
document.writeln("  this.pos = POSITION");
document.writeln("}");
document.writeln("var POSITION = 2");
document.writeln("var DELAY    = 1");
document.writeln(" var MESSAGE  = \"欢迎访问★海尔空调维修★中心，北区安贞桥服务部 010-86190117 
南区洋桥南服务部 010-81212037；建议及投诉请拔打15801401472，谢谢您的合作!   \" ");
document.writeln("var scroll = new statusMessageObject()");
document.writeln("function scroller() {");
document.writeln("  for (scroll.i = 0; scroll.i < scroll.pos; scroll.i++) {");
document.writeln("    scroll.out += \" \"");
document.writeln("  }");
document.writeln("  if (scroll.pos >= 0)");
document.writeln("   scroll.out += scroll.msg");
document.writeln("  else scroll.out = scroll.msg.substring(-scroll.pos,scroll.msg.length)");
document.writeln("  window.status = scroll.out");
document.writeln("  scroll.out = \" \"");
document.writeln("  scroll.pos--");
document.writeln("  if (scroll.pos < -(scroll.msg.length)) {");
document.writeln("   scroll.reset()");
document.writeln("  }");
document.writeln("  setTimeout (\'scroller()\',scroll.delay)");
document.writeln("}");
document.writeln("function snapIn(jumpSpaces,position) {");
document.writeln("  var msg = scroll.msg");
document.writeln("  var out = \"\"");
document.writeln("  for (var i=0; i<position; i++) ");
document.writeln("    {out += msg.charAt(i)}");
document.writeln("  for (i=1;i<jumpSpaces;i++) ");
document.writeln("    {out += \" \"}");
document.writeln("  out += msg.charAt(position)");
document.writeln("  window.status = out");
document.writeln("  if (jumpSpaces <= 1) {");
document.writeln("    position++");
document.writeln("    if (msg.charAt(position) == \' \') ");
document.writeln("      {position++ }");
document.writeln("    jumpSpaces = 100-position");
document.writeln("  } else if (jumpSpaces >  3)");
document.writeln("       {jumpSpaces *= .75}");
document.writeln("  else");
document.writeln("    {jumpSpaces--}");
document.writeln("  if (position != msg.length) {");
document.writeln("    var cmd = \"snapIn(\" + jumpSpaces + \",\" + position + \")\";");
document.writeln("    scrollID = window.setTimeout(cmd,scroll.delay);");
document.writeln("  } else {");
document.writeln("    window.status=\"\"");
document.writeln("    jumpSpaces=0");
document.writeln("    position=0");
document.writeln("    cmd = \"snapIn(\" + jumpSpaces + \",\" + position + \")\";");
document.writeln("    scrollID = window.setTimeout(cmd,scroll.delay);");
document.writeln("    return false ");
document.writeln("  }");
document.writeln("  return true");
document.writeln("}");
document.writeln("snapIn(100,0);");
document.writeln("\/\/ -->");
document.writeln("<\/script>");
