
if($.SIL===undefined){$.SIL={};}
$.SIL.UserBar=function(isAdmin,marketWebsite){if($.SIL.IsLoggedIn==false){var ru;var qs=document.location.search.substr(1).split(';');for(var i=0;i<qs.length;i++){var parts=qs[i].split('=');if(parts[0]=='ReturnUrl'){ru=parts[1];break;}}
if(!(ru)){ru=escape(document.location);}
$.SIL.LoginUrl=$.SIL.Authority+'/user/login.aspx?ReturnUrl='+ru;$("#SILUserBar").html('<a href="'+$.SIL.LoginUrl+'">Sign in</a>');}
else{var adminHtml="";if(isAdmin){adminHtml=' | <a href="'+$.SIL.Authority+'/Admin/">Admin</a>';}
var marketHtml="";if(marketWebsite!=''){marketHtml=' | <a href="'+marketWebsite+'">Home</a>';}
$("#SILUserBar").html('Welcome, '+$.SIL.Username+'!&nbsp;&nbsp;<a href="'+$.SIL.Authority+'/user/default.aspx">Your Profile</a>'+marketHtml+adminHtml+' | <a href="'+$.SIL.Authority+'/user/logout.aspx">Log out</a>');}};$.NotifyError=function(e,html){var sel=".ErrorNotification";$(sel).remove();$("body").append('<div class="ErrorNotification"><div>'+html+'</div>(Click on this box to dismiss.)</div>');var pgX=(e)?e.pageX:($(window).width()/2);var pgY=(e)?e.pageY:($(window).height()/2);var left=pgX-($(sel).width()/2);if(left+$(sel).width()>$(window).width()){left=pgX-($(sel).width()+40);}
$(sel).css({left:left+'px',top:pgY+'px'}).click(function(e){$(sel).fadeOut(250,function(){$(sel).remove();});}).fadeIn(250);};$.SIL.PleaseLogin=function(e,toWhat){if(!$.SIL.IsLoggedIn){$.NotifyError(e,'Please <a href="'+$.SIL.LoginUrl+'">login or register</a> to '+toWhat);}
return $.SIL.IsLoggedIn;};
