// odpalanie lightboxa z flasha

function SWFDelegate(url,width,height,caption,flashvars) {
   var objLink = document.createElement('a');
   objLink.setAttribute('href',url);
   objLink.setAttribute('rel','lightbox');
   objLink.setAttribute('title',caption);
   if(typeof width != 'undefined') {
	  objLink.setAttribute('width',width);
   }
   if(typeof height != 'undefined') {
	  objLink.setAttribute('height',height);
   }
   if(typeof flashvars != 'undefined') {
	  objLink.setAttribute('flashvars',flashvars);
   }
   Lightbox.prototype.start(objLink);
}

function addStyle(el, s){
  if(typeof(el) == 'string'){el = document.getElementById(el);}
  var st = s.split(';');
  for(var i=0; i<st.length; i++){
    var stl = st[i].split(':');
    if(stl.length == 2){
      stl[0] = stl[0].replace(/^\s*|\s*$/g,"");
      stl[1] = stl[1].replace(/^\s*|\s*$/g,"");
      stl[1] = stl[1].replace(/'/g, "\"");
      tmpStl = stl[0].split('-');
      stl[0] = tmpStl[0];
      for(var j=1; j < tmpStl.length; j++){
        stl[0] += tmpStl[j].charAt(0).toUpperCase() + tmpStl[j].substr(1).toLowerCase();
      }
      delete tmpStl;
      if(stl[0].length > 3){eval('el.style.' + stl[0] + ' = \'' + stl[1] + '\';');}
    }
  }
  return false;
}

function createLayer(path){
	if(!document.getElementById('kzi')){
		var kzi = document.body.appendChild(document.createElement('div'));
		kzi.id = 'kzi';
		document.getElementById('jt').appendChild(kzi);
	}
	addStyle('kzi','position:absolute;z-index:1000;width:100%;height:100%;display:block;left:0;top:0;');
	
	//var so = new SWFObject("swf/zoomin.swf", "kzi", "100%", "100%", "9", "#FFFFFF");
	var so = new SWFObject("swf/zoomin.swf", "kzif", "100%", "100%", "9", "#FFFFFF");
	so.addVariable("id", "100");
	so.addParam("wmode", "transparent");
	so.addParam("flashvars", path);
	so.write("kzi");
}

function closeZoomIn(){
	var kzi=document.getElementById('kzi');	
	addStyle('kzi','position:relative;z-index:0;width:1px;height:1px;display:none;');
	document.body.removeChild(document.getElementById('kzif'));
	document.body.removeChild(document.getElementById('kzi'));
}