var currFlashPluginVersion="10.1.102.64", ppc=null;
var ci, listVisible=false;

var msc, initObj, wnd=null;
var enableFormSubmit=true;
initClassObj=null;
hintObject=null;

function MM_callJS(jsStr) { //v2.0
  return eval(jsStr)
}

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.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_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_scanStyles(obj, prop) { //v9.0
  var inlineStyle = null; var ccProp = prop; var dash = ccProp.indexOf("-");
  while (dash != -1){ccProp = ccProp.substring(0, dash) + ccProp.substring(dash+1,dash+2).toUpperCase() + ccProp.substring(dash+2); dash = ccProp.indexOf("-");}
  inlineStyle = eval("obj.style." + ccProp);
  if(inlineStyle) return inlineStyle;
  var ss = document.styleSheets;
  for (var x = 0; x < ss.length; x++) { var rules = ss[x].cssRules;
  	if (typeof(rules)=="undefined") return "";
	for (var y = 0; y < rules.length; y++) { var z = rules[y].style;
	  if(z[prop] && (rules[y].selectorText == '*[ID"' + obj.id + '"]' || rules[y].selectorText == '#' + obj.id)) {
        return z[prop];
  }  }  }  return "";
}

function MM_getProp(obj, prop) { //v8.0
  if (!obj) return ("");
  if (prop == "L") return obj.offsetLeft;
  else if (prop == "T") return obj.offsetTop;
  else if (prop == "W") return obj.offsetWidth;
  else if (prop == "H") return obj.offsetHeight;
  else {
    if (typeof(window.getComputedStyle) == "undefined") {
	    if (typeof(obj.currentStyle) == "undefined" || obj.currentStyle==null){
		    if (prop == "P") return MM_scanStyles(obj,"position");
        else if (prop == "Z") return MM_scanStyles(obj,"z-index");
        else if (prop == "V") return MM_scanStyles(obj,"visibility");
	    } else {
	      if (prop == "P") return obj.currentStyle.position;
        else if (prop == "Z") return obj.currentStyle.zIndex;
        else if (prop == "V") return obj.currentStyle.visibility;
	    }
    } else {
	    if (prop == "P") return window.getComputedStyle(obj,null).getPropertyValue("position");
      else if (prop == "Z") return window.getComputedStyle(obj,null).getPropertyValue("z-index");
      else if (prop == "V") return window.getComputedStyle(obj,null).getPropertyValue("visibility");
    }
  }
}

function MM_dragLayer(objId,x,hL,hT,hW,hH,toFront,dropBack,cU,cD,cL,cR,targL,targT,tol,dropJS,et,dragJS) { //v9.01
  var i,j,aLayer,retVal,curDrag=null,curLeft,curTop,IE=document.all;
  var NS=(!IE&&document.getElementById); if (!IE && !NS) return false;
  retVal = true; if(IE && event) event.returnValue = true;
  if (MM_dragLayer.arguments.length > 1) {
    curDrag = document.getElementById(objId); if (!curDrag) return false;
    if (!document.allLayers) { document.allLayers = new Array();
      with (document){ if (NS) { var spns = getElementsByTagName("span"); var all = getElementsByTagName("div");
        for (i=0;i<spns.length;i++) if (MM_getProp(spns[i],'P')) allLayers[allLayers.length]=spns[i];}
        for (i=0;i<all.length;i++) {
	        if (MM_getProp(all[i],'P')) allLayers[allLayers.length]=all[i]; 
        }
    } }
    curDrag.MM_dragOk=true; curDrag.MM_targL=targL; curDrag.MM_targT=targT;
    curDrag.MM_tol=Math.pow(tol,2); curDrag.MM_hLeft=hL; curDrag.MM_hTop=hT;
    curDrag.MM_hWidth=hW; curDrag.MM_hHeight=hH; curDrag.MM_toFront=toFront;
    curDrag.MM_dropBack=dropBack; curDrag.MM_dropJS=dropJS;
    curDrag.MM_everyTime=et; curDrag.MM_dragJS=dragJS;
  
    curDrag.MM_oldZ = MM_getProp(curDrag,'Z');
    curLeft = MM_getProp(curDrag,'L');
    if (String(curLeft)=="NaN") curLeft=0; curDrag.MM_startL = curLeft;
    curTop = MM_getProp(curDrag,'T');
    if (String(curTop)=="NaN") curTop=0; curDrag.MM_startT = curTop;
    curDrag.MM_bL=(cL<0)?null:curLeft-cL; curDrag.MM_bT=(cU<0)?null:curTop-cU;
    curDrag.MM_bR=(cR<0)?null:curLeft+cR; curDrag.MM_bB=(cD<0)?null:curTop+cD;
    curDrag.MM_LEFTRIGHT=0; curDrag.MM_UPDOWN=0; curDrag.MM_SNAPPED=false; //use in your JS!
    document.onmousedown = MM_dragLayer; document.onmouseup = MM_dragLayer;
    if (NS) document.captureEvents(Event.MOUSEDOWN|Event.MOUSEUP);
    } else {
    var theEvent = ((NS)?objId.type:event.type);
    if (theEvent == 'mousedown') {
      var mouseX = (NS)?objId.pageX : event.clientX + document.body.scrollLeft;
      var mouseY = (NS)?objId.pageY : event.clientY + document.body.scrollTop;
      var maxDragZ=null; document.MM_maxZ = 0;
      for (i=0; i<document.allLayers.length; i++) { aLayer = document.allLayers[i];
        var aLayerZ = MM_getProp(aLayer,'Z');
        if (aLayerZ > document.MM_maxZ) document.MM_maxZ = aLayerZ;
        var isVisible = (MM_getProp(aLayer,'V')).indexOf('hid') == -1;
        if (aLayer.MM_dragOk != null && isVisible) with (aLayer) {
          var parentL=0; var parentT=0;
          if (NS) { parentLayer = aLayer.parentNode;
            while (parentLayer != null && parentLayer != document && MM_getProp(parentLayer,'P')) {
              parentL += parseInt(MM_getProp(parentLayer,'L')); parentT += parseInt(MM_getProp(parentLayer,'T'));
              parentLayer = parentLayer.parentNode;
              if (parentLayer==document) parentLayer = null;
          } } else if (IE) { parentLayer = aLayer.parentElement;       
            while (parentLayer != null && MM_getProp(parentLayer,'P')) {
              parentL += MM_getProp(parentLayer,'L'); parentT += MM_getProp(parentLayer,'T');
              parentLayer = parentLayer.parentElement; } }
          var tmpX=mouseX-((MM_getProp(aLayer,'L'))+parentL+MM_hLeft);
          var tmpY=mouseY-((MM_getProp(aLayer,'T'))+parentT+MM_hTop);
          if (String(tmpX)=="NaN") tmpX=0; if (String(tmpY)=="NaN") tmpY=0;
          var tmpW = MM_hWidth;  if (tmpW <= 0) tmpW += MM_getProp(aLayer,'W');
          var tmpH = MM_hHeight; if (tmpH <= 0) tmpH += MM_getProp(aLayer,'H');
          if ((0 <= tmpX && tmpX < tmpW && 0 <= tmpY && tmpY < tmpH) && (maxDragZ == null
              || maxDragZ <= aLayerZ)) { curDrag = aLayer; maxDragZ = aLayerZ; } } }
      if (curDrag) {
        document.onmousemove = MM_dragLayer;
        curLeft = MM_getProp(curDrag,'L');
        curTop = MM_getProp(curDrag,'T');
        if (String(curLeft)=="NaN") curLeft=0; if (String(curTop)=="NaN") curTop=0;
        MM_oldX = mouseX - curLeft; MM_oldY = mouseY - curTop;
        document.MM_curDrag = curDrag;  curDrag.MM_SNAPPED=false;
        if(curDrag.MM_toFront) {
          var newZ = parseInt(document.MM_maxZ)+1;
          eval('curDrag.'+('style.')+'zIndex=newZ');
          if (!curDrag.MM_dropBack) document.MM_maxZ++; }
        retVal = false; if(!NS) event.returnValue = false;
    } } else if (theEvent == 'mousemove') {
      if (document.MM_curDrag) with (document.MM_curDrag) {
        var mouseX = (NS)?objId.pageX : event.clientX + document.body.scrollLeft;
        var mouseY = (NS)?objId.pageY : event.clientY + document.body.scrollTop;
        var newLeft = mouseX-MM_oldX; var newTop  = mouseY-MM_oldY;
        if (MM_bL!=null) newLeft = Math.max(newLeft,MM_bL);
        if (MM_bR!=null) newLeft = Math.min(newLeft,MM_bR);
        if (MM_bT!=null) newTop  = Math.max(newTop ,MM_bT);
        if (MM_bB!=null) newTop  = Math.min(newTop ,MM_bB);
        MM_LEFTRIGHT = newLeft-MM_startL; MM_UPDOWN = newTop-MM_startT;
        if (NS){style.left = newLeft + "px"; style.top = newTop + "px";}
        else {style.pixelLeft = newLeft; style.pixelTop = newTop;}
        if (MM_dragJS) eval(MM_dragJS);
        retVal = false; if(!NS) event.returnValue = false;
    } } else if (theEvent == 'mouseup') {
      document.onmousemove = null;
      if (NS) document.releaseEvents(Event.MOUSEMOVE);
      if (NS) document.captureEvents(Event.MOUSEDOWN); //for mac NS
      if (document.MM_curDrag) with (document.MM_curDrag) {
        if (typeof MM_targL =='number' && typeof MM_targT == 'number' &&
            (Math.pow(MM_targL-(MM_getProp(document.MM_curDrag,'L')),2)+
             Math.pow(MM_targT-(MM_getProp(document.MM_curDrag,'T')),2))<=MM_tol) {
          if (NS) {style.left = MM_targL + "px"; style.top = MM_targT + "px";}
          else {style.pixelLeft = MM_targL; style.pixelTop = MM_targT;}
          MM_SNAPPED = true; MM_LEFTRIGHT = MM_startL-MM_targL; MM_UPDOWN = MM_startT-MM_targT; }
        if (MM_everyTime || MM_SNAPPED) eval(MM_dropJS);
        if(MM_dropBack) {style.zIndex = MM_oldZ;}
        retVal = false; if(!NS) event.returnValue = false; }
      document.MM_curDrag = null;
    }
    if (NS) document.routeEvent(objId);
  } return retVal;
}

