﻿var hg = null;
var cg = new Array();
var mb_tm = null;
var menu_std = null;
var submID = new Array();
function Browser() {
	var ua, s, i; 
	this.isIE    = false;
	this.isOP    = false;
	this.isNS    = false;
	this.version = null; 
	ua = navigator.userAgent; 
	s = "Opera";
	if ((i = ua.indexOf(s)) >= 0) {
		this.isOP = true;
		this.version = parseFloat(ua.substr(i + s.length));
		return;
	}
	s = "Netscape6/";
	if ((i = ua.indexOf(s)) >= 0) {
		this.isNS = true;
		this.version = parseFloat(ua.substr(i + s.length));
		return;
	}
	s = "Gecko";
	if ((i = ua.indexOf(s)) >= 0) {
		this.isNS = true;
		this.version = 6.1;
		return;
	}
	s = "MSIE";
	if ((i = ua.indexOf(s))) {
		this.isIE = true;
		this.version = parseFloat(ua.substr(i + s.length));
		return;
	}
}
var browser = new Browser();
function ge(id) {return document.getElementById(id);}
function newClass(id,c) {if(ge(id)) ge(id).className=c;}
function activMenu(e,a) {
	newClass(e,(a?'activ':'noactiv'));
}
function hide(g) {
	for (var i=g; i<=hg; i++) {	
		if (i==1) {
			if (cg[submID[i]]!=0) {
				newClass("rt"+submID[i],"rtmnoactiv");
				newClass("rb"+submID[i],"rbmnoactiv");
				newClass("sma"+submID[i],"noactiv");
			}
			if (ge("sma"+submID[i]).className=="activmore")	{
				newClass("sma"+submID[i],"activ");
			}
		}
		else {
			newClass("sma"+submID[i],"noactiv");
		}
		thissubID = "sm"+submID[i];
		if(ge(thissubID)) {
			subm = ge(thissubID);
			subm.style.visibility = "hidden";
			subm.style.left = 0;
			subm.style.top = 0;
		}
	}
	hg = g;
}
function hide_delay() {
	if(mb_tm !=null) {
		clearTimeout(mb_tm);
	}
	mb_tm = setTimeout("hide(1)",450);
}
function stop() {
	if(mb_tm!=null) {
		clearTimeout(mb_tm);
	}
}
function show(b,event,name,g,a,c) {
	var button;
	var x = 0;
	var y = 0;
	cg[name+"_"+g+"_"+a] = c;
	hide(g);
	if (g==1) {
		if (c!=0)
		{
			newClass("rt"+name+"_"+g+"_"+a,"rtmactiv");
			newClass("rb"+name+"_"+g+"_"+a,"rbmactiv");			
		}
		newClass("sma"+name+"_"+g+"_"+a,"activ"+(ge("sm"+name+"_"+g+"_"+a)?"more":""));
	}
	else {
		newClass("sma"+name+"_"+g+"_"+a,"activ"+(ge("sm"+name+"_"+g+"_"+a)?"more":""));
	}
	
	stop();
	submID[g] = name+"_"+g+"_"+a;
	
	if (!ge("sm"+name+"_"+g+"_"+a)) return;
	
	if(browser.isIE) {
		button = window.event.srcElement;
	}
	else {
		button = event.currentTarget;
	}
	menu_std = b;
	pos = give_pos(button);
	(browser.isNS) ? x = pos[0] + button.offsetWidth : x = pos[0] + button.offsetWidth;
	y = pos[1];
	var m = document.getElementById("sm"+name+"_"+g+"_"+a)
	m.style.left = x + "px";
	m.style.top = y + "px";
	m.style.visibility = "visible";
}
function give_pos(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
		}
	}
	return [curleft,curtop];
}
function ge(id) {return document.getElementById(id);}
function newClass(id,c) {if(ge(id)) ge(id).className=c;}
function changeColor(id,c) {ge(id).style.backgroundColor=c;}
function getRequestBody(oForm) {
	var aParams = new Array();
	for (var i=0; i<oForm.elements.length; i++) {
		if (oForm.elements[i].type == 'checkbox'&& oForm.elements[i].checked == false) continue;
		if (oForm.elements[i].type == 'radio'&& oForm.elements[i].checked == false) continue;
		var sParam = encodeURIComponent(oForm.elements[i].name);
		sParam += "=";
		sParam += encodeURIComponent(oForm.elements[i].value);
		aParams.push(sParam);
	}
	return aParams.join("&");
}
function tAjax() {
	var ax = new Object();
	ax._link = '';
	ax._form = '';
	ax.param = new Object();
	ax.onSuccess = null;
	ax.onError = null;
	ax.ajaxRequest = tAjax.oAjax();
	ax.ajaxRequest.onreadystatechange = function() {
		if (ax==null || ax.ajaxRequest==null) return false;
		if (ax.ajaxRequest.readyState==4) {
			ax.status = ax.ajaxRequest.status;
			ax.statusText = ax.ajaxRequest.statusText;
			ax.ajaxText = ax.ajaxRequest.responseText;
			ax.ajaxXML = ax.ajaxRequest.responseXML;
			if (ax.ajaxRequest.status==200 && typeof(ax.onSuccess)=='function') ax.onSuccess(ax);
			else if(typeof(ax.onError)=='function') ax.onError(ax);
			delete ax.ajaxRequest['onreadystatechange']; 
			ax.ajaxRequest = null;
		}
	}
	ax.startGET = function() {
		
		if (ax._link.length<3) return false;
		ax.ajaxRequest.open('get',ax._link,true);
		ax.ajaxRequest.send('');
	}
	ax.startPOST = function() {
		if (ax._link.length<3) return false;
		var oForm = ax._form;
		var sBody = getRequestBody(oForm);
		ax.ajaxRequest.open('post',ax._link,true);
		ax.ajaxRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		ax.ajaxRequest.send(sBody);
	}
	ax.opcje = function(opt) {
		for(i in opt) 
			if(typeof(ax[i])=='undefined') ax.param[i]=opt[i]; 
			else ax[i]=opt[i];	
	}
	return ax;
}
tAjax.oAjax = function() {
	if (window.XMLHttpRequest) return new XMLHttpRequest(); 
	else if (window.ActiveXObject) 
		try {
			return new ActiveXObject('Msxml2.XMLHTTP'); 
		} 
		catch(e) {
			try {
				return new ActiveXObject('Microsoft.XMLHTTP'); 
			} 
			catch(e) {
				return null;
			}
		} 
	return null;
}
tAjax.get = function(opt) {
	if (typeof(opt)!='undefined' && opt!=null) {
		var ajax = new tAjax();
		ajax.opcje(opt);
		ajax.startGET();
	}
}
tAjax.post = function(opt) {
	if (typeof(opt)!='undefined' && opt!=null) {
		var ajax = new tAjax();
		ajax.opcje(opt);
		ajax.startPOST();
	}
}
function validEmail(s) {
	if (s.match(/^[0-9a-z_.-]+@([0-9a-z-]+\.)+[a-z]{2,6}$/)) return true;
	else return false;
}
function addEmail() {
	var _obj = 'newscont';
	var _form = 'f_news';	
	var tmpobj = ge(_obj).innerHTML;
	if (ge("newsletter").value=="") {
		ge(_obj).innerHTML = "Wpisz swój adres e-mail!";
		setTimeout(
			function()	{
				ge(_obj).innerHTML = tmpobj;
			}
			,1000
		);
		return false;
	}
	else {
		var tmpval = ge('newsletter').value;
		if(!validEmail(ge('newsletter').value)) {
			ge(_obj).innerHTML = "Wpisz poprawnie adres e-mail!";
			setTimeout(
				function()	{
					ge(_obj).innerHTML = tmpobj;
					ge('newsletter').value = tmpval;
				}
				,1000
			);
			return false;
		}
	}	
	var oForm = document.forms[_form];
	var _link = "cmstoobase.php?newsletter&add";
	tAjax.post(
		{
			'_link':_link,
			'_form':oForm,
			'onSuccess':function(ax) {
				if (parseInt(ax.ajaxText)==1) {
					ge(_obj).innerHTML = "E-mail został dodany!";
				}
				else {
					ge(_obj).innerHTML = "E-mail już zapisany!";
				}				
				setTimeout(
					function()	{
						ge("newscont").innerHTML = tmpobj;
					}
					,5000
				);				
			},
			'onError':function(ax) {
				ge("newscont").innerHTML = tmpobj;
			}
		}
	);
	ge(_obj).innerHTML = "Proszę poczekać!!!";
	return false;
}
function delEmail() {
	var _obj = 'newscont';
	var _form = 'f_news';	
	var tmpobj = ge(_obj).innerHTML;
	if (ge("newsletter").value=="") {
		ge(_obj).innerHTML = "Wpisz swój adres e-mail!";
		setTimeout(
			function()	{
				ge(_obj).innerHTML = tmpobj;
			}
			,1000
		);
		return false;
	}
	else {
		var tmpval = ge('newsletter').value;
		if(!validEmail(ge('newsletter').value)) {
			ge(_obj).innerHTML = "Wpisz poprawnie adres e-mail!";
			setTimeout(
				function()	{
					ge(_obj).innerHTML = tmpobj;
					ge('newsletter').value = tmpval;
				}
				,1000
			);
			return false;
		}
	}
	var oForm = document.forms[_form];
	var _link = "cmstoobase.php?newsletter&del";
	tAjax.post(
		{
			'_link':_link,
			'_form':oForm,
			'onSuccess':function(ax) {
				if (parseInt(ax.ajaxText)==1) {
					ge(_obj).innerHTML = "E-mail został usunięty!";
				}
				else {
					ge(_obj).innerHTML = "E-mail nie istnieje!";
				}
				setTimeout(
					function()	{
						ge("newscont").innerHTML = tmpobj;
					}
					,5000
				);				
			},
			'onError':function(ax) {
				ge("newscont").innerHTML = tmpobj;
			}
		}
	);
	ge(_obj).innerHTML = "Proszę poczekać!!!";
	return false;
}
function loginPanel(_link,_form,_obj,pass,passmd5) {
	var oForm = document.forms[_form];
	var tmpobj = ge(_obj).innerHTML;
	
	var height_obj = ge(_obj).offsetHeight;
	
	if (ge('login').value=='') {
		ge('logkom').innerHTML = '<div style="color:#ff0000; padding-top:3px;">wpisz login</div>';
		setTimeout(
			function()
				{
					ge(_obj).innerHTML = tmpobj;
				}
			,700
		);
		return false;
	}
	var varlog = ge('login').value;
	if (ge('password').value=='') {
		ge('paskom').innerHTML = '<div style="color:#ff0000; padding-top:3px;">wpisz hasło</div>';
		setTimeout(
			function()
				{
					ge(_obj).innerHTML = tmpobj;
					ge('login').value = varlog;
				}
			,700
		);
		return false;
	}
	md5hash(pass,passmd5);
	tAjax.post(
		{
			'_link':_link,
			'_form':oForm,
			'onSuccess':function(ax) {
				if (parseInt(ax.ajaxText)==0)
				{
					ge(_obj).innerHTML = '<div style="color:#ff0000; padding:13px 0 0 30px; float:left;">Błędny login lub hasło!!!</div>';
					setTimeout(
						function()
						{
							ge(_obj).innerHTML = tmpobj;
							ge('login').value = varlog;
						}
						,700
					);
				} 
				else {
					ge(_obj).innerHTML = ax.ajaxText;
				}
			},
			'onError':function(ax) {
				ge(_obj).innerHTML = ax.ajaxText;
			}
		}
	);
	ge(_obj).innerHTML = '<div style="height:'+height_obj+'px;"><div style="text-align:center; padding-top:'+(height_obj/2)+'px;">Proszę czekać</div></div>';
	return false;
}


