var obase; var win = '';var o_left; var o_top;var o_oldmenu = ''; var o_oldsubmenu = ''; var submenuopen = false;var scrx = screen.width / 2; var scry = screen.height / 2;function GetObj(obj) {	return document.getElementById(obj)};function GetObjStyle(obj) {	return GetObj(obj).style;};function WebDBName() {	return (path = (location.pathname).toLowerCase()).substring(0,(path.lastIndexOf('.nsf') + 4)) + '/'};function ChangeLanguage(Lang) {	var path = (location.href).toLowerCase();	location.replace(path.substring(0,path.lastIndexOf('lang=') + 5) + Lang);};function ShowAboutDialog() {	if (GetBrowserType() == 'IE' ) {		window.showModalDialog(GetFullURL('($Welcome)?OpenPage'), '', 'dialogWidth:350px;dialogHeight:170px;status:no')	} else {		var window_x = 350; var window_y = 150;		var param = 'status=no,resizable=no,scrollbars=no,width=' + window_x.toString() + ',height=' + window_y.toString() + ',left=' + (scrx - window_x/2).toString() + ',top=' + (scry - window_y/2).toString();		if (typeof(win) == 'object') win.close();		win = window.open(GetFullURL('($Welcome)?OpenPage'),'about',param);		win.focus()	}};function SetPriceForFamilyMember(fmi, frm) {	var idx = GetTotalForRow(fmi); var lp = frm['PriceOption'].selectedIndex; lp = frm['PriceOption'].options[lp].value;	switch (idx) {		case 1: frm['Total' + fmi].value = 0; frm['Zaliczka' + fmi].value = 0; break;		case 2: var a = Explode(frm['Kids1'].value, ';'); frm['Total' + fmi].value = a[lp - 1]; var b = Explode(frm['ForePayment'].value, ';'); frm['Zaliczka' + fmi].value = b[lp - 1]; break;		case 3: var a = Explode(frm['Kids2'].value, ';'); frm['Total' + fmi].value = a[lp - 1]; var b = Explode(frm['ForePayment'].value, ';'); frm['Zaliczka' + fmi].value = b[lp - 1]; break;		case 4: var a = Explode(frm['BasicPayment'].value, ';'); frm['Total' + fmi].value = a[lp - 1]; var b = Explode(frm['ForePayment'].value, ';'); frm['Zaliczka' + fmi].value = b[lp - 1]; break;	};	var a = Explode(frm['BasicPayment'].value, ';'); var O = parseInt(a[lp - 1]);	var b = Explode(frm['ForePayment'].value, ';'); var Z = parseInt(b[lp - 1]);	for (var i = 1; i <= iRows; i++) {		var dp = parseInt(frm['Total' + i].value); var dz = parseInt(frm['Zaliczka' + i].value);		O = O + dp; Z = Z + dz;	};	frm['OplataDSP'].value = O + ',00 PLN'; frm['ZaliczkaDSP'].value = Z + ',00 PLN';	frm['Oplata'].value = O; frm['Zaliczka'].value = Z};function ShowRow(row) {	GetObjStyle('r' + row).display = 'inline'; iRows += 1;	GetObjStyle('LastName' + row).display = 'inline'; GetObjStyle('FirstName' + row).display = 'inline'; GetObjStyle('Pokrewienstwo' + row).display = 'inline';	GetObjStyle('BirthYear' + row).display = 'inline'; GetObjStyle('Total' + row).display = 'inline'; GetObjStyle('Zaliczka' + row).display = 'inline';};function HideRow(row) {	GetObjStyle('r' + row).display = 'none'; iRows -= 1;	GetObjStyle('LastName' + row).display = 'none'; GetObjStyle('FirstName' + row).display = 'none'; GetObjStyle('Pokrewienstwo' + row).display = 'none';	GetObjStyle('BirthYear' + row).display = 'none'; GetObjStyle('Total' + row).display = 'none'; GetObjStyle('Zaliczka' + row).display = 'none';}function GetTotalForRow(i) {	if (frm['BirthYear' + i].value == '0' || frm['Pokrewienstwo' + i].value == '0') {		var iA = 0	} else {		var iA = frm['$$CurYear'].value - parseInt(frm['BirthYear' + i].value)	};	if (iA < 4) return 1;	if (iA < 8) return 2;	if (iA < 11) return 3;	return 4}function ChangePage(from, to) {	var frm = window.document.forms[0]; var tmp; var pass = true;	with (frm) {		switch (from + to) {			case 'P2P0':				GetObjStyle(from).display = 'none'; GetObjStyle(to).display = 'inline'; RequestType.focus()				break;			case 'P2P3':				if (CheckRequiredAndValidationFields(frm, false)) {					GetObjStyle(from).display = 'none'; GetObjStyle(to).display = 'inline'; Street.focus()				}; break;			case 'P3P2':				GetObjStyle(from).display = 'none'; GetObjStyle(to).display = 'inline'; Surname.focus()				break;			case 'P3P4':				if (CheckRequiredAndValidationFields(frm, false)) {					GetObjStyle(from).display = 'none'; GetObjStyle(to).display = 'inline'; Church.focus()				}; break;			case 'P4P3':				GetObjStyle(from).display = 'none'; GetObjStyle(to).display = 'inline'; Street.focus()				break;			case 'P4P5':				if (CheckRequiredAndValidationFields(frm, false)) {					frm.submit();				}; break;		}	};	return false};function ChangeWEBPage(from, to) {	GetObjStyle(from).display = 'none'; GetObjStyle(to).display = 'inline';	return false};function ShowInputTranslationErrorMsg(frm, fld) {	var vdfld = frm['ValidationFieldList'];	with (frm) {		for (var i = 0; i < vdfld.length; i++) {			if (vdfld.options[i].value == fld || vdfld.options[i].value == fld + '*') {				var msg = vdfld.options[i].text; msg = msg.substring(0, msg.indexOf('~')); alert(msg.split('#').join('\n'));				return false;			}		}	}; return true;};function SaveSubscription(Mode) {	if (Mode = 'S') {		if (CheckRequiredAndValidationFields(frm, true)) frm.submit()	} else {		if (CheckRequiredAndValidationFields(frm, true)) frm.submit()	}};function SaveRequestUSA() {	if (CheckRequiredAndValidationFields(frm, true)) frm.submit()}function CheckRequiredAndValidationFields(frm, SetErrorIcon) {	var ok = true; var empty; var req; var vdfld = frm['ValidationFieldList']	with (frm) {		for (var i = 0; i < vdfld.length; i++) {			var fld = vdfld.options[i].value;			if (fld.indexOf('*') > -1) {req = true; fld = fld.replace('*', '')} else {req = false};			fld = frm[fld]; empty = false;			if (fld.type != 'hidden' && GetObjStyle(fld.name).display != 'none') {				if (fld.type == 'select-one') {					if (fld.selectedIndex < 1) empty = true				} else {					if (fld.value == '' && req) empty = true;					if (fld.value != '' && fld.value.search(vdfld.options[i].text.split('~')[1]) == -1) empty = true				};				GetObj(fld.name).className = (empty ? 'RequiredFieldWithErrorData' : (req ? 'RequiredField' : 'RequiredFieldWithOKData'));				if (SetErrorIcon) GetObjStyle('Err' + fld.name).display = (empty ? 'inline': 'none'); 				ok = (empty ? false: ok)			}		}	};	if (!ok) alert('Na formularzu s\u0105 b\u0142\u0119dy!\nKliknij na niebieskich ikonach z prawej strony p\u00F3l aby zobaczy\u0107 przyczyn\u0119 b\u0142\u0119du.\nPopraw b\u0142\u0119dy, aby przej\u015B\u0107 do dalszej cz\u0119\u015Bci formularza.')	return ok;};function LowerCase(fld) {	fld.value = fld.value.toLowerCase();	return true};function UpperCase(fld) {	fld.value = fld.value.toUpperCase();	return true};function Left(str, n) {	if (n <= 0)		return "";	else if (n > String(str).length)	    return str;	else	    return String(str).substring(0, n);}function Right(str, n) {    if (n <= 0)       return "";    else if (n > String(str).length)       return str;    else {       var iLen = String(str).length;       return String(str).substring(iLen, iLen - n);    }};function Trim(txt) {	while (txt.substring(0, 1) == ' ') txt = txt.substring(1, txt.length);	while (txt.substring(txt.length - 1, txt.length) == ' ') txt = txt.substring(0, txt.length - 1);	while (txt.indexOf('  ') > 0) txt = txt.replace('  ', ' ')	return txt};function Explode(txt, sep) {	var isep; var el; var tmp = txt + sep; var i = 0; var arr = new Array();	while (tmp != '') {		isep = tmp.indexOf(sep); el = tmp.substr(0, isep); tmp = tmp.substr(isep + 1);		arr[i] = el; i++	};	return arr};function Implode(fld, sep) {	var arr = new Array();	for (var i = 0; i < fld.length; i++) arr[i] = fld.options[i].value;	return arr.join(sep)};function ProperCase(txt) {	var arr = new Array(), arr1 = new Array(); arr = txt.split(' ');	for (var i = 0; i < arr.length; i++) {		arr1 = arr[i].split('-');		for (var j = 0; j < arr1.length; j++) arr1[j] = arr1[j].substring(0, 1).toUpperCase() + arr1[j].substring(1).toLowerCase();		arr[i] = arr1.join('-');	}	return arr.join(' ')};function OpenInNewWindow(url) {	var param = '';	if (typeof(win) == 'object') win.close();	win = window.open(WebDBName() + url,'win',param);	win.focus()};function OpenNewDialogBox(url, x, y, title) {	var param = 'status=no,resizable=no,scrollbars=no,width=' + x.toString() + ',height=' + y.toString() + ',left=' + (scrx - x/2).toString() + ',top=' + (scry - y/2).toString();	if (typeof(win) == 'object') win.close();	win = window.open(url, title, param);	win.focus()};function SetValue(url) {	if (confirm('Czy jeste\u015B pewny, \u017Ce wys\u0142a\u0142e\u015B zam\u00F3wienie tej osobie?')) location.replace(url)};function SelectVideo(video) {	var path = (location.href).toLowerCase(); var ss = '&restricttocategory='; var ii = path.lastIndexOf(ss);	var url = ((ii > -1 ? path.substring(0, ii) : path) + ss + video);	location.replace(url)}