/* ----- ac_runactivecontent.js ---- */
//v1.0
//Copyright 2006 Adobe Systems, Inc. All rights reserved.
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;
}/* ----- javascripts.js ---- */

var firefox = ((navigator.userAgent.indexOf("Firefox")!= -1))? true : false; 
var basename = location.href.substring(location.href.lastIndexOf('/')+1);
var mediaurl;
var hours;
var minutes;
var seconds;
var timer=null;
var secondsinsession = 0;
var usingcookies = true;


var localCopyPlayerOptions ="&amp;bg=0xffffcc&amp;leftbg=0x6699cc&amp;rightbg=0x6699cc&amp;rightbghover=0x336699&amp;lefticon=0xFFFFFF&amp;righticon=0xFFFFFF&amp;righticonhover=0xFFFFFF&amp;text=0x000000&amp;slider=0x006699&amp;track=0xFFFFFF&amp;loader=0x99ccff&amp;border=0x666666&amp;"; 


function GoUrl(str){
	location.href=str;
}

function getE(el){
	if(document.getElementById(el)){
	return document.getElementById(el);	
	}else{		
	return false;	
	}	
}

if(basename.length<1){ basename = 'index.php';	}




function sClock(h,m,s)
{
  hours=h;
  minutes=m;
  seconds=s; 
  if(timer == null){
  timer=setInterval("work();",1000);
  }    
}


function ShowPopImage(id,width,height,size,imgid){
	if(width<1){ width= 150; }
	if(height<1){ height= 150; }	
	var winleft = (screen.width - width) / 2;
	var winUp = (screen.height - height) / 2;
	usethis='';	if(imgid>0){ usethis = '&only='+imgid;	}
	child = window.open("showimage.php?SP="+id+"&WS="+size+''+usethis, "imageview", "status=0,resizable=1,HEIGHT="+height+",WIDTH="+width+",left="+winleft+",top="+winUp);
	child.focus();
	return false;
}



/* calendar functions */
function GoDay(day,month,year){	
	d = document.CalendarForm;
	d.DD.value=day;
	d.MM.value=month;
	d.YY.value=year;	
	d.submit();
}



function twoDigit(_v)
{

  	if(_v<10 && _v.lenght<2){_v="0"+_v;}
  	return _v;

}

function work()
{

  if (!document.layers && !document.all && !document.getElementById) return;
  var runTime = new Date();
  var dn ="";
  var shours = hours;
  var sminutes = minutes;
  var sseconds = seconds;
  if (!shours) shours = 0;
  sminutes=twoDigit(sminutes);
  sseconds=twoDigit(sseconds);
  shours  =twoDigit(shours);
  if(shours<1 && sminutes<1 && sseconds<1){ window.location.reload(); }
  serverrunningtime = ""+ shours + ":" + sminutes +":"+sseconds+"" + dn;
	if (document.getElementById){
	field = document.getElementById('clock');
	field.innerHTML=serverrunningtime;
	}
	
  else if (document.layers)
  {
    document.layers.clock.document.open();
    document.layers.clock.document.write(serverrunningtime);
    document.layers.clock.document.close();
  }
  else if (document.all){
    clock.innerHTML = serverrunningtime;
	}
	
  if(++seconds>59)
  {
    seconds=0;
    if(++minutes>59)
    {
      minutes=0;
      if(++hours>23)
      {
        hours=0;
      }
    }
  }
}



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];}
}

//mini ajax functions
function $(e){if(typeof e=='string')e=document.getElementById(e);return e};
function collect(a,f){var n=[];for(var i=0;i<a.length;i++){var v=f(a[i]);if(v!=null)n.push(v)}return n};

var ajax={};
ajax.x=function(){try{return new ActiveXObject('Msxml2.XMLHTTP')}catch(e){try{return new ActiveXObject('Microsoft.XMLHTTP')}catch(e){return new XMLHttpRequest()}}};
ajax.serialize=function(f){var g=function(n){return f.getElementsByTagName(n)};var nv=function(e){if(e.name)return encodeURIComponent(e.name)+'='+encodeURIComponent(e.value);else return ''};var i=collect(g('input'),function(i){if((i.type!='radio'&&i.type!='checkbox')||i.checked)return nv(i)});var s=collect(g('select'),nv);var t=collect(g('textarea'),nv);return i.concat(s).concat(t).join('&');};
ajax.send=function(u,f,m,a){var x=ajax.x();x.open(m,u,true);x.onreadystatechange=function(){if(x.readyState==4)f(x.responseText)};if(m=='POST')x.setRequestHeader('Content-type','application/x-www-form-urlencoded');x.send(a)};
ajax.get=function(url,func){ajax.send(url,func,'GET')};
ajax.gets=function(url){var x=ajax.x();x.open('GET',url,false);x.send(null);return x.responseText};
ajax.post=function(url,func,args){ajax.send(url,func,'POST',args)};
ajax.update=function(url,elm){var e=$(elm);var f=function(r){e.innerHTML=r};ajax.get(url,f)};
ajax.submit=function(url,elm,frm){ var e=$(elm); var f=function(r){e.innerHTML=r}; ajax.post(url,f,ajax.serialize(frm)) };
ajax.submitwithfunction=function(url,func,frm){	args = ajax.serialize(frm); ajax.post(url,func,args);  };


function ReplaceIntroImage(newsrc,introimg){
	if(	introimg!=undefined){
		if(	introimg.length>0){
			var f = getE(''+introimg+'');
			f.src = newsrc;
		}
	}
}

 
var CURRENTINTROIMAGE = "";
function ReplaceIntroImage(ximgh,ximgsm,primg,introimg){
	if(	introimg!=undefined){
		if(ximgh.length>0){
			f = getE(''+ximgh+'');
			f2 = getE(''+ximgsm+'');			
			f3 = getE(''+introimg+''); //intro holder
			f4 = getE('intrbig');
			f5 = getE('intrsm');
			f6 = getE(''+primg+'');
			
		
			var cmb = f4.value;
			var csm = f5.value;
						
			f3.src = f.value;
			f4.value = f.value;
			f5.value = f2.value;
			f.value = cmb;
			f2.value = csm;
			f6.src = csm;
		}
	}
}

function inserttempajaxdiv(){
	if(!getE('tempajaxdiv')){
	newdiv = document.createElement("div");	
	newdiv.id = "tempajaxdiv";
	document.body.appendChild(newdiv);
	}
}

function insertajaxaform(){		
	inserttempajaxdiv();		
	
	if(getE('tempajaxdiv')){
	str = '<form name="ARTICLEAJAXFORM" id="ARTICLEAJAXFORM" method="post" style="display:none">';
	str += '<input type="hidden" name="S" value="" />';
	str += '<input type="hidden" name="Article" value="" />';
	str += '<input type="hidden" name="Action" value="AjaxArticle" />';
	str += '<input type="hidden" name="L" value="" />';
	str += '<input type="hidden" name="IE" value="0" />';
	str += '<input type="hidden" name="DIVID" value="" />';
	str += '</form>';
	getE('tempajaxdiv').innerHTML = str;
	return true;
	}else{
	return false;
	}
}

function ElOffSet(el){
return getE(el).offsetHeight;
}
function RemoveElement(elm){
if(getE(elm)){	
	el = getE(elm);	
	el.parentNode.removeChild(el);			
	}
}
function insertajaxcont(responce){	

	a = responce.indexOf('<!-- DIVID:');	
	if(a==0){
		newresponce = responce.replace('<!-- DIVID:','');		
		toplimit = parseInt(newresponce.indexOf(' -->'));
		if(toplimit>0){
		ajaxdivid = newresponce.substring(0,toplimit);
		l = parseInt(ajaxdivid.length);
			if(l>0){
				if(getE(ajaxdivid)){
				t = getE(ajaxdivid);
				pd = ajaxdivid.substring(0,l-1);
				rl = newresponce.length;
				newresponce = newresponce.substring((l+4),rl);
					if(pd.length>0){
						RemoveElement(ajaxdivid);				
						newdiv=document.createElement('div');
						newdiv.id = ajaxdivid;
						newdiv.innerHTML=newresponce;	
						newdiv.style.display = 'block';
						p = getE(pd);
						p.appendChild(newdiv);
						h = ElOffSet(ajaxdivid);
						ch = ElOffSet(pd);						
						p.style.height='10px';
						AnimateDiv(pd,h);
					}
				}
			}
		}
	}
}


function AnimateDiv(ELEMENTID,th){
		th = parseInt(th);		
		fa = getE(ELEMENTID);					
		ch = parseInt(fa.style.height);

			if(isNaN(ch)){
			ch = ElOffSet(ELEMENTID+'a');			
			}
			
		step = 5;
		direction = fa.getAttribute('d');
		animate = 1;
				
	
				p = parentEl(fa);
				if(p!=""){
				tmph = 	ElOffSet(p);		
					if(tmph>10000){
						if(firefox==false){
						animate = 0;	
						ch = th;
						}else{
							if(tmph>30000){
								animate = 0;	
								ch = th;
							}
						}
					}
				}
	
				
				
				allow = 0;
				if(direction=='up' && (th<1 && (ch > th)) && animate==1){
				nh = Math.floor(ch  / 1.5);
				
				fa.setAttribute('o',0);
				if (nh <= th){nh=th; } else{  }
				allow = 1;
				}else if(direction=='down' && (th>0 && (ch < th)) && animate==1){
				nh = ch + step;		
				nh = (Math.floor(ch  * 1.2) + step);
				fa.setAttribute('o',1);
				if (nh >= th){	nh = th; fa.style.display = ''; } 
				allow = 1;
				}else{
					if(th==0){
					fa.setAttribute('o',0);
					}else{
					fa.setAttribute('o',1);
					}					
				}

						
				if(allow==1 && animate==1){				
				fa.style.height = nh+'px';
				c = setTimeout('AnimateDiv(\''+ELEMENTID+'\',\''+th+'\')',25);
				}else{					
					if(direction=='up'){
						if(th==0){
						fa.style.display = 'none';
						}
					}else{																		
						if(ch==th){
						nh = ElOffSet(ELEMENTID+'a');
						fa.setAttribute('h',nh);							
						fa.style.height = '';	
						}
					}
				}
		}
		

function parentEl(ref)
	{
	ok=0; // it's just to start the loop, we don't use it to get out.
	while (!ok)
		{
		ref = ref.parentNode;
		if (ref.nodeType==1) //check that the node is a tag, not text (type=3)
			{
			if (String(ref.nodeName)=="DIV")
				{				
				return ref.id;
				}
			if (String(ref.nodeName)=="BODY")
				{
				return false;
				}
			}
		}
	}
	
function AjaxDiv(s,article,d,lng){
				
				
			var a = getE(d);				
			aa = d+'a';						
			
			l = a.getAttribute('l');
			o = a.getAttribute('o');
			h = a.getAttribute('h');								
			
			if(l=="" || l==null){
				a.setAttribute('d','down');
				a.setAttribute('l','1');
				a.setAttribute('o','1');
				a.style.display = 'block';		
				if(insertajaxaform()==false){ return ""; }	
				newdiv=document.createElement('div');
				newdiv.id = aa;
				newdiv.innerHTML='<img src="media/loading.gif" />';	
				a.appendChild(newdiv);
				b = document.ARTICLEAJAXFORM;
				b.S.value = s;
				b.Article.value = article;		
				b.L.value = lng;
				b.DIVID.value = aa;
				
										
				ajax.submitwithfunction('index.php',insertajaxcont, $('ARTICLEAJAXFORM'));
				
			}else if(l==1){		
			
				h = 0;
				a.setAttribute('d','up');
				if(getE(aa)){						
					if(o==1){
					a.setAttribute('o',0);
					a.setAttribute('d','up');
					a.style.display = 'block';
					h = 0;
					}else{
					a.setAttribute('o',1);
					a.style.display = 'block';
					a.setAttribute('d','down');					
					h = a.getAttribute('h');
					}
				}	
			AnimateDiv(d,h);				
			}
}

function GoDay(day,month,year,cgrp){	
	location.href='index.php?Action=Calendar&DD='+day+'&MM='+month+'&YY='+year+'&cgrp='+cgrp;	
}

function GoToUrl(str){
	location.href=str;	
}

