function createFlash(flashSrc, flashGateway, flashWidth, flashHeight, destDiv, flashColor)
{
   this.lcId = new Date().getTime();
   var targetDiv = $(destDiv)
   if(flashGateway != "")
   {
      this.flashProxy = new FlashProxy(this.lcId, flashGateway);
   }
   var myControl = new FlashTag(flashSrc, flashWidth, flashHeight, "7,0,14,0");
   myControl.bgcolor = flashColor;
   myControl.setFlashvars("lcId=" + this.lcId);
   targetDiv.innerHTML =  myControl;
}
function objectLanguage(object)
{
   this.objectName = $(object)
   this.objectLanguage;
}
function pathToNameL(string)
{
   var tablica = new Array()
   tablica = string.split("/");
   return(tablica[tablica.length - 1])
}
function slownik()
{
   this.kategoria;
   this.slownik;
   var tablica = new Array();
   var string;
   tablica = string.split('/')
   tablica[tablica.length - 1]
   //    for(i = 0; i < this.slownik.length){
   //
   //    }
}
function objectValidator()
{
   this.textError = new String;
   this.typeToCheck = new String;
   this.alertControl;
   this.sourceControl;
   this.checkCon = new Boolean();
}
function validator(num)
{
   this.numCon = num;
   this.control = new Array();
   this.checkAll = new Boolean()
   this.cssName;
   for(i = 0; i < this.numCon; i ++ )
   {
      this.control[i] = new objectValidator()
      this.control[i].check = true;
   }
   this.checkTextError = function(v)
   {
      if(this.control[v].textError == '')
      {
         if(this.control[v].sourceControl.type == 'select-one')
         {
            this.control[v].textError = 'Prosz&#281; wyba&#263; pozycj&#281; z listy.'
            this.control[v].alertControl = $('val' + v)
            this.control[v].alertControl.className = this.cssName;
            this.control[v].alertControl.innerHTML = this.control[v].textError;
            this.control[v].check = false;
         }
         if(this.control[v].sourceControl.type == 'text')
         {
            this.control[v].textError = 'Prosz&#281; wype&#322;ni&#263; pole.'
            this.control[v].alertControl = $('val' + v)
            this.control[v].alertControl.className = this.cssName;
            this.control[v].alertControl.innerHTML = this.control[v].textError;
            this.control[v].check = false;
         }
      }
      if((this.control[v].textError) != '')
      {
         this.control[v].alertControl = $('val' + v)
         this.control[v].alertControl.className = this.cssName;
         this.control[v].alertControl.innerHTML = this.control[v].textError
         this.control[v].check = false;
      }
   }
   this.checkIn = function()
   {
      this.checkAll = true;
      for(i = 0; i < this.numCon; i ++ )
      {
         // Sprawdzanie czy jest wybrane lub wypelnione pole
         if(this.control[i].sourceControl.type == 'select-one')
         {
            if(this.control[i].sourceControl.selectedIndex == 0)
            {
               this.checkTextError(i)
            }
         }
         if(this.control[i].sourceControl.type == 'text')
         {
            if(this.control[i].sourceControl.value == '' && this.control[i].typeToCheck == '')
            {
               this.checkTextError(i)
            }
            if(this.control[i].typeToCheck == 'link')
            {
               if(this.control[i].sourceControl.value == '')
               {
                  this.checkTextError(i)
               }
               if(this.control[i].sourceControl.value != '')
               {
               }
            }
         }
         // Jesli spelnione sa warunki
         if(this.control[i].sourceControl.type == 'select-one')
         {
            if(this.control[i].sourceControl.selectedIndex != 0)
            {
               this.control[i].alertControl = $('val' + i)
               this.control[i].alertControl.innerHTML = '';
            }
         }
         if(this.control[i].sourceControl.type == 'text')
         {
            if(this.control[i].sourceControl.value != '' && this.control[i].check == true)
            {
               this.control[i].alertControl = $('val' + i)
               this.control[i].alertControl.innerHTML = '';
            }
         }
         if(this.control[i].check == false)
         {
            this.checkAll = false;
         }
      }
      return(this.checkAll);
   }
}
