﻿function go()
  { x=document.theform.nick.value;
    if (x.length<11){alert('Ошибка! Вы должны вписать ссылку с HTTP://!'); return 0;}
    y=document.location.search.substring(1,11);
    y='';
    document.theform.thelink1.value='http://www.nonym.ru/i/?'+x+''+y;
    document.theform.thelink2.value='<a href=http://www.nonym.ru/i/?'+x+''+y+'>Nonym '+x+''+y+'</a>';
    document.theform.thelink3.value='[url=http://www.nonym.ru/i/?'+x+''+y+']Nonym '+x+''+y+'[/url]';
	document.theform.thelink4.value='[url=http://www.nonym.ru/]Правильный анонимайзер[/url]';
	document.theform.thelink5.value='<a href=http://www.nonym.ru/>Правильный анонимайзер</a>';
return false;
  }
function generateCode(formName, displayIn)
  { 
	var script_path = "http://nonym.ru/addon/nonym.js";
	var keywords = document.forms[formName].elements["keywords"].value;
	keywords = keywords.replace(" ", "");
	var keywords_array = new Array();
	var the_code = "";
	keyword_array = keywords.split(",");
	the_code += "<script src=\"" +  script_path + "\" type=\"text/javascript\"></script>\n";
	the_code += "<script type=\"text/javascript\"><!--\n";
	the_code += "protected_links = \"" + keyword_array.join(", ") + "\";";
	the_code += " auto_anonymize();\n";
	the_code += "//--></script>";
	displayCode(displayIn, the_code);
  }
  function displayCode(displayIn, the_code)
 {
	var the_element = document.getElementById(displayIn);
	the_element.value = "";
	the_element.value = the_code;
 }