function backToTop(){
	var x1 = x2 = x3 = 0;
    var y1 = y2 = y3 = 0;

    if (document.documentElement) {
        x1 = document.documentElement.scrollLeft || 0;
        y1 = document.documentElement.scrollTop || 0;
    }

    if (document.body) {
        x2 = document.body.scrollLeft || 0;
        y2 = document.body.scrollTop || 0;
    }

    x3 = window.scrollX || 0;
    y3 = window.scrollY || 0;

    var x = Math.max(x1, Math.max(x2, x3));
    var y = Math.max(y1, Math.max(y2, y3));

    window.scrollTo(Math.floor(x / 1.5), Math.floor(y / 1.5));

    if (x > 0 || y > 0) {
        window.setTimeout("backToTop()", 25);
    }
	
}


function showpollresults(r){		
	if(r.indexOf('<!-- SHOWIN:')==0){
		l = parseInt(r.length);
		nr = r.substring(12,l);		
		tl = parseInt(nr.indexOf(' -->'));
			if(tl>0){
			newv = nr.substring(0,tl);
				if(getE(newv)){
				f = getE(newv);
				f.innerHTML = r;
				}
			}
	}
}

function SetGender(Gender,plid){
d = document.CMSPollForm;  
d.Gender.value=Gender;
d.Ajax.value='1';
d.showin.value= 'CMSPOLL'+plid;
ajax.submitwithfunction(basename, showpollresults, $('CMSPollForm')); 
getE('CMSPOLL'+plid).innerHTML = '<div id="polload"><img src="media/loading.gif" /></div>';
} 
 
 function ViewPollResults(plid){
	 d = document.CMSPollForm;  
	 d.FolderAction.value = 'ViewResults';
	 SetGender('',plid);
 }
 
function submitregform(){
	getE('regnewuserform').submit();
}

function ShowFormSend(hidediv,showdiv){
	if(getE(hidediv) && getE(showdiv)){
	a = getE(hidediv);
	a.style.display = 'none';
	b = getE(showdiv); b.style.display = '';
	b.innerHTML = '<div id="loadingbar"><img src="media/dot.gif" id="loadingimg" /></div>';
	return setTimeout('submitregform()',500);
	} 
}



function checkemail(str){
	filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
	if (filter.test(str)){ return true; }else{ return false; }
}

function showrateresults(r){		
	if(r.indexOf('<!-- OK -->')==0){
		a = r.split('<!-- vote -->');	
		if(a.length==3){		
		if(a[0]){stars = a[0];}
		if(a[1]){rate = a[1]; }
		if(a[2]){numrate = a[2]; }
		DisplayVoteResults(stars,rate,numrate);
		}
	}
}

function RateArticle(s,a,r,t){
	inserttempajaxdiv();		
	str = '<form name="VOTEFORM" id="VOTEFORM" method="post" style="display:none" action="'+basename+'">';
	str += '<input type="hidden" name="S" value="'+s+'" />';
	str += '<input type="hidden" name="Article" value="'+a+'" />';
	str += '<input type="hidden" name="Action" value="VoteArticle" />';
	str += '<input type="hidden" name="rate" value="'+r+'" />';
	str += '<input type="hidden" name="Ajax" value="Vote" />';
	str += '</form>';
	getE('tempajaxdiv').innerHTML = str;
	ajax.submitwithfunction(basename, showrateresults, $('VOTEFORM')); 
}


function OpenChat(){	
	var w= 550;
	var h = 680;	
	var wl = 10;
	var wt = 10;
	url = "shout/index.php";
	var child = window.open(url, "shoutit","toolbar=no,scrollbars=no,location=no,statusbar=no,menubar=no,resizable=no,width="+w+",height="+h+",top="+wt+",left="+wl);
	child.focus();
}


function OpenGlZelje(){	
	var w= 575;
	var h = 470;	
	var wl = 10;
	var wt = 10;
	url = "/gl/";
	var child = window.open(url, "glzelje","toolbar=no,scrollbars=no,location=no,statusbar=no,menubar=no,resizable=yes,width="+w+",height="+h+",top="+wt+",left="+wl);
	child.focus();
}


