function noweOkno(imageType,imageName,imageWidth,imageHeight,alt) {  // v4.01
	posLeft = (screen.width) ? (screen.width-imageWidth)/2 : 0;
	posTop = (screen.height) ? (screen.height-imageHeight)/2 : 0;
	newWindow = window.open("","newWindow","width="+imageWidth+",height="+imageHeight+",scrollbars=no,left="+posLeft+",top="+posTop);
	newWindow.document.open();
	newWindow.document.write('<html><title>'+alt+'</title><body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" onBlur="self.close()">');
	newWindow.document.write('<img src=\"'+imageName+'\" width='+imageWidth+' height='+imageHeight+' border="0" alt=\"'+alt+'\" title=\"'+alt+'\" onClick="javascript:window.close()" style="cursor:pointer">');
	newWindow.document.write('</body></html>');
	newWindow.document.close();
}


function okno(url, imgWidth, imgHeight) {
	posLeft = (screen.width) ? (screen.width-imgWidth)/2 : 0;
	posTop = (screen.height) ? (screen.height-imgHeight)/2 : 0;
	var okno = window.open(url,'okno','width=' + imgWidth + ',height=' + imgHeight + ',resizable=no,scrollbars=yes,left='+posLeft+',top='+posTop);
}


function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_swapImgRestore()
{ //v3.0
	var i,x,a=document.MM_sr;
	for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages()
{ //v3.0
	var d=document;
	if(d.images)
	{
		if(!d.MM_p) d.MM_p=new Array();
		var i,j=d.MM_p.length,a=MM_preloadImages.arguments;
		for(i=0; i<a.length; i++)
		if (a[i].indexOf("#")!=0)
		{
			d.MM_p[j]=new Image;
			d.MM_p[j++].src=a[i];
		}
	}
}

function MM_findObj(n, d)
{ //v4.0
	var p,i,x;
	if(!d) d=document;
	if((p=n.indexOf("?"))>0&&parent.frames.length)
	{
		d=parent.frames[n.substring(p+1)].document;
		n=n.substring(0,p);
	}
	if(!(x=d[n])&&d.all) x=d.all[n];
	for(i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
	if(!x && document.getElementById) x=document.getElementById(n);
	return x;
}

function MM_swapImage()
{ //v3.0
	var i,j=0,x,a=MM_swapImage.arguments;
	document.MM_sr=new Array;
	for(i=0;i<(a.length-2);i+=3)
	if ((x=MM_findObj(a[i]))!=null)
	{
		document.MM_sr[j++]=x;
		if(!x.oSrc) x.oSrc=x.src;
		x.src=a[i+2];
	}
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_jumpMenuGo(selName,targ,restore){ //v3.0
  var selObj = MM_findObj(selName); if (selObj) MM_jumpMenu(targ,selObj,restore);
}

function set_email(obj){
  if (obj.selectedIndex != 0) {
    adres_email=obj[obj.selectedIndex].title;
  	document.mainForm.email.value=adres_email;
  }
}



function BlurText(BoxName)
{
	if (BoxName.value == '')
	{
		BoxName.value = BoxName.defaultValue;
	}
}

function FocusText(BoxName)
{
	if (BoxName.value == BoxName.defaultValue)
	{
		BoxName.value = '';
	}
}


//JavaSctipt doc - http://www.hubert.idv.tw/
function require() {
  ile = tab_req.length;
  allok=0;
  for (var i=0;i<ile;i+=2) {
    obj=document.getElementById(tab_req[i]);
    if (obj==undefined) { alert('Not found object: '+tab_req[i]); continue; }
      obj_typ=obj.type;
      if (tab_req[i+1]==null || tab_req[i+1]==undefined ) obj_txt=new Object();
      else {
        obj_txt=document.getElementById(tab_req[i+1]);
        if (obj_txt==undefined) { alert('Not found text: '+tab_req[i+1]); continue; }
    }
    switch (obj_typ){                          
      case 'password':                         
      case 'text':                             
      case 'textarea':                         
        if (obj.value=='') { obj_txt.className='on'; allok++; }
        else obj_txt.className='off';          
        break;                                 
      case 'select-one':
        if (obj.selectedIndex<1) { obj_txt.className='on'; allok++; }
        else obj_txt.className='off';
        break;
      case 'radio':
         all_obj=eval('document.'+obj.form.name+'.'+obj.name);
         ile=all_obj.length
         ok=0
         for (var j=0; j<ile; j++) if (all_obj[j].checked) ok++;
         if (ok==0) { obj_txt.className='on'; allok++; }
         else obj_txt.className='off';
        break
      default :  alert(obj_typ);
     }
  }
  if (allok==0) document.getElementById('wyslij').disabled=false;
  else document.getElementById('wyslij').disabled=true;
}

function set_cols(){
  obj_lang=document.testForm.dbs_lang;
  ile_lang=obj_lang.length
  for (var i=0; i<ile_lang; i++) if (obj_lang[i].checked) choise_lang=obj_lang[i].value
  
  obj_col=document.testForm.dbi_col;
  ile_col=obj_col.length
  for (var i=0; i<ile_col; i++) if (obj_col[i].checked) choise_col=obj_col[i].value

  for (var i=1; i<=6; i++){
     element_name='cols_dbs_'+i+'_'+choise_lang
     obj=document.getElementById(element_name);
     if (i<=choise_col) { //element aktywny
       obj.className='lib_input_400';
       obj.disabled=false;
     }
     else { //element zablokowany
       obj.className='lib_input_400_disabled';
       obj.disabled=true;
     }
  }
}


