(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";
		}
	}
}