function MM_displayStatusMsg(msgStr) { //v1.0
  status=msgStr;
  document.MM_returnValue = true;
}


function AC_AddExtension(src, ext)
{
  if (src.indexOf('?') != -1)
    return src.replace(/\?/, ext+'?'); 
  else
    return src + ext;
}

function AC_Generateobj(objAttrs, params, embedAttrs) 
{ 
  var str = '<object ';
  for (var i in objAttrs)
    str += i + '="' + objAttrs[i] + '" ';
  str += '>';
  for (var i in params)
    str += '<param name="' + i + '" value="' + params[i] + '" /> ';
  str += '<embed ';
  for (var i in embedAttrs)
    str += i + '="' + embedAttrs[i] + '" ';
  str += ' ></embed></object>';

  document.write(str);
}

function AC_FL_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
     , "application/x-shockwave-flash"
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_SW_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".dcr", "src", "clsid:166B1BCA-3F9C-11CF-8075-444553540000"
     , null
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
  var ret = new Object();
  ret.embedAttrs = new Object();
  ret.params = new Object();
  ret.objAttrs = new Object();
  for (var i=0; i < args.length; i=i+2){
    var currArg = args[i].toLowerCase();    

    switch (currArg){	
      case "classid":
        break;
      case "pluginspage":
        ret.embedAttrs[args[i]] = args[i+1];
        break;
      case "src":
      case "movie":	
        args[i+1] = AC_AddExtension(args[i+1], ext);
        ret.embedAttrs["src"] = args[i+1];
        ret.params[srcParamName] = args[i+1];
        break;
      case "onafterupdate":
      case "onbeforeupdate":
      case "onblur":
      case "oncellchange":
      case "onclick":
      case "ondblClick":
      case "ondrag":
      case "ondragend":
      case "ondragenter":
      case "ondragleave":
      case "ondragover":
      case "ondrop":
      case "onfinish":
      case "onfocus":
      case "onhelp":
      case "onmousedown":
      case "onmouseup":
      case "onmouseover":
      case "onmousemove":
      case "onmouseout":
      case "onkeypress":
      case "onkeydown":
      case "onkeyup":
      case "onload":
      case "onlosecapture":
      case "onpropertychange":
      case "onreadystatechange":
      case "onrowsdelete":
      case "onrowenter":
      case "onrowexit":
      case "onrowsinserted":
      case "onstart":
      case "onscroll":
      case "onbeforeeditfocus":
      case "onactivate":
      case "onbeforedeactivate":
      case "ondeactivate":
      case "type":
      case "codebase":
        ret.objAttrs[args[i]] = args[i+1];
        break;
      case "width":
      case "height":
      case "align":
      case "vspace": 
      case "hspace":
      case "class":
      case "title":
      case "accesskey":
      case "name":
      case "id":
      case "tabindex":
        ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
        break;
      default:
        ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
    }
  }
  ret.objAttrs["classid"] = classid;
  if (mimeType) ret.embedAttrs["type"] = mimeType;
  return ret;
}