var ap_instances = new Array();

	function ap_stopAll(playerID) {
		for(var i = 0;i<ap_instances.length;i++) {
			try {
			if(ap_instances[i] != playerID) document.getElementById("audioplayer" + ap_instances[i].toString()).SetVariable("closePlayer", 1);
				else document.getElementById("audioplayer" + ap_instances[i].toString()).SetVariable("closePlayer", 0);
			} catch( errorObject ) {
			// stop any errors
			}
		}
	}

	function ap_broadcast(playerID) {		
	ap_instances[ap_instances.length] = playerID;
	}
	
	function AddMp3Player(strPlayerDiv,strMediaFile,autostart){
	var autostart = 'yes';
		
				strResult = '';				
				strResult += '<object type="application/x-shockwave-flash" data="'+mediaurl+'mp3player.swf" width="200" height="24" id="audioplayer'+strPlayerDiv+'">';
				strResult += '	<param name="movie" value="'+mediaurl+'mp3player.swf" />';
				strResult += '	<param name="FlashVars" value="playerID='+strPlayerDiv+'&amp;autostart='+autostart+localCopyPlayerOptions+'&amp;soundFile='+encodeURI(strMediaFile)+'" />';
				strResult += '	<param name="quality" value="high" />';
				strResult += '	<param name="menu" value="false" />';
				strResult += '	<param name="wmode" value="transparent" />';
				strResult += '</object>';	
				
				ap_stopAll(strPlayerDiv);
				getE('MP3PLAYER_'+strPlayerDiv).innerHTML = strResult;
	}/* ----- mootools.js ---- */
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?"":e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('l 18=h(1B){l 4j=h(){k(9.1j&&W[0]!=\'76\')f 9.1j.2N(9,W);T f 9};K(l q 14 9)4j[q]=9[q];4j.N=1B;f 4j};18.1D=h(){};18.N={L:h(1B){l 3X=R 9(\'76\');l 6q=h(2j,1n){k(!2j.2N||!1n.2N)f J;f h(){9.1g=2j;f 1n.2N(9,W)}};K(l q 14 1B){l 2j=3X[q];l 1n=1B[q];k(2j&&2j!=1n)1n=6q(2j,1n)||1n;3X[q]=1n}f R 18(3X)},2f:h(1B){K(l q 14 1B)9.N[q]=1B[q]}};1r.L=h(){l P=W;P=(P[1])?[P[0],P[1]]:[9,P[0]];K(l q 14 P[1])P[0][q]=P[1][q];f P[0]};1r.5e=h(){K(l i=0;i<W.Y;i++)W[i].L=18.N.2f};R 1r.5e(4M,1l,4J,6B,18);k(59 3y==\'6r\'){l 3y=18.1D;3y.N={}}T{3y.N.5d=1c}V.L=F.L=1r.L;l 9a=V;h $o(Q){k(Q===1w||Q===6r)f J;l o=59 Q;k(o==\'3J\'){k(Q.5d)f\'O\';k(Q.1h)f\'1z\';k(Q.9b){1N(Q.5y){17 1:f\'O\';17 3:f Q.9c.11(/\\S/)?\'ap\':\'4v\'}}}f o};h $3v(Q){f!!(Q||Q===0)};h $9e(Q,6m){f($o(Q))?Q:6m};h $67(3E,23){f G.9d(G.67()*(23-3E+1)+3E)};h $53(1q){9h(1q);9i(1q);f 1w};k(V.65)V.2x=V[V.3Y?\'9j\':\'4X\']=1c;T k(F.7e&&!F.8V&&!9l.9m)V.2n=1c;T k(F.9n!=1w)V.5i=1c;k(V.4X)51{F.9o("9p",J,1c)}52(e){};1l.N.3R=1l.N.3R||h(I,H){K(l i=0;i<9.Y;i++)I.1s(H,9[i],i,9)};1l.N.1R=1l.N.1R||h(I,H){l 2L=[];K(l i=0;i<9.Y;i++){k(I.1s(H,9[i],i,9))2L.1h(9[i])}f 2L};1l.N.56=1l.N.56||h(I,H){l 2L=[];K(l i=0;i<9.Y;i++)2L[i]=I.1s(H,9[i],i,9);f 2L};1l.N.3g=1l.N.3g||h(I,H){K(l i=0;i<9.Y;i++){k(!I.1s(H,9[i],i,9))f J}f 1c};1l.N.6t=1l.N.6t||h(I,H){K(l i=0;i<9.Y;i++){k(I.1s(H,9[i],i,9))f 1c}f J};1l.N.3f=1l.N.3f||h(2O,B){B=B||0;k(B<0)B=G.23(0,9.Y+B);2A(B<9.Y){k(9[B]===2O)f B;B++}f-1};1l.L({1i:1l.N.3R,6v:h(1k,Y){1k=1k||0;k(1k<0)1k=9.Y+1k;Y=Y||(9.Y-1k);l 2G=[];K(l i=0;i<Y;i++)2G[i]=9[1k++];f 2G},42:h(2O){l i=0;2A(i<9.Y){k(9[i]===2O)9.5j(i,1);T i++}f 9},11:h(2O,B){f 9.3f(2O,B)!=-1},L:h(2G){K(l i=0;i<2G.Y;i++)9.1h(2G[i]);f 9},9q:h(1y){l Q={},Y=G.3E(9.Y,1y.Y);K(l i=0;i<Y;i++)Q[1y[i]]=9[i];f Q}});h $A(1z,1k,Y){f 1l.N.6v.1s(1z,1k,Y)};h $1i(6w,I,H){f 1l.N.3R.1s(6w,I,H)};4J.L({11:h(4d,6x){f((59 4d==\'33\')?R 6R(4d,6x):4d).11(9)},2U:h(){f 5o(9)},6C:h(){f 3t(9)},5g:h(){f 9.2X(/-\\D/g,h(1G){f 1G.5a(1).6y()})},74:h(){f 9.2X(/\\w[A-Z]/g,h(1G){f(1G.5a(0)+\'-\'+1G.5a(1).3a())})},78:h(){f 9.3a().2X(/\\b[a-z]/g,h(1G){f 1G.6y()})},5E:h(){f 9.2X(/^\\s+|\\s+$/g,\'\')},4s:h(){f 9.2X(/\\s{2,}/g,\' \').5E()},4q:h(1z){l 1J=9.1G(/\\d{1,3}/g);f(1J)?1J.4q(1z):J},4w:h(1z){l 2s=9.1G(/^#?(\\w{1,2})(\\w{1,2})(\\w{1,2})$/);f(2s)?2s.9u(1).4w(1z):J}});1l.L({4q:h(1z){k(9.Y<3)f J;k(9[3]&&(9[3]==0)&&!1z)f\'8c\';l 2s=[];K(l i=0;i<3;i++){l 4f=(9[i]-0).9v(16);2s.1h((4f.Y==1)?\'0\'+4f:4f)}f 1z?2s:\'#\'+2s.22(\'\')},4w:h(1z){k(9.Y!=3)f J;l 1J=[];K(l i=0;i<3;i++){1J.1h(5o((9[i].Y==1)?9[i]+9[i]:9[i],16))}f 1z?1J:\'1J(\'+1J.22(\',\')+\')\'}});6B.L({2U:h(){f 5o(9)},6C:h(){f 3t(9)}});4M.L({24:h(n){l I=9;n=1r.L({\'H\':I,\'r\':J,\'W\':1w,\'1O\':J,\'2v\':J,\'4x\':J},n||{});k($3v(n.W)&&$o(n.W)!=\'1z\')n.W=[n.W];f h(r){l P;k(n.r){r=r||V.r;P=[(n.r===1c)?r:R n.r(r)];k(n.W)P=P.9y(n.W)}T P=n.W||W;l 2m=h(){f I.2N(n.H,P)};k(n.1O)f 9z(2m,n.1O);k(n.2v)f 9A(2m,n.2v);k(n.4x){51{f 2m()}52(6E){f 6E}}f 2m()}},9B:h(P,H){f 9.24({\'W\':P,\'H\':H})},4x:h(P,H){f 9.24({\'W\':P,\'H\':H,\'4x\':1c})()},H:h(H,P){f 9.24({\'H\':H,\'W\':P})},9C:h(H,P){f 9.24({\'H\':H,\'r\':1c,\'W\':P})},1O:h(4e,H,P){f 9.24({\'1O\':4e,\'H\':H,\'W\':P})()},2v:h(4e,H,P){f 9.24({\'2v\':4e,\'H\':H,\'W\':P})()}});l 1b=R 18({1j:h(m){k($o(m)==\'33\')m=F.60(m);f $(m)}});h $(m){k(!m)f J;k(m.6F||[V,F].11(m))f m;k($o(m)==\'33\')m=F.3S(m);k($o(m)!=\'O\')f J;k([\'3J\',\'9E\'].11(m.3W.3a())||m.L)f m;m.6F=1c;2p.3V(m);m.L=1r.L;k(!(m.5d))m.L(1b.N);f m};l 1Y=R 18({});R 1r.5e(1Y);F.2y=F.2l;h $$(){k(!W)f J;k(W.Y==1){k(!W[0])f J;k(W[0].6G)f W[0]}l 12=[];$1i(W,h(1a){1N($o(1a)){17\'O\':12.1h($(1a));1F;17\'33\':1a=F.2y(1a);5V:k(1a.Y){$1i(1a,h(m){k($(m))12.1h(m)})}}});12.6G=1c;f 1r.L(12,R 1Y)};1Y.45=h(q){f h(){l P=W;l 3x=[];l 12=1c;$1i(9,h(m){l 2m=m[q].2N(m,P);k($o(2m)!=\'O\')12=J;3x.1h(2m)});k(12)3x=$$(3x);f 3x}};1b.L=h(1B){K(l q 14 1B){3y.N[q]=1B[q];1b.N[q]=1B[q];1Y.N[q]=1Y.45(q)}};1b.L({4k:h(m,6I){m=$(m)||R 1b(m);1N(6I){17"6L":$(m.1Q).6Z(9,m);1F;17"6M":k(!m.5m())$(m.1Q).4i(9);T $(m.1Q).6Z(9,m.5m());1F;17"6P":m.4i(9)}f 9},9G:h(m){f 9.4k(m,\'6L\')},71:h(m){f 9.4k(m,\'6M\')},9H:h(m){f 9.4k(m,\'6P\')},77:h(m){9.4i($(m)||R 1b(m));f 9},42:h(){9.1Q.9I(9);f 9},9U:h(6Q){l m=9.9T(6Q!==J);f $(m)},5T:h(m){m=$(m)||R 1b(m);9.1Q.9K(m,9);f m},9M:h(1p){k(V.2x){1N(9.3j()){17\'1f\':9.9N.6O=1p;f 9;17\'2b\':9.4g(\'1p\',1p);f 9}}9.4i(F.9P(1p));f 9},3U:h(1d){f 9.1d.11(\'(?:^|\\\\s)\'+1d+\'(?:\\\\s|$)\')},7h:h(1d){k(!9.3U(1d))9.1d=(9.1d+\' \'+1d).4s();f 9},6U:h(1d){9.1d=9.1d.2X(R 6R(\'(^|\\\\s)\'+1d+\'(?:\\\\s|$)\'),\'$1\').4s();f 9},9S:h(1d){f 9.3U(1d)?9.6U(1d):9.7h(1d)},1W:h(q,C){k(q==\'1M\')9.6X(3t(C));T 9.1f[q.5g()]=(C.1h)?\'1J(\'+C.22(\',\')+\')\':C;f 9},7f:h(1t){1N($o(1t)){17\'3J\':K(l q 14 1t)9.1W(q,1t[q]);1F;17\'33\':9.1f.6O=1t}f 9},6X:h(1M){k(1M==0){k(9.1f.4m!="4p")9.1f.4m="4p"}T{k(9.1f.4m!="6Y")9.1f.4m="6Y"}k(!9.4a||!9.4a.9V)9.1f.9X=1;k(V.2x)9.1f.1R="9Y(1M="+1M*9Z+")";9.1f.1M=9.1M=1M;f 9},1T:h(q){q=q.5g();l 1f=9.1f[q]||J;k(!$3v(1f)){k(q==\'1M\')f $3v(9.1M)?9.1M:1;k([\'2h\',\'a1\'].11(q)){f[9.1T(q+\'-1Z\')||0,9.1T(q+\'-4A\')||0,9.1T(q+\'-5v\')||0,9.1T(q+\'-1V\')||0].22(\' \')}k(F.73)1f=F.73.a2(9,1w).a4(q.74());T k(9.4a)1f=9.4a[q]}k(1f==\'a5\'&&[\'3s\',\'3q\'].11(q))f 9[\'2z\'+q.78()]+\'6g\';f(1f&&q.11(/6n/i)&&1f.11(/1J/))?1f.4q():1f},1e:h(o,I){9.M=9.M||{};9.M[o]=9.M[o]||{\'1y\':[],\'1L\':[]};k(!9.M[o].1y.11(I)){9.M[o].1y.1h(I);k(9.79){9.79((o==\'3G\'&&V.5i)?\'4C\':o,I,J)}T{I=I.H(9);9.a7(\'4Q\'+o,I);9.M[o].1L.1h(I)}}f 9},a8:h(1t){k(1t){K(l o 14 1t)9.1e(o,1t[o])}f 9},2d:h(o,I){k(9.M&&9.M[o]){l 4c=9.M[o].1y.3f(I);k(4c==-1)f 9;l 1E=9.M[o].1y.5j(4c,1)[0];k(9.7a){9.7a((o==\'3G\'&&V.5i)?\'4C\':o,1E,J)}T{9.aa(\'4Q\'+o,9.M[o].1L.5j(4c,1)[0])}}f 9},2H:h(o){k(9.M){k(o){k(9.M[o]){9.M[o].1y.1i(h(I){9.2d(o,I)},9);9.M[o]=1w}}T{K(l 7b 14 9.M)9.2H(7b);9.M=1w}}f 9},1K:h(o,P){k(9.M&&9.M[o]){9.M[o].1y.1i(h(I){I.H(9,P)()},9)}},5n:h(5l){l m=9[5l+\'7d\'];2A($o(m)==\'4v\')m=m[5l+\'7d\'];f $(m)},ab:h(){f 9.5n(\'2j\')},5m:h(){f 9.5n(\'ad\')},ag:h(){l m=9.ah;2A($o(m)==\'4v\')m=m.ai;f $(m)},aj:h(){l m=9.al;2A($o(m)==\'4v\')m=m.am;f $(m)},an:h(){f $(9.1Q)},ao:h(){f $$(9.7e)},4g:h(q,C){1N(q){17\'5r\':9.1d=C;1F;17\'1f\':9.7f(C);1F;17\'1u\':k(V.4X){l m=$(F.60(\'<\'+9.3j()+\' 1u="\'+C+\'" />\'));$1i(9.7k,h(2Y){k(2Y.1u!=\'1u\')m.4g(2Y.1u,2Y.C)});k(9.1Q)9.5T(m);f m}5V:9.8R(q,C)}f 9},7n:h(1t){K(l q 14 1t)9.4g(q,1t[q]);f 9},5D:h(){9.7p=$A(W).22(\'\');f 9},6D:h(q){f(q==\'5r\')?9.1d:9.5N(q)},3j:h(){f 9.3W.3a()},2k:h(x,y){9.3r=x;9.3p=y},2c:h(){1N(9.3j()){17\'2D\':k(9.6a!=-1){l 58=9.n[9.6a];f 58.C||58.1p}1F;17\'6K\':k(!(9.8K&&[\'7q\',\'7r\'].11(9.o))&&![\'4p\',\'1p\',\'7s\'].11(9.o))1F;17\'70\':f 9.C}f J},5k:h(){f{\'34\':{\'x\':9.3r,\'y\':9.3p},\'4r\':{\'x\':9.3B,\'y\':9.3D},\'5h\':{\'x\':9.3Z,\'y\':9.49}}},3n:h(2K){2K=2K||[];l m=9,1V=0,1Z=0;8G{1V+=m.7u||0;1Z+=m.8E||0;m=m.7v}2A(m);2K.1i(h(O){1V-=O.3r||0;1Z-=O.3p||0});f{\'x\':1V,\'y\':1Z}},6W:h(){f 9.3n().y},6T:h(){f 9.3n().x},7x:h(2K){l 4y=9.3n(2K);l Q={\'3q\':9.3B,\'3s\':9.3D,\'1V\':4y.x,\'1Z\':4y.y};Q.4A=Q.1V+Q.3q;Q.5v=Q.1Z+Q.3s;f Q}});V.1e=F.1e=1b.N.1e;V.2d=F.2d=1b.N.2d;V.2H=F.2H=1b.N.2H;l 2p={12:[],3V:h(O){2p.12.1h(O)},5I:h(){2p.3V(V);2p.3V(F);2p.12.1i(h(m){m.2H();K(l p 14 1b.N)m[p]=1w;m.L=1w})}};V.1e(\'7y\',2p.5I);l 35=R 18({1j:h(r){9.r=r||V.r;9.o=9.r.o;9.36=9.r.36||9.r.7A;k(9.36.5y==3)9.36=9.36.1Q;9.5H=9.r.8q;9.8p=9.r.8o;9.7D=9.r.8m;9.8l=9.r.7G;k([\'4C\',\'3G\'].11(9.o)){9.8i=9.r.5F?(9.r.5F/(V.4Y?-5G:5G)):-(9.r.7K||0)/ 3} T k (9.o.11(/1E/)){9.4B=9.r.5Q||9.r.7M;K(l 1u 14 35.1y){k(35.1y[1u]==9.4B){9.1E=1u;1F}}9.1E=9.1E||4J.7O(9.4B).3a()}T k(9.o.11(/89/)||(9.o==\'5w\')){9.88={\'x\':9.r.4H||9.r.5A+F.1C.3r,\'y\':9.r.4K||9.r.5B+F.1C.3p};9.7R={\'x\':9.r.4H?9.r.4H-V.66:9.r.5A,\'y\':9.r.4K?9.r.4K-V.68:9.r.5B};9.82=(9.r.5Q==3)||(9.r.7W==2);1N(9.o){17\'7X\':9.3K=9.r.3K||9.r.7Z;1F;17\'80\':9.3K=9.r.3K||9.r.4D}}},2e:h(){9.3M();9.3L();f 9},3M:h(){k(9.r.3M)9.r.3M();T 9.r.81=1c;f 9},3L:h(){k(9.r.3L)9.r.3L();T 9.r.84=J;f 9}});35.1y={\'86\':13,\'8a\':38,\'8d\':40,\'1V\':37,\'4A\':39,\'8g\':27,\'8k\':32,\'8s\':8,\'8t\':46};4M.L({5M:h(H,P){f 9.24({\'H\':H,\'W\':P,\'r\':35})}});l 5b=R 18({5P:h(I){9.2o=9.2o||[];9.2o.1h(I);f 9},57:h(){k(9.2o&&9.2o.Y)9.2o.5H().1O(10,9)},5t:h(){9.2o=[]}});l 5c=R 18({1e:h(o,I){k(I!=18.1D){9.M=9.M||{};9.M[o]=9.M[o]||[];k(!9.M[o].11(I))9.M[o].1h(I)}f 9},1K:h(o,P,1O){k(9.M&&9.M[o]){9.M[o].1i(h(I){I.24({\'H\':9,\'1O\':1O,\'W\':P})()},9)}f 9},2d:h(o,I){k(9.M&&9.M[o])9.M[o].42(I);f 9}});l 5f=R 18({3C:h(5J,n){9.n=1r.L(5J,n);k(9.1e){K(l 3e 14 9.n){k(($o(9.n[3e])==\'h\')&&3e.11(/^4Q[A-Z]/))9.1e(3e,9.n[3e])}}f 9}});l 8w=R 18({1j:h(){9.3l=$A(W);9.M={};9.2F={}},1e:h(o,I){9.2F[o]=9.2F[o]||{};9.M[o]=9.M[o]||[];k(9.M[o].11(I))f J;T 9.M[o].1h(I);9.3l.1i(h(3h,i){3h.1e(o,9.5K.H(9,[o,3h,i]))},9);f 9},5K:h(o,3h,i){9.2F[o][i]=1c;l 3g=9.3l.3g(h(1n,j){f 9.2F[o][j]||J},9);k(!3g)f;9.3l.1i(h(1n,j){9.2F[o][j]=J},9);9.M[o].1i(h(r){r.1s(9,9.3l,3h)},9)}});h $E(1a,1R){f($(1R)||F).3T(1a)};h $8x(1a,1R){f($(1R)||F).2y(1a)};1b.L({3k:h(1a){l 12=[];1a.4s().55(\' \').1i(h(4n,i){l 1v=4n.1G(/^(\\w*|\\*)(?:#([\\w-]+)|\\.([\\w-]+))?(?:\\[(\\w+)(?:([*^$]?=)["\']?([^"\'\\]]*)["\']?)?])?$/);k(!1v)f;1U.1a=1v;1v[1]=1v[1]||\'*\';k(i==0){k(1v[2]){l m=9.3S(1v[2]);k(!m||((1v[1]!=\'*\')&&(1b.N.3j.1s(m)!=1v[1])))f;12=[m]}T{12=$A(9.2l(1v[1]))}}T{12=1Y.N.2l.1s(12,1v[1],1c);k(1v[2])12=12.1R(1U.2Z)}k(1v[3])12=12.1R(1U.1d);k(1v[4])12=12.1R(1U.2Y)},9);f $$(12)},3S:h(2Z){l m=F.3S(2Z);k(!m)f J;K(l 1g=m.1Q;1g!=9;1g=1g.1Q){k(!1g)f J}f m},3T:h(1a){f 9.2y(1a)[0]},2y:h(1a){l 4S=[];1a.55(\',\').1i(h(4n){4S.L(9.3k(4n))},9);f $$(4S)}});F.L({8C:h(1d){f F.3k(\'.\'+1d)},3T:1b.N.3T,3k:1b.N.3k,2y:1b.N.2y});l 1U={1a:[],2Z:h(m){f(m.2Z==1U.1a[2])},1d:h(m){f(1b.N.3U.1s(m,1U.1a[3]))},2Y:h(m){l 1n=m.5N(1U.1a[4]);k(!1n)f J;l 4U=1U.1a[5];k(!4U)f 1c;l C=1U.1a[6];1N(4U){17\'*=\':f(1n.11(C));17\'=\':f(1n==C);17\'^=\':f(1n.11(\'^\'+C));17\'$=\':f(1n.11(C+\'$\'))}f J}};1Y.L({2l:h(3W){l 4V=[];9.1i(h(m){4V.L(m.2l(3W))});f 4V}});V.L({1e:h(o,I){k(o==\'3w\'){k(9.4h)I();T k(!9.M||!9.M.3w){l 3m=h(){k(9.4h)f;9.4h=1c;k(9.1q)9.1q=$53(9.1q);1b.N.1K.1s(9,\'3w\');9.M.3w=1w}.H(9);k(F.3o&&9.2n){9.1q=h(){k([\'4h\',\'5W\'].11(F.3o))3m()}.2v(50)}T k(F.3o&&9.2x){F.8M("<2b 2Z=6J 8N 8O=5u:8P(0)><\\/2b>");$(\'6J\').4Z=h(){k(9.3o==\'5W\')3m()}}T{9.1e("8S",3m);F.1e("8T",3m)}}}1b.N.1e.1s(9,o,I);f 9},8U:h(61){f 9.1e(\'3w\',61)}});V.L({69:h(){k(9.2n)f 9.8X;k(9.4Y)f F.4u.63;f F.1C.63},6l:h(){k(9.2n)f 9.8Z;k(9.4Y)f F.4u.64;f F.1C.64},6b:h(){k(9.2x)f G.23(F.1C.3B,F.1C.3Z);k(9.2n)f F.4u.3Z;f F.1C.3Z},6c:h(){k(9.2x)f G.23(F.1C.3D,F.1C.49);k(9.2n)f F.4u.49;f F.1C.49},6d:h(){f 9.66||F.1C.3r},6e:h(){f 9.68||F.1C.3p},5k:h(){f{\'4r\':{\'x\':9.69(),\'y\':9.6l()},\'5h\':{\'x\':9.6b(),\'y\':9.6c()},\'34\':{\'x\':9.6d(),\'y\':9.6e()}}},3n:h(){f{\'x\':0,\'y\':0}}});l U={};U.26=R 18({41:h(){f{4E:18.1D,2q:18.1D,5p:18.1D,6h:U.2M.4F,2C:92,1H:\'6g\',2I:1c,6k:50}},1j:h(n){9.O=9.O||1w;9.3C(9.41(),n);k(9.n.1j)9.n.1j.1s(9)},6j:h(){l 2Q=R 4I().4O();k(2Q<9.2Q+9.n.2C){9.6i=2Q-9.2Q;9.2u();9.2g()}T{9.2e(1c);9.15=9.u;9.2g();9.1K(\'2q\',9.O,10);9.57()}},21:h(u){9.15=u;9.2g();f 9},2u:h(){9.15=9.2w(9.B,9.u)},2w:h(B,u){f 9.n.6h(9.6i,B,(u-B),9.n.2C)},1k:h(B,u){k(!9.n.2I)9.2e();T k(9.1q)f 9;9.B=B;9.u=u;9.2Q=R 4I().4O();9.1q=9.6j.2v(G.6z(93/9.n.6k),9);9.1K(\'4E\',9.O);f 9},2e:h(44){k(!9.1q)f 9;9.1q=$53(9.1q);k(!44)9.1K(\'5p\',9.O);f 9},94:h(B,u){f 9.1k(B,u)},96:h(44){f 9.2e(44)}});U.26.2f(R 5b);U.26.2f(R 5c);U.26.2f(R 5f);U.2M={5z:h(t,b,c,d){f c*t/d+b},4F:h(t,b,c,d){f-c/2*(G.4G(G.1I*t/d)-1)+b}};U.1P={2D:h(q,u){k(q.11(/6n/i))f 9.6p;k(u.11&&u.11(\' \'))f 9.45;f 9.6o},1A:h(m,q,2R){k(!2R.1h)2R=[2R];l B=2R[0],u=2R[1];k(!u&&u!=0){u=B;B=m.1T(q)}l 19=9.2D(q,u);f{B:19.1A(B),u:19.1A(u),19:19}}};U.1P.6o={1A:h(C){f 3t(C)},2S:h(B,u,2T){f 2T.2w(B,u)},2c:h(C,1H){f C+1H}};U.1P.45={1A:h(C){f C.1h?C:C.55(\' \').56(h(v){f 3t(v)})},2S:h(B,u,2T){l 15=[];K(l i=0;i<B.Y;i++)15[i]=2T.2w(B[i],u[i]);f 15},2c:h(C,1H){f C.22(1H+\' \')+1H}};U.1P.6p={1A:h(C){f C.1h?C:C.4w(1c)},2S:h(B,u,2T){l 15=[];K(l i=0;i<B.Y;i++)15[i]=G.6z(2T.2w(B[i],u[i]));f 15},2c:h(C){f\'1J(\'+C.22(\',\')+\')\'}};U.5Y=U.26.L({1j:h(m,q,n){9.O=$(m);9.q=q;9.1g(n)},7g:h(){f 9.21(0)},2u:h(){9.15=9.19.2S(9.B,9.u,9)},21:h(u){9.19=U.1P.2D(9.q,u);f 9.1g(9.19.1A(u))},1k:h(B,u){k(9.1q&&9.n.2I)f 9;l 1m=U.1P.1A(9.O,9.q,[B,u]);9.19=1m.19;f 9.1g(1m.B,1m.u)},2g:h(){9.O.1W(9.q,9.19.2c(9.15,9.n.1H))}});1b.L({9f:h(q,n){f R U.5Y(9,q,n)}});U.5Z=U.26.L({1j:h(m,n){9.O=$(m);9.1g(n)},2u:h(){K(l p 14 9.B)9.15[p]=9.19[p].2S(9.B[p],9.u[p],9)},21:h(u){l 1m={};9.19={};K(l p 14 u){9.19[p]=U.1P.2D(p,u[p]);1m[p]=9.19[p].1A(u[p])}f 9.1g(1m)},1k:h(Q){k(9.1q&&9.n.2I)f 9;9.15={};9.19={};l B={},u={};K(l p 14 Q){l 1m=U.1P.1A(9.O,p,Q[p]);B[p]=1m.B;u[p]=1m.u;9.19[p]=1m.19}f 9.1g(B,u)},2g:h(){K(l p 14 9.15)9.O.1W(p,9.19[p].2c(9.15[p],9.n.1H))}});1b.L({9k:h(n){f R U.5Z(9,n)}});U.1Y=U.26.L({1j:h(12,n){9.12=$$(12);9.1g(n)},2u:h(){K(l i 14 9.B){l 3c=9.B[i],2i=9.u[i],1X=9.19[i],3d=9.15[i]={};K(l p 14 3c)3d[p]=1X[p].2S(3c[p],2i[p],9)}},21:h(u){l 1m={};9.19={};K(l i 14 u){l 2i=u[i],1X=9.19[i]={},6u=1m[i]={};K(l p 14 2i){1X[p]=U.1P.2D(p,2i[p]);6u[p]=1X[p].1A(2i[p])}}f 9.1g(1m)},1k:h(Q){k(9.1q&&9.n.2I)f 9;9.15={};9.19={};l B={},u={};K(l i 14 Q){l 4T=Q[i],3c=B[i]={},2i=u[i]={},1X=9.19[i]={};K(l p 14 4T){l 1m=U.1P.1A(9.12[i],p,4T[p]);3c[p]=1m.B;2i[p]=1m.u;1X[p]=1m.19}}f 9.1g(B,u)},2g:h(){K(l i 14 9.15){l 3d=9.15[i],1X=9.19[i];K(l p 14 3d)9.12[i].1W(p,1X[p].2c(3d[p],9.n.1H))}}});U.6V=U.26.L({1j:h(O,n){9.15=[];9.O=$(O);9.1e(\'4E\',h(){9.O.1e(\'3G\',9.2e.H(9,J))}.H(9));9.2d(\'2q\',h(){9.O.2d(\'3G\',9.2e.H(9,J))}.H(9));9.1g(n)},2u:h(){K(l i=0;i<2;i++)9.15[i]=9.2w(9.B[i],9.u[i])},2k:h(x,y){k(9.1q&&9.n.2I)f 9;l m=9.O.5k();l 1L={\'x\':x,\'y\':y};K(l z 14 m.4r){l 23=m.5h[z]-m.4r[z];k($3v(1L[z]))1L[z]=($o(1L[z])==\'9F\')?G.23(G.3E(1L[z],23),0):23;T 1L[z]=m.34[z]}f 9.1k([m.34.x,m.34.y],[1L.x,1L.y])},9J:h(){f 9.2k(J,0)},9L:h(){f 9.2k(J,\'6S\')},9O:h(){f 9.2k(0,J)},9Q:h(){f 9.2k(\'6S\',J)},4D:h(m){f 9.2k($(m).6T(),$(m).6W())},2g:h(){9.O.2k(9.15[0],9.15[1])}});U.9W=U.26.L({1j:h(m,n){9.O=$(m).1W(\'2h\',0);9.2J=R 1b(\'a0\').71(9.O).1W(\'a3\',\'4p\').77(9.O);9.3C({\'1o\':\'7c\'},n);9.15=[];9.1g(9.n)},2u:h(){K(l i=0;i<2;i++)9.15[i]=9.2w(9.B[i],9.u[i])},7c:h(){9.2h=\'1Z\';9.4z=\'3s\';9.2z=9.O.3D;f[9.O.1T(\'2h-1Z\').2U(),9.2J.1T(\'3s\').2U()]},ae:h(){9.2h=\'1V\';9.4z=\'3q\';9.2z=9.O.3B;f[9.O.1T(\'2h-1V\').2U(),9.2J.1T(\'3q\').2U()]},5s:h(1o){f 9.1k(9[1o||9.n.1o](),[0,9.2z])},7i:h(1o){f 9.1k(9[1o||9.n.1o](),[-9.2z,0])},7g:h(1o){9[1o||9.n.1o]();f 9.21([-9.2z,0])},7j:h(1o){9[1o||9.n.1o]();f 9.21([0,9.2z])},7m:h(1o){k(9.2J.3D==0||9.2J.3B==0)f 9.5s(1o);T f 9.7i(1o)},2g:h(){9.O.1W(\'2h-\'+9.2h,9.15[0]+9.n.1H);9.2J.1W(9.4z,9.15[1]+9.n.1H)}});U.2M={5z:h(t,b,c,d){f c*t/d+b},7C:h(t,b,c,d){f c*(t/=d)*t+b},7E:h(t,b,c,d){f-c*(t/=d)*(t-2)+b},7F:h(t,b,c,d){k((t/=d/2)<1)f c/2*t*t+b;f-c/2*((--t)*(t-2)-1)+b},7H:h(t,b,c,d){f c*(t/=d)*t*t+b},7J:h(t,b,c,d){f c*((t=t/d-1)*t*t+1)+b},7L:h(t,b,c,d){k((t/=d/2)<1)f c/2*t*t*t+b;f c/2*((t-=2)*t*t+2)+b},7N:h(t,b,c,d){f c*(t/=d)*t*t*t+b},7P:h(t,b,c,d){f-c*((t=t/d-1)*t*t*t-1)+b},7Q:h(t,b,c,d){k((t/=d/2)<1)f c/2*t*t*t*t+b;f-c/2*((t-=2)*t*t*t-2)+b},7S:h(t,b,c,d){f c*(t/=d)*t*t*t*t+b},7T:h(t,b,c,d){f c*((t=t/d-1)*t*t*t*t+1)+b},7U:h(t,b,c,d){k((t/=d/2)<1)f c/2*t*t*t*t*t+b;f c/2*((t-=2)*t*t*t*t+2)+b},7V:h(t,b,c,d){f-c*G.4G(t/d*(G.1I/2))+c+b},7Y:h(t,b,c,d){f c*G.3u(t/d*(G.1I/2))+b},4F:h(t,b,c,d){f-c/2*(G.4G(G.1I*t/d)-1)+b},83:h(t,b,c,d){f(t==0)?b:c*G.28(2,10*(t/d-1))+b},85:h(t,b,c,d){f(t==d)?b+c:c*(-G.28(2,-10*t/d)+1)+b},87:h(t,b,c,d){k(t==0)f b;k(t==d)f b+c;k((t/=d/2)<1)f c/2*G.28(2,10*(t-1))+b;f c/2*(-G.28(2,-10*--t)+2)+b},8b:h(t,b,c,d){f-c*(G.3P(1-(t/=d)*t)-1)+b},8e:h(t,b,c,d){f c*G.3P(1-(t=t/d-1)*t)+b},8f:h(t,b,c,d){k((t/=d/2)<1)f-c/2*(G.3P(1-t*t)-1)+b;f c/2*(G.3P(1-(t-=2)*t)+1)+b},8j:h(t,b,c,d,a,p){k(t==0)f b;k((t/=d)==1)f b+c;k(!p)p=d*.3;k(!a)a=1;k(a<G.4N(c)){a=c;l s=p/4}T l s=p/(2*G.1I)*G.4P(c/a);f-(a*G.28(2,10*(t-=1))*G.3u((t*d-s)*(2*G.1I)/p))+b},8r:h(t,b,c,d,a,p){k(t==0)f b;k((t/=d)==1)f b+c;k(!p)p=d*.3;k(!a)a=1;k(a<G.4N(c)){a=c;l s=p/4}T l s=p/(2*G.1I)*G.4P(c/a);f a*G.28(2,-10*t)*G.3u((t*d-s)*(2*G.1I)/p)+c+b},8u:h(t,b,c,d,a,p){k(t==0)f b;k((t/=d/2)==2)f b+c;k(!p)p=d*(.3*1.5);k(!a)a=1;k(a<G.4N(c)){a=c;l s=p/4}T l s=p/(2*G.1I)*G.4P(c/a);k(t<1)f-.5*(a*G.28(2,10*(t-=1))*G.3u((t*d-s)*(2*G.1I)/p))+b;f a*G.28(2,-10*(t-=1))*G.3u((t*d-s)*(2*G.1I)/p)*.5+c+b},8z:h(t,b,c,d,s){k(!s)s=1.4R;f c*(t/=d)*t*((s+1)*t-s)+b},8A:h(t,b,c,d,s){k(!s)s=1.4R;f c*((t=t/d-1)*t*((s+1)*t+s)+1)+b},8B:h(t,b,c,d,s){k(!s)s=1.4R;k((t/=d/2)<1)f c/2*(t*t*(((s*=(1.5L))+1)*t-s))+b;f c/2*((t-=2)*t*(((s*=(1.5L))+1)*t+s)+2)+b},5R:h(t,b,c,d){f c-U.2M.4W(d-t,0,c,d)+b},4W:h(t,b,c,d){k((t/=d)<(1/2.75)){f c*(7.4l*t*t)+b}T k(t<(2/2.75)){f c*(7.4l*(t-=(1.5/2.75))*t+.75)+b}T k(t<(2.5/2.75)){f c*(7.4l*(t-=(2.25/2.75))*t+.8D)+b}T{f c*(7.4l*(t-=(2.8H/2.75))*t+.8J)+b}},8L:h(t,b,c,d){k(t<d/2)f U.2M.5R(t*2,0,c,d)*.5+b;f U.2M.4W(t*2-d,0,c,d)*.5+c*.5+b}};l 3A=R 18({41:h(){f{2a:\'2E\',5X:1c,6s:18.1D,4b:18.1D,3z:18.1D,47:18.1D,2r:{},43:9.43}},1j:h(n){9.1x=V.3Y?R 3Y():(V.2x?R 65(\'90.91\'):J);9.3C(9.41(),n);k(!9.1x)f;9.2r={};k(9.n.1j)9.n.1j.1s(9)},4b:h(){9.1K(\'4b\',9.1x);k(9.1x.3o!=4)f;l 2t=0;51{2t=9.1x.2t}52(e){}k(9.n.43(2t))9.3z();T 9.47();9.1x.4Z=18.1D},43:h(2t){f((2t>=95)&&(2t<97))},3z:h(){9.29={\'1p\':9.1x.98,\'3b\':9.1x.99};9.1K(\'3z\',[9.29.1p,9.29.3b]);9.57()},47:h(){9.1K(\'47\',9.1x)},3H:h(1u,C){9.2r[1u]=C;f 9},48:h(2P,1S){9.1K(\'6s\');9.1x.9g(9.n.2a,2P,9.n.5X);9.1x.4Z=9.4b.H(9);k((9.n.2a==\'2E\')&&9.1x.9r)9.3H(\'9s\',\'9t\');1r.L(9.2r,9.n.2r);K(l o 14 9.2r)9.1x.9w(o,9.2r[o]);9.1x.48(1S);f 9}});3A.2f(R 5b);3A.2f(R 5c);3A.2f(R 5f);l 6A=3A.L({72:h(){f{2W:1w,4L:1w,2q:18.1D,4o:J,5C:J,3I:\'9R-8\'}},1j:h(2P,n){9.1e(\'3z\',9.2q);9.3C(9.72(),n);9.1g(9.n);k(![\'2E\',\'5O\'].11(9.n.2a)){9.3i=\'3i=\'+9.n.2a;9.n.2a=\'2E\'}k(9.n.2a==\'2E\'){l 3I=(9.n.3I)?\'; a6=\'+9.n.3I:\'\';9.3H(\'a9-o\',\'5x/x-ac-af-ak\'+3I)}9.3H(\'X-7l-7o\',\'3Y\');9.3H(\'7w\',\'1p/5u, 1p/7z, 5x/3b, 1p/3b, */*\');9.2P=2P},2q:h(){k(9.n.4L)$(9.n.4L).5D(9.29.1p);k(9.n.5C)62(9.29.1p);k(9.n.4o)9.4o.1O(30,9);9.1K(\'2q\',[9.29.1p,9.29.3b],20)},6H:h(){l 1S=1w;1N($o(9.n.2W)){17\'O\':1S=$(9.n.2W).31();1F;17\'3J\':1S=1r.31(9.n.2W);1F;17\'33\':1S=9.n.2W}k(9.3i)1S=(1S)?[9.3i,1S].22(\'&\'):9.3i;f 9.48(9.2P,1S)},4o:h(){l 2b,5S=/<2b[^>]*>([\\s\\S]*?)<\\/2b>/8I;2A((2b=5S.8Q(9.29.1p)))62(2b[1])}});1r.31=h(1t){l 54=[];K(l q 14 1t)54.1h(6f(q)+\'=\'+6f(1t[q]));f 54.22(\'&\')};1b.L({48:h(n){n=1r.L(n||{},{2W:9.31(),2a:\'2E\'});f R 6A(9.6D(\'9D\'),n).6H()},5q:h(){l Q={};$$(9.2l(\'6K\'),9.2l(\'2D\'),9.2l(\'70\')).1i(h(m){l 1u=$(m).1u;l C=m.2c();k((C!==J)&&1u)Q[1u]=C});f Q},31:h(){f 1r.31(9.5q())}});l 7t={21:h(1E,C,n){n=1r.L({3O:J,3N:J,2C:7B},n||{});C=7I(C);k(n.3O)C+="; 3O="+n.3O;k(n.3N)C+="; 3N="+n.3N;k(n.2C){l 3Q=R 4I();3Q.8h(3Q.4O()+(n.2C*8v));C+="; 8y="+3Q.8F()}F.5U=1E+"="+C},5O:h(1E){l C=F.5U.1G(\'(?:^|;)\\\\s*\'+1E+\'=([^;]*)\');f C?8W(C[1]):J},42:h(1E){9.21(1E,\'\',{2C:-1})}};l 9x=U.6V.L({1j:h(n){9.1e(\'5p\',9.5t);l 3F=V.3F.4t.1G(/^[^#]*/)[0]+\'#\';$1i(F.8n,h(2V){k(2V.4t.3f(3F)!=0)f;l 2B=2V.4t.8Y(3F.Y);k(2B&&$(2B))9.6N(2V,2B)},9);9.1g(V,n)},6N:h(2V,2B){2V.1e(\'5w\',h(r){k(!V.2n)9.5P(h(){V.3F.4t=\'#\'+2B});9.4D(2B);r.2e()}.5M(9))}});',62,646,'|||||||||this||||||return||function|||if|var|el|options|type||property|event|||to|||||||from|value|||document|Math|bind|fn|false|for|extend|events|prototype|element|args|obj|new||else|Fx|window|arguments||length|||test|elements||in|now||case|Class|css|selector|Element|true|className|addEvent|style|parent|push|each|initialize|start|Array|parsed|current|mode|text|timer|Object|call|source|name|param|null|transport|keys|array|parse|properties|documentElement|empty|key|break|match|unit|PI|rgb|fireEvent|values|opacity|switch|delay|CSS|parentNode|filter|data|getStyle|Filters|left|setStyle|iCss|Elements|top||set|join|max|create||Base||pow|response|method|script|getValue|removeEvent|stop|implement|increase|margin|iTo|previous|scrollTo|getElementsByTagName|returns|khtml|chains|Garbage|onComplete|headers|hex|status|setNow|periodical|compute|ie|getElementsBySelector|offset|while|anchor|duration|select|post|checker|newArray|removeEvents|wait|wrapper|overflown|results|Transitions|apply|item|url|time|fromTo|getNow|fx|toInt|lnk|postBody|replace|attribute|id||toQueryString||string|scroll|Event|target||||toLowerCase|xml|iFrom|iNow|option|indexOf|every|instance|_method|getTag|getElements|instances|domReady|getPosition|readyState|scrollTop|width|scrollLeft|height|parseFloat|sin|chk|domready|items|HTMLElement|onSuccess|XHR|offsetWidth|setOptions|offsetHeight|min|location|mousewheel|setHeader|encoding|object|relatedTarget|preventDefault|stopPropagation|path|domain|sqrt|date|forEach|getElementById|getElement|hasClass|collect|tagName|pr0t0typ3|XMLHttpRequest|scrollWidth||getOptions|remove|isSuccess|end|Multi||onFailure|send|scrollHeight|currentStyle|onStateChange|pos|regex|ms|bit|setProperty|loaded|appendChild|klass|inject|5625|visibility|sel|evalScripts|hidden|rgbToHex|size|clean|href|body|whitespace|hexToRgb|attempt|position|layout|right|code|DOMMouseScroll|toElement|onStart|sineInOut|cos|pageX|Date|String|pageY|update|Function|abs|getTime|asin|on|70158|els|iProps|operator|found|bounceOut|ie6|opera|onreadystatechange||try|catch|clear|queryString|split|map|callChain|opt|typeof|charAt|Chain|Events|htmlElement|Native|Options|camelCase|scrollSize|gecko|splice|getSize|what|getNext|getBrother|parseInt|onCancel|toObject|class|slideIn|clearChain|javascript|bottom|click|application|nodeType|linear|clientX|clientY|evalResponse|setHTML|trim|wheelDelta|120|shift|trash|defaults|check|525|bindWithEvent|getAttribute|get|chain|which|bounceIn|regexp|replaceWith|cookie|default|complete|async|Style|Styles|createElement|init|eval|clientWidth|clientHeight|ActiveXObject|pageXOffset|random|pageYOffset|getWidth|selectedIndex|getScrollWidth|getScrollHeight|getScrollLeft|getScrollTop|encodeURIComponent|px|transition|cTime|step|fps|getHeight|picked|color|Single|Color|parentize|undefined|onRequest|some|iParsed|copy|iterable|params|toUpperCase|round|Ajax|Number|toFloat|getProperty|err|_element_extended_|_elements_extended_|request|where|ie_ready|input|before|after|useLink|cssText|inside|contents|RegExp|full|getLeft|removeClass|Scroll|getTop|setOpacity|visible|insertBefore|textarea|injectAfter|moreOptions|defaultView|hyphenate||noinit|adopt|capitalize|addEventListener|removeEventListener|evType|vertical|Sibling|childNodes|setStyles|hide|addClass|slideOut|show|attributes|Requested|toggle|setProperties|With|innerHTML|checkbox|radio|password|Cookie|offsetLeft|offsetParent|Accept|getCoordinates|unload|html|srcElement|365|quadIn|alt|quadOut|quadInOut|metaKey|cubicIn|escape|cubicOut|detail|cubicInOut|keyCode|quartIn|fromCharCode|quartOut|quartInOut|client|quintIn|quintOut|quintInOut|sineIn|button|mouseover|sineOut|fromElement|mouseout|cancelBubble|rightClick|expoIn|returnValue|expoOut|enter|expoInOut|page|mouse|up|circIn|transparent|down|circOut|circInOut|esc|setTime|wheel|elasticIn|space|meta|altKey|links|ctrlKey|control|shiftKey|elasticOut|backspace|delete|elasticInOut|86400000|Group|ES|expires|backIn|backOut|backInOut|getElementsByClassName|9375|offsetTop|toGMTString|do|625|gi|984375|checked|bounceInOut|write|defer|src|void|exec|setAttribute|load|DOMContentLoaded|onDomReady|all|unescape|innerWidth|substr|innerHeight|Microsoft|XMLHTTP|500|1000|custom|200|clearTimer|300|responseText|responseXML|Window|nodeName|nodeValue|floor|pick|effect|open|clearTimeout|clearInterval|ie7|effects|navigator|taintEnabled|getBoxObjectFor|execCommand|BackgroundImageCache|associate|overrideMimeType|Connection|close|slice|toString|setRequestHeader|SmoothScroll|concat|setTimeout|setInterval|pass|bindAsEventListener|action|embed|number|injectBefore|injectInside|removeChild|toTop|replaceChild|toBottom|appendText|styleSheet|toLeft|createTextNode|toRight|utf|toggleClass|cloneNode|clone|hasLayout|Slide|zoom|alpha|100|div|padding|getComputedStyle|overflow|getPropertyValue|auto|charset|attachEvent|addEvents|Content|detachEvent|getPrevious|www|next|horizontal|form|getFirst|firstChild|nextSibling|getLast|urlencoded|lastChild|previousSibling|getParent|getChildren|textnode'.split('|'),0,{}))


