/* Last modyfication 2006-06-13 */
// Object.prototype.extending = function (supClass) {  tempObj = new supClass();  for (property in tempObj) { this[property] = tempObj[property]; } };

function GetObject(jaki){ 
if(!document.layers&&!document.all){ if (document.getElementById) { return (document.getElementById(jaki)!=undefined) ? document.getElementById(jaki) : jaki; } } 
if(document.all) { return (document.all[jaki]!=undefined) ? document.all[jaki] : jaki; } 
if(document.layers) { return (document.layers[jaki]!=undefined) ? (document.layers[jaki]) : jaki ; } 
if(document.forms[jaki]!=undefined) { return document.forms[jaki]; }
if(document.forms.length > 0){for(i=0;i<document.forms.length;i++){formularz=document.forms[i];if(formularz.length >0){for(ii=0;ii<formularz.length;ii++){  if(formularz.elements[ii].name == jaki){ return formularz[ii].name;break;}}}}}
return jaki;} 

function obj(jaki) {
  var refObj = new GetObject(jaki);
  for (property in refObj) { this[property] = refObj[property]; } 
  function _Error(kode) { alert(kode) }
  function _ShowHideDisplay() {  display = (this.style.display == '' || this.style.display == 'block') ? 'none' : 'block';  this.style.display = display;  }
  function _ShowHideVisibility()   {    visibility = (this.style.visibility=='' || this.style.visibility=='visible') ? 'hidden' : 'visible';    this.style.visibility = visibility;  }
  function _vpos(x,y) {  this.style.top = (x >= 0) ? x : this.style.top; this.style.left  = (y >=0) ? y : this.style.left;}
  function _opacity(v){  this.style.filter='alpha(opacity='+v+')';   this.style.MozOpacity= v/100; this.style.opacity = v/100; this.opacity = v; return v;}  
  function _H(v){refObj.innerHTML=v}function h(v){with(refObj.document){write(v);close()}}
  
  this.myblur = function () {}
  this.opacity = (this.opacity==undefined) ? 100 : this.opacity;
  this.Error=_Error; 
  this.SHDilspay=_ShowHideDisplay; 
  this.SHVisibility=_ShowHideVisibility;
  this.vopacity = _opacity;
  this.vpos =_vpos;
  this.write = _H;
}

function vpos(objid,x,y) { a=new obj(objid); a.vpos(x,y); }
function SHDilspay(objid) { a=new obj(objid); a.SHDilspay(); }
function SHVisibility(objid) { 
a=new obj(objid); a.SHVisibility(); 
  if(arguments.length > 1) {
    for (var n = 1; n < arguments.length; n++) {
      GetObject(arguments[n]).style.visibility = 'hidden';
    }
    
  }
  
}
/* FX function FX rollover for div */
function objFX(jaki) {  var refObj=new obj(jaki);  for (property in refObj) { this[property]=refObj[property]; }   this.name=jaki; }
function menu(a) { this.name = a; } var FX = new menu('Mymenu');function SHFX(objid,m){ten = new objFX(objid);FX[objid]=ten;if(m=='-'){na(objid,80);setTimeout("na('"+objid+"','80')",40);setTimeout("na('"+objid+"','60')",100);setTimeout("na('"+objid+"','0')",150);}else{if(m=='+'){na(objid,10);setTimeout("na('"+objid+"','20')",100);setTimeout("na('"+objid+"','25')",150);setTimeout("na('"+objid+"','30')",200);setTimeout("na('"+objid+"','35')",250);setTimeout("na('"+objid+"','40')",300);setTimeout("na('"+objid+"','45')",350);setTimeout("na('"+objid+"','50')",400);setTimeout("na('"+objid+"','60')",500);setTimeout("na('"+objid+"','65')",550);setTimeout("na('"+objid+"','70')",600);setTimeout("na('"+objid+"','75')",650);setTimeout("na('"+objid+"','85')",700);setTimeout("na('"+objid+"','100')",800);}}}
function na(objid,vt) {  o = FX[objid];  o.vopacity(vt); }
/* End FX function FX */

/**
 objName    nazwa obiektu src do którego ma mieĉ zastosowania rollover
 srcFile    zrodlo pomienianej grafiki
 objAction  dodatkowy obiekt wobeck którego ma zostaĉ zastosowana funkcja onmouseout
*/
function rollover(objName,srcFile,objAction) {
  var my = new GetObject(objName);
  if(my!=undefined) {
    srcTmp = my.src;
    my.src = srcFile;
    my.onmouseout = function(){my.src = srcTmp;} 
    if(objAction!=undefined)
    objAction.onmouseout = my.onmouseout;
  }
}
function rolloverClass(objName,cssName){var my = new GetObject(objName);if(my!=undefined){cssTmp=my.className;my.className=cssName;my.onmouseout=function(){my.className=cssTmp;}}}
/* NAWIGACJA */
/* skrocona wersja window location */
function go(path) {  window.location = path; }
/* FORMULARZE */
/* zaznacza wskazany element w grupie obiektó typu radio radio*/
function Text4Radio(name,nr){var tmp = GetObject(name);if(tmp!=undefined){for(i=0; i < tmp.length; i++){if(i==nr){tmp[i].checked=true; return true; }else{ tmp[i].checked=false;}}}}
function Text4Checbox(name) { var tmp = GetObject(name);if(tmp!=undefined)if(tmp.checked==true){tmp.checked=false;}else{ tmp.checked=true;return true;}}

function CheckUncheckAll(theElement){
var theForm=GetObject(theElement),z=0,tmp='none';
  for(z=0;z<theForm.length;z++){
    if(theForm[z].type=='checkbox'){
      if(tmp=='none') {
         tmp = (theForm[z].checked==true) ? false : true;
      }
    theForm[z].checked=tmp;
    }
  }
  return tmp;
}

function NewWindow(location,name,w,h) {
if(w== undefined && h == undefined ){w = 520;h = 600;}
namewindow = (name!=undefined) ? name : 'Okno'; var namewindow = window.open(location,namewindow,'height='+ h +',width='+ w +',status=yes,toolbar=no,menubar=no,location=no,directories=no,scrollbars=no,top=0,left=0');
namewindow.focus();
}




// alert('load object.js');