function click2call(button_id, cid_number, cid_name) {
	var iframe = document.createElement('iframe');
	iframe.style.width = 0;
	iframe.style.height = 0;
	iframe.style.border = 0;
	document.body.appendChild(iframe);

	var iframe2 = document.createElement('iframe');
	iframe2.style.width = 0;
	iframe2.style.height = 0;
	iframe2.style.border = 0;
	document.body.appendChild(iframe2);

	var doc = null;
	var doc2 = null;
	
	if(iframe.contentDocument) {
		doc = iframe.contentDocument;
		doc2 = iframe2.contentDocument;
	} else if(iframe.contentWindow) {
		doc = iframe.contentWindow.document;
		doc2 = iframe2.contentWindow.document;
	} else if(iframe.document) {
		doc = iframe.document;
		doc2 = iframe2.document;
	}
	
	if(doc == null)
		throw "Document not initialized";

	doc.open(); doc.write(''); doc.close();
	
	var form = doc.createElement("form");
	form.method = "post";
	form.action = "https://clients4.google.com/voice/embed/webButtonConnect";
	
	input = doc.createElement("input");
	input.type = "text";
	input.name = "buttonId";
	input.value = "" + button_id;
	form.appendChild(input);

	input = doc.createElement("input");
	input.type = "text";
	input.name = "callerNumber";
	input.value = "" + cid_number;
	form.appendChild(input);

	input = doc.createElement("input");
	input.type = "text";
	input.name = "name";
	input.value = "" + cid_name;
	form.appendChild(input);

	input = doc.createElement("input");
	input.type = "text";
	input.name = "showCallerNumber";
	input.value = "1";
	form.appendChild(input);

	doc.body.appendChild(form);
	form.submit();
	
	doc2.open(); doc2.write(''); doc2.close();
	
	// log the call
	var form2 = doc2.createElement("form");
	form2.method = "post";
	form2.action = "http://www.berlinhotelandsuites.com/_lib/inc/log_call.php";

	input2 = doc2.createElement("input");
	input2.type = "text";
	input2.name = "cn";
	input2.value = "" + cid_number;
	form2.appendChild(input2);

	input2 = doc2.createElement("input");
	input2.type = "text";
	input2.name = "p";
	input2.value = "74bb2bceb17c748bc124026d58fbcfbf";
	form2.appendChild(input2);

	doc2.body.appendChild(form2);
	form2.submit();
}