/* ----- slideshow.js ---- */
//Slideshow RC2 for Mootools 1.0. Copyright (c) 2007 Aeron Glemann, <http://electricprism.com/aeron/slideshow>, MIT Style License.
//-------------------------------------------------------
//	Class: Slideshow
//	
//	  Slideshow is a javascript class to stream and animate the presentation of images on your website.
//	
//	Properties:
//	
//	  captions      - Array of HTML captions to accomodate slides. Captions are inserted into a P element
//	  classes       - An array of 3 class names for 'prev', 'next' and 'active' navigation elements
//	  duration      - An array of 2 values in milliseconds (1000 = 1 second). The first value indicates the duration of the effect, and the second the duration between slide changes
//	  height        - Optional height value for the slideshow as a whole integer. If a height value is not given the height of the default image will be used
//	  hu            - Relative path to the image directory. Default is the same directory as the web page
//	  images        - Array of image filenames found at the path above
//	  navigation    - Optional navigation controls. The navigation appears as anchors (A) within an unordered list (UL LI). If called with the optional 'fast' keyword (eg. 'arrows fast'), the slideshow will not wait until the current transition completes, but update the slide change instantly
//                  		arrows: Only previous and next controls
//                  		arrows+: Previous, next and controls to jump to any image
//                  		thumbnails: Controls to jump to any image represented as thumbnails. The thumbnail images must exist in the same directory as the full-size images and be named as expected by the slideshow (see thumbnailre)
//	  pan           - Optional value to customize slideshow panning movement. Acceptable values are whole integers between 1 and 100 or the keyword 'rand' which will generate a random value for each slide
//	  resize        - Boolean, true or false, whether images are resized (default is true). Resized images may not appear well in all browsers. Note: If you are using a 'zoom' or 'combo' type slideshow, images will be resized regardless
//	  thumbnailre   - An array used in a javascript replace to determine the file naming schema of thumbnail images. The first value is a regular expression (find) the second value is the new substring (replace)
//	  transition    - Optional name of Robert Penner transition to use with wipe and push type slideshows. Transitions are only available if Fx.Transitions.js is available in Mootools
//	  type          - Slideshow type
//                  		fade: Fades between slides
//                  		pan: Fades between slides and scrolls the image while it is visible
//                  		zoom: Fades between slides and zooms the image while it is visible
//                  		combo: Fades between slides and zooms and scrolls the image while it is visible, also known as the Ken Burns Effect
//                  		push: Pushes the old image out of the frame with the new one
//                  		wipe: Wipes the new image over the old one
//	  width       - Optional width value for the slideshow as a whole integer. If a width value is not given the width of the default image will be used
//	  zoom        - Optional value to customize slideshow zooming movement. Acceptable values are whole integers between 1 and 100 or the keyword 'rand' which will generate a random value for each slide
//-------------------------------------------------------