//****************************************************************************************


function readCookies()
	{
	var i,arr,tmp,ret=new Object;
	
	arr=document.cookie.split("; ");
	if (arr.length==0) return null;
	for (i=0;i<arr.length;i++)
		{
		tmp=arr[i].split("=");
		if (tmp.length!=2) continue;
		ret[tmp[0]]=unescape(tmp[1]);
		}
	return ret;
	}
	
	
function writeCookie(name,value,expiryDays)
	{
	var tmp, expires=new Date();
	
	if (expiryDays==null)
		tmp=name+"="+escape(value);
	else
		{
		tmp=expires.getTime()+expiryDays*24*60*60*1000;
		expires.setTime(tmp);
		tmp=name+"="+escape(value)+"; expires="+expires.toGMTString();
		}
	
	document.cookie=tmp;
	}
	

function viewPicture(pictUrl,width,height,resizable)
	{
	var str=Array();
	
	if (wnd) wnd.close();
	str.push("resizable="+(resizable ? 1 : 0));
	if (width) str.push("width="+width);
	if (height) str.push("height="+height);
	str=str.join(",");
	wnd=open(pictUrl,"view",str);
	wnd.focus();
	}
	
	
function setFormAction(idOrObj,action)
	{
	var tmp;
	
	if (typeof(idOrObj)=="string")
		{
		tmp=document.getElementById(idOrObj);
		if (!tmp)
			{
			alert("setFormAction - form name '"+idOrObj+"' has not be found.");
			return false;
			}
		idOrObj=tmp;
		}
	else if (typeof(idOrObj.action)=="undefined")
		{
		alert("setFormAction - passed parameter is not a form object.");
		return false;
		}
	
	idOrObj.action=action;
	return true;
	}


function submitFormAction(formName,action)
	{
	var url, val, arr;
	var obj=document.getElementById(formName);
	var saveAction, glue="?";

	if (!action) action="";
	if (!obj)
		{
		alert("Form '"+formName+"' is not found in the document. Action refused.");	
		return;
		}

	if (!enableFormSubmit) 
		{
		obj.submit();
		return;
		}

	saveAction=obj.getAttribute("action").split("#");
	if (saveAction[0].indexOf("?")!=-1) glue="&";
		
	if (saveAction.length!=1 && saveAction.length!=2) 
		{
		alert("Form '"+formName+"' action field contains more then 1 '#' character. Action refused.");	
		return;
		}
	if (action!="")
		{
		action=saveAction[0] + glue + action;
		glue="&";
		}
		
	url=window.location.search.substr(1);
	if (url.length && document.cookie.indexOf("PHPSESSID=")==-1)
		{
		arr=url.split("&");
		for(i=0;i<arr.length;i++)
			{
			val=arr[i];
			val=val.split("=");
			if (val[0]=="PHPSESSID")
				{
				action+=glue+"PHPSESSID="+val[1];
				glue="&";
				break;
				}
			}
		}

	if (saveAction.length==2) action+="#"+saveAction[1];
	if (window.external && typeof(window.external.AutoCompleteSaveForm)!="undefined") window.external.AutoCompleteSaveForm(obj);
	obj.action=action;
	obj.submit();
	enableFormSubmit=false;
	}

	
function submitMode(formName,mode)
	{
	var form=document.getElementById(formName);
	
	if (!form || !form.elements["mode"])
		{
		alert("Form name '"+formName+"' or field name 'mode' in form name '"+formName+"' is not defined.");
		return;
		}
		
	form.elements["mode"].value=mode;
	form.submit();
	}
	
	
function submitForm(formName,mode,id,subid)
	{
	var url;
	var obj=document.getElementById(formName);
	var action="";

	if (!obj)
		{
		alert("Form '"+formName+"' is not found in the document. Action refused.");	
		return false;
		}

	if (mode==null)
		{
		submitFormAction(formName);
		return false;
		}
	
	action="mode="+mode;
	if (id!=null) action+="&id="+id;
	if (subid!=null) action+="&subid="+subid;
	submitFormAction(formName,action);
	return false;
	}


//optional second argument contains object with properties to use as arguments
function submitFormParams(formName)
	{
	var url;
	var obj=document.getElementById(formName);
	var action="", arg;

	if (!obj)
		{
		alert("Form '"+formName+"' is not found in the document. Action refused.");	
		return false;
		}

	if (arguments.length==1)
		{
		submitFormAction(formName);
		return false;
		}
		
	for (arg in arguments[1]) action+="&"+arg+"="+arguments[1][arg];
	if (action!="") action=action.substr(1);
	
	submitFormAction(formName,action);
	return false;
	}
	
	
function rewriteJSCode(str)
	{
	document.writeln(str);	
	}
	
	
function elementPosition(obj) 
	{ 
	var offsetLeft = 0, offsetTop = 0; 
	
	if (obj.offsetParent) 
		{ 
		offsetLeft = obj.offsetLeft; 
		offsetTop = obj.offsetTop; 
		while (obj = obj.offsetParent) 
			{ 
			offsetLeft += obj.offsetLeft; 
			offsetTop += obj.offsetTop; 
			} 
		} 
	
	return [offsetLeft,offsetTop]; 
	} 


	

//****************************************************************************************

function formKeyPress(ev)
	{
	var obj;

	if (ev)
		{
		if (ev.keyCode!=13) return true;
		}
	else if (window.event.keyCode!=13)
		return true;

	obj=initClassObj.getFormByFieldObj(this);
	if (!obj) return true;
	submitForm(obj.formName,obj.mode);
	
	return false;  
	}


function ic_getFormByFieldObj(fieldObj)
	{
	var cnt=this.fields.length;
	var i, obj;
	
	for(i=0; i<cnt; i++)
		{
		obj=this.fields[i];
		if (obj.fieldObj==fieldObj) return obj;
		}
		
	return null;
	}
	

function ic_submitByEnter(formName, fieldId, mode)
	{
	var obj=new Object();
	
	obj.formName=formName;
	obj.fieldId=fieldId;
	obj.mode=mode;
	
	this.fields[this.fields.length]=obj;
	}
	

//second and next parametera will be considered as registered function arguments
function ic_registerFunction(func)
	{
	var i,arr;

	arr=new Array();
	for(i=1;i<arguments.length; i++)
		arr.push(arguments[i]);
	this.func[this.func.length]=func;
	this.funcArgs[this.funcArgs.length]=arr;
	}
	
	
function ic_setHiPriority()
	{
	var tmp; 
	
	if (this.func.length<2) return;
	
	tmp=this.func[0];
	this.func[0]=this.func[this.func.length-1];
	this.func[this.func.length-1]=tmp;
	
	tmp=this.funcArgs[0];
	this.funcArgs[0]=this.funcArgs[this.funcArgs.length-1];
	this.funcArgs[this.funcArgs.length-1]=tmp;
	}
	

