if (typeof mi18nSenderName == null)
	mi18nSenderName = 'Your name';
	
if (typeof mi18nSenderMail == null)
	mi18nSenderMail = 'Your e-mail';

if (typeof mi18nReceipName == null)
	mi18nReceipName = 'Receipient\'s name';

if (typeof mi18nReceipMail == null)
	mi18nReceipMail = 'Receipient\'s e-mail';

if (typeof mi18nNote == null)
	mi18nNote = 'Note';


function initBox() {
	var container = document.createElement("div");
	container.id = 'container';
	
	document.getElementsByTagName('body')[0].appendChild(container);
}

function destroyBox() {
	if (document.getElementById('container') == null)
		return;
	
	new Effect.SlideUp('outerContainer');
	document.getElementById('container').removeChild(document.getElementById('overlay'));
}

function recommend() {
	if (document.getElementById('container') == null)
		return;

	overlay();
		
	var out = document.createElement("div");
	out.id = 'outerContainer';
	var arrayPageSize = getPageSize();
	var arrayPageScroll = getPageScroll();
	out.style.top = arrayPageScroll[1] + "px";
	
	var div = document.createElement("div");
	div.id = 'innerContainer';
	
	var form = document.createElement("form");

	var tbl = document.createElement("table");
	var tbdy = document.createElement("tbody");
	var tr = document.createElement("tr");

	var td = document.createElement("td");
	attr = document.createAttribute("width");
	attr.nodeValue = "100";
	td.setAttributeNode(attr);
	td.appendChild(document.createTextNode(mi18nSenderName + ":"));
	tr.appendChild(td);
	

	td = document.createElement("td");

	var input = document.createElement("input");
	attr = document.createAttribute("type");
	attr.nodeValue = "text";
	input.setAttributeNode(attr);
	attr = document.createAttribute("class");
	attr.nodeValue = "text";
	input.setAttributeNode(attr);
	attr = document.createAttribute("maxlength");
	attr.nodeValue = "40";
	input.setAttributeNode(attr);
	attr = document.createAttribute("size");
	attr.nodeValue = "50";
	input.setAttributeNode(attr);
	attr = document.createAttribute("id");
	attr.nodeValue = "sendername";
	input.setAttributeNode(attr);
	
	td.appendChild(input);
	tr.appendChild(td);
	tbdy.appendChild(tr);
	

	tr = document.createElement("tr");
	td = document.createElement("td");
	attr = document.createAttribute("width");
	attr.nodeValue = "100";
	td.setAttributeNode(attr);
	td.appendChild(document.createTextNode(mi18nSenderMail + ":"));
	tr.appendChild(td);
	
	td = document.createElement("td");

	input = document.createElement("input");
	attr = document.createAttribute("type");
	attr.nodeValue = "text";
	input.setAttributeNode(attr);
	attr = document.createAttribute("class");
	attr.nodeValue = "text";
	input.setAttributeNode(attr);
	attr = document.createAttribute("maxlength");
	attr.nodeValue = "40";
	input.setAttributeNode(attr);
	attr = document.createAttribute("size");
	attr.nodeValue = "50";
	input.setAttributeNode(attr);
	attr = document.createAttribute("id");
	attr.nodeValue = "sendermail";
	input.setAttributeNode(attr);
	
	td.appendChild(input);
	tr.appendChild(td);
	tbdy.appendChild(tr);
	

	tr = document.createElement("tr");
	td = document.createElement("td");
	attr = document.createAttribute("width");
	attr.nodeValue = "100";
	td.setAttributeNode(attr);
	td.appendChild(document.createTextNode(mi18nReceipName + ":"));
	tr.appendChild(td);
	
	td = document.createElement("td");

	input = document.createElement("input");
	attr = document.createAttribute("type");
	attr.nodeValue = "text";
	input.setAttributeNode(attr);
	attr = document.createAttribute("class");
	attr.nodeValue = "text";
	input.setAttributeNode(attr);
	attr = document.createAttribute("maxlength");
	attr.nodeValue = "40";
	input.setAttributeNode(attr);
	attr = document.createAttribute("size");
	attr.nodeValue = "50";
	input.setAttributeNode(attr);
	attr = document.createAttribute("id");
	attr.nodeValue = "receipname";
	input.setAttributeNode(attr);
	
	td.appendChild(input);
	tr.appendChild(td);
	tbdy.appendChild(tr);
	
	tr = document.createElement("tr");
	td = document.createElement("td");
	attr = document.createAttribute("width");
	attr.nodeValue = "100";
	td.setAttributeNode(attr);
	td.appendChild(document.createTextNode(mi18nReceipMail + ":"));
	tr.appendChild(td);
	
	td = document.createElement("td");

	input = document.createElement("input");
	attr = document.createAttribute("type");
	attr.nodeValue = "text";
	input.setAttributeNode(attr);
	attr = document.createAttribute("class");
	attr.nodeValue = "text";
	input.setAttributeNode(attr);
	attr = document.createAttribute("maxlength");
	attr.nodeValue = "40";
	input.setAttributeNode(attr);
	attr = document.createAttribute("size");
	attr.nodeValue = "50";
	input.setAttributeNode(attr);
	attr = document.createAttribute("id");
	attr.nodeValue = "receipmail";
	input.setAttributeNode(attr);
	
	td.appendChild(input);
	tr.appendChild(td);
	tbdy.appendChild(tr);
	
	tr = document.createElement("tr");
	td = document.createElement("td");
	attr = document.createAttribute("width");
	attr.nodeValue = "100";
	td.setAttributeNode(attr);
	td.appendChild(document.createTextNode(mi18nNote + ":"));
	tr.appendChild(td);
	
	td = document.createElement("td");

	input = document.createElement("textarea");
	attr = document.createAttribute("cols");
	attr.nodeValue = "35";
	input.setAttributeNode(attr);
	attr = document.createAttribute("rows");
	attr.nodeValue = "4";
	input.setAttributeNode(attr);
	attr = document.createAttribute("maxlength");
	attr.nodeValue = "255";
	input.setAttributeNode(attr);
	attr = document.createAttribute("id");
	attr.nodeValue = "sendermsg";
	input.setAttributeNode(attr);
	
	td.appendChild(input);
	tr.appendChild(td);
	tbdy.appendChild(tr);
	
	tr = document.createElement("tr");
	td = document.createElement("td");
	td.className = "right";
	attr = document.createAttribute("colspan");
	attr.nodeValue = "2";
	td.setAttributeNode(attr);


	var a = document.createElement("a");
	attr = document.createAttribute("title");
	attr.nodeValue = "Abbrechen";
	a.setAttributeNode(attr);
	attr = document.createAttribute("href");
	attr.nodeValue = "javascript:destroyBox();";
	a.setAttributeNode(attr);
	input = document.createElement("img");
	attr = document.createAttribute("src");
	attr.nodeValue = "upload/grafiken/cancel.png";
	input.setAttributeNode(attr);
	a.appendChild(input);
	td.appendChild(a);

	a = document.createElement("a");
	attr = document.createAttribute("title");
	attr.nodeValue = "Senden";
	a.setAttributeNode(attr);
	attr = document.createAttribute("href");
	attr.nodeValue = "javascript:post(document.URL, 'recommend=yes&url=' + document.URL + '&sendername=' + document.getElementById('sendername').value + '&sendermail=' + document.getElementById('sendermail').value + '&receipname=' + document.getElementById('receipname').value + '&receipmail=' + document.getElementById('receipmail').value + '&sendermsg=' + document.getElementById('sendermsg').value);";
	a.setAttributeNode(attr);
	input = document.createElement("img");
	attr = document.createAttribute("src");
	attr.nodeValue = "upload/grafiken/ok.png";
	input.setAttributeNode(attr);
	a.appendChild(input);
	
	td.appendChild(a);
	tr.appendChild(td);
	tbdy.appendChild(tr);
	tbl.appendChild(tbdy);
	
	form.appendChild(tbl);
	div.appendChild(form);
	out.appendChild(div);
	
	out.style.display = 'none';
	document.getElementById('container').appendChild(out);
	new Effect.SlideDown('outerContainer');
}