Slideshow = new Class({
	
//-------------------------------------------------------
//	Function: initialize
//
//	  Called automatically when a new slideshow instance is created.
//
//	Arguments:
//
//	  slideshow     - Instance or ID of element that wraps the slideshow images, usually a DIV
//	  props					- Property list as described for the class
//-------------------------------------------------------

	initialize: function(slideshow, props) {
		this.props = Object.extend({
			captions: false,
			classes: ['prev', 'next', 'active'],
			duration: [2000, 4000],
			height: false,
			hu: '/',
			images: [],
			navigation: false,
			pan: 100,
			resize: true,
			thumbnailre: [/\./, 't.'],
			transition: Fx.Transitions.sineInOut,
			type: 'fade',
			width: false,
			zoom: 50
		}, props || {});

		if (this.props.images.length <= 1) { return; }

		if (this.props.pan != 'rand') {
			if (isNaN(this.props.pan.toInt()) || this.props.pan.toInt() < 0 || this.props.pan.toInt() > 100) { this.props.pan = 0; }
		}

		if (this.props.zoom != 'rand') {
			if (isNaN(this.props.zoom.toInt()) || this.props.zoom.toInt() < 0 || this.props.zoom.toInt() > 100) { this.props.zoom = 0; }
		}

		this.slideshow = $(slideshow);

		this.a = img = $E('img', this.slideshow);

		this.fx = [];

		this.start();
	},

//-------------------------------------------------------
//	Function: start
//
//	  Sets class variables; creates slideshow, navigation and caption elements; resizes images.
//-------------------------------------------------------
	
	start: function() {
		this.slideshow.setHTML('');

		this.a.setStyles({display: 'block', position: 'absolute', left: '0px', top: '0px', zIndex: 1});		
		this.a.injectInside(this.slideshow);		
		this.fx.each(function(fx) { 
			fx.time = fx.options.duration = 0;
			fx.stop(true); 
		});		

		obj = this.a.getCoordinates();

		this.height = ((this.props.height) ? this.props.height : obj['height']);
		this.width = ((this.props.width) ? this.props.width : obj['width']);
		
		this.slideshow.setStyles({display: 'block', position: 'relative', width: this.width + 'px'});

		// Images appear within a bounding div inside of the slideshow div
		// This div may be used to attach events - such as myShow.div.onmouseover - in order to show / hide navigation or further manipulate the slideshow
		this.div = new Element('div');
		this.div.setStyles({display: 'block', height: (this.height + 'px'), overflow: 'hidden', position: 'relative', width: (this.width + 'px')});
		this.div.injectInside(this.slideshow);

		this.a.injectInside(this.div);

		if ((this.props.height || this.props.width) && this.props.resize) {			
			dh = this.height / obj['height'];
			dw = this.width / obj['width'];
	
			n = (dw > dh) ? dw : dh;

			this.a.setStyles({height: Math.ceil(obj['height'] * n) + 'px', width: Math.ceil(obj['width'] * n) + 'px'});
		}
				
		this.b = this.a.clone();
		this.b.setStyle('opacity', 0);
		this.b.injectAfter(this.a);

		if (this.props.navigation) { this.navigation(); }

		if ($type(this.props.captions) == 'array') {
			this.p = new Element('p');
			this.p.setHTML(this.props.captions[0]);
			this.p.injectInside(this.slideshow);
		}

		this.direction = 'left';
		this.curr = [1, 1];
		this.timer = (this.timer) ? [0] : [(new Date).getTime() + this.props.duration[1], 0];

		this.loader = new Image();
		this.loader.src = this.props.hu + this.props.images[this.curr[0]].trim();

		this.preload();
	},

//-------------------------------------------------------
//	Function: preload
//
//	  Loops until new image has loaded or delay has been met; calculates and executes effects.
//
//	Arguments:
//
//	  fast     		- True if the navigation is in 'fast' mode
//-------------------------------------------------------

	preload: function(fast) {
		if (this.loader.complete && ((new Date).getTime() > this.timer[0])) {
			img = (this.curr[1] % 2) ? this.b : this.a;
			img.setStyles({height: 'auto', opacity: 0, width: 'auto', zIndex: this.curr[1]});
			img.setProperty('src', this.loader.src);	
			
			dh = this.height / this.loader.height;
			dw = this.width / this.loader.width;

			n = (dw > dh) ? dw : dh;

			if (this.props.resize) { img.setStyles({height: Math.ceil(this.loader.height * n) + 'px', width: Math.ceil(this.loader.width * n) + 'px'}); }
			
			if (fast) {
				img.setStyles({left: '0px', opacity: 1, top: '0px'});
				if ($type(this.props.captions) == 'array') { this.p.setHTML(this.props.captions[this.curr[0]]).setStyle('opacity', 1); }
				return this.loaded();
			}

			this.fx = [];

			if ($type(this.props.captions) == 'array') {
				fn = function(i) {
					if (this.props.captions[i]) { this.p.setHTML(this.props.captions[i]); }
					
					fx = new Fx.Style(this.p, 'opacity');
					fx.start(0, 1);
					this.fx.push(fx);
				}.pass(this.curr[0], this);
	
				fx = new Fx.Style(this.p, 'opacity', {onComplete: fn});
				fx.start(1, 0);
				this.fx.push(fx);
			}

			if (this.props.type.test(/push|wipe/)) {
				img.setStyles({left: 'auto', right: 'auto'});
				img.setStyle(this.direction, this.width + 'px');
				img.setStyle('opacity', 1);

				if (this.props.type == 'wipe') {
					fx = new Fx.Style(img, this.direction, {duration: this.props.duration[0], transition: this.props.transition});
					fx.start(this.width, 0);
					this.fx.push(fx);
				} 
				else {
					arr = [img, ((this.curr[1] % 2) ? this.a : this.b)];

					p0 = {};					
					p0[this.direction] = [this.width, 0];
					p1 = {};
					p1[this.direction] = [0, (this.width * -1)];

					// Navigation has changed direction
					// The image shifts when changing from right <> left so we need to correct the positioning
					if (arr[1].getStyle(this.direction) == 'auto') {
						x = this.width - arr[1].getStyle('width').toInt();
					
						arr[1].setStyle(this.direction, x + 'px');
						arr[1].setStyle(((this.direction == 'left') ? 'right' : 'left'), 'auto');
						 
						p1[this.direction] = [x, (this.width * -1)];
					}
					
					fx = new Fx.Elements(arr, {duration: this.props.duration[0], transition: this.props.transition});
					fx.start({'0': p0, '1': p1});
					this.fx.push(fx);						
				}
			} 
			else {	
				img.setStyles({bottom: 'auto', left: 'auto', right: 'auto', top: 'auto'});

				arr = ['left top', 'right top', 'left bottom', 'right bottom'][this.curr[1] % 4].split(' ');
				arr.each(function(p) { img.setStyle(p, 0); });

				zoom = ((this.props.type).test(/zoom|combo/)) ? this.zoom() : {};
					
				pan = ((this.props.type).test(/pan|combo/)) ? this.pan() : {};
				
				fx = new Fx.Style(img, 'opacity', {duration: this.props.duration[0]});
				fx.start(0, 1);
				this.fx.push(fx);

				fx = new Fx.Styles(img, {duration: (this.props.duration[0] + this.props.duration[1]), transition: Fx.Transitions.linear});
				fx.start(Object.extend(zoom, pan));
				this.fx.push(fx);
			}

			this.loaded();
		}
		else { this.timeout = this.preload.delay(100, this); }
	},

//-------------------------------------------------------
//	Function: loaded
//
//	  Sets next image in slideshow; updates status of navigation elements.
//-------------------------------------------------------

	loaded: function() {
		if (this.ul) {
			anchors = $ES('a[name]', this.ul);
			anchors.each(function(a, i) {
				if (i == this.curr[0]) { a.addClass(this.props.classes[2]); }
				else { a.removeClass(this.props.classes[2]); }
			}, this);
		}

		this.direction = 'left';
		this.curr[0] = (this.curr[0] == this.props.images.length - 1) ? 0 : this.curr[0] + 1;
		this.curr[1]++;
		this.timer[0] = (new Date).getTime() + this.props.duration[1] + ((this.props.type.test(/fade|push|wipe/)) ? this.props.duration[0] : 0);
		this.timer[1] = (new Date).getTime() + this.props.duration[0];

		this.loader = new Image();
		this.loader.src = this.props.hu + this.props.images[this.curr[0]].trim();
		
		this.preload();
	},

//-------------------------------------------------------
//	Function: zoom
//
//	  Calculates degree of zooming based on image and slideshow properties.
//
//	Returns:
//
//	  A property array with the height and width styles for the effect.
//-------------------------------------------------------

	zoom: function() {
		z = (this.props.zoom == 'rand') ? Math.random() + 1 : (this.props.zoom.toInt() / 100.0) + 1;

		eh = Math.ceil(this.loader.height * n);
		ew = Math.ceil(this.loader.width * n);

		sh = parseInt(eh * z);
		sw = parseInt(ew * z);

		return {height: [sh, eh], width: [sw, ew]};
	},

//-------------------------------------------------------
//	Function: pan
//
//	  Calculates degree of panning based on image and slideshow properties.
//
//	Returns:
//
//	  A property array with the left and right styles for the effect.
//-------------------------------------------------------

	pan: function() {
		p = (this.props.pan == 'rand') ? Math.random() : Math.abs((this.props.pan.toInt() / 100.0) - 1);

		ex = (this.width - img.width);
		ey = (this.height - img.height);

		sx = parseInt(ex * p);
		sy = parseInt(ey * p);

		obj = {};

		if (dw > dh) { obj[arr[1]] = [sy, ey] }
		else { obj[arr[0]] = [sx, ex]; }
		
		return obj;
	},

//-------------------------------------------------------
//	Function: navigation
//
//	  Generates navigation elements / functionality based on slideshow properties
//-------------------------------------------------------

	navigation: function() {
		this.ul = new Element('ul');

		if (this.props.navigation.test(/arrows/)) {
			li = new Element('li');

			a = new Element('a');
			a.addClass(this.props.classes[0]);
			a.onclick = function() {
				if (this.props.navigation.test(/fast/) || (new Date).getTime() > this.timer[1]) {	
					$clear(this.timeout);
			
					// Clear the FX array only for fast navigation since this stops combo effects
					if (this.props.navigation.test(/fast/)) {
						this.fx.each(function(fx) { 
							fx.time = fx.options.duration = 0;
							fx.stop(true); 
						});
					}

					this.direction = 'right';
					this.curr[0] = (this.curr[0] < 2) ? this.props.images.length - (2 - this.curr[0]) : this.curr[0] - 2;
					this.timer = [0];
					
					this.loader = new Image();
					this.loader.src = this.props.hu + this.props.images[this.curr[0]].trim();

					this.preload(this.props.navigation.test(/fast/));
				}
			}.bind(this);
			a.injectInside(li);
			
			li.injectInside(this.ul);
		}
		
		if (this.props.navigation.test(/arrows\+|thumbnails/)) {
			for (i = 0; i < this.props.images.length; i++) {
				li = new Element('li');

				a = new Element('a');
				a.setProperty('name', i);
				if (this.props.navigation.test(/thumbnails/)) {
					src = this.props.hu + this.props.images[i].trim().replace(this.props.thumbnailre[0], this.props.thumbnailre[1]);
					a.setStyle('background-image', 'url(' + src + ')');
				}
				if (i == 0) { a.className = this.props.classes[2]; }
				a.onclick = function(i) {
					if (this.props.navigation.test(/fast/) || (new Date).getTime() > this.timer[1]) {	
						$clear(this.timeout);
				
						// Clear the FX array only for fast navigation since this stops combo effects
						if (this.props.navigation.test(/fast/)) {
							this.fx.each(function(fx) { 
								fx.time = fx.options.duration = 0;
								fx.stop(true); 
							});
						}
						
						this.direction = (i < this.curr[0] || this.curr[0] == 0) ? 'right' : 'left';
						this.curr[0] = i;
						this.timer = [0];			
		
						this.loader = new Image();
					  this.loader.src = this.props.hu + this.props.images[this.curr[0]].trim();
		
						this.preload(this.props.navigation.test(/fast/));
					}
				}.pass(i, this);
				a.injectInside(li);
				
				li.injectInside(this.ul);
			}
		}

		if (this.props.navigation.test(/arrows/)) {
			li = new Element('li');
	
			a = new Element('a');
			a.addClass(this.props.classes[1]);
			a.onclick = function() {
				if (this.props.navigation.test(/fast/) || (new Date).getTime() > this.timer[1]) {	
					$clear(this.timeout);

					// Clear the FX array only for fast navigation since this stops combo effects
					if (this.props.navigation.test(/fast/)) {
						this.fx.each(function(fx) { 
							fx.time = fx.options.duration = 0;
							fx.stop(true); 
						});
					}

					this.timer = [0];					

					this.preload(this.props.navigation.test(/fast/));
				}
			}.bind(this);
			a.injectInside(li);
			
			li.injectInside(this.ul);
		}

		this.ul.injectInside(this.slideshow);
	}
});/* ----- imgbox.js ---- */