function ic_run()
	{
	var cnt=this.func.length;
	var i, obj;
	
	for(i=0;i<cnt;i++) 
		if (this.funcArgs[i].length>0)
			this.func[i](this.funcArgs[i]);
		else
			this.func[i]();
		
	this.func=Array();
	
	cnt=this.fields.length;
	for(i=0;i<cnt;i++) 
		{
		obj=document.forms[this.fields[i].formName];
		if (!obj || !obj[this.fields[i].fieldId]) continue;
		obj=obj[this.fields[i].fieldId];
		this.fields[i].fieldObj=obj;
		obj.onkeypress=formKeyPress;
		}
	}


function initClass()
	{
	this.run=ic_run;
	this.registerFunction=ic_registerFunction;
	this.submitByEnter=ic_submitByEnter;
	this.getFormByFieldObj=ic_getFormByFieldObj;
	this.setHiPriority=ic_setHiPriority;
	
	this.func=Array();
	this.funcArgs=Array();
	this.fields=Array();
	}
	
	
//****************************************************************************************

function hc_showError(message)
	{
	alert(message);
	return false;
	}
	
	
function hc_convertToObject(id)
	{
	var tmp;
	
	tmp=document.getElementById(id);
	if (!tmp) this.showError("Nie znaleziono obiektu ID '"+id+"'.");
	return tmp;
	}
	

function hc_show(ev)
	{
	var src, obj, mx, my, offX, offY, tmp;
	
	if (ev) //NN
		{
		src=ev.target;
		offX=window.pageXOffset;
		offY=window.pageYOffset;
		mx=ev.pageX;
		my=ev.pageY;
		}
	else if (window.event)
		{
		src=window.event.srcElement;
		obj=document.getElementsByTagName("html");
		obj=obj[0];
		offX=obj.scrollLeft;
		offY=obj.scrollTop;
		mx=window.event.clientX+offX;
		my=window.event.clientY+offY;
		}
	else
		return;
	
	src.hintConfig.hintTitleId.innerHTML=src.hintConfig.title;
	src.hintConfig.hintContentId.innerHTML=src.hintConfig.text.replace(/\n/g,"<br>");
	obj=src.hintConfig.hintObjectId;
	obj.style.width=src.hintConfig.width+"px";

	tmp=mx-src.hintConfig.xOffset-src.hintConfig.width;
	if (tmp<0 || tmp<offX) tmp=mx+src.hintConfig.xOffset;
	obj.style.left=tmp+"px";
	
	tmp=my-src.hintConfig.yOffset-obj.offsetHeight;
	if (tmp<0 || tmp<offY) tmp=my+src.hintConfig.yOffset;
	obj.style.top=tmp+"px";
	
	obj.style.visibility="visible";
	}


function hc_hide(ev)
	{
	var src;
	
	if (ev) //NN
		src=ev.target;
	else if (window.event)
		src=window.event.srcElement;
	else
		return;

	src.hintConfig.hintObjectId.style.visibility="hidden";
	}
	
	
function hc_registerSource(config)
	{
	var obj, prop;
	
	obj=new Object();
	for(prop in config)
		obj[prop]=config[prop];
	
	if (!obj.width) obj.width=150;
	if (!obj.xOffset) obj.xOffset=20;
	if (!obj.yOffset) obj.yOffset=20;
	if (!obj.hintTitleId) return this.showError("Brak pola 'hintTitleId' w obiekcie konfiguracyjnym komunikatu.");
	if (!obj.hintContentId) return this.showError("Brak pola 'hintContentId' w obiekcie konfiguracyjnym komunikatu.");
	if (!obj.hintObjectId) return this.showError("Brak pola 'hintObjectId' w obiekcie konfiguracyjnym komunikatu.");
	if (!obj.hintSourceId) return this.showError("Brak pola 'hintSourceId' w obiekcie konfiguracyjnym komunikatu.");
	if (!obj.title) return this.showError("Brak pola 'title' w obiekcie konfiguracyjnym komunikatu.");
	if (!obj.text) return this.showError("Brak pola 'text' w obiekcie konfiguracyjnym komunikatu.");
	
	obj.hintTitleId=this.convertToObject(obj.hintTitleId);
	if (!obj.hintTitleId) return false;
	obj.hintContentId=this.convertToObject(obj.hintContentId);
	if (!obj.hintContentId) return false;
	obj.hintObjectId=this.convertToObject(obj.hintObjectId);
	if (!obj.hintObjectId) return false;
	obj.hintSourceId=this.convertToObject(obj.hintSourceId);
	if (!obj.hintSourceId) return false;
	
	obj.hintSourceId.hintConfig=obj;
	obj.hintSourceId.onmouseover=function(ev) {hintObject.show(ev)};
	obj.hintSourceId.onmousemove=function(ev) {hintObject.show(ev)};
	obj.hintSourceId.onmouseout=function(ev) {hintObject.hide(ev)};
	}


function hintClass()
	{
	this.show=hc_show;
	this.hide=hc_hide;
	this.showError=hc_showError;
	this.convertToObject=hc_convertToObject;
	this.registerSource=hc_registerSource;
	}

//****************************************************************************************


function msc_updatePos(menuObj)
	{
	var width, offX;
	
	if (this.blockWidth==undefined || menuObj.xOffset==undefined) return;
	width = document.body.offsetWidth ? document.body.offsetWidth : window.innerWidth;	
	if (!width) return;
	offX=(Math.max(width,this.blockWidth)-this.blockWidth)/2;
	menuObj.style.left=(offX+menuObj.xOffset)+"px";
	}
	

function msc_rollOver(menuObj)
	{
	var i;

	menuObj.classObj.updatePos(menuObj);
	menuObj.style.visibility="visible";
	menuObj.classObj.setDelay(menuObj);
	
	for(i=0;i<menuObj.classObj.opened.length;i++)
		menuObj.classObj.opened[i].timer=1;
	}


function msc_rollOut(menuObj)
	{
	var i;
	
	for(i=0;i<menuObj.classObj.opened.length;i++)
		if (menuObj.classObj.opened[i]==menuObj) return;
		
	menuObj.classObj.opened.push(menuObj);
	}
	
	
function msc_setDelay(menuObj)
	{
	menuObj.timer=40;		
	}
	
	
function msc_timerEvent()
	{
	var i, arr;

	arr=Array();
	for(i=0;i<this.opened.length;i++)
		if (--this.opened[i].timer>0) 
			arr.push(this.opened[i]);
		else
			this.opened[i].style.visibility="hidden";
			
	this.opened=arr;
	}


