(function($){$.fn.bgIframe=$.fn.bgiframe=function(s){if($.browser.msie&&/6.0/.test(navigator.userAgent)){s=$.extend({top:'auto',left:'auto',width:'auto',height:'auto',opacity:true,src:'javascript:false;'},s||{});var prop=function(n){return n&&n.constructor==Number?n+'px':n;},html='<iframe class="bgiframe"frameborder="0"tabindex="-1"src="'+s.src+'"'+'style="display:block;position:absolute;z-index:-1;'+(s.opacity!==false?'filter:Alpha(Opacity=\'0\');':'')+'top:'+(s.top=='auto'?'expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+\'px\')':prop(s.top))+';'+'left:'+(s.left=='auto'?'expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+\'px\')':prop(s.left))+';'+'width:'+(s.width=='auto'?'expression(this.parentNode.offsetWidth+\'px\')':prop(s.width))+';'+'height:'+(s.height=='auto'?'expression(this.parentNode.offsetHeight+\'px\')':prop(s.height))+';'+'"/>';return this.each(function(){if($('> iframe.bgiframe',this).length==0)this.insertBefore(document.createElement(html),this.firstChild);});}return this;};})(jQuery);;(function($){var ajax=$.ajax;var pendingRequests={};var synced=[];var syncedData=[];$.ajax=function(settings){settings=jQuery.extend(settings,jQuery.extend({},jQuery.ajaxSettings,settings));var port=settings.port;switch(settings.mode){case"abort":if(pendingRequests[port]){pendingRequests[port].abort();}
return pendingRequests[port]=ajax.apply(this,arguments);case"queue":var _old=settings.complete;settings.complete=function(){if(_old)
_old.apply(this,arguments);jQuery([ajax]).dequeue("ajax"+port);;};jQuery([ajax]).queue("ajax"+port,function(){ajax(settings);});return;case"sync":var pos=synced.length;synced[pos]={error:settings.error,success:settings.success,complete:settings.complete,done:false};syncedData[pos]={error:[],success:[],complete:[]};settings.error=function(){syncedData[pos].error=arguments;};settings.success=function(){syncedData[pos].success=arguments;};settings.complete=function(){syncedData[pos].complete=arguments;synced[pos].done=true;if(pos==0||!synced[pos-1])
for(var i=pos;i<synced.length&&synced[i].done;i++){if(synced[i].error)synced[i].error.apply(jQuery,syncedData[i].error);if(synced[i].success)synced[i].success.apply(jQuery,syncedData[i].success);if(synced[i].complete)synced[i].complete.apply(jQuery,syncedData[i].complete);synced[i]=null;syncedData[i]=null;}};}
return ajax.apply(this,arguments);};})(jQuery);;;(function($){var ie6=$.browser.msie&&parseInt($.browser.version)==6&&typeof window['XMLHttpRequest']!="object",ieQuirks=null,w=[];$.modal=function(data,options){return $.modal.impl.init(data,options);};$.modal.close=function(){$.modal.impl.close();};$.fn.modal=function(options){return $.modal.impl.init(this,options);};$.modal.defaults={appendTo:'body',focus:true,opacity:50,overlayId:'simplemodal-overlay',overlayCss:{},containerId:'simplemodal-container',containerCss:{},dataId:'simplemodal-data',dataCss:{},minHeight:null,minWidth:null,maxHeight:null,maxWidth:null,autoResize:false,autoPosition:true,zIndex:1000,close:true,closeHTML:'<a class="modalCloseImg" title="Close"></a>',closeClass:'simplemodal-close',escClose:true,overlayClose:false,position:null,persist:false,transient:false,onOpen:null,onShow:null,onClose:null};$.modal.impl={o:null,d:{},init:function(data,options){var s=this;if(s.d.data){return false;}ieQuirks=$.browser.msie&&!$.support.boxModel;s.o=$.extend({},$.modal.defaults,options);s.zIndex=s.o.zIndex;s.occb=false;if(typeof data=='object'){data=data instanceof jQuery?data:$(data);s.d.placeholder=false;if(data.parent().parent().size()>0){data.before($('<span></span>').attr('id','simplemodal-placeholder').css({display:'none'}));s.d.placeholder=true;s.display=data.css('display');if(!s.o.persist){s.d.orig=data.clone(true);}}}else if(typeof data=='string'||typeof data=='number'){data=$('<div></div>').html(data);}else{alert('SimpleModal Error: Unsupported data type: '+typeof data);return s;}s.create(data);data=null;s.open();if($.isFunction(s.o.onShow)){s.o.onShow.apply(s,[s.d]);}return s;},create:function(data){var s=this;w=s.getDimensions();if(!s.o.transient&&ie6){s.d.iframe=$('<iframe src="javascript:false;"></iframe>').css($.extend(s.o.iframeCss,{display:'none',opacity:0,position:'fixed',height:w[0],width:w[1],zIndex:s.o.zIndex,top:0,left:0})).appendTo(s.o.appendTo);}s.d.overlay=$('<div></div>').attr('id',s.o.overlayId).addClass('simplemodal-overlay').css($.extend(s.o.overlayCss,{display:'none',opacity:s.o.opacity/100,height:s.o.transient?0:w[0],width:s.o.transient?0:w[1],position:'fixed',left:0,top:0,zIndex:s.o.zIndex+1})).appendTo(s.o.appendTo);s.d.container=$('<div></div>').attr('id',s.o.containerId).addClass('simplemodal-container').css($.extend(s.o.containerCss,{display:'none',position:'fixed',zIndex:s.o.zIndex+2})).append(s.o.close&&s.o.closeHTML?$(s.o.closeHTML).addClass(s.o.closeClass):'').appendTo(s.o.appendTo);s.d.wrap=$('<div></div>').attr('tabIndex',-1).addClass('simplemodal-wrap').css({height:'100%',outline:0,width:'100%'}).appendTo(s.d.container);s.d.data=data.attr('id',data.attr('id')||s.o.dataId).addClass('simplemodal-data').css($.extend(s.o.dataCss,{display:'none'})).appendTo('body');data=null;s.setContainerDimensions();s.d.data.appendTo(s.d.wrap);if(ie6||ieQuirks){s.fixIE();}},bindEvents:function(){var s=this;$('.'+s.o.closeClass).bind('click.simplemodal',function(e){e.preventDefault();s.close();});if(!s.o.transient&&s.o.close&&s.o.overlayClose){s.d.overlay.bind('click.simplemodal',function(e){e.preventDefault();s.close();});}$(document).bind('keydown.simplemodal',function(e){if(!s.o.transient&&s.o.focus&&e.keyCode==9){s.watchTab(e);}else if((s.o.close&&s.o.escClose)&&e.keyCode==27){e.preventDefault();s.close();}});$(window).bind('resize.simplemodal',function(){w=s.getDimensions();s.setContainerDimensions(true);if(ie6||ieQuirks){s.fixIE();}else if(!s.o.transient){s.d.iframe&&s.d.iframe.css({height:w[0],width:w[1]});s.d.overlay.css({height:w[0],width:w[1]});}});},unbindEvents:function(){$('.'+this.o.closeClass).unbind('click.simplemodal');$(document).unbind('keydown.simplemodal');$(window).unbind('resize.simplemodal');this.d.overlay.unbind('click.simplemodal');},fixIE:function(){var s=this,p=s.o.position;$.each([s.d.iframe||null,s.o.transient?null:s.d.overlay,s.d.container],function(i,el){if(el){var bch='document.body.clientHeight',bcw='document.body.clientWidth',bsh='document.body.scrollHeight',bsl='document.body.scrollLeft',bst='document.body.scrollTop',bsw='document.body.scrollWidth',ch='document.documentElement.clientHeight',cw='document.documentElement.clientWidth',sl='document.documentElement.scrollLeft',st='document.documentElement.scrollTop',s=el[0].style;s.position='absolute';if(i<2){s.removeExpression('height');s.removeExpression('width');s.setExpression('height',''+bsh+' > '+bch+' ? '+bsh+' : '+bch+' + "px"');s.setExpression('width',''+bsw+' > '+bcw+' ? '+bsw+' : '+bcw+' + "px"');}else{var te,le;if(p&&p.constructor==Array){var top=p[0]?typeof p[0]=='number'?p[0].toString():p[0].replace(/px/,''):el.css('top').replace(/px/,'');te=top.indexOf('%')==-1?top+' + (t = '+st+' ? '+st+' : '+bst+') + "px"':parseInt(top.replace(/%/,''))+' * (('+ch+' || '+bch+') / 100) + (t = '+st+' ? '+st+' : '+bst+') + "px"';if(p[1]){var left=typeof p[1]=='number'?p[1].toString():p[1].replace(/px/,'');le=left.indexOf('%')==-1?left+' + (t = '+sl+' ? '+sl+' : '+bsl+') + "px"':parseInt(left.replace(/%/,''))+' * (('+cw+' || '+bcw+') / 100) + (t = '+sl+' ? '+sl+' : '+bsl+') + "px"';}}else{te='('+ch+' || '+bch+') / 2 - (this.offsetHeight / 2) + (t = '+st+' ? '+st+' : '+bst+') + "px"';le='('+cw+' || '+bcw+') / 2 - (this.offsetWidth / 2) + (t = '+sl+' ? '+sl+' : '+bsl+') + "px"';}s.removeExpression('top');s.removeExpression('left');s.setExpression('top',te);s.setExpression('left',le);}}});},focus:function(pos){var s=this,p=pos||'first';var input=$(':input:enabled:visible:'+p,s.d.wrap);input.length>0?input.focus():s.d.wrap.focus();},getDimensions:function(){var el=$(window);var h=$.browser.opera&&$.browser.version>'9.5'&&$.fn.jquery<='1.2.6'?document.documentElement['clientHeight']:$.browser.opera&&$.browser.version<'9.5'&&$.fn.jquery>'1.2.6'?window.innerHeight:el.height();return[h,el.width()];},getVal:function(v){return v=='auto'?0:v.indexOf('%')>0?v:parseInt(v.replace(/px/,''));},setContainerDimensions:function(resize){var s=this;if(!resize||(resize&&s.o.autoResize)){var ch=$.browser.opera?s.d.container.height():s.getVal(s.d.container.css('height')),cw=$.browser.opera?s.d.container.width():s.getVal(s.d.container.css('width')),dh=s.d.data.outerHeight(true),dw=s.d.data.outerWidth(true);var mh=s.o.maxHeight&&s.o.maxHeight<w[0]?s.o.maxHeight:w[0],mw=s.o.maxWidth&&s.o.maxWidth<w[1]?s.o.maxWidth:w[1];if(!ch){if(!dh){ch=s.o.minHeight;}else{if(dh>mh){ch=mh;}else if(dh<s.o.minHeight){ch=s.o.minHeight;}else{ch=dh;}}}else{ch=ch>mh?mh:ch;}if(!cw){if(!dw){cw=s.o.minWidth;}else{if(dw>mw){cw=mw;}else if(dw<s.o.minWidth){cw=s.o.minWidth;}else{cw=dw;}}}else{cw=cw>mw?mw:cw;}s.d.container.css({height:ch,width:cw});if(dh>ch||dw>cw){s.d.wrap.css({overflow:'auto'});}}if(s.o.autoPosition){s.setPosition();}},setPosition:function(){var s=this,top,left,hc=(w[0]/2)-(s.d.container.outerHeight(true)/2),vc=(w[1]/2)-(s.d.container.outerWidth(true)/2);if(s.o.position&&Object.prototype.toString.call(s.o.position)==="[object Array]"){top=s.o.position[0]||hc;left=s.o.position[1]||vc;}else{top=hc;left=vc;}s.d.container.css({left:left,top:top});},watchTab:function(e){var s=this;if($(e.target).parents('.simplemodal-container').length>0){s.inputs=$(':input:enabled:visible:first, :input:enabled:visible:last',s.d.data[0]);if((!e.shiftKey&&e.target==s.inputs[s.inputs.length-1])||(e.shiftKey&&e.target==s.inputs[0])||s.inputs.length==0){e.preventDefault();var pos=e.shiftKey?'last':'first';setTimeout(function(){s.focus(pos);},10);}}else{e.preventDefault();setTimeout(function(){s.focus();},10);}},open:function(){var s=this;s.d.iframe&&s.d.iframe.show();if($.isFunction(s.o.onOpen)){s.o.onOpen.apply(s,[s.d]);}else{s.d.overlay.show();s.d.container.show();s.d.data.show();}s.focus();s.bindEvents();},close:function(){var s=this;if(!s.d.data){return false;}s.unbindEvents();if($.isFunction(s.o.onClose)&&!s.occb){s.occb=true;s.o.onClose.apply(s,[s.d]);}else{if(s.d.placeholder){var ph=$('#simplemodal-placeholder');if(s.o.persist){ph.replaceWith(s.d.data.removeClass('simplemodal-data').css('display',s.display));}else{s.d.data.hide().remove();ph.replaceWith(s.d.orig);}}else{s.d.data.hide().remove();}s.d.container.hide().remove();s.d.overlay.hide().remove();s.d.iframe&&s.d.iframe.hide().remove();s.d={};}}};})(jQuery);;(function($){$.fn._hover=$.fn.hover;$.fn.hover=function(fn1,fn2,fn3){if(fn3)this.bind('hoverstart',fn1);if(fn2)this.bind('hoverend',fn3?fn3:fn2);return!fn1?this.trigger('hover'):this.bind('hover',fn3?fn2:fn1);};var hover=$.event.special.hover={delay:100,speed:100,setup:function(data){data=$.extend({speed:hover.speed,delay:hover.delay,hovered:0},data||{});$.event.add(this,"mouseenter mouseleave",hoverHandler,data);},teardown:function(){$.event.remove(this,"mouseenter mouseleave",hoverHandler);}};function hoverHandler(event){var data=event.data||event;switch(event.type){case'mouseenter':data.dist2=0;data.event=event;event.type="hoverstart";if($.event.handle.call(this,event)!==false){data.elem=this;$.event.add(this,"mousemove",hoverHandler,data);data.timer=setTimeout(compare,data.delay);}
break;case'mousemove':data.dist2+=Math.pow(event.pageX-data.event.pageX,2)
+Math.pow(event.pageY-data.event.pageY,2);data.event=event;break;case'mouseleave':clearTimeout(data.timer);if(data.hovered){event.type="hoverend";$.event.handle.call(this,event);data.hovered--;}
else $.event.remove(data.elem,"mousemove",hoverHandler);break;default:if(data.dist2<=Math.pow(data.speed*(data.delay/1e3),2)){$.event.remove(data.elem,"mousemove",hoverHandler);data.event.type="hover";if($.event.handle.call(data.elem,data.event)!==false)
data.hovered++;}
else data.timer=setTimeout(compare,data.delay);data.dist2=0;break;}
function compare(){hoverHandler(data);};};})(jQuery);;function str_repeat(input,multiplier){return new Array(multiplier+1).join(input);}
function strpos(haystack,needle,offset){var i=(haystack+'').indexOf(needle,offset);return i===-1?false:i;}
function is_string(mixed_var){return(typeof(mixed_var)=='string');}
function unserialize(data){var error=function(type,msg,filename,line){throw new window[type](msg,filename,line);};var read_until=function(data,offset,stopchr){var buf=[];var chr=data.slice(offset,offset+1);var i=2;while(chr!=stopchr){if((i+offset)>data.length){error('Error','Invalid');}
buf.push(chr);chr=data.slice(offset+(i-1),offset+i);i+=1;}
return[buf.length,buf.join('')];};var read_chrs=function(data,offset,length){buf=[];for(var i=0;i<length;i++){var chr=data.slice(offset+(i-1),offset+i);buf.push(chr);}
return[buf.length,buf.join('')];};var _unserialize=function(data,offset){if(!offset)offset=0;var buf=[];var dtype=(data.slice(offset,offset+1)).toLowerCase();var dataoffset=offset+2;var typeconvert=new Function('x','return x');var chrs=0;var datalength=0;switch(dtype){case"i":typeconvert=new Function('x','return parseInt(x)');var readData=read_until(data,dataoffset,';');var chrs=readData[0];var readdata=readData[1];dataoffset+=chrs+1;break;case"b":typeconvert=new Function('x','return (parseInt(x) == 1)');var readData=read_until(data,dataoffset,';');var chrs=readData[0];var readdata=readData[1];dataoffset+=chrs+1;break;case"d":typeconvert=new Function('x','return parseFloat(x)');var readData=read_until(data,dataoffset,';');var chrs=readData[0];var readdata=readData[1];dataoffset+=chrs+1;break;case"n":readdata=null;break;case"s":var ccount=read_until(data,dataoffset,':');var chrs=ccount[0];var stringlength=ccount[1];dataoffset+=chrs+2;var readData=read_chrs(data,dataoffset+1,parseInt(stringlength));var chrs=readData[0];var readdata=readData[1];dataoffset+=chrs+2;if(chrs!=parseInt(stringlength)&&chrs!=readdata.length){error('SyntaxError','String length mismatch');}
break;case"a":var readdata={};var keyandchrs=read_until(data,dataoffset,':');var chrs=keyandchrs[0];var keys=keyandchrs[1];dataoffset+=chrs+2;for(var i=0;i<parseInt(keys);i++){var kprops=_unserialize(data,dataoffset);var kchrs=kprops[1];var key=kprops[2];dataoffset+=kchrs;var vprops=_unserialize(data,dataoffset);var vchrs=vprops[1];var value=vprops[2];dataoffset+=vchrs;readdata[key]=value;}
dataoffset+=1;break;default:break;}
return[dtype,dataoffset-offset,typeconvert(readdata)];};return _unserialize(data,0)[2];};var object_move={};function empty(v){if(typeof v=="undefined")
return true;if(typeof v=="object"){for(var vv in v){if(vv)
return false;}}else{return v=="";}
return true;}
var mpX,mpY;$(document).ready(function(){$(document).mousemove(function(e){mpX=e.pageX;mpY=e.pageY;});$(document).mousemove(objectMover);});function getMousePosition(){var pos=[mpX,mpY];return pos;}
function getPageDimensions(){var xScroll,yScroll;pageWidth=$(document).width();pageHeight=$(document).height();windowWidth=$(window).width();windowHeight=$(window).height();arrayPageSize=new Array(pageWidth,pageHeight,windowWidth,windowHeight);return arrayPageSize;}
function fav(h,t){var h=(typeof h=="undefined")?location.href:h;var t=(typeof t=="undefined")?document.title:t;if(window.sidebar){window.sidebar.addPanel(t,h,"");}else if(window.external){window.external.AddFavorite(h,t);}else if(window.opera&&window.print){return true;}}
$(document).ready(function(){$("[id^='submit_delete-']").hide();$("input[name^='delete_vars']").live("click",function(){var parent_formid=$(this).parents("form").attr("id");var delete_checked=($("#"+parent_formid+" input[name^='delete_vars']:checked").length>0)?true:false;if(!delete_checked){$("#"+parent_formid+" input[name=action]").val('');}
$("#submit_delete-"+parent_formid).css("display",(delete_checked)?"":"none");});$(".formaddrow").each(function(){$(this).data("h_o",$(this).html());});$(".formaddrow").prepend("Click to ").parent().css("cursor","pointer").next().hide();$(".formaddrow").live("click",function(){$(this).html($(this).data("h_o"));$(this).parent().next().show();});$("textarea").each(function(){if($(this).hasClass("Code")){$(this).tabby();}
if($(this).hasClass("TextareaFixed")){return;}
var pad_line=0;var expand_rows=parseInt($(this).attr("rows"));if(expand_rows<=1)
expand_rows=3;var line_height=$(this).css("line-height");if(line_height=='normal'){line_height=parseInt($(this).css("font-size").replace('px',''))+2;$(this).css("line-height",line_height+'px');}else{line_height=parseInt(line_height.replace('px',''));}
$(this).attr("rows",1);$(this).css("height",line_height+'px');$(this).focus(function(){var r=expand_rows+2;var h=(r*line_height);if($(this).css("height")==h+'px')
return;$(this).attr("rows",expand_rows);$(this).animate({height:h},250,function(){$(this)[0].focus();});});});});$(document).ready(function(){$(".ToolTip").each(function(){var t=new ToolTip(this);$(this).mouseover(function(){t.show(this);});$(this).mouseout(function(){t.hide();});});});$(document).ready(function(){var toggler_checkboxes=[];$(".ToggleOptions").each(function(){var toggle_to;var set=false;if(strpos($(this)[0].id,"to_on-")===0){toggle_to=true;set=$(this)[0].id.replace("to_on-","");}else if(strpos($(this)[0].id,"to_off-")===0){toggle_to=false;set=$(this)[0].id.replace("to_off-","");}
if(set){$(this).click(function(){toggleOptions(set,toggle_to);});}});});function toggleOptions(set,toggle_to){var options=$("[id^='"+set+"-']").filter("[type='checkbox']");if(options.length<1)
return false;options.attr("checked",toggle_to);return;}
function modalOpen(dialog){dialog.overlay.fadeIn('slow',function(){dialog.container.fadeIn('slow',function(){dialog.data.slideDown('slow');});});}
function modalLoader(load_func,load_func_vars){if(!load_func)
load_func=false;if(typeof load_func_vars=="undefined")
load_func_vars=false;else if(typeof load_func_vars=="string")
load_func_vars=[load_func_vars];$('#modal_box').modal({overlayCss:{backgroundColor:'#000',cursor:'wait'},containerCss:{height:"90%",width:"840px",backgroundColor:'#fff',border:'3px solid #ccc',overflow:"auto"},onOpen:modalOpen,onShow:function(dialog){dialog.container.addClass("loading");if(load_func){load_func.apply(this,load_func_vars);}},close:false});}
function loadScript(src){var e=document.createElement("script");e.src=src;e.type="text/javascript";document.getElementsByTagName("head")[0].appendChild(e);}
function registerObjectMover(object){object_move={};object_move.object=object;object_move.init_obj_x=parseInt(object.style.left.replace('px',''));object_move.init_obj_y=parseInt(object.style.top.replace('px',''));object_move.init_pos_x=mpX;object_move.init_pos_y=mpY;object_move.init_zindex=object.style.zIndex;object.style.zIndex=10000;var dim=getPageDimensions();object_move.init_win_w=dim[2];object_move.init_win_h=dim[3];}
function unregisterObjectMover(){var object=object_move.object;var left=parseInt(object.style.left.replace('px',''));var width=parseInt(object.style.width.replace('px',''));if(left+width>object_move.init_win_w)
object.style.left=object_move.init_win_w-width-5+'px';object.style.zIndex=object_move.init_zindex;object_move=null;}
function objectMover(){if(empty(object_move))
return;var object=object_move.object;object.style.left=object_move.init_obj_x+mpX-object_move.init_pos_x+'px';object.style.top=object_move.init_obj_y+mpY-object_move.init_pos_y+'px';emptySelection();}
function emptySelection(){if(document.selection){if(document.selection.empty)
document.selection.empty();else
document.selection.innerHTML=document.selection.createRange().text;}else if(window.getSelection()&&window.getSelection()!='')
window.getSelection().removeAllRanges();}
function deactivate_screen(show){if(!show)
var show=false;var dim=getPageDimensions();if(show)
$('#deact_screen').addClass('loading');else
$('#deact_screen').removeClass('loading');$('#deact_screen').css({display:((show)?'':'none'),height:dim[1]+'px'});}
function loader_display(open){deactivate_screen(open);$('#loader_container').css({display:((open)?'':'none')});}
function loader_loaded(){$('#deact_screen').attr({className:''});}
function debug_message(message){var _message='';if(message&&typeof message=='object'){for(m in message)
_message=debug(message[m])+'<BR>';}else
_message=message+'<BR>';return _message;}
function debug(message){var _message=debug_message(message);$('#jsdebug').append(_message);}
function truncate(string,length,end_string){if(!end_string)
var end_string='';if(!length)
var length=48;if(length>=string.length)
end_string='';string=string.substring(0,length);string=string.replace('/\w+$/','');if(end_string)
string+=end_string
return string;}
function strip_tags(string){return string.replace(/(<([^>]+)>)/ig,"");}
function strtolower(str){return str.toLowerCase();}
String.prototype.repeat=function(l){return new Array(l+1).join(this);};function int2str(i){return i+'';}
function bytes_string(bytes){var s=['B','KB','MB','GB','TB','PB'];var e=Math.floor(Math.log(bytes)/Math.log(1024));return(bytes/Math.pow(1024,Math.floor(e))).toFixed(2)+" "+s[e];}
function assembleOptions(options_data,options_vars,options,level){var value,display_value,subs;if(!options)
var options=new Array();if(!level)
var level=0;var indent='--';if(options_vars&&options_vars['value_key']&&options_vars['display_key']){for(o in options_data){value=options_data[o][options_vars['value_key']];display=options_data[o][options_vars['display_key']];var ind='';if(level){ind=indent.repeat(level)+' ';}
options[options.length]=new Array(ind+display,value);if(subs=options_data[o][options_vars['subs_key']])
options=assembleOptions(subs,options_vars,options,level+1);}}else{for(o in options_data){options[options.length]=new Array(options_data[o],o);}}
return options;}
function unix_timestamp(){var d=new Date();var time=d.getTime();time=parseInt(time/1000);return time;};function ToolTip(element){var c_id=null;var tt_id="_tt_";var hide_timeout=null;var tt_content="";var active=false;if($(element).attr("alt"))
tt_content=$(element).attr("alt");else if($(element).attr("title"))
tt_content=$(element).attr("title");if(!tt_content)
return;$(element).attr("title","");$(element).attr("alt","");var _hide=function(){if($("#"+tt_id))
$("#"+tt_id).remove();active=false;}
this.hide=function(){__hide=_hide;hide_timeout=setTimeout(__hide,250);}
this.show=function(){if(hide_timeout)
clearTimeout(hide_timeout);if(!active){_hide();$(element).after('<SPAN class="ToolTipContainer" id="'+tt_id+'">'+tt_content+'</SPAN>');$("#"+tt_id).css({"top":mpY,"left":mpX});$("#"+tt_id).mouseover(this.show);$("#"+tt_id).mouseout(this.hide);active=true;}}};function date(format,timestamp){var a,jsdate=((timestamp)?new Date(timestamp*1000):new Date());var pad=function(n,c){if((n=n+"").length<c){return new Array(++c-n.length).join("0")+n;}else{return n;}};var txt_weekdays=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var txt_ordin={1:"st",2:"nd",3:"rd",21:"st",22:"nd",23:"rd",31:"st"};var txt_months=["","January","February","March","April","May","June","July","August","September","October","November","December"];var f={d:function(){return pad(f.j(),2);},D:function(){t=f.l();return t.substr(0,3);},j:function(){return jsdate.getDate();},l:function(){return txt_weekdays[f.w()];},N:function(){return f.w()+1;},S:function(){return txt_ordin[f.j()]?txt_ordin[f.j()]:'th';},w:function(){return jsdate.getDay();},z:function(){return(jsdate-new Date(jsdate.getFullYear()+"/1/1"))/864e5>>0;},W:function(){var a=f.z(),b=364+f.L()-a;var nd2,nd=(new Date(jsdate.getFullYear()+"/1/1").getDay()||7)-1;if(b<=2&&((jsdate.getDay()||7)-1)<=2-b){return 1;}else{if(a<=2&&nd>=4&&a>=(6-nd)){nd2=new Date(jsdate.getFullYear()-1+"/12/31");return date("W",Math.round(nd2.getTime()/1000));}else{return(1+(nd<=3?((a+nd)/7):(a-(7-nd))/7)>>0);}}},F:function(){return txt_months[f.n()];},m:function(){return pad(f.n(),2);},M:function(){t=f.F();return t.substr(0,3);},n:function(){return jsdate.getMonth()+1;},t:function(){var n;if((n=jsdate.getMonth()+1)==2){return 28+f.L();}else{if(n&1&&n<8||!(n&1)&&n>7){return 31;}else{return 30;}}},L:function(){var y=f.Y();return(!(y&3)&&(y%1e2||!(y%4e2)))?1:0;},Y:function(){return jsdate.getFullYear();},y:function(){return(jsdate.getFullYear()+"").slice(2);},a:function(){return jsdate.getHours()>11?"pm":"am";},A:function(){return f.a().toUpperCase();},B:function(){var off=(jsdate.getTimezoneOffset()+60)*60;var theSeconds=(jsdate.getHours()*3600)+
(jsdate.getMinutes()*60)+
jsdate.getSeconds()+off;var beat=Math.floor(theSeconds/86.4);if(beat>1000)beat-=1000;if(beat<0)beat+=1000;if((String(beat)).length==1)beat="00"+beat;if((String(beat)).length==2)beat="0"+beat;return beat;},g:function(){return jsdate.getHours()%12||12;},G:function(){return jsdate.getHours();},h:function(){return pad(f.g(),2);},H:function(){return pad(jsdate.getHours(),2);},i:function(){return pad(jsdate.getMinutes(),2);},s:function(){return pad(jsdate.getSeconds(),2);},O:function(){var t=pad(Math.abs(jsdate.getTimezoneOffset()/60*100),4);if(jsdate.getTimezoneOffset()>0)t="-"+t;else t="+"+t;return t;},P:function(){var O=f.O();return(O.substr(0,3)+":"+O.substr(3,2));},c:function(){return f.Y()+"-"+f.m()+"-"+f.d()+"T"+f.h()+":"+f.i()+":"+f.s()+f.P();},U:function(){return Math.round(jsdate.getTime()/1000);}};return format.replace(/[\\]?([a-zA-Z])/g,function(t,s){if(t!=s){ret=s;}else if(f[s]){ret=f[s]();}else{ret=s;}
return ret;});};function clink(l){if(typeof dc_d=="undefined"||typeof dc_d.ap=="undefined"||typeof dc_d.ap[l]=="undefined")
return"index.php";return dc_d.ap[l];};var polls_details={};function checkPoll(pollid,number){var allow_submit=false;var options_chosen={};var pd=polls_details[pollid];var type=pd.type;var options=pd.options;var required_choices=(type=="RANK")?pd.required_choices:1;var number=(number)?number:false;if(type=="RANK"){var v;var just_selected=false;var n=1;$("#minipollrespond-"+pollid+" [id^='post_vars-minipolls-"+pollid+"-response_o-']").each(function(){v=$(this).val();options_chosen[v]=n;n++;});n=1;$("#minipollrespond-"+pollid+" [id^='post_vars-minipolls-"+pollid+"-response_o-']").each(function(){v=$(this).val();si=0;options_string='<option value=""></option>';i=1;for(o in options){allow_option=(typeof options_chosen[o]=="undefined"||options_chosen[o]==n);if(!allow_option)
continue;options_string+='<option value="'+o+'">'+options[o]+'</option>';if(o==v)
si=i;i++;}
$(this).html(options_string);if(si){this.selectedIndex=si;}
n++;});var occ=0;for(o in options_chosen){occ++;}
allow_submit=(occ>=required_choices);}else{if($("[id^='post_vars-minipolls-"+pollid+"-response-o-']")[0]){allow_submit=($("[id^='post_vars-minipolls-"+pollid+"-response-o-']:checked").length==1);}else{allow_submit=($("#post_vars-minipolls-"+pollid+"-response-o")[0].selectedIndex>0);}}
$("#minipollrespond-"+pollid+" .MiniPollSubmit").css("display",(allow_submit)?"":"none");};var gcalendar={};function previewCalendarDay(code,ds){$('#calendar_preview-'+code).html('');$('#calendar_preview-'+code).hide(0);var cal=gcalendar[code];if(!ds){ds=cal.current_day;}
for(d in cal.days){if(d==ds){$('#gc_'+d).addClass('GraphicCalendarSpecialDaySelected');}else
$('#gc_'+d).removeClass('GraphicCalendarSpecialDaySelected');}
if(cal.days[ds]){var _day=cal.days[ds];var html="";for(var e in _day.entries){var _date=cal.dates[_day.entries[e]];var _event=cal.events[_date.pageid];html+='<DIV class="GraphicCalendarPreviewEntry" onclick="window.location.href=\''+_event.href+'\';">';html+='<DIV class="GraphicCalendarPreviewEntryTitle">'+_event.title+'</DIV><DIV class="GraphicCalendarPreviewEntryDate">'+_date.show+'</DIV><DIV class="GraphicCalendarPreviewEntryDescr">'+((_date.summary)?_date.summary:_event.summary)+'</DIV></DIV>';}
$('#calendar_preview-'+code).html(html);if($('#gc_prev-'+code)[0]){var p=$('#gc_prev-'+code).position();window.scrollTo(0,p.top);}
$('#calendar_preview-'+code).fadeIn(750);}}