
$x=jQuery.noConflict();function getElementsByClass(class_name)
{return $x('.'+class_name);}
function getTheme()
{for(var i=0;i<document.styleSheets.length;i++)
{var sheet=document.styleSheets[i];if(sheet.media.mediaText=='screen')
{for(var j=0;j<sheet.cssRules.length;j++)
{if(sheet.cssRules[j]instanceof CSSImportRule)
{var url=sheet.cssRules[j].href;if(url.indexOf('/themes/')===0)
{return url.slice(8,(url.slice(8).indexOf('/')+8));}}}}}
return'default';}
function openInNewWindow(object)
{var newWindow=window.open($x(object).attr('href'),'_blank');newWindow.focus();return false;}
function getNewWindowLinks()
{$x('a.external').not('.text').css({background:'url(/img/external_link.png) no-repeat right',paddingRight:'12px'}).click(function(){return openInNewWindow(this);});}
$x(document).ready(function(){getNewWindowLinks()});$x.ajaxSetup({type:"POST",data:{'FX_AJAX':true},dataType:'json'});$x(document).ready(function(){replaceWithChooser($x('select#choose_user'));$x('select#choose_user_click').after('<a class="xmo_action xmo_action_edit" style="margin-left: 5px;" href="#" id="choose_user_link">Choose a different user</a>');$x('a#choose_user_link').click(function(){$x(this).remove();replaceWithChooser($x('select#choose_user_click'));return false;});});function replaceWithChooser(obj)
{var id=$x(obj).attr('name');$x(obj).replaceWith('<div id="'+id+'">')
$x('#'+id).flexbox('/user/search/',{'watermark':'Start typing a surname or username','showArrow':false,'maxVisibleRows':10,'paging':false,'minChars':3,'resultTemplate':'{name} ({id})','method':'POST'});}
$x(document).ready(function(){$x('li#xmo_not_loggedin a:first').click(function(e){e.preventDefault();if(!$x.xmo.loginForm)
{$x.ajax({success:function(data){$x.xmo.loginForm=$x(data.results);$x.xmo.loginForm.dialogBox('open',{title:'Login'});},error:function(){document.location.href=this.url},url:'/user/login'});}
else
{$x.xmo.loginForm.dialogBox('open');}});});