var oLBX = new Object;
function pLBX(){	
	
	if(oLBX.options.lb_slideshow==1){			
		oLBX.next();	
		setTimeout('pLBX()',parseInt(oLBX.options.lb_slideshowdur));		
	}
}


function oLBT(){

}


var viewportwidth;
var viewportheight;
 
function getVP(){
	if (typeof window.innerWidth != 'undefined'){
	viewportwidth = window.innerWidth,
	viewportheight = window.innerHeight
	} else if (typeof document.documentElement != 'undefined' && typeof document.documentElement.clientWidth !='undefined' && document.documentElement.clientWidth != 0){
    viewportwidth = document.documentElement.clientWidth,
    viewportheight = document.documentElement.clientHeight
	}else{
       viewportwidth = document.getElementsByTagName('body')[0].clientWidth,
       viewportheight = document.getElementsByTagName('body')[0].clientHeight
	 }
}
 
var LBX = {
	init: function(options){
		this.options = Object.extend({
			resizeDuration: 400,
			resizeTransition: Fx.Transitions.sineInOut,
			initialWidth: 250,
			initialHeight: 250,
			animateCaption: true,
			defaultIframeWidth : 500, 
			defaultIframeHeight: 300,
			lb_slideshowdur: 5000,
			lb_slideshow: 0,
			loop: 1,
			op:0
		}, options || {});
		
		
		try {
		document.execCommand("BackgroundImageCache", false, true);
		} catch(e) {}

		// IE 6 - XML prolog problem
		if(window.ie6 && document.compatMode=="BackCompat"){
			this.options.animateCaption = false;
		}

		this.anchors = [];
		$each(document.links, function(el){
			if (el.rel && el.rel.test(/^lbx/i)){
				el.onclick = this.click.pass(el, this);
				this.anchors.push(el);
			}
		}, this);
		this.eventKeyDown = this.keyboardListener.bindAsEventListener(this);
		this.eventPosition = this.position.bind(this);

		/*	Build float panel
			<div id="lbOverlay"></div>
			<div id="lbCenter">
				<div id="lbCanvas">
					<a id="lbPrevLink"></a>
					<a id="lbNextLink"></a>
					<!-- img or iframe element is inserted here -->
				</div>
			</div>
			<div id="lbBottomContainer">
				<div id="lbBottom">
					<a id="lbCloseLink"></a>
					<div id="lbCaption"></div>
					<div id="lbNumber"></div>
					<div style="clear:both;"></div>
				</div>
			</div>
		*/
		
		
		
		this.overlay = new Element('div').setProperty('id', 'lbOverlay').injectInside(document.body);
		//this.overlay = new Element('div').setProperty('id', 'lbOverlay').injectInside(this.GHolder);


		this.GHolder = new Element('div').setProperty('id', 'lbGHolder').injectInside(document.body);
		//this.center = new Element('div').setProperty('id', 'lbCenter').setStyles({width: this.options.initialWidth+'px', height: this.options.initialHeight+'px', marginLeft: '-'+(this.options.initialWidth/2)+'px', display: 'none'}).injectInside(document.body);
		this.center = new Element('div').setProperty('id', 'lbCenter').setStyles({width: this.options.initialWidth+'px', height: this.options.initialHeight+'px', marginLeft: '-'+(this.options.initialWidth/2)+'px', display: 'none'}).injectInside(this.GHolder);
		
		this.canvas = new Element('div').setProperty('id', 'lbCanvas').injectInside(this.center);
		this.prevLink = new Element('a').setProperties({id: 'lbPrevLink', href: '#'}).setStyle('display', 'none').injectInside(this.canvas);
		this.nextLink = this.prevLink.clone().setProperty('id', 'lbNextLink').injectInside(this.canvas);
		this.prevLink.onclick = this.previous.bind(this);
		this.nextLink.onclick = this.next.bind(this);
		
		//this.bottomContainer = new Element('div').setProperty('id', 'lbBottomContainer').setStyle('display', 'none').injectInside(document.body);
		this.bottomContainer = new Element('div').setProperty('id', 'lbBottomContainer').setStyle('display', 'none').injectInside(this.GHolder);
		this.bottom = new Element('div').setProperty('id', 'lbBottom').injectInside(this.bottomContainer);
		new Element('a').setProperties({id: 'lbCloseLink', href: '#'}).injectInside(this.bottom).onclick = this.overlay.onclick = this.close.bind(this);
		
		
		if(this.anchors.length>1){				
		this.playlink = new Element('div').setProperties({id: 'lbPlayLink', href: '#'}).setStyle('display', '').injectInside(this.bottom);
		this.playlink.onclick = this.togglep.bind(this);
		//onclick = this.overlay.onclick = this.togglep.bind(this);
		
		this.stoplink = new Element('div').setProperties({id: 'lbStopLink', href: '#'}).setStyle('display', 'none').injectInside(this.bottom);
		this.stoplink.onclick = this.togglep.bind(this);
		//onclick = this.overlay.onclick = this.togglep.bind(this);
		}
		
		
		
		this.caption = new Element('div').setProperty('id', 'lbCaption').injectInside(this.bottom);
		this.number = new Element('div').setProperty('id', 'lbNumber').injectInside(this.bottom);
		new Element('div').setStyle('clear', 'both').injectInside(this.bottom);

		/* Build effects */
		var nextEffect = this.nextEffect.bind(this);
		this.fx = {
			overlay: this.overlay.effect('opacity', {duration: 500}).hide(),
			resizeCenter: this.center.effects({duration: this.options.resizeDuration, transition: this.options.resizeTransition, onComplete: nextEffect}),
			image: this.canvas.effect('opacity', {duration: 1000, onComplete: nextEffect}),
			bottom: this.bottomContainer.effect('height', {duration: 400, onComplete: nextEffect})
		};

		this.preloadPrev = new Image();
		this.preloadNext = new Image();
	},

	click: function(link){
		
		if (link.rel.length == 8) return this.show(link.href, link.title, link.rev);

		var j, itemNumber, items = [];		
		this.anchors.each(function(el){
			if (el.rel == link.rel){
				for (j = 0; j < items.length; j++) if(items[j][0] == el.href && items[j][2] == el.rev) break;
				if (j == items.length){
					items.push([el.href, el.title, el.rev]);
					if (el.href == link.href && el.rev == link.rev) itemNumber = j;
				}
			}
		}, this);

		return this.open(items, itemNumber);
	},

	show: function(url, title, rev){		
		return this.open([[url, title, rev]], 0);
	},

	open: function(items, itemNumber){		
		oLBX = this;
		this.items = items;
		this.position();		
		this.setup(true);
		var wh = (window.getHeight() == 0) ? window.getScrollHeight() : window.getHeight();
		var st = document.body.scrollTop  || document.documentElement.scrollTop;
		this.top = st  + (wh / 20);				
		this.center.setStyles({top: this.top+'px', display: ''});		
		this.fx.overlay.start(0.8);
		this.options.op = 1;		

		return this.changeItem(itemNumber);
	},

	position: function(){
		//IE6 - XML prolog problem.				
		var ww = (window.getWidth() == 0) ? window.getScrollWidth()-22 : window.getWidth();
		var wh = (window.getHeight() == 0) ? window.getScrollHeight() : window.getHeight();
		var st = document.body.scrollTop  || document.documentElement.scrollTop;		
		this.overlay.setStyles({height:window.getScrollHeight()+'px', width:ww+'px',top:0+'px'});
		var pt = 20;
		var toppadd = parseInt(this.center.offsetHeight); // + parseInt(this.bottomContainer.offsetHeight);		
		//correct center
		if(isNaN(toppadd) || toppadd<1){  }else{ getVP(); pt = (viewportheight/2) - (toppadd / 2) - 20; } 
		this.center.setStyles({top: parseInt(st) + parseInt(pt) +'px'});		
		v = parseInt(this.center.offsetHeight) + parseInt(this.center.style.top);		
		this.bottomContainer.style.top = v+'px';				
	},

	checksls: function(){
			v = this.options.lb_slideshow;			
			if(v==1){						
				this.stoplink.setStyle('display', '');
				this.playlink.setStyle('display', 'none');											
			}else{					
				if(this.playlink){
				this.playlink.setStyle('display', '');
				this.stoplink.setStyle('display', 'none');				
				}
			}
	},
	
	setup: function(open){
		var elements = $A(document.getElementsByTagName('object'));
		if (window.ie) elements.extend(document.getElementsByTagName('select'));
		elements.each(function(el){ el.style.visibility = open ? 'hidden' : ''; });
		var fn = open ? 'addEvent' : 'removeEvent';
		window[fn]('scroll', this.eventPosition)[fn]('resize', this.eventPosition);
		document[fn]('keydown', this.eventKeyDown);
		this.step = 0;		
	},

	keyboardListener: function(event){
		
		if(event.keyCode=='39'){
			if((parseInt(this.anchors.length) - 1) == this.activeItem){
			this.close();	
			}
		}
		
		a = parseInt(event.keyCode);
			if(a==27 || a==88 || a==67){
			options.lb_slideshow=0; 
			this.close(); 		
			}else if(a==37){
			this.previous(); this.options.lb_slideshow=0;
			}else if(a==39){
			this.next(); this.options.lb_slideshow=0;
			}
			
		
	},
	
	
	previous: function(){
		return this.changeItem(this.activeItem-1);
	},

	next: function(){			
	return this.changeItem(this.activeItem+1);
	},

	changeItem: function(itemNumber){	
		
		this.checksls();							

		if(this.step || (itemNumber < 0)) { return false; }
		else if(itemNumber >= this.items.length){
		this.close();
		return false;
		}
		
		this.step = 1;
		this.activeItem = parseInt(itemNumber);
						
		
		this.bottomContainer.style.display = this.prevLink.style.display = this.nextLink.style.display = 'none';
		this.fx.image.hide();
		this.center.className = 'lbLoading';

		// discard previous content by clicking
		this.removeCurrentItem();
		
		// check item type
		var url = this.items[this.activeItem][0];
		var rev = this.items[this.activeItem][2];
		
		var re_imageURL = /\.(jpe?g|png|gif|bmp)/i;
		if( url.match(re_imageURL) ) {
			
		
			this.preload = new Image();	// JavaScript native Object
			this.preload.datatype = 'image';
			this.preload.w = this.matchOrDefault(rev, new RegExp("width=(\\d+%?)", "i"), -1); //-1 if use original size.
			this.preload.h = this.matchOrDefault(rev, new RegExp("height=(\\d+%?)", "i"), -1);					
			this.preload.onload = this.nextEffect.bind(this);			
			this.preload.src = url;		
		}else{
			this.preload = new Object ();	// JavaScript native Object
			this.preload.datatype = 'iframe';
			neww =  this.matchOrDefault(rev, new RegExp("width=(\\d+)", "i"), this.options.defaultIframeWidth);
			newh =  this.matchOrDefault(rev, new RegExp("height=(\\d+)", "i"), this.options.defaultIframeHeight);
			this.preload.w = neww;		
			this.preload.h = newh; 
			this.preload.src = url;
			this.nextEffect(); //asynchronous loading
		}
		
		return false;
	},

	nextEffect: function(){
		switch (this.step++){
		case 1:
			this.center.className = '';

			// create HTML element
			if( this.preload.datatype == 'image' ) {
				
				var ws = (this.preload.w == -1) ? this.preload.width.toString() : this.preload.w.toString();
				var hs = (this.preload.h == -1) ? this.preload.height.toString() : this.preload.h.toString();
				
				ww = parseInt((window.getWidth() == 0) ? window.getScrollWidth()-22 : window.getWidth()) - 150;
				wh = parseInt((window.getHeight() == 0) ? window.getScrollHeight() : window.getHeight()) - 150 - this.bottom.offsetHeight;					
				
				ratio = parseInt(ws) / parseInt(hs);
				ws_ = parseInt(ws); hs_= parseInt(hs);

					if(ws_ > ww || hs_ > wh){
					//image height					
					if(hs_ > wh){							
							hs = wh.toString();
							ws = parseInt(hs) * ratio;
							ws = ws.toString();														
						}else if(ws_ > ww){
						  	ws = ww.toString();	
							hs = parseInt(ws) * ratio;
							hs = hs.toString();
						}
				}
				
				this.p_width = ( q = ws.match(/(\d+)%/) ) ? q[1] * this.preload.width * 0.01 : ws;
				this.p_height = ( q = hs.match(/(\d+)%/) ) ? q[1] * this.preload.height * 0.01 : hs;				
				new Element('img').setProperties({id: 'lbImage', src:this.preload.src, width:this.p_width, height:this.p_height}).injectInside(this.canvas);

				var st = document.body.scrollTop  || document.documentElement.scrollTop;
				var toppadd = parseInt(this.center.offsetHeight);
				if(isNaN(toppadd) || toppadd<1){  }else{ getVP(); pt = (viewportheight/2) - (toppadd / 2) - 20; } 
				this.center.setStyles({top: parseInt(st) + parseInt(pt) +'px'});
				
				this.nextLink.style.right = '';
				this.nextLink.blur();
				
				
				
					
				
					
			
			
			}else{
				this.p_width = this.preload.w;
				this.p_height = this.preload.h;
				// Safari would not update iframe content that has static id.
				this.iframeId = "lbFrame_"+new Date().getTime();
				new Element('iframe').setProperties({id: this.iframeId, width: this.p_width, height: this.p_height, frameBorder:0, scrolling:'yes', src:this.preload.src}).injectInside(this.canvas);
				this.nextLink.style.right = '25px';
			}
									
			this.canvas.style.width = this.bottom.style.width = ((parseInt(this.p_width)) )+'px';

			this.canvas.style.height = this.prevLink.style.height = this.nextLink.style.height = this.p_height+'px';					
			this.caption.setHTML(this.items[this.activeItem][1] || '');
			this.number.setHTML( (this.items.length == 1) ? '' : '' + (this.activeItem+1) + ' / ' + this.items.length );

			if (this.activeItem) this.preloadPrev.src = this.items[this.activeItem-1][0];
			if (this.activeItem != (this.items.length - 1)) this.preloadNext.src = this.items[this.activeItem+1][0];
			if (this.center.clientHeight != this.canvas.offsetHeight){
				var oh = (this.p_height == this.canvas.clientHeight) ? this.canvas.offsetHeight : eval(this.p_height)+18; // fix for ie
				this.fx.resizeCenter.start({height: oh});
				this.position();
				break;
			}
			this.position();
			this.step++;
		case 2:
			
			if (this.center.clientWidth != this.canvas.offsetWidth){
				var ow = (this.p_width == this.canvas.clientWidth) ? this.canvas.offsetWidth : eval(this.p_width)+18; // fix for ie
				this.fx.resizeCenter.start({width: ow, marginLeft: -ow/2}); 		
				this.position();
				break;
			}
			this.position();
			this.step++;
		case 3:		
			this.bottomContainer.setStyles({top: (this.top + this.center.clientHeight + 10)+'px', height:'0px', marginLeft: this.center.style.marginLeft, width:this.center.style.width, display: ''});
			this.fx.image.start(1);
			break;
		case 4:
			if (this.options.animateCaption){
				this.position();
				// This is not smooth animation in IE 6 with XML prolog.
				// If your site is XHTML strict with XML prolog, disable this option.				
				this.fx.bottom.start(0,this.bottom.offsetHeight+10);								
				break;
			}
			
			
			
		case 5:
			
			if (this.activeItem){
				this.prevLink.style.display = '';				
			}
			
			if (this.activeItem != (this.items.length - 1)){
				this.nextLink.style.display = '';				
			}
			
			
			this.step = 0;
		}
		
		
	
	},
	
	togglep: function(){
			v = this.options.lb_slideshow;			
			if(v==1){							
				this.options.lb_slideshow = 0;
			}else{
				this.options.lb_slideshow = 1;
				setTimeout('pLBX()',1000);
			}			
			this.checksls();
	},
	
	close: function(){
		this.options.op = 0;
		if (this.step < 0) return;
		this.step = -1;
		this.options.lb_slideshow = 0;
		this.removeCurrentItem();	// discard content
		for (var f in this.fx) this.fx[f].stop();
		this.center.style.display = this.bottomContainer.style.display = 'none';
		this.fx.overlay.chain(this.setup.pass(false, this)).start(0);
		return false;
	},

	removeCurrentItem: function(){
		if (this.preload){
			if( this.preload.datatype == 'image' ) {
				if($('lbImage')){ 
				$('lbImage').remove(); 
				}
				this.preload.onload = Class.empty;
			}else{
				$(this.iframeId).remove();
			}
			this.preload = null;
		}		
	},

	matchOrDefault: function(str, re, val){
		var hasQuery = str.match(re);
		return hasQuery ? hasQuery[1] : val;
	}

};

window.addEvent('domready', LBX.init.bind(LBX));
