
function RegisterNamespace(namespacePath)
{var rootObject=window;var namespaceParts=namespacePath.split('.');for(var i=0;i<namespaceParts.length;i++)
{var currentPart=namespaceParts[i];if(!rootObject[currentPart])
{rootObject[currentPart]=new Object();}
rootObject=rootObject[currentPart];}}
RegisterNamespace('FreshLogicStudios.Scripts');FreshLogicStudios.Scripts.Command=function(_action)
{var action=_action;var enabled=true;var self=this;this.Events=new FreshLogicStudios.Scripts.EventCollection();this.Disable=function()
{self.SetEnabled(false);}
this.Enable=function()
{self.SetEnabled(true);}
this.Execute=function()
{if(enabled)
{action();}}
this.IsEnabled=function()
{return enabled;}
this.SetEnabled=function(value)
{if(enabled!=value)
{enabled=value;self.Events.Fire('EnabledChanged',self);}}}
FreshLogicStudios.Scripts.Console=function(){}
FreshLogicStudios.Scripts.Console.In=null;FreshLogicStudios.Scripts.Console.Out=null;FreshLogicStudios.Scripts.Console.Clear=function()
{if(FreshLogicStudios.Scripts.Console.Out)
{FreshLogicStudios.Scripts.Console.Out.innerHTML='';}}
FreshLogicStudios.Scripts.Console.ReadLine=function()
{if(FreshLogicStudios.Scripts.Console.In)
{try
{FreshLogicStudios.Scripts.Console.WriteLine(eval(FreshLogicStudios.Scripts.Console.In.value));}
catch(ex)
{FreshLogicStudios.Scripts.Console.WriteLine(FreshLogicStudios.Scripts.String.Format('<span style="color:Red;">{0}: {1}</span>',ex.name,ex.message));}}}
FreshLogicStudios.Scripts.Console.SetIn=function(element)
{FreshLogicStudios.Scripts.Console.In=element;}
FreshLogicStudios.Scripts.Console.SetOut=function(element)
{FreshLogicStudios.Scripts.Console.Out=element;}
FreshLogicStudios.Scripts.Console.Write=function(object)
{if(FreshLogicStudios.Scripts.Console.Out&&object&&(object!=undefined))
{FreshLogicStudios.Scripts.Console.Out.innerHTML=FreshLogicStudios.Scripts.String.Format('<span>{0}</span>{1}',object.toString(),FreshLogicStudios.Scripts.Console.Out.innerHTML);}}
FreshLogicStudios.Scripts.Console.WriteLine=function(object)
{if(FreshLogicStudios.Scripts.Console.Out&&object&&(object!=undefined))
{FreshLogicStudios.Scripts.Console.Out.innerHTML=FreshLogicStudios.Scripts.String.Format('<span>{0}</span><br />{1}',object.toString(),FreshLogicStudios.Scripts.Console.Out.innerHTML);}}
FreshLogicStudios.Scripts.DateTime=function(year,month,day,hour,minute,second,millisecond)
{var self=this;var date=new Date(year,month-1,day,hour||0,minute||0,second||0,millisecond||0);function FromJavaScriptDate(value)
{return new FreshLogicStudios.Scripts.DateTime(value.getFullYear(),value.getMonth()+1,value.getDate(),value.getHours(),value.getMinutes(),value.getSeconds(),value.getMilliseconds());}
function GetDayName(value)
{switch(value)
{case 0:return'Sunday';break;case 1:return'Monday';break;case 2:return'Tuesday';break;case 3:return'Wednesday';break;case 4:return'Thursday';break;case 5:return'Friday';break;case 6:return'Saturday';break;}}
function GetMeridiem()
{return(date.getHours()<=10)?'AM':'PM';}
function GetMeridiemHours()
{if(date.getHours()%12==0)
{return 12;}
return date.getHours()%12;}
function GetMonthName(value)
{switch(value)
{case 1:return'January';break;case 2:return'February';break;case 3:return'March';break;case 4:return'April';break;case 5:return'May';break;case 6:return'June';break;case 7:return'July';break;case 8:return'August';break;case 9:return'September';break;case 10:return'October';break;case 11:return'November';break;case 12:return'December';break;}}
function PadLeft(value,totalWidth,paddingChar)
{paddingChar=paddingChar||' ';while(value.length<totalWidth)
{value=paddingChar+value;}
return value.substr(value.length-totalWidth);}
this.AddDays=function(value)
{var myDate=new Date(date);myDate.setDate(myDate.getDate()+value);return FromJavaScriptDate(myDate);}
this.AddHours=function(value)
{var myDate=new Date(date);myDate.setHours(myDate.getHours()+value);return FromJavaScriptDate(myDate);}
this.AddMilliseconds=function(value)
{var myDate=new Date(date);myDate.setMilliseconds(myDate.getMilliseconds()+value);return FromJavaScriptDate(myDate);}
this.AddMinutes=function(value)
{var myDate=new Date(date);myDate.setMinutes(myDate.getMinutes()+value);return FromJavaScriptDate(myDate);}
this.AddMonths=function(value)
{var myDate=new Date(date);myDate.setMonths(myDate.getMonths()+value);return FromJavaScriptDate(myDate);}
this.AddSeconds=function(value)
{var myDate=new Date(date);myDate.setSeconds(myDate.getSeconds()+value);return FromJavaScriptDate(myDate);}
this.GetDate=function()
{return new FreshLogicStudios.Scripts.DateTime(self.GetYear(),self.GetMonth(),self.GetDay());}
this.GetDay=function()
{return date.getDate();}
this.GetDayOfWeek=function()
{return date.getDay();}
this.GetHour=function()
{return date.getHours();}
this.GetMillisecond=function()
{return date.getMilliseconds();}
this.GetMinute=function()
{return date.getMinutes();}
this.GetMonth=function()
{return date.getMonth()+1;}
this.GetSecond=function()
{return date.getSeconds();}
this.GetYear=function()
{return date.getFullYear();}
this.ToLongDateString=function()
{return self.ToString('D');}
this.ToLongTimeString=function()
{return self.ToString('T');}
this.ToShortDateString=function()
{return self.ToString('d');}
this.ToShortTimeString=function()
{return self.ToString('t');}
this.toString=function()
{return self.ToString('G');}
this.ToString=function(format)
{format=format||'G';switch(format)
{case'd':return FreshLogicStudios.Scripts.String.Format('{0}/{1}/{2}',self.GetMonth(),self.GetDay(),PadLeft(self.GetYear().toString(),4,'0'));break;case'D':return FreshLogicStudios.Scripts.String.Format('{0}, {1} {2}, {3}',GetDayName(self.GetDayOfWeek()),GetMonthName(self.GetMonth()),PadLeft(self.GetDay().toString(),2,'0'),PadLeft(self.GetYear().toString(),4,'0'));break;case't':return FreshLogicStudios.Scripts.String.Format('{0}:{1} {2}',GetMeridiemHours(),PadLeft(self.GetMinute().toString(),2,'0'),GetMeridiem());break;case'T':return FreshLogicStudios.Scripts.String.Format('{0}:{1}:{2} {3}',GetMeridiemHours(),PadLeft(self.GetMinute().toString(),2,'0'),PadLeft(self.GetSecond().toString(),2,'0'),GetMeridiem());break;case'f':return FreshLogicStudios.Scripts.String.Format('{0}, {1} {2}, {3} {4}:{5} {6}',GetDayName(self.GetDayOfWeek()),GetMonthName(self.GetMonth()),PadLeft(self.GetDay().toString(),2,'0'),PadLeft(self.GetYear().toString(),4,'0'),GetMeridiemHours(),PadLeft(self.GetMinute().toString(),2,'0'),GetMeridiem());break;case'F':return FreshLogicStudios.Scripts.String.Format('{0}, {1} {2}, {3} {4}:{5}:{6} {7}',GetDayName(self.GetDayOfWeek()),GetMonthName(self.GetMonth()),PadLeft(self.GetDay().toString(),2,'0'),PadLeft(self.GetYear().toString(),4,'0'),GetMeridiemHours(),PadLeft(self.GetMinute().toString(),2,'0'),PadLeft(self.GetSecond().toString(),2,'0'),GetMeridiem());break;case'g':return FreshLogicStudios.Scripts.String.Format('{0}/{1}/{2} {3}:{4} {5}',self.GetMonth(),self.GetDay(),PadLeft(self.GetYear().toString(),4,'0'),GetMeridiemHours(),PadLeft(self.GetMinute().toString(),2,'0'),GetMeridiem());break;case'G':return FreshLogicStudios.Scripts.String.Format('{0}/{1}/{2} {3}:{4}:{5} {6}',self.GetMonth(),self.GetDay(),PadLeft(self.GetYear().toString(),4,'0'),GetMeridiemHours(),PadLeft(self.GetMinute().toString(),2,'0'),PadLeft(self.GetSecond().toString(),2,'0'),GetMeridiem());break;case'M':return FreshLogicStudios.Scripts.String.Format('{0} {1}',GetMonthName(self.GetMonth()),PadLeft(self.GetDay().toString(),2,'0'));break;case's':return FreshLogicStudios.Scripts.String.Format('{0}-{1}-{2}T{3}:{4}:{5}',PadLeft(self.GetYear().toString(),4,'0'),PadLeft(self.GetMonth().toString(),2,'0'),PadLeft(self.GetDay().toString(),2,'0'),PadLeft(self.GetHour().toString(),2,'0'),PadLeft(self.GetMinute().toString(),2,'0'),PadLeft(self.GetSecond().toString(),2,'0'));break;case'Y':return FreshLogicStudios.Scripts.String.Format('{0}, {1}',GetMonthName(self.GetMonth()),PadLeft(self.GetYear().toString(),4,'0'));break;default:return self.ToString('G');break;}}}
FreshLogicStudios.Scripts.DateTime.MaxValue=new FreshLogicStudios.Scripts.DateTime(9999,12,31,23,59,59,999);FreshLogicStudios.Scripts.DateTime.MinValue=new FreshLogicStudios.Scripts.DateTime(1,1,1,0,0,0,0);FreshLogicStudios.Scripts.DateTime.Now=function()
{var date=new Date();return new FreshLogicStudios.Scripts.DateTime(date.getFullYear(),date.getMonth()+1,date.getDate(),date.getHours(),date.getMinutes(),date.getSeconds(),date.getMilliseconds());}
FreshLogicStudios.Scripts.DateTime.Today=function()
{var date=new Date();return new FreshLogicStudios.Scripts.DateTime(date.getFullYear(),date.getMonth()+1,date.getDate());}
FreshLogicStudios.Scripts.EventCollection=function()
{this.Events=[];}
FreshLogicStudios.Scripts.EventCollection.prototype.Add=function(_event)
{this.Events[this.Events.length]=_event;}
FreshLogicStudios.Scripts.EventCollection.prototype.Clear=function()
{for(var i=this.Events.length-1;i>=0;i--)
{delete this.Events[i];}}
FreshLogicStudios.Scripts.EventCollection.prototype.Remove=function(_event)
{for(var i=this.Events.length-1;i>=0;i--)
{if(this.Events[i].Equals(_event))
{delete this.Events[i];}}}
FreshLogicStudios.Scripts.EventCollection.prototype.Fire=function(eventName,args)
{for(var i=0;i<this.Events.length;i++)
{if(this.Events[i].Name==eventName)
{this.Events[i].Fire(args);}}}
var Events=new FreshLogicStudios.Scripts.EventCollection();FreshLogicStudios.Scripts.Event=function(name,handler)
{this.Name=name;this.Handler=handler;}
FreshLogicStudios.Scripts.Event.prototype.Equals=function(_event)
{return(this.Name==_event.Name&&this.Handler==_event.Handler);}
FreshLogicStudios.Scripts.Event.prototype.Fire=function(args)
{this.Handler(args);}
function AddEvent(targetObject,eventType,functionPointer)
{if(targetObject.addEventListener)
{targetObject.addEventListener(eventType,functionPointer,true);return true;}
else if(targetObject.attachEvent)
{var r=targetObject.attachEvent("on"+eventType,functionPointer);return r;}
else
{return false;}}
function RemoveEvent(targetObject,eventType,functionPointer)
{if(targetObject.removeEventListener)
{targetObject.removeEventListener(eventType,functionPointer,true);return true;}
else if(targetObject.detachEvent)
{var r=targetObject.detachEvent("on"+eventType,functionPointer);return r;}
else
{return false;}}
FreshLogicStudios.Scripts.Guid=function(g)
{var self=this;var guid=g||'00000000-0000-0000-0000-000000000000';this.CompareTo=function(value)
{if(guid<value.ToString())
{return-1;}
else if(guid>value.ToString())
{return 1;}
return 0;}
this.Equals=function(g)
{return(guid==g.ToString());}
this.toString=function()
{return guid;}
this.ToString=function()
{return guid;}}
FreshLogicStudios.Scripts.Guid.Empty=new FreshLogicStudios.Scripts.Guid('00000000-0000-0000-0000-000000000000');FreshLogicStudios.Scripts.Guid.NewGuid=function()
{var guid="";var characters="0123456789abcdef";var parts=[8,4,4,4,12];for(var i=0;i<parts.length;++i)
{for(var j=0;j<parts[i];++j)
{var index=Math.round(Math.random()*16);guid+=characters.charAt(index);}
if(i!=parts.length-1)
{guid+="-"}}
return new FreshLogicStudios.Scripts.Guid(guid);}
function RegisterNamespace(namespacePath)
{var rootObject=window;var namespaceParts=namespacePath.split('.');for(var i=0;i<namespaceParts.length;i++)
{var currentPart=namespaceParts[i];if(!rootObject[currentPart])
{rootObject[currentPart]=new Object();}
rootObject=rootObject[currentPart];}}
RegisterNamespace('FreshLogicStudios.Scripts');FreshLogicStudios.Scripts.String=function(){}
FreshLogicStudios.Scripts.String.Empty='';FreshLogicStudios.Scripts.String.Format=function()
{var params=FreshLogicStudios.Scripts.String.Format.arguments;var myString=params[0];for(var i=1;i<params.length;i++)
{var regex=new RegExp('\\{'+(i-1)+'\\}','g');myString=myString.replace(regex,params[i].toString());}
return myString;}
FreshLogicStudios.Scripts.String.IsNullOrEmpty=function(value)
{return(value==null||value=='');}
FreshLogicStudios.Scripts.Uri=function(uriString)
{var self=this;var absoluteUri=uriString;var regex=/(\w+):\/\/([\w:.]+)\/(\S*)/;function GetDefaultPort(scheme)
{switch(scheme)
{case'file':return'';case'ftp':return 21;case'gopher':return 70;case'http':return 80;case'https':return 443;case'mailto':return 25;case'news':return 119;case'nntp':return 119;default:return'';}}
this.GetAbsolutePath=function()
{return absoluteUri.match(regex)[3];}
this.GetAbsoluteUri=function()
{return absoluteUri;}
this.GetAuthority=function()
{var authority=self.GetHost();if(!self.IsDefaultPort())
{authority+=':'+self.GetPort();}
return authority;}
this.GetFragment=function()
{return absoluteUri.substring(absoluteUri.indexOf('#'));}
this.GetHost=function()
{return absoluteUri.match(regex)[2].split(':')[0];}
this.GetPathAndQuery=function()
{return self.GetAbsolutePath()+self.GetQuery();}
this.GetPort=function()
{if(absoluteUri.match(regex)[2].split(':')[1])
{return parseInt(absoluteUri.match(regex)[2].split(':')[1]);}
else
{return GetDefaultPort(self.GetScheme());}}
this.GetQuery=function()
{return absoluteUri.substring(absoluteUri.indexOf('?'));}
this.GetQueryParameters=function()
{var parameters={};var myUri=absoluteUri;var q=myUri.indexOf("?");if(q==-1)
{return parameters;}
myUri=myUri.substring(q+1);var pairs=myUri.split("&");for(var i=0;i<pairs.length;i++)
{var keyval=pairs[i].split("=");parameters[keyval[0]]=decodeURIComponent(keyval[1]);}
return parameters;}
this.GetScheme=function()
{return absoluteUri.match(regex)[1].toLowerCase();}
this.IsDefaultPort=function()
{return(self.GetPort()==GetDefaultPort(self.GetScheme()));}
this.IsFile=function()
{return(self.GetScheme()=='file');}
this.IsLoopback=function()
{var host=self.GetHost();if(host=='127.0.0.1'||host=='loopback'||host=='localhost')
{return true;}
return false;}}
RegisterNamespace('FreshLogicStudios.Scripts.Html');FreshLogicStudios.Scripts.Html.HtmlElement=function(){}
FreshLogicStudios.Scripts.Html.HtmlElement.Show=function(element)
{element.style.display='block';}
FreshLogicStudios.Scripts.Html.HtmlElement.Hide=function(element)
{element.style.display='none';}
FreshLogicStudios.Scripts.Html.HtmlElement.Toggle=function(element)
{if(element.style.display!='none')
{FreshLogicStudios.Scripts.Html.HtmlElement.Hide(element);}
else
{FreshLogicStudios.Scripts.Html.HtmlElement.Show(element);}}
FreshLogicStudios.Scripts.Html.HtmlElement.HideChildren=function(parentElement)
{for(var i=0;i<parentElement.childNodes.length;i++)
{if(parentElement==parentElement.childNodes[i].parentNode&&parentElement.childNodes[i].tagName)
{FreshLogicStudios.Scripts.Html.HtmlElement.Hide(parentElement.childNodes[i]);}}}
FreshLogicStudios.Scripts.Html.HtmlElement.ShowSingleChild=function(element)
{FreshLogicStudios.Scripts.Html.HtmlElement.HideChildren(element.parentNode);FreshLogicStudios.Scripts.Html.HtmlElement.Show(element);}
FreshLogicStudios.Scripts.Html.HtmlElement.SetBackgroundImage=function(element,imageUrl)
{if(imageUrl.indexOf('.png')!=-1&&document.body.style.filter!=undefined)
{element.style.backgroundImage='none';element.style.filter='progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+imageUrl+'", sizingMethod="scale")';}
else
{element.style.backgroundImage='url("'+imageUrl+'")';}}
RegisterNamespace('FreshLogicStudios.Scripts.Drawing.Image');FreshLogicStudios.Scripts.Drawing.Image=function(){}
FreshLogicStudios.Scripts.Drawing.Image.FixBackgroundImages=function()
{if(document.body.style.filter!=undefined)
{for(i=0;i<document.styleSheets.length;i++)
{try
{for(j=0;j<document.styleSheets[i].rules.length;j++)
{if(document.styleSheets[i].rules.item(j).style.backgroundImage.indexOf('.png')!=-1)
{var imageUrl=document.styleSheets[i].rules.item(j).style.backgroundImage;imageUrl=imageUrl.substring(imageUrl.indexOf('(')+1,imageUrl.lastIndexOf(')'));document.styleSheets[i].rules.item(j).style.backgroundImage='none';document.styleSheets[i].rules.item(j).style.filter='progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+imageUrl+'", sizingMethod="scale")';}}}
catch(e)
{}}}}
RegisterNamespace('FreshLogicStudios.Scripts.Drawing');FreshLogicStudios.Scripts.Drawing.Point=function(x,y)
{var self=this;this.X=x||0;this.Y=y||0;this.Clone=function()
{return new FreshLogicStudios.Scripts.Drawing.Point(self.X,self.Y);}
this.IsEmpty=function()
{return(self.X==0&&self.Y==0);}
this.Offset=function(dx,dy)
{self.X+=dx;self.Y+=dy;}}
RegisterNamespace('FreshLogicStudios.Scripts.Drawing');FreshLogicStudios.Scripts.Drawing.Rectangle=function(location,size)
{var self=this;this.Location=location||new FreshLogicStudios.Scripts.Drawing.Point(0,0);this.Size=size||new FreshLogicStudios.Scripts.Drawing.Size(0,0);this.Clone=function()
{return new FreshLogicStudios.Scripts.Drawing.Rectangle(self.Location.Clone(),self.Size.Clone());}
this.Contains=function(pt)
{if(((self.GetX()<=pt.X)&&(pt.X<(self.GetX()+self.GetWidth())))&&(self.GetY()<=pt.Y))
{return(pt.Y<(self.GetY()+self.GetHeight()));}
return false;}
this.GetBottom=function()
{return self.Location.Y+self.Size.Height;}
this.GetHeight=function()
{return self.Size.Height;}
this.GetLeft=function()
{return self.Location.X;}
this.GetRight=function()
{return self.Location.X+self.Size.Width;}
this.GetTop=function()
{return self.Location.Y;}
this.GetWidth=function()
{return self.Size.Width;}
this.GetX=function()
{return self.Location.X;}
this.GetY=function()
{return self.Location.Y;}
this.Inflate=function(size)
{this.SetX(this.GetX()-size.Width);this.SetY(this.Gety()-size.Height);this.SetWidth(this.GetWidth()+(2*size.Width));this.SetHeight(this.GetHeight()+(2*size.Height));}
this.Intersect=function(rect)
{var x=Math.max(a.GetX(),b.GetX());var num2=Math.min(a.GetX()+a.GetWidth(),b.GetX()+b.GetWidth());var y=Math.max(a.GetY(),b.GetY());var num4=Math.min(a.GetY()+a.GetHeight(),b.GetY()+b.GetHeight());if((num2>=x)&&(num4>=y))
{this.Location=new FreshLogicStudios.Scripts.Drawing.Point(x,y);this.Size=new FreshLogicStudios.Scripts.Drawing.Size(num2-x,num4-y);}
else
{this.Location=new FreshLogicStudios.Scripts.Drawing.Point(0,0);this.Size=new FreshLogicStudios.Scripts.Drawing.Size(0,0);}}
this.IntersectsWith=function(rect)
{if(((rect.GetX()<(self.GetX()+self.GetWidth()))&&(self.GetX()<(rect.GetX()+rect.GetWidth())))&&(rect.GetY()<(self.GetY()+self.GetHeight())))
{return(self.GetY()<(rect.GetY()+rect.GetHeight()));}
return false;}
this.IsEmpty=function()
{return(self.Location.IsEmpty()&&self.Size.IsEmpty());}
this.Offset=function(pos)
{self.Location.Offset(pos);}
this.SetHeight=function(height)
{self.Size.Height=height;}
this.SetWidth=function(width)
{self.Size.Width=width;}
this.SetX=function(x)
{self.Location.X=x;}
this.SetY=function(y)
{self.Location.Y=y;}}
FreshLogicStudios.Scripts.Drawing.Rectangle.FromLTRB=function(left,top,right,bottom)
{var location=new FreshLogicStudios.Scripts.Drawing.Point(left,top);var size=new FreshLogicStudios.Scripts.Drawing.Size(right-left,bottom-top);return new FreshLogicStudios.Scripts.Drawing.Rectangle(location,size);}
FreshLogicStudios.Scripts.Drawing.Rectangle.Union=function(a,b)
{var x=Math.min(a.GetX(),b.GetX());var num2=Math.max(a.GetX()+a.GetWidth(),b.GetX()+b.GetWidth());var y=Math.min(a.GetY(),b.GetY());var num4=Math.max(a.GetY()+a.GetHeight(),b.GetY()+b.GetHeight());return new FreshLogicStudios.Scripts.Drawing.Rectangle(new FreshLogicStudios.Scripts.Drawing.Point(x,y),new FreshLogicStudios.Scripts.Drawing.Size(num2-x,num4-y));}
RegisterNamespace('FreshLogicStudios.Scripts.Drawing');FreshLogicStudios.Scripts.Drawing.Size=function(width,height)
{var self=this;this.Height=height||0;this.Width=width||0;this.Clone=function()
{return new FreshLogicStudios.Scripts.Drawing.Size(self.Width,self.Height);}
this.IsEmpty=function()
{return(self.Width==0&&self.Height==0);}}
RegisterNamespace('FreshLogicStudios.Scripts.Configuration.Settings');FreshLogicStudios.Scripts.Configuration.Settings=function(){}
FreshLogicStudios.Scripts.Configuration.Settings.Defaults=[];FreshLogicStudios.Scripts.Configuration.Settings.Load=function()
{FreshLogicStudios.Scripts.Configuration.Settings.LoadDefaults();for(var settingName in FreshLogicStudios.Scripts.Configuration.Settings.Defaults)
{FreshLogicStudios.Scripts.Configuration.Settings[settingName]=FreshLogicStudios.Scripts.Configuration.Settings.ReadCookie(settingName)||FreshLogicStudios.Scripts.Configuration.Settings.Defaults[settingName];}}
FreshLogicStudios.Scripts.Configuration.Settings.LoadDefaults=function(){}
FreshLogicStudios.Scripts.Configuration.Settings.Reset=function()
{for(var settingName in Settings)
{if(typeof Settings[settingName]!='function'&&Settings.Defaults[settingName])
{FreshLogicStudios.Scripts.Configuration.Settings[settingName]=FreshLogicStudios.Scripts.Configuration.Settings.Defaults[settingName];}}}
FreshLogicStudios.Scripts.Configuration.Settings.Save=function()
{for(var settingName in FreshLogicStudios.Scripts.Configuration.Settings)
{if(typeof FreshLogicStudios.Scripts.Configuration.Settings[settingName]!='function')
{FreshLogicStudios.Scripts.Configuration.Settings.CreateCookie(settingName,FreshLogicStudios.Scripts.Configuration.Settings[settingName],365);}}}
FreshLogicStudios.Scripts.Configuration.Settings.CreateCookie=function(name,value,days)
{if(days)
{var date=new Date();date.setTime(date.getTime()+(days*24*60*60*1000));var expires='; expires='+date.toGMTString();}
else
{expires='';}
document.cookie=name+'='+value+expires+'; path=/';}
FreshLogicStudios.Scripts.Configuration.Settings.DeleteCookie=function(name)
{FreshLogicStudios.Scripts.Configuration.Settings.CreateCookie(name,'',-1);}
FreshLogicStudios.Scripts.Configuration.Settings.ReadCookie=function(name)
{var nameEQ=name+'=';var ca=document.cookie.split(';');for(var i=0;i<ca.length;i++)
{var c=ca[i];while(c.charAt(0)==' ')
{c=c.substring(1,c.length);}
if(c.indexOf(nameEQ)==0)
{return c.substring(nameEQ.length,c.length);}}
return null;}
RegisterNamespace('FreshLogicStudios.Scripts.Collections');FreshLogicStudios.Scripts.Collections.ArrayList=function()
{var self=this;var items=new Array();this.Events=new FreshLogicStudios.Scripts.EventCollection();function add(value)
{return items.push(value);}
function insert(index,value)
{if(index>-1&&index<=items.length)
{switch(index)
{case 0:items.unshift(value);break;case items.length:items.push(value);break;default:var head=items.slice(0,index-1);var tail=items.slice(index);items=items.concat(tail.unshift(value));break;}}}
function removeAt(index)
{if(items.length>0&&index>-1&&index<items.length)
{switch(index)
{case 0:items.shift();break;case items.length-1:items.pop();break;default:var head=items.slice(0,index);var tail=items.slice(index+1);items=head.concat(tail);break;}}}
this.Add=function(value)
{self.Events.Fire('AddingNew');var index=add(value);self.Events.Fire('ListChanged');return index;}
this.AddRange=function(value)
{self.Events.Fire('AddingNew');for(var i=0;i<value.length;i++)
{add(value[i]);}
self.Events.Fire('ListChanged');}
this.Clear=function()
{items=new Array();self.Events.Fire('ListChanged');}
this.Clone=function()
{var myArrayList=new FreshLogicStudios.Scripts.Collections.ArrayList();for(var i=0;i<items.length;i++)
{myArrayList.Add(items[i]);}
return myArrayList;}
this.Contains=function(object)
{return(self.IndexOf(object)!=-1);}
this.CopyTo=function(array)
{for(var i=0;i<items.length;i++)
{if(i<array.length)
{array[i]=items[i];}
else
{array.push(items[i]);}}}
this.GetCount=function()
{return items.length;}
this.GetItem=function(index)
{if(index>-1&&index<items.length)
{return items[index];}
else
{return undefined;}}
this.GetRange=function(index,count)
{var myArrayList=new FreshLogicStudios.Scripts.Collections.ArrayList();for(var i=index;i<items.length;i++)
{if(myArrayList.GetCount()==count)
{break;}
myArrayList.Add(items[i]);}
return myArrayList;}
this.IndexOf=function(value)
{var index=-1;for(var i=0;i<items.length;i++)
{if(items[i]==value)
{index=i;break;}}
return index;}
this.Insert=function(index,value)
{insert(index,value);self.Events.Fire('ListChanged');}
this.InsertRange=function(index,value)
{for(var i=value.length-1;i>=0;i--)
{insert(index,value[i]);}
self.Events.Fire('ListChanged');}
this.LastIndexOf=function(value)
{var index=-1;for(var i=items.length-1;i>=0;i--)
{if(items[i]==object)
{index=i;break;}}
return index;}
this.Remove=function(obj)
{var index=self.IndexOf(obj);if(index>=0)
{removeAt(index);self.Events.Fire('ListChanged');}}
this.RemoveAt=function(index)
{removeAt(index);self.Events.Fire('ListChanged');}
this.RemoveRange=function(index,count)
{for(var i=0;i<count;i++)
{removeAt(index);}
self.Events.Fire('ListChanged');}
this.Reverse=function()
{items.reverse();self.Events.Fire('ListChanged');}
this.SetItem=function(index,value)
{if(index>-1&&index<items.length)
{items[index]=value;self.Events.Fire('ListChanged');}}
this.SetRange=function(index,value)
{for(var i=0;i<value.length;i++)
{var setAt=index+i;if(setAt<items.length)
{items[setAt]=value[i];}
else
{add(value[i]);}}
self.Events.Fire('ListChanged');}
this.Sort=function(comparer)
{if(comparer)
{items.sort(comparer);}
else
{items.sort();}
self.Events.Fire('ListChanged');}
this.ToArray=function()
{var array=new Array();for(var i=0;i<items.length;i++)
{array.push(items[i]);}
return array;}
this.toString=function()
{return self.ToString();}
this.ToString=function(seperator)
{return self.ToArray().join(seperator);}}