(top.location == self.location) || (top.location = self.location)

function imgchange(obj, src){
    obj.src = src;
}

function czatWindow(url) {
        var win = ''; 
        win = window.open(url,"czatWindow",'resizable=1,scrollbars=auto,menubar=no' );
}

function popup(url, width, height) {
        var win = ''; 
        win = window.open(url,"popup",'width=' + width + ',height=' + height + 'resizable=1,scrollbars=yes,menubar=no' );
	win.focus();
}

function maxlength( field, countfield, maxlimit ){
    if ( field.value.length > maxlimit ){
	field.value = field.value.substring( 0, maxlimit );
	alert( 'Przekroczona maksymalna dozwolona ilość znaków (' + maxlimit + ')' );
	return false;
    }
    else{
	countfield.value = maxlimit - field.value.length;
    }
}

function setF(form, id, value){
    var obj = eval("window.opener.document.forms["+form+"]."+id);    
    obj.value =  value;
    window.close();
    return true;
}


function pokaz(id) {
	document.getElementById(id).style.display = 'block';
}
function ukryj(id, value, parent) {
	document.getElementById(parent).value = value;
	document.getElementById(id).style.display = 'none';
}
function divblur(input_id, div_id){
	var rows = document.getElementsByTagName("a");
	
	document.getElementById(input_id).blur();
	for(i = 0; i < rows.length; i++) {
		rows[i].onmouseover = function() {
			if(this.parentNode.id == div_id)
				this.parentNode.style.display = "block";
		}
		rows[i].onmouseout = function() {
			if(this.parentNode.id == div_id)
				this.parentNode.style.display = "none";
		}
	}
}


/*	
    @Modification date: 2012/01/23 
    @Author:  FAUST
    @Description: add pdf get button after reservation href 
*/ 

function base64_encode (data) {
    var b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
    var o1, o2, o3, h1, h2, h3, h4, bits, i = 0,
    ac = 0,
    enc = "",
    tmp_arr = []; 
    if (!data) {
	return data;
    }

    data = this.utf8_encode(data + '');
    do { // pack three octets into four hexets
	o1 = data.charCodeAt(i++);
        o2 = data.charCodeAt(i++);
        o3 = data.charCodeAt(i++);
        bits = o1 << 16 | o2 << 8 | o3;
        h1 = bits >> 18 & 0x3f;
        h2 = bits >> 12 & 0x3f;
        h3 = bits >> 6 & 0x3f;
        h4 = bits & 0x3f;
        // use hexets to index into b64, and append result to encoded string
        tmp_arr[ac++] = b64.charAt(h1) + b64.charAt(h2) + b64.charAt(h3) + b64.charAt(h4);
    } while (i < data.length);
   enc = tmp_arr.join('');
   var r = data.length % 3;
   return (r ? enc.slice(0, r - 3) : enc) + '==='.slice(r || 3);
}

function utf8_encode (argString) {
    // Encodes an ISO-8859-1 string to UTF-8  
        // 
            // version: 1109.2015
                // discuss at: http://phpjs.org/functions/utf8_encode
                    // +   original by: Webtoolkit.info (http://www.webtoolkit.info/)
                        // +   improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
                            // +   improved by: sowberry
                                // +    tweaked by: Jack
                                    // +   bugfixed by: Onno Marsman
                                        // +   improved by: Yves Sucaet
                                            // +   bugfixed by: Onno Marsman
                                                // +   bugfixed by: Ulrich
                                                    // +   bugfixed by: Rafal Kukawski
                                                        // *     example 1: utf8_encode('Kevin van Zonneveld');
                                                            // *     returns 1: 'Kevin van Zonneveld'
                                                                if (argString === null || typeof argString === "undefined") {
                                                                        return "";
                                                                            }
                                                                             
                                                                                 var string = (argString + ''); // .replace(/\r\n/g, "\n").replace(/\r/g, "\n");
                                                                                     var utftext = "",
                                                                                             start, end, stringl = 0;
                                                                                              
                                                                                                  start = end = 0;
                                                                                                      stringl = string.length;
                                                                                                          for (var n = 0; n < stringl; n++) {
                                                                                                                  var c1 = string.charCodeAt(n);
                                                                                                                          var enc = null;
                                                                                                                           
                                                                                                                                   if (c1 < 128) {
                                                                                                                                               end++;
                                                                                                                                                       } else if (c1 > 127 && c1 < 2048) {
                                                                                                                                                                   enc = String.fromCharCode((c1 >> 6) | 192) + String.fromCharCode((c1 & 63) | 128);
                                                                                                                                                                           } else {
                                                                                                                                                                                       enc = String.fromCharCode((c1 >> 12) | 224) + String.fromCharCode(((c1 >> 6) & 63) | 128) + String.fromCharCode((c1 & 63) | 128);
                                                                                                                                                                                               }
                                                                                                                                                                                                       if (enc !== null) {
                                                                                                                                                                                                                   if (end > start) {
                                                                                                                                                                                                                                   utftext += string.slice(start, end);
                                                                                                                                                                                                                                               }
                                                                                                                                                                                                                                                           utftext += enc;
                                                                                                                                                                                                                                                                       start = end = n + 1;
                                                                                                                                                                                                                                                                               }
                                                                                                                                                                                                                                                                                   }
                                                                                                                                                                                                                                                                                    
                                                                                                                                                                                                                                                                                        if (end > start) {
                                                                                                                                                                                                                                                                                                utftext += string.slice(start, stringl);
                                                                                                                                                                                                                                                                                                    }
                                                                                                                                                                                                                                                                                                     
                                                                                                                                                                                                                                                                                                         return utftext;
                                                                                                                                                                                                                                                                                                         }

jQuery(document).ready(function() {
    var fURL= base64_encode(location.href);
    
    jQuery('#rezBut').after('<a href="http://pdf.studio-it.pl/?url='+fURL+'&plugin=namorzu.pl&pdf=true" class="fPDF">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>');
});