//xOffset - use only when menu horizontal position should be related to centered object
function msc_assignMenu(linkId,menuId,xOffset)
	{
	var obj,menuObj;
	
	obj=document.getElementById(linkId);
	if (!obj) return alert("Link o ID '"+linkId+"' nie został zdefiniowany.");
	menuObj=document.getElementById(menuId);
	if (!menuObj) return alert("Menu o ID '"+menuId+"' nie zostało zdefiniowane.");

	menuObj.timer=0;
	menuObj.classObj=this;
	menuObj.onmousemove=function () {this.classObj.setDelay(this)};
	menuObj.xOffset=xOffset;
	obj.menuObj=menuObj;
	obj.triggerOverFnc=this.rollOver;
	obj.onmouseover=function () {this.triggerOverFnc(this.menuObj)};
	obj.triggerOutFnc=this.rollOut;
	obj.onmouseout=function () {this.triggerOutFnc(this.menuObj)};
	}
	
	
function msc_fixHorizontalPos(blockWidth)
	{
	this.blockWidth=blockWidth;
	}
	

	
function menuSystemClass()
	{
	this.assignMenu=msc_assignMenu;	
	this.rollOver=msc_rollOver;
	this.rollOut=msc_rollOut;
	this.timerEvent=msc_timerEvent;
	this.setDelay=msc_setDelay;
	this.fixHorizontalPos=msc_fixHorizontalPos;
	this.updatePos=msc_updatePos;
	
	this.blockWidth=null;
	this.opened=Array();
	setInterval(clock,50);
	}
	
function clock()
	{
	msc.timerEvent();		
	}
	

//************************************************************************************

	


function ppc_currentIndex()
	{
	var i;
	
	if (!this.gallerySetup) return null;
	for(i=0; i<this.gallerySetup["ids"].length; i++)
		if (this.gallerySetup["ids"][i]==this.currPictId) return i;
	return null;
	}


function ppc_nextPicture()
	{
	var i, idx=this.currentIndex();
	
	if (idx==null) return;
	for(i=0; i<this.gallerySetup["ids"].length; i++)
		{
		idx=++idx % this.gallerySetup["ids"].length;
		if (this.gallerySetup["ids"][idx]!=null) break;
		}
	this.removePicture();
	this.showPicture(this.gallerySetup["ids"][idx],"picture_"+this.gallerySetup["ids"][idx]+".dyn",this.gallerySetup["widths"][idx],this.gallerySetup["heights"][idx]);
	}
	
	
function ppc_previousPicture()
	{
	var i, idx=this.currentIndex();
	
	if (idx==null) return;
	for(i=0; i<this.gallerySetup["ids"].length; i++)
		{
		if (--idx<0) idx=this.gallerySetup["ids"].length-1;
		if (this.gallerySetup["ids"][idx]!=null) break;
		}
	this.removePicture();
	this.showPicture(this.gallerySetup["ids"][idx],"picture_"+this.gallerySetup["ids"][idx]+".dyn",this.gallerySetup["widths"][idx],this.gallerySetup["heights"][idx]);
	}


	
function ppc_removePicture()
	{
	var obj;
	
	if (!this.screenObj) return;
	obj=document.getElementsByTagName("body");
	obj=obj[0];
	obj.removeChild(this.screenObj);
	this.screenObj=null;
	}
	
	
function ppc_manyItems()
	{
	var i, counter=0, cnt=this.gallerySetup["ids"].length;
	
	if (cnt<2) return false;		
	for(i=0; i<cnt; i++)
		if (this.gallerySetup["ids"][i]!=null && ++counter>1) return true;
	return false;
	}
	

function ppc_showPicture(id,pictURL,w,h)
	{
	var tmp, tmp2;

	if (this.gallerySetupName) this.gallerySetup=eval(this.gallerySetupName); 
	this.currPictId=id;

	this.screenObj=document.createElement("div");
	this.screenObj.className="billboard";
	tmp=document.getElementsByTagName("body");
	tmp=tmp[0];
	tmp.appendChild(this.screenObj);
	
	this.pictureObj=document.createElement("div");
	this.pictureObj.className="billboardScreen";
	this.pictureObj.style.backgroundImage="url("+pictURL+")";
	this.pictureObj.style.width=w+"px";
	this.pictureObj.style.height=h+"px";
	this.pictureObj.style.marginTop=parseInt(Math.max(0,(document.documentElement.clientHeight-h)/2))+"px";
	this.screenObj.appendChild(this.pictureObj);
	
	tmp=document.createElement("div");
	tmp.className="billboardClose";
	tmp.rootObj=this;
	tmp.onclick=function() {this.rootObj.removePicture()};
	this.pictureObj.appendChild(tmp);
	
	if (!this.gallerySetup) return;

	if (this.manyItems() 
		&& typeof(this.gallerySetup["widths"])!="undefined" 
		&& typeof(this.gallerySetup["heights"])!="undefined")
		{
		tmp=document.createElement("div");
		tmp.className="billboardArrowLeft";
		tmp2=document.createElement("div");
		tmp2.rootObj=this;
		tmp2.onclick=function() {this.rootObj.previousPicture()};
		tmp.appendChild(tmp2);
		this.pictureObj.appendChild(tmp);
	
		tmp=document.createElement("div");
		tmp.className="billboardArrowRight";
		tmp2=document.createElement("div");
		tmp2.rootObj=this;
		tmp2.onclick=function() {this.rootObj.nextPicture()};
		tmp.appendChild(tmp2);
		this.pictureObj.appendChild(tmp);
		}
	
	tmp2=this.currentIndex();
	if (tmp2!=null && (this.gallerySetup["alts"][tmp2]!="" || this.gallerySetup["descriptions"][tmp2]!=""))
		{
		if (this.gallerySetup["alts"][tmp2]!="")
			{
			this.titleObj=document.createElement("p");
			this.titleObj.style.width=w+"px";
			this.titleObj.className="billboardTitle";
			this.titleObj.innerHTML=this.gallerySetup["alts"][tmp2];
			this.screenObj.appendChild(this.titleObj);
			}
		if (this.gallerySetup["descriptions"][tmp2]!="")
			{
			this.descriptionObj=document.createElement("p");
			this.descriptionObj.style.width=w+"px";
			this.descriptionObj.className="billboardDescription";
			this.descriptionObj.innerHTML=this.gallerySetup["descriptions"][tmp2].replace("\n","<br>");
			this.screenObj.appendChild(this.descriptionObj);
			}
		}
	}
	
