function FlashTag(src, uid, param, wmode, width, height)
{
    this.src       = src;
    this.uid       = uid;
    this.param     = param;
    this.width     = width;
    this.height    = height;
    this.version   = '7,0,14,0';
    this.id        = null;
    this.bgcolor   = 'ffffff';
    this.wmode     = wmode;
    this.flashVars = null;
}

FlashTag.prototype.setVersion = function(v)
{
    this.version = v;
}

FlashTag.prototype.setId = function(id)
{
    this.id = id;
}


FlashTag.prototype.setFlashvars = function(fv)
{
    this.flashVars = fv;
}

FlashTag.prototype.toString = function()
{
    var ie = (navigator.appName.indexOf ("Microsoft") != -1) ? 1 : 0;
    var flashTag = new String();
    if (ie)
    {
        flashTag += '<object id="' + this.uid + '" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" ';
        if (this.id != null)
        {
            flashTag += 'id="'+this.id+'" ';
        }
        flashTag += 'codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" ';
        flashTag += 'width="'+this.width+'" ';
        flashTag += 'height="'+this.height+'">';
        flashTag += '<param name="movie" value="'+this.src+'"/>';
        flashTag += '<param name="quality" value="high"/>';
		flashTag += '<param name="wmode" value="'+this.wmode+'"/>';
        flashTag += '<param name="bgcolor" value="#'+this.bgcolor+'"/>';
        //flashTag += '<param name="allowScriptAccess" value="sameDomain"/>';
        if (this.flashVars != null)
        {
            flashTag += '<param name="flashvars" value="'+this.flashVars+'&'+this.param+'"/>';
        }
        flashTag += '</object>';
    }
    else
    {
        flashTag += '<embed id="' + this.uid + '" src="'+this.src+'" ';
        flashTag += 'quality="high" '; 
        flashTag += 'bgcolor="#'+this.bgcolor+'" ';
        flashTag += 'width="'+this.width+'" ';
        flashTag += 'height="'+this.height+'" ';
		flashTag += 'wmode="'+this.wmode+'" ';
	//	flashTag += 'allowScriptAccess="sameDomain" ';
        flashTag += 'type="application/x-shockwave-flash" ';
        if (this.flashVars != null)
        {
            flashTag += 'flashvars="'+this.flashVars+'&'+this.param+'" ';
        }
        if (this.id != null)
        {
            flashTag += 'name="'+this.id+'" ';
        }
        flashTag += 'pluginspage="http://www.macromedia.com/go/getflashplayer">';
        flashTag += '</embed>';
    }
	op_n=1;

    return flashTag;
}
FlashTag.prototype.fetch = function()
{
    return this.toString();
}

function getPosition(obj,top) {
	 var x=top?obj.offsetTop:obj.offsetLeft;
	 obj=obj.offsetParent;
	 while (obj!=document.getElementsByTagName('body')[0]) 
	 	{
	  		x+=top?obj.offsetTop:obj.offsetLeft;
	  		obj=obj.offsetParent;
 		}
 return x;
};

function rozwin()
{
	var obj = document.getElementById('search');	
	obj.style.height = 325+'px';
}

function zwin()
{
	var obj = document.getElementById('search');	
	obj.style.height = 22+'px';
}

function outer()
{
	
	
	var	objects = document.getElementById("search");

	    objects.outerHTML = objects.outerHTML;
}

function ustawSearch()
{



	
	try { document.getElementById('banerek').innerHTML =  ftagbaner.fetch(); } catch (e){ };
	try { document.getElementById('kontakt').innerHTML =  ftagkontakt.fetch(); } catch (e){ };
	try { document.getElementById('oferta').innerHTML =  ftagoferta.fetch(); } catch (e){ };
	try { document.getElementById('dystrybucja').innerHTML =  ftagdystrybucja.fetch(); } catch (e){ };
	
		var srch = document.getElementById('srch');	
	var obj = document.getElementById('szukajka');
	obj.innerHTML = ftagszukaj.fetch(); 
	if(srch==undefined) return;
	obj.style.display = "block";
	obj.style.left=parseInt(getPosition(srch,0)+10)+'px';
	obj.style.top=parseInt(getPosition(srch,1)-2)+'px';
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function resizeOuterTo(w,h) {
 if (parseInt(navigator.appVersion)>3) {
   if (navigator.appName=="Netscape") {
    top.outerWidth=w+8;
    top.outerHeight=h+29;
   }
   else 
   {
    top.resizeTo(400,300);
    wd = 400-document.body.clientWidth;
    hd = 300-document.body.clientHeight;
    top.resizeTo(w+wd,h+hd);
   }
 }
}

function ustawRozmiar()
{
  resizeOuterTo(document.images['LargeImg'].width, document.images['LargeImg'].height);
}


(window.attachEvent)?attachEvent('onload', ustawSearch) : addEventListener('load', ustawSearch, false);
(window.attachEvent)?attachEvent('onresize', ustawSearch) : addEventListener('resize', ustawSearch, false);