function auto_iframe(margines)
{
   if (parent != self && document.body && (document.body.scrollHeight || document.body.offsetHeight))
   {
      var undefined;
      if (isNaN(parseInt(margines))) var margines = 20;

      if (parent.document.getElementById) parent.document.getElementById('autoiframe').height = 1;
      else if (parent.document.all) parent.document.all['autoiframe'].height = 1;
      var wysokosc = document.body.scrollHeight != undefined ? document.body.scrollHeight : document.body.offsetHeight;
      if (wysokosc)
      {
        if (parent.document.getElementById)
        {
          parent.document.getElementById('autoiframe').height = wysokosc + margines;
          parent.document.getElementById('autoiframe').scrolling = 'no';
        }
        else if (parent.document.all)
        {
          parent.document.all['autoiframe'].height = wysokosc + margines;
          parent.document.all['autoiframe'].scrolling = 'no';
        }
      }
   }
}
window.onload = auto_iframe;

function checkAllDomains(form){
		for (var i=0;i< form.elements.length;i++) {
		var e = form.elements[i];
		if (e.checked == false) { e.checked=true; }
	}
parent.document.getElementById('check_one').checked=true;
document.getElementById('pull').name='pulldown';
}

function uncheckAllDomains(form){
		for (var j=0;j< form.elements.length;j++) {
		var e = form.elements[j];
		if (e.checked == true) 
		{ 
		e.checked=false; 
		}
	}
parent.document.getElementById('check_one').checked=false;
document.getElementById('pull').name='';
}

function check_parent(){
if(parent.document.getElementById('check_one').checked==true)
	{
	document.getElementById('pull').name='pulldown';
	}
}


function displayWindow(url, width, height) {
        var Win = window.open(url,"displayWindow",'width=' + width + ',height=' + height + ',resizable=0,scrollbars=yes,menubar=no,left=48,top=220' );
}

function disableNASK(obj)
{
	obj.disabled = !(obj.disabled);
	var z = (obj.disabled) ? 'disabled' : 'enabled';
	
	if (document.forms[0].NASK_registrant_box.checked) {
		obj.value="pole zablokowane";
	} else {
		obj.value="";
	}
	document.forms[0].cancelAUTHINFO.value = 'on';
	document.forms[0].cancelAKT_REJESTRANT.value = 'on';
}

function disableCOMPANY(obj)
{
	obj.disabled = !(obj.disabled);
	var z = (obj.disabled) ? 'disabled' : 'enabled';
	
	if (document.forms[0].COMPANY_box.checked)
		obj.value="pole zablokowane";
	else
		obj.value="";
	document.forms[0].cancelNIP.value = 'on';
	document.forms[0].cancelREPREZENTANT.value = 'on';
}
function us_hide(myid) {
	var obj;
	obj = document.getElementById(myid);
	obj.style.display = "none";
}
function us_show(myid) {
	var obj;
	obj = document.getElementById(myid);
	obj.style.display = "";
}



function waitPreloadPage() { //DOM
	if (document.getElementById){
		document.getElementById('prepage').style.visibility='hidden';
	}else{
		if (document.layers){ //NS4
			document.prepage.visibility = 'hidden';
		}else { //IE4
			document.all.prepage.style.visibility = 'hidden';
		}
	}
}

function showPreloadPage() { //DOM
	if (document.getElementById){
		document.getElementById('prepage').style.visibility='';
	}else{
		if (document.layers){ //NS4
			document.prepage.visibility = '';
		}else { //IE4
			document.all.prepage.style.visibility = '';
		}
	}
}

function waitPreloadPage2() { //DOM
	if (parent.document.getElementById){
		parent.document.getElementById('prepage2').style.visibility='hidden';
	}else{
		if (parent.document.layers){ //NS4
			parent.document.prepage2.visibility = 'hidden';
		}else { //IE4
			parent.document.all.prepage2.style.visibility = 'hidden';
		}
	}
}

function showPhoneHelp(){
	var w=((screen.width-760)/2) + 480;
	var h=screen.height;
	var url="phone_help.html";
	
	window.open(url,'Pomoc','height=390,width=540,resizable=yes,status=no,scrollbars=yes,toolbar=no,left='+w+',top=300');
	return true;
}

function showPasswordHelp(){
	var w=((screen.width-760)/2) + 480;
	var h=screen.height;
	var url="password_help.html";
	
	window.open(url,'Pomoc','height=150,width=305,resizable=yes,status=no,scrollbars=yes,toolbar=no,left='+w+',top=300');
	return true;
}

function showPasswordAccountHelp(){
	var w=((screen.width-760)/2) + 480;
	var h=screen.height;
	var url="passwordaccount_help.html";
	
	window.open(url,'Pomoc','height=150,width=305,resizable=yes,status=no,scrollbars=yes,toolbar=no,left='+w+',top=300');
	return true;
}

function showIndividualHelp(){
	var w=((screen.width-760)/2) + 480;
	var h=screen.height;
	var url="individual_help.html";
	
	window.open(url,'Pomoc','height=390,width=540,resizable=yes,status=no,scrollbars=yes,toolbar=no,left='+w+',top=300');
	return true;
}

function showTechnicanHelp(){
	var w=((screen.width-760)/2) + 480;
	var h=screen.height;
	var url="technican_help.html";
	
	window.open(url,'Pomoc','height=390,width=540,resizable=yes,status=no,scrollbars=yes,toolbar=no,left='+w+',top=300');
	return true;
}

function showAdminHelp(){
	var w=((screen.width-760)/2) + 480;
	var h=screen.height;
	var url="admin_help.html";
	
	window.open(url,'Pomoc','height=390,width=540,resizable=yes,status=no,scrollbars=yes,toolbar=no,left='+w+',top=300');
	return true;
}

function showDNSHelp(){
	var w=((screen.width-760)/2) + 480;
	var h=screen.height;
	var url="dns_help.html";
	
	window.open(url,'Pomoc','height=200,width=400,resizable=yes,status=no,scrollbars=yes,toolbar=no,left='+w+',top=300');
	return true;
}

function sprawdz_checkboxy(myform) {
        var licznik=0;
        for (var i = 0; i < myform.elements.length; i++) {
                if (myform.elements[i].type == 'checkbox' && myform.elements[i].checked==true) {
                        licznik=licznik+1;
                }
        }
        if(licznik==0) {
                return false;
        }
        return true;
}