/*
gallerySetupName - optional parameter - name of variable with array with fields:
ids,alts,descriptions,mimes
If skip to next/previous picture is required then additional fields must be set:
widths,heights
*/	
function picturePresenterClass(gallerySetupName)
	{
	this.currPictId=null;
	this.screenObj=null;
	this.descriptionObj=null;
	this.titleObj=null;
	this.pictureObj=null;
	this.gallerySetup=null;
	this.gallerySetupName=arguments.length==0 ? null : gallerySetupName;
	
	this.showPicture=ppc_showPicture;
	this.removePicture=ppc_removePicture;
	this.nextPicture=ppc_nextPicture;
	this.previousPicture=ppc_previousPicture;
	this.currentIndex=ppc_currentIndex;
	this.manyItems=ppc_manyItems;
	}

//************************************************************************************


function init()
	{
	initClassObj.run();
	}

initClassObj=new initClass();
hintObject=new hintClass();
 
/*	SWFObject v2.2 <http://code.google.com/p/swfobject/> 
	is released under the MIT License <http://www.opensource.org/licenses/mit-license.php> 
*/
var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="ShockwaveFlash.ShockwaveFlash",q="application/x-shockwave-flash",R="SWFObjectExprInst",x="onreadystatechange",O=window,j=document,t=navigator,T=false,U=[h],o=[],N=[],I=[],l,Q,E,B,J=false,a=false,n,G,m=true,M=function(){var aa=typeof j.getElementById!=D&&typeof j.getElementsByTagName!=D&&typeof j.createElement!=D,ah=t.userAgent.toLowerCase(),Y=t.platform.toLowerCase(),ae=Y?/win/.test(Y):/win/.test(ah),ac=Y?/mac/.test(Y):/mac/.test(ah),af=/webkit/.test(ah)?parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,X=!+"\v1",ag=[0,0,0],ab=null;if(typeof t.plugins!=D&&typeof t.plugins[S]==r){ab=t.plugins[S].description;if(ab&&!(typeof t.mimeTypes!=D&&t.mimeTypes[q]&&!t.mimeTypes[q].enabledPlugin)){T=true;X=false;ab=ab.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ag[0]=parseInt(ab.replace(/^(.*)\..*$/,"$1"),10);ag[1]=parseInt(ab.replace(/^.*\.(.*)\s.*$/,"$1"),10);ag[2]=/[a-zA-Z]/.test(ab)?parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof O.ActiveXObject!=D){try{var ad=new ActiveXObject(W);if(ad){ab=ad.GetVariable("$version");if(ab){X=true;ab=ab.split(" ")[1].split(",");ag=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}}catch(Z){}}}return{w3:aa,pv:ag,wk:af,ie:X,win:ae,mac:ac}}(),k=function(){if(!M.w3){return}if((typeof j.readyState!=D&&j.readyState=="complete")||(typeof j.readyState==D&&(j.getElementsByTagName("body")[0]||j.body))){f()}if(!J){if(typeof j.addEventListener!=D){j.addEventListener("DOMContentLoaded",f,false)}if(M.ie&&M.win){j.attachEvent(x,function(){if(j.readyState=="complete"){j.detachEvent(x,arguments.callee);f()}});if(O==top){(function(){if(J){return}try{j.documentElement.doScroll("left")}catch(X){setTimeout(arguments.callee,0);return}f()})()}}if(M.wk){(function(){if(J){return}if(!/loaded|complete/.test(j.readyState)){setTimeout(arguments.callee,0);return}f()})()}s(f)}}();function f(){if(J){return}try{var Z=j.getElementsByTagName("body")[0].appendChild(C("span"));Z.parentNode.removeChild(Z)}catch(aa){return}J=true;var X=U.length;for(var Y=0;Y<X;Y++){U[Y]()}}function K(X){if(J){X()}else{U[U.length]=X}}function s(Y){if(typeof O.addEventListener!=D){O.addEventListener("load",Y,false)}else{if(typeof j.addEventListener!=D){j.addEventListener("load",Y,false)}else{if(typeof O.attachEvent!=D){i(O,"onload",Y)}else{if(typeof O.onload=="function"){var X=O.onload;O.onload=function(){X();Y()}}else{O.onload=Y}}}}}function h(){if(T){V()}else{H()}}function V(){var X=j.getElementsByTagName("body")[0];var aa=C(r);aa.setAttribute("type",q);var Z=X.appendChild(aa);if(Z){var Y=0;(function(){if(typeof Z.GetVariable!=D){var ab=Z.GetVariable("$version");if(ab){ab=ab.split(" ")[1].split(",");M.pv=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}else{if(Y<10){Y++;setTimeout(arguments.callee,10);return}}X.removeChild(aa);Z=null;H()})()}else{H()}}function H(){var ag=o.length;if(ag>0){for(var af=0;af<ag;af++){var Y=o[af].id;var ab=o[af].callbackFn;var aa={success:false,id:Y};if(M.pv[0]>0){var ae=c(Y);if(ae){if(F(o[af].swfVersion)&&!(M.wk&&M.wk<312)){w(Y,true);if(ab){aa.success=true;aa.ref=z(Y);ab(aa)}}else{if(o[af].expressInstall&&A()){var ai={};ai.data=o[af].expressInstall;ai.width=ae.getAttribute("width")||"0";ai.height=ae.getAttribute("height")||"0";if(ae.getAttribute("class")){ai.styleclass=ae.getAttribute("class")}if(ae.getAttribute("align")){ai.align=ae.getAttribute("align")}var ah={};var X=ae.getElementsByTagName("param");var ac=X.length;for(var ad=0;ad<ac;ad++){if(X[ad].getAttribute("name").toLowerCase()!="movie"){ah[X[ad].getAttribute("name")]=X[ad].getAttribute("value")}}P(ai,ah,Y,ab)}else{p(ae);if(ab){ab(aa)}}}}}else{w(Y,true);if(ab){var Z=z(Y);if(Z&&typeof Z.SetVariable!=D){aa.success=true;aa.ref=Z}ab(aa)}}}}}function z(aa){var X=null;var Y=c(aa);if(Y&&Y.nodeName=="OBJECT"){if(typeof Y.SetVariable!=D){X=Y}else{var Z=Y.getElementsByTagName(r)[0];if(Z){X=Z}}}return X}function A(){return !a&&F("6.0.65")&&(M.win||M.mac)&&!(M.wk&&M.wk<312)}function P(aa,ab,X,Z){a=true;E=Z||null;B={success:false,id:X};var ae=c(X);if(ae){if(ae.nodeName=="OBJECT"){l=g(ae);Q=null}else{l=ae;Q=X}aa.id=R;if(typeof aa.width==D||(!/%$/.test(aa.width)&&parseInt(aa.width,10)<310)){aa.width="310"}if(typeof aa.height==D||(!/%$/.test(aa.height)&&parseInt(aa.height,10)<137)){aa.height="137"}j.title=j.title.slice(0,47)+" - Flash Player Installation";var ad=M.ie&&M.win?"ActiveX":"PlugIn",ac="MMredirectURL="+O.location.toString().replace(/&/g,"%26")+"&MMplayerType="+ad+"&MMdoctitle="+j.title;if(typeof ab.flashvars!=D){ab.flashvars+="&"+ac}else{ab.flashvars=ac}if(M.ie&&M.win&&ae.readyState!=4){var Y=C("div");X+="SWFObjectNew";Y.setAttribute("id",X);ae.parentNode.insertBefore(Y,ae);ae.style.display="none";(function(){if(ae.readyState==4){ae.parentNode.removeChild(ae)}else{setTimeout(arguments.callee,10)}})()}u(aa,ab,X)}}function p(Y){if(M.ie&&M.win&&Y.readyState!=4){var X=C("div");Y.parentNode.insertBefore(X,Y);X.parentNode.replaceChild(g(Y),X);Y.style.display="none";(function(){if(Y.readyState==4){Y.parentNode.removeChild(Y)}else{setTimeout(arguments.callee,10)}})()}else{Y.parentNode.replaceChild(g(Y),Y)}}function g(ab){var aa=C("div");if(M.win&&M.ie){aa.innerHTML=ab.innerHTML}else{var Y=ab.getElementsByTagName(r)[0];if(Y){var ad=Y.childNodes;if(ad){var X=ad.length;for(var Z=0;Z<X;Z++){if(!(ad[Z].nodeType==1&&ad[Z].nodeName=="PARAM")&&!(ad[Z].nodeType==8)){aa.appendChild(ad[Z].cloneNode(true))}}}}}return aa}function u(ai,ag,Y){var X,aa=c(Y);if(M.wk&&M.wk<312){return X}if(aa){if(typeof ai.id==D){ai.id=Y}if(M.ie&&M.win){var ah="";for(var ae in ai){if(ai[ae]!=Object.prototype[ae]){if(ae.toLowerCase()=="data"){ag.movie=ai[ae]}else{if(ae.toLowerCase()=="styleclass"){ah+=' class="'+ai[ae]+'"'}else{if(ae.toLowerCase()!="classid"){ah+=" "+ae+'="'+ai[ae]+'"'}}}}}var af="";for(var ad in ag){if(ag[ad]!=Object.prototype[ad]){af+='<param name="'+ad+'" value="'+ag[ad]+'" />'}}aa.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+ah+">"+af+"</object>";N[N.length]=ai.id;X=c(ai.id)}else{var Z=C(r);Z.setAttribute("type",q);for(var ac in ai){if(ai[ac]!=Object.prototype[ac]){if(ac.toLowerCase()=="styleclass"){Z.setAttribute("class",ai[ac])}else{if(ac.toLowerCase()!="classid"){Z.setAttribute(ac,ai[ac])}}}}for(var ab in ag){if(ag[ab]!=Object.prototype[ab]&&ab.toLowerCase()!="movie"){e(Z,ab,ag[ab])}}aa.parentNode.replaceChild(Z,aa);X=Z}}return X}function e(Z,X,Y){var aa=C("param");aa.setAttribute("name",X);aa.setAttribute("value",Y);Z.appendChild(aa)}function y(Y){var X=c(Y);if(X&&X.nodeName=="OBJECT"){if(M.ie&&M.win){X.style.display="none";(function(){if(X.readyState==4){b(Y)}else{setTimeout(arguments.callee,10)}})()}else{X.parentNode.removeChild(X)}}}function b(Z){var Y=c(Z);if(Y){for(var X in Y){if(typeof Y[X]=="function"){Y[X]=null}}Y.parentNode.removeChild(Y)}}function c(Z){var X=null;try{X=j.getElementById(Z)}catch(Y){}return X}function C(X){return j.createElement(X)}function i(Z,X,Y){Z.attachEvent(X,Y);I[I.length]=[Z,X,Y]}function F(Z){var Y=M.pv,X=Z.split(".");X[0]=parseInt(X[0],10);X[1]=parseInt(X[1],10)||0;X[2]=parseInt(X[2],10)||0;return(Y[0]>X[0]||(Y[0]==X[0]&&Y[1]>X[1])||(Y[0]==X[0]&&Y[1]==X[1]&&Y[2]>=X[2]))?true:false}function v(ac,Y,ad,ab){if(M.ie&&M.mac){return}var aa=j.getElementsByTagName("head")[0];if(!aa){return}var X=(ad&&typeof ad=="string")?ad:"screen";if(ab){n=null;G=null}if(!n||G!=X){var Z=C("style");Z.setAttribute("type","text/css");Z.setAttribute("media",X);n=aa.appendChild(Z);if(M.ie&&M.win&&typeof j.styleSheets!=D&&j.styleSheets.length>0){n=j.styleSheets[j.styleSheets.length-1]}G=X}if(M.ie&&M.win){if(n&&typeof n.addRule==r){n.addRule(ac,Y)}}else{if(n&&typeof j.createTextNode!=D){n.appendChild(j.createTextNode(ac+" {"+Y+"}"))}}}function w(Z,X){if(!m){return}var Y=X?"visible":"hidden";if(J&&c(Z)){c(Z).style.visibility=Y}else{v("#"+Z,"visibility:"+Y)}}function L(Y){var Z=/[\\\"<>\.;]/;var X=Z.exec(Y)!=null;return X&&typeof encodeURIComponent!=D?encodeURIComponent(Y):Y}var d=function(){if(M.ie&&M.win){window.attachEvent("onunload",function(){var ac=I.length;for(var ab=0;ab<ac;ab++){I[ab][0].detachEvent(I[ab][1],I[ab][2])}var Z=N.length;for(var aa=0;aa<Z;aa++){y(N[aa])}for(var Y in M){M[Y]=null}M=null;for(var X in swfobject){swfobject[X]=null}swfobject=null})}}();return{registerObject:function(ab,X,aa,Z){if(M.w3&&ab&&X){var Y={};Y.id=ab;Y.swfVersion=X;Y.expressInstall=aa;Y.callbackFn=Z;o[o.length]=Y;w(ab,false)}else{if(Z){Z({success:false,id:ab})}}},getObjectById:function(X){if(M.w3){return z(X)}},embedSWF:function(ab,ah,ae,ag,Y,aa,Z,ad,af,ac){var X={success:false,id:ah};if(M.w3&&!(M.wk&&M.wk<312)&&ab&&ah&&ae&&ag&&Y){w(ah,false);K(function(){ae+="";ag+="";var aj={};if(af&&typeof af===r){for(var al in af){aj[al]=af[al]}}aj.data=ab;aj.width=ae;aj.height=ag;var am={};if(ad&&typeof ad===r){for(var ak in ad){am[ak]=ad[ak]}}if(Z&&typeof Z===r){for(var ai in Z){if(typeof am.flashvars!=D){am.flashvars+="&"+ai+"="+Z[ai]}else{am.flashvars=ai+"="+Z[ai]}}}if(F(Y)){var an=u(aj,am,ah);if(aj.id==ah){w(ah,true)}X.success=true;X.ref=an}else{if(aa&&A()){aj.data=aa;P(aj,am,ah,ac);return}else{w(ah,true)}}if(ac){ac(X)}})}else{if(ac){ac(X)}}},switchOffAutoHideShow:function(){m=false},ua:M,getFlashPlayerVersion:function(){return{major:M.pv[0],minor:M.pv[1],release:M.pv[2]}},hasFlashPlayerVersion:F,createSWF:function(Z,Y,X){if(M.w3){return u(Z,Y,X)}else{return undefined}},showExpressInstall:function(Z,aa,X,Y){if(M.w3&&A()){P(Z,aa,X,Y)}},removeSWF:function(X){if(M.w3){y(X)}},createCSS:function(aa,Z,Y,X){if(M.w3){v(aa,Z,Y,X)}},addDomLoadEvent:K,addLoadEvent:s,getQueryParamValue:function(aa){var Z=j.location.search||j.location.hash;if(Z){if(/\?/.test(Z)){Z=Z.split("?")[1]}if(aa==null){return L(Z)}var Y=Z.split("&");for(var X=0;X<Y.length;X++){if(Y[X].substring(0,Y[X].indexOf("="))==aa){return L(Y[X].substring((Y[X].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(a){var X=c(R);if(X&&l){X.parentNode.replaceChild(l,X);if(Q){w(Q,true);if(M.ie&&M.win){l.style.display="block"}}if(E){E(B)}}a=false}}}}(); 


function infoTimer()
	{
	ci.checkFlash();	
	}


function ci_checkFlash()
	{
	var obj=document.getElementById("infoFlash");
		
	if (!obj) return;
	if (!obj.showDocument) return;
	clearInterval(this.timerId);
	this.timerId=null;
	this.showInfo(this.container,this.docId);
	}
	

function ci_flashNotReady()
	{
	this.timerId=setInterval(infoTimer,100);
	}


function ci_showInfo(container,id)
	{
	var pos, pos2, obj=document.getElementById("infoFlash");
	
	if (!obj) return;
	obj.style.visibility="visible";
	if (!obj.showDocument)
		{
		this.container=container;
		this.docId=id;
		this.flashNotReady();
		return;
		}
	obj.showDocument(id);
	
	pos2=elementPosition(document.getElementById("calendarForm"));
	pos=elementPosition(container);
	obj.style.left=(pos[0]-pos2[0]-380)+"px";
	obj.style.top=(pos[1]-pos2[1]-43)+"px";
	}
	


function ci_hideInfo()
	{
	var obj=document.getElementById("infoFlash");
	
	if (!obj) return;
	obj.style.visibility="hidden";
	}
	
	
function calendarInfo()
	{
	this.timerId=null;	
	this.container=null;
	this.docId=null;
	this.hideInfo=ci_hideInfo;	
	this.showInfo=ci_showInfo;	
	this.flashNotReady=ci_flashNotReady;
	this.checkFlash=ci_checkFlash;
	}
	
	
function viewFullScreen(id,url,width,height,alt,description)
	{
	var obj=Array();	

	obj["ids"]=Array(""+id);
	obj["widths"]=Array(""+width);
	obj["heights"]=Array(""+height);
	obj["alts"]=Array(decodeURI(alt));
	obj["descriptions"]=Array(decodeURI(description));
	
	ppc=new picturePresenterClass(obj);
	ppc.showPicture(id,url,width,height);
	}

	
function viewZoomed(id,fileName,bigW,bigH)
	{
	var obj = typeof(gallerySetup)=="undefined" ? null : gallerySetup;
	
	ppc=new picturePresenterClass(obj);
	ppc.showPicture(id,"picture_"+id+".dyn/"+fileName,bigW,bigH);
	}
	
	
function showList()
	{
	var obj=document.getElementById("playList");	
	
	obj=obj.getElementsByTagName("div");
	if (!obj) return;
	obj=obj[0];
	listVisible=!listVisible;
	obj.style.visibility = listVisible ? "visible" : "hidden";
	}
	
	
function playItem(idx)
	{
	var obj=document.getElementById("playerFlash");	
	
	if (!obj) return;
	obj.selectItem(idx);	
	showList();
	}
	


function initPage()
	{
	var arr, i, obj;
	
	obj=typeof(gallerySetup)=="undefined" ? null : gallerySetup;
	ppc=new picturePresenterClass(obj);
	ci=new calendarInfo();
	
	obj=new Object();
	if (typeof(sectionColor)!="undefined") obj.sectionColor=sectionColor;
	if (typeof(documentId)!="undefined") obj.documentId=documentId;
	
	swfobject.embedSWF("Skins/chor/photos/Header.swf","headerEmbed",628,400,currFlashPluginVersion,"/common/expressInstall.swf",obj,{quality:"high",wmode:"opaque",menu:"false"},{id:"headerFlash"});
	swfobject.embedSWF("Skins/chor/photos/Info.swf","infoEmbed",390,165,currFlashPluginVersion,"/common/expressInstall.swf",false,{quality:"high",wmode:"transparent",menu:"false"},{id:"infoFlash"});
	swfobject.embedSWF("Skins/chor/photos/CalendarBack.swf","calendarEmbed",210,205,currFlashPluginVersion,"/common/expressInstall.swf",{colorOffset: typeof(colorShift)=="undefined" ? 0 : colorShift},{quality:"high",wmode:"opaque",menu:"false"},{id:"calendarFlash"});
	swfobject.embedSWF("Skins/chor/photos/News.swf","newsEmbed",210,290,currFlashPluginVersion,"/common/expressInstall.swf",obj,{quality:"high",wmode:"transparent",menu:"false"},{id:"newsFlash"});
	swfobject.embedSWF("Skins/chor/photos/Mecenasi.swf","mecenasiEmbed",174,200,currFlashPluginVersion,"/common/expressInstall.swf",false,{quality:"high",wmode:"opaque",menu:"false"},{id:"mecenasiFlash"});
	swfobject.embedSWF("Skins/chor/photos/player.swf","playerEmbed",210,90,currFlashPluginVersion,"/common/expressInstall.swf",false,{quality:"high",wmode:"opaque",menu:"false"},{id:"playerFlash"});
	
	arr=document.getElementsByTagName("a");
	for (i=0; i<arr.length; i++)
		if (arr[i].rel=="external") arr[i].onclick=function () {window.open(this.href,"info"); return false;};
	}


window.onload=init;
initClassObj.registerFunction(initPage);