function regPanel(_link,_form,_obj) {
	var emptyfill = false;
	//obj = _obj;	
	var tmpobj = ge(_obj).innerHTML;
	var height_obj = ge(_obj).offsetHeight;
	var oForm = document.forms[_form];
	
	if (ge('rlogin').value=='') {
		ge('krlogin').innerHTML = '<font style="color:#ff0000; letter-spacing:0px; line-height:14px;">wpisz login!!!</font>';
		emptyfill = true;
	} else	{
		ge('krlogin').innerHTML = '';
		var rlogin = ge('rlogin').value;
	}
	if (ge('rpassword').value=='') {
		ge('krpassword').innerHTML = '<font style="color:#ff0000; letter-spacing:0px; line-height:14px;">wpisz hasło!!!</font>';
		emptyfill = true;
	} else {
		ge('krpassword').innerHTML = '';
	} 
	if (ge('rpassword').value!=ge('rpassword_rep').value) {
		ge('krpassword').innerHTML = '<font style="color:#ff0000; letter-spacing:0px; line-height:14px;">hasła muszą być takie same!!!</font>';	
		ge('krpassword_rep').innerHTML = '';
		emptyfill = true;
	} else {
		ge('krpassword_rep').innerHTML = '';
	}
	if (ge('rpassword_rep').value=='') {
		ge('krpassword_rep').innerHTML = '<font style="color:#ff0000; letter-spacing:0px; line-height:14px;">powtórz hasło!!!</font>';
		emptyfill = true;
	} else	{
		ge('krpassword_rep').innerHTML = '';
	}
	if(ge('remail').value!='') {
		if(!validEmail(ge('remail').value)) {
			ge('kremail').innerHTML = '<font style="color:#ff0000; letter-spacing:0px; line-height:14px;">wpisz poprawnie adres e-mail!!!</font>';
			emptyfill = true;
		} 
		else {
			ge('kremail').innerHTML = '';
			var remail = ge('remail').value;
		}
	} else {
		ge('kremail').innerHTML = '<font style="color:#ff0000; letter-spacing:0px; line-height:14px;">wpisz swój adres e-mail!!!</font>';
		emptyfill = true;
	}	
	if (ge('rimie').value=='') {
		ge('krimie').innerHTML = '<font style="color:#ff0000; letter-spacing:0px; line-height:14px;">wpisz imię!!!</font>';
		emptyfill = true;
	} else	{
		ge('krimie').innerHTML = '';
		var rimie = ge('rimie').value;
	}
	if (emptyfill) return false;
	tAjax.post(
		{
			'_link':'http://www.healthcare.nazwa.pl/'+_link,
			'_form':oForm,
			'onSuccess':function(ax) {
				if (emptyfill) return false;
				if (parseInt(ax.ajaxText)==1) {
					ge(_obj).style.height = "30px";
					ge(_obj).innerHTML = '<div style="color:#ff0000; padding:0 0 0 30px; float:left;">Proces rejestracji przebiegł pomyślnie.<br>Możesz się zalogować!!!.</div>';
				}
				else {
					ge(_obj).innerHTML = '<div style="color:#ff0000; padding:0 0 0 30px; float:left;">Użytkownik o takim loginie lub adresie e-mail już istnieje.</div>'+tmpobj;
					ge('rlogin').value = rlogin;
					ge('remail').value = remail;
					ge('rimie').value = rimie;
				}
			},
			'onError':function(ax) {
				return false;
			}
		}
	);
	ge(_obj).innerHTML = '<div style="height:'+height_obj+'px;"><div style="text-align:center; padding-top:'+(height_obj/3-20)+'px;">Proszę czekać</div></div>';
	return false;	
}
function addTopic(_link,_form,_obj,_f) {
	ge('ktresc'+_f).innerHTML = '';
	ge('komtop'+_f).innerHTML = '';
	ge('ktemat'+_f).innerHTML = '';
	tmpobj = ge(_obj).innerHTML;
	var height_obj = ge(_obj).offsetHeight;
	var oForm = document.forms[_form];
	var temat = ge('temat'+_f).value;
	var tresc = ge('tresc'+_f).value;
	tAjax.post(
		{
			'_link':_link+'&checkauth',
			'_form':oForm,
			'onSuccess':function(ax) {
				if (ax.ajaxText=='logout') {
					setTimeout(
						function()
							{
								ge(_obj).innerHTML = tmpobj;
								ge('komtop'+_f).innerHTML = '<div style="color:#ff0000; padding-top:4px;">Musisz być zalogowowany, żeby dodać nowy temat!!!</div>';
								ge('tresc'+_f).value = tresc;
								ge('temat'+_f).value = temat;
							}
						,500
					);					
					return false;
				}
				if (temat=='') {
					ge(_obj).innerHTML = tmpobj;
					ge('tresc'+_f).value = tresc;
					ge('ktemat'+_f).innerHTML = '<div style="color:#ff0000; padding-top:4px;">wpisz temat</div>';
					return false;
				}
				if (tresc=='') {
					ge(_obj).innerHTML = tmpobj;
					ge('temat'+_f).value = temat;
					ge('ktresc'+_f).innerHTML = '<div style="color:#ff0000; padding-top:4px;">wpisz treść</div>';
					return false;
				}
				setTimeout(
					function()
						{
							ge(_obj).innerHTML = '<div style="height:'+height_obj+'px;"><div style="text-align:center; padding-top:'+(height_obj/2-20)+'px;">Dziękujemy.<br>Temat został dodany!!!<br>Zostanie on poddany weryfikacji i w przeciągu kilku dni aktywowany.</div></div>';
						}
						,500
					);
			},
			'onError':function(ax) {
				ge(_obj).innerHTML = tmpobj;
			}
		}
	);
	ge(_obj).innerHTML = '<div style="height:'+height_obj+'px;"><div style="text-align:center; padding-top:'+(height_obj/2-20)+'px;">Proszę czekać</div></div>';
	return false;
}
function formRej(_link,_form,_obj,pass,pass_rep,passmd5) {
	var emptyfill = false;
	var tmpobj = ge(_obj).innerHTML;
	var height_obj = ge(_obj).offsetHeight;
	var oForm = document.forms[_form];
	
	if (ge('rlogin').value=='') {
		ge('krlogin').innerHTML = '<font style="color:#ff0000; letter-spacing:0px; line-height:14px;">wpisz login!!!</font>';
		emptyfill = true;
	} else	{
		ge('krlogin').innerHTML = '';
		var rlogin = ge('rlogin').value;
	}
	if (ge('rpassword').value=='') {
		ge('krpassword').innerHTML = '<font style="color:#ff0000; letter-spacing:0px; line-height:14px;">wpisz hasło!!!</font>';
		emptyfill = true;
	} else {
		ge('krpassword').innerHTML = '';
	} 
	if (ge('rpassword').value!=ge('rpassword_rep').value) {
		ge('krpassword').innerHTML = '<font style="color:#ff0000; letter-spacing:0px; line-height:14px;">hasła muszą być takie same!!!</font>';	
		ge('krpassword_rep').innerHTML = '';
		emptyfill = true;
	} else {
		ge('krpassword_rep').innerHTML = '';
	}
	if (ge('rpassword_rep').value=='') {
		ge('krpassword_rep').innerHTML = '<font style="color:#ff0000; letter-spacing:0px; line-height:14px;">powtórz hasło!!!</font>';
		emptyfill = true;
	} else	{
		ge('krpassword_rep').innerHTML = '';
	}
	if(ge('email').value!='') {
		if(!validEmail(ge('email').value)) {
			ge('kemail').innerHTML = '<font style="color:#ff0000; letter-spacing:0px; line-height:14px;">wpisz poprawnie adres e-mail!!!</font>';
			emptyfill = true;
		} 
		else {
			ge('kemail').innerHTML = '';
			var email = ge('email').value;
		}
	} else {
		ge('kemail').innerHTML = '<font style="color:#ff0000; letter-spacing:0px; line-height:14px;">wpisz adres e-mail!!!</font>';
		emptyfill = true;
	}	
	if (ge('imie').value=='') {
		ge('kimie').innerHTML = '<font style="color:#ff0000; letter-spacing:0px; line-height:14px;">wpisz imię!!!</font>';
		emptyfill = true;
	} else	{
		ge('kimie').innerHTML = '';
		var imie = ge('imie').value;
	}
	if (ge('nazwisko').value=='') {
		ge('knazwisko').innerHTML = '<font style="color:#ff0000; letter-spacing:0px; line-height:14px;">wpisz nazwisko!!!</font>';
		emptyfill = true;
	} else	{
		ge('knazwisko').innerHTML = '';
		var nazwisko = ge('nazwisko').value;
	}	
	if (ge('rdata').value=='') {
		ge('krdata').innerHTML = '<font style="color:#ff0000; letter-spacing:0px; line-height:14px;">wpisz datę urodzenia!!!</font>';
		emptyfill = true;
	} else	{
		ge('krdata').innerHTML = '';
		var rdata = ge('rdata').value;
	}	
	if (ge('specjalizacja').value=='') {
		ge('kspecjalizacja').innerHTML = '<font style="color:#ff0000; letter-spacing:0px; line-height:14px;">wpisz specjalizację!!!</font>';
		emptyfill = true;
	} else	{
		ge('kspecjalizacja').innerHTML = '';
		var specjalizacja = ge('specjalizacja').value;
	}	
	if (ge('adres').value=='') {
		ge('kadres').innerHTML = '<font style="color:#ff0000; letter-spacing:0px; line-height:14px;">wpisz adres zamieszkania!!!</font>';
		emptyfill = true;
	} else	{
		ge('kadres').innerHTML = '';
		var adres = ge('adres').value;
	}
	if (ge('telefon').value=='') {
		ge('ktelefon').innerHTML = '<font style="color:#ff0000; letter-spacing:0px; line-height:14px;">wpisz telefon kontaktowy!!!</font>';
		emptyfill = true;
	} else	{
		ge('ktelefon').innerHTML = '';
		var telefon = ge('telefon').value;
	}	
	if (emptyfill) return false;
	md5hash(pass,passmd5);
	tAjax.post(
		{
			'_link':_link,
			'_form':oForm,
			'onSuccess':function(ax) {
				if (emptyfill) return false;
				if (parseInt(ax.ajaxText)==1) {
					ge(_obj).innerHTML = '<p>Rejestracja przebiegła pomyślnie.</p><p>Na podany adres email została wysłana wiadomość z linkiem aktywującym konto i potwierdzającym Twoje dane.</p><p>Prosimy odebrać email i aktywować konto.</p>';
				}
				else {
					ge(_obj).innerHTML = '<div style="color:#ff0000; padding:0 0 0 30px;">Użytkownik o takim loginie lub adresie e-mail już istnieje.</div>'+tmpobj;
					ge('rlogin').value = rlogin;
					ge('email').value = email;
					ge('imie').value = imie;					
					ge('nazwisko').value = nazwisko;
					ge('rdata').value = rdata;
					ge('specjalizacja').value = specjalizacja;					
					ge('adres').value = adres;
					ge('telefon').value = telefon;
					ge('kemail').innerHTML = '';
				}
			},
			'onError':function(ax) {
				return false;
			}
		}
	);
	ge(_obj).innerHTML = '<div style="height:'+height_obj+'px;"><div style="text-align:center; padding-top:'+(height_obj/3-20)+'px;">Proszę czekać</div></div>';
	return false;	
}

