/**
 * created by: Pavel Spacil, licence: LGPL, v. 0.9.17
 * modified by: 
 */ 
var SWindow=function(){var pr={w:200,h:0,opened:false,wh:null,whIn:null,cross:null,bg:null,sel:null,closeFunc:null,HideSelects:function(){if(pr.sel==null)
pr.sel=SJEL.$T(document.body,"select");for(var i=0;i<pr.sel.length;i++)
SJEL.SStyle(pr.sel[i],{visibility:"hidden"});},ShowSelects:function(){for(var i=0;i<pr.sel.length;i++)
SJEL.SStyle(pr.sel[i],{visibility:"visible"});}}
var pu={bgCol:"#000",opac:0.7,Init:function(){pr.wh=SJEL.CE("div");pr.whIn=SJEL.CE("div");pr.cross=SJEL.CE("div");pr.bg=SJEL.CE("div");pr.wh.className="s_win";pr.whIn.className="s_win_in";pr.cross.className="s_win_cross";pr.wh.appendChild(pr.cross);pr.wh.appendChild(pr.whIn);SJEL.AddEvent(pr.cross,"click",function(){pu.Close();});SJEL.SStyle(pr.bg,{position:"fixed",zIndex:5999,top:"0px",left:"0px",width:"100%",height:"100%",backgroundColor:pu.bgCol,opacity:pu.opac});if(SJEL.ie==6){SJEL.SStyle(pr.wh,{position:"absolute"});SJEL.SStyle(pr.bg,{position:"absolute"});}
SJEL.AddEvent(pr.bg,"click",function(){pu.Close();});},Open:function(_w,_h,_t,_cl){if(pr.opened)
return false;pu.Init();SJEL.AddEvent(document,"keyup",pu.OnKeyUp);pr.w=_w;pr.h=_h;pu.SetText(_t);if(pr.w<=0)
pr.w=200;if(_cl!=undefined)
SJEL.AddClass(pr.wh,_cl);SJEL.SStyle(pr.wh,{width:pr.w+"px"});if(pr.h>0)
SJEL.SStyle(pr.wh,{height:pr.h+"px"});if(SJEL.ie==6){SJEL.SStyle(pr.bg,{height:document.body.offsetHeight+"px"});pr.HideSelects();}
var wwh=SJEL.GWindowWH(),sy=0;if(SJEL.ie==6)
sy=SJEL.GScrollXY()[1];document.body.appendChild(pr.bg);if(pr.h>0){SJEL.SStyle(pr.wh,{left:((wwh[0]-pr.w)/2)+"px",top:(((wwh[1]-pr.h)/2)+sy)+"px"});document.body.appendChild(pr.wh);}else{document.body.appendChild(pr.wh);SJEL.SStyle(pr.wh,{left:((wwh[0]-pr.w)/2)+"px",top:(((wwh[1]-pr.wh.offsetHeight)/2)+sy)+"px"});}
pr.opened=true;return true;},SetText:function(_t){if(_t==undefined)
return;if(typeof(_t)=="string")
pr.whIn.innerHTML=_t;else if(typeof(_t)=="object"){pr.whIn.innerHTML="";pr.whIn.appendChild(_t);}},OnKeyUp:function(_e){if(!_e)
_e=event;switch(_e.keyCode){case 27:pu.Close();break;}},OnCloseFunc:function(_f){pr.closeFunc=_f;},Close:function(){if(pr.closeFunc!=null)
pr.closeFunc();if(SJEL.ie==6)
pr.ShowSelects();SJEL.RemoveEvent(document,"keyup",pu.OnKeyUp);document.body.removeChild(pr.bg);document.body.removeChild(pr.wh);pr.opened=false;}}
return pu;}();