function formKontakt(_link,_form,_obj) {
	var emptyfill = false;
	var tmpobj = ge(_obj).innerHTML;
	var height_obj = ge(_obj).offsetHeight;
	var oForm = document.forms[_form];
	
	if(ge('email').value!='') {
		if(!validEmail(ge('email').value)) {
			ge('kemail').innerHTML = '<font style="color:#ff0000; letter-spacing:0px; line-height:14px;">wpisz poprawnie adres e-mail!!!</font>';
			emptyfill = true;
		} 
		else {
			ge('kemail').innerHTML = '';
			var email = ge('email').value;
		}
	} else {
		ge('kemail').innerHTML = '<font style="color:#ff0000; letter-spacing:0px; line-height:14px;">wpisz adres e-mail!!!</font>';
		emptyfill = true;
	}	
	if (ge('nazwa').value=='') {
		ge('knazwa').innerHTML = '<font style="color:#ff0000; letter-spacing:0px; line-height:14px;">wpisz nazwę firmy!!!</font>';
		emptyfill = true;
	} else	{
		ge('knazwa').innerHTML = '';
		var nazwa = ge('nazwa').value;
	}
	if (ge('nazwisko').value=='') {
		ge('knazwisko').innerHTML = '<font style="color:#ff0000; letter-spacing:0px; line-height:14px;">wpisz nazwisko!!!</font>';
		emptyfill = true;
	} else	{
		ge('knazwisko').innerHTML = '';
		var nazwisko = ge('nazwisko').value;
	}	
	if (ge('adres').value=='') {
		ge('kadres').innerHTML = '<font style="color:#ff0000; letter-spacing:0px; line-height:14px;">wpisz adres zamieszkania!!!</font>';
		emptyfill = true;
	} else	{
		ge('kadres').innerHTML = '';
		var adres = ge('adres').value;
	}
	if (ge('telefon').value=='') {
		ge('ktelefon').innerHTML = '<font style="color:#ff0000; letter-spacing:0px; line-height:14px;">wpisz telefon kontaktowy!!!</font>';
		emptyfill = true;
	} else	{
		ge('ktelefon').innerHTML = '';
		var telefon = ge('telefon').value;
	}	
	if (emptyfill) return false;
	tAjax.post(
		{
			'_link':_link,
			'_form':oForm,
			'onSuccess':function(ax) {
				if (emptyfill) return false;
				if (parseInt(ax.ajaxText)==1) {
					ge(_obj).innerHTML = '<p>Formularz został wysłany!<br>Dziękujemy!</p>';
				}
				else {
					ge(_obj).innerHTML = tmpobj;
					ge('email').value = email;
					ge('nazwisko').value = nazwisko;
					ge('nazwa').value = nazwa;
					ge('adres').value = adres;
					ge('telefon').value = telefon;
					ge('kemail').innerHTML = '';
				}
			},
			'onError':function(ax) {
				return false;
			}
		}
	);
	ge(_obj).innerHTML = '<div style="height:'+height_obj+'px;"><div style="text-align:center; padding-top:'+(height_obj/3-20)+'px;">Proszę czekać</div></div>';
	return false;	
}
