Search Results

Search found 2572 results on 103 pages for 'relative'.

Page 18/103 | < Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >

  • How do i get the mouse position?

    - by acidzombie24
    Basically in relation to this question It seems like e.X,y and e.Location.X,Y is relative to mousedown? I seen negative values when i havent moved it left/above the parent picbox. So it seems like the values are relative to my mousedown, but i need values relative to the parent because i update the left/top every event and other datat and relative to mousedown is breaking my code.

    Read the article

  • Alternative to position: relative; for overflow: auto; bug in IE7.

    - by Myles
    I have content arranged thusly: <div id="thumbnails" style="width: 40px; overflow: auto;"> <div style="float:left; width: 20px;">content</div> <div style="float:left; width: 20px;">content</div> <div style="float:left; width: 20px;">content</div> <div style="float:left; width: 20px;">content</div> <div style="float:left; width: 20px;">content</div> <div style="float:left; width: 20px;">content</div> In IE7 this shows up with the content running out of the scrollable box. The answer everywhere is to make #thumbnails position:relative. My problem is that the items in #thumbnails are scriptaculous draggables that drag outside of thumbnails with a ghost of the element that is positioned absolutely. This does not go over well if the parent is positioned:relatively because now the absolute positions are relative to #thumbnails and not the <body>. Does anyone know an alternative solution to the IE7 bug?

    Read the article

  • Understanding EDI 997.

    - by VishnuTiwariBlog
    Hi Guys, This is for the EDI starter. Below is the complete detail of EDI 997 segment and element details. 997 Functional Acknowledgment Transaction Layout: No. Seg ID Name Description Example M/O 010 ST Transaction Set Header To indicate the start of a transaction set and to assign a control number ST*997*382823~   M ST01   Code uniquely identifying a Transaction Set   M ST02   Identifying control number that must be unique within the transaction set functional group assigned by the originator for a transaction set   M 020 AK1 Functional Group Response Header To start acknowledgment of a functional group AK1*QM*2459823 M        AK101   Code identifying a group of application related transaction sets IN Invoice Information (810) SH Ship Notice/Manifest (856)     AK102   Assigned number originated and maintained by the sender     030 AK2 Transaction Set Response Header To start acknowledgment of a single transaction set AK2*856*001 M AK201   Code uniquely identifying a Transaction Set 810 Invoice 856 Ship Notice/Manifest   M AK202   Identifying control number that must be unique within the transaction set functional group assigned by the originator for a transaction set   M 040 AK3 Data Segment Note To report errors in a data segment and identify the location of the data segment AK3*TD3*9 O AK301 Segment ID Code Code defining the segment ID of the data segment in error (See Appendix A - Number 77)     AK302 Segment Position in Transaction Set The numerical count position of this data segment from the start of the transaction set: the transaction set header is count position 1     050 AK4 Data Element Note To report errors in a data element or composite data structure and identify the location of the data element AK4*2**2 O AK401 Position in Segment Code indicating the relative position of a simple data element, or the relative position of a composite data structure combined with the relative position of the component data element within the composite data structure, in error; the count starts with 1 for the simple data element or composite data structure immediately following the segment ID     AK402 Element Position in Segment This is used to indicate the relative position of a simple data element, or the relative position of a composite data structure with the relative position of the component within the composite data structure, in error; in the data segment the count starts with 1 for the simple data element or composite data structure immediately following the segment ID     AK403 Data Element Syntax Error Code Code indicating the error found after syntax edits of a data element 1 Mandatory Data Element Missing 2 Conditional Required Data Element Missing 3 Too Many Data Elements 4 Data Element Too Short 5 Data Element Too Long 6 Invalid Character in Data Element 7 Invalid Code Value 8 Invalid Date 9 Invalid Time 10 Exclusion Condition Violated     AK404 Copy of Bad Data Element This is a copy of the data element in error     060 AK5 AK5 Transaction Set Response Trailer To acknowledge acceptance or rejection and report errors in a transaction set AK5*A~ AK5*R*5~ M AK501 Transaction Set Acknowledgment Code Code indicating accept or reject condition based on the syntax editing of the transaction set A Accepted E Accepted But Errors Were Noted R Rejected     AK502 Transaction Set Syntax Error Code Code indicating error found based on the syntax editing of a transaction set 1 Transaction Set Not Supported 2 Transaction Set Trailer Missing 3 Transaction Set Control Number in Header and Trailer Do Not Match 4 Number of Included Segments Does Not Match Actual Count 5 One or More Segments in Error 6 Missing or Invalid Transaction Set Identifier 7 Missing or Invalid Transaction Set Control Number     070 AK9 Functional Group Response Trailer To acknowledge acceptance or rejection of a functional group and report the number of included transaction sets from the original trailer, the accepted sets, and the received sets in this functional group AK9*A*1*1*1~ AK9*R*1*1*0~ M AK901 Functional Group Acknowledge Code Code indicating accept or reject condition based on the syntax editing of the functional group A Accepted E Accepted, But Errors Were Noted. R Rejected     AK902 Number of Transaction Sets Included Total number of transaction sets included in the functional group or interchange (transmission) group terminated by the trailer containing this data element     AK903 Number of Received Transaction Sets Number of Transaction Sets received     AK904 Number of Accepted Transaction Sets Number of accepted Transaction Sets in a Functional Group     AK905 Functional Group Syntax Error Code Code indicating error found based on the syntax editing of the functional group header and/or trailer 1 Functional Group Not Supported 2 Functional Group Version Not Supported 3 Functional Group Trailer Missing 4 Group Control Number in the Functional Group Header and Trailer Do Not Agree 5 Number of Included Transaction Sets Does Not Match Actual Count 6 Group Control Number Violates Syntax     080 SE Transaction Set Trailer To indicate the end of the transaction set and provide the count of the transmitted segments (including the beginning (ST) and ending (SE) segments) SE*9*223~ M SE01 Number of Included Segments Total number of segments included in a transaction set including ST and SE segments     SE02 Transaction Set Control Number Identifying control number that must be unique within the transaction set functional group assigned by the originator for a transaction set

    Read the article

  • Understanding EDI 997

    - by VishnuTiwariBlog
    Hi Guys, This is for the EDI starter. Below is the complete detail of EDI 997 segment and element details. 997 Functional Acknowledgment Transaction Layout:   No. Seg ID Name Description Example M/O 010 ST Transaction Set Header To indicate the start of a transaction set and to assign a control number ST*997*382823~   M ST01   Code uniquely identifying a Transaction Set   M ST02   Identifying control number that must be unique within the transaction set functional group assigned by the originator for a transaction set   M 020 AK1 Functional Group Response Header To start acknowledgment of a functional group AK1*QM*2459823 M        AK101   Code identifying a group of application related transaction sets IN Invoice Information (810) SH Ship Notice/Manifest (856)     AK102   Assigned number originated and maintained by the sender     030 AK2 Transaction Set Response Header To start acknowledgment of a single transaction set AK2*856*001 M AK201   Code uniquely identifying a Transaction Set 810 Invoice 856 Ship Notice/Manifest   M AK202   Identifying control number that must be unique within the transaction set functional group assigned by the originator for a transaction set   M 040 AK3 Data Segment Note To report errors in a data segment and identify the location of the data segment AK3*TD3*9 O AK301 Segment ID Code Code defining the segment ID of the data segment in error (See Appendix A - Number 77)     AK302 Segment Position in Transaction Set The numerical count position of this data segment from the start of the transaction set: the transaction set header is count position 1     050 AK4 Data Element Note To report errors in a data element or composite data structure and identify the location of the data element AK4*2**2 O AK401 Position in Segment Code indicating the relative position of a simple data element, or the relative position of a composite data structure combined with the relative position of the component data element within the composite data structure, in error; the count starts with 1 for the simple data element or composite data structure immediately following the segment ID     AK402 Element Position in Segment This is used to indicate the relative position of a simple data element, or the relative position of a composite data structure with the relative position of the component within the composite data structure, in error; in the data segment the count starts with 1 for the simple data element or composite data structure immediately following the segment ID     AK403 Data Element Syntax Error Code Code indicating the error found after syntax edits of a data element 1 Mandatory Data Element Missing 2 Conditional Required Data Element Missing 3 Too Many Data Elements 4 Data Element Too Short 5 Data Element Too Long 6 Invalid Character in Data Element 7 Invalid Code Value 8 Invalid Date 9 Invalid Time 10 Exclusion Condition Violated     AK404 Copy of Bad Data Element This is a copy of the data element in error     060 AK5 AK5 Transaction Set Response Trailer To acknowledge acceptance or rejection and report errors in a transaction set AK5*A~ AK5*R*5~ M AK501 Transaction Set Acknowledgment Code Code indicating accept or reject condition based on the syntax editing of the transaction set A Accepted E Accepted But Errors Were Noted R Rejected     AK502 Transaction Set Syntax Error Code Code indicating error found based on the syntax editing of a transaction set 1 Transaction Set Not Supported 2 Transaction Set Trailer Missing 3 Transaction Set Control Number in Header and Trailer Do Not Match 4 Number of Included Segments Does Not Match Actual Count 5 One or More Segments in Error 6 Missing or Invalid Transaction Set Identifier 7 Missing or Invalid Transaction Set Control Number     070 AK9 Functional Group Response Trailer To acknowledge acceptance or rejection of a functional group and report the number of included transaction sets from the original trailer, the accepted sets, and the received sets in this functional group AK9*A*1*1*1~ AK9*R*1*1*0~ M AK901 Functional Group Acknowledge Code Code indicating accept or reject condition based on the syntax editing of the functional group A Accepted E Accepted, But Errors Were Noted. R Rejected     AK902 Number of Transaction Sets Included Total number of transaction sets included in the functional group or interchange (transmission) group terminated by the trailer containing this data element     AK903 Number of Received Transaction Sets Number of Transaction Sets received     AK904 Number of Accepted Transaction Sets Number of accepted Transaction Sets in a Functional Group     AK905 Functional Group Syntax Error Code Code indicating error found based on the syntax editing of the functional group header and/or trailer 1 Functional Group Not Supported 2 Functional Group Version Not Supported 3 Functional Group Trailer Missing 4 Group Control Number in the Functional Group Header and Trailer Do Not Agree 5 Number of Included Transaction Sets Does Not Match Actual Count 6 Group Control Number Violates Syntax     080 SE Transaction Set Trailer To indicate the end of the transaction set and provide the count of the transmitted segments (including the beginning (ST) and ending (SE) segments) SE*9*223~ M SE01 Number of Included Segments Total number of segments included in a transaction set including ST and SE segments     SE02 Transaction Set Control Number Identifying control number that must be unique within the transaction set functional group assigned by the originator for a transaction set

    Read the article

  • position of View on asp.net mvc site master page

    - by ognjenb
    How fix data table to open only in Main Content Frame? Structure of my site.master page is: left content, main content and right content. When open View page in main content she goes to the right content if it is large. Is this CSS problem? My problem is similar to this http://www.inq.me/post/ASPNet-MVC-Extension-method-to-create-a-Security-Aware-HtmlActionLink.aspx This is my CSS(come with template): /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PRIMARY LAYOUT STYLES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ .content-container { position:relative; _height:1px; min-height:1px; width:900px; /* background:url(images/bg-column-left.png) repeat-y;*/ } .content-container-inner { /*background:url(images/bg-column-right.png) repeat-y right;*/ _height:1px; min-height:1px; /*padding:0 200px;*/ position:relative; /*width:900px;*/ } .content-main { padding :15px 0% 0px 2%; /*position:relative;*/ min-height:1px; _height:1px; float:left; position:relative; /*width:96%;*/ /*width:900px;*/ } .content-left { padding:20px 10px; float:left; width:180px; margin-top:-1px; position:relative; margin-left:-100%; right:200px; _left:200px; border-top:1px dotted #797979; } .content-right { padding :15px 10px 10px 10px; float:left; width:160px; position:relative; margin-right:-200px; } .ads { text-align:center; margin:20px 0; } /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Read the article

  • Attaching two objects and changing their world matrices accordingly

    - by A-Type
    I'm having a hard time wrapping my head around the transformations required to bind two objects together in either a two-way or one-way relationship. I will need to implement both types. For the first case, I want to be able to 'couple' two ships together in space. The ships have different mass, of course. Forces applied to either ship will use combined mass and moment of inertia to calculate and move both ships. The trick is, being sure that the point at which they are coupled remains the same, and they don't move at all relative to each other. The second case is similar: I want a ship to be able to enter the atmosphere of a planet and move relative to the planet. The planet will be orbiting the sun, which is fixed at 0,0,0. Essentially, when the ship is sitting still outside of the atmosphere, the planet will move past it on its course-- but when the ship is sitting still inside the atmosphere, it moves and rotates with the planet, so that it is always relative to the horizon. Essentially, the vertices which make up the ship are now transformed just like the ones that make up the planet, except that the ship can move itself around relative to the planet. I get the feeling I can implement both of these with the same code. Essentially, I am thinking of giving each object (which I call Fixtures) a list of "slave" Fixtures onto which that Fixture's world matrix is imposed. So, this would be the planet imposing its world on any contained ships. In the case of coupling, I would simply make each ship a slave of the other, somehow. Obviously I can't just multiply the ship's world matrix by the planet's, or each ship by the others. What I'd like some help with is what calculations to make in order to get a nice, seamless relative world to the other object. I was thinking maybe I could just multiply the world of the slave by the inverse of the master, but then when you couple two ships you would lose all that world data. So, perhaps I need an intermediate "world" which is the absolute world, but use a secondary "final world" to actually transform the objects?

    Read the article

  • IE6 + IE7 CSS problem with overflow: hidden; - position: relative; combo.

    - by googletorp
    So I have created a slider for a homepage, that slides some images with a title and teaser text using jQuery. Everything works fine, and I went to check IE and found that IE 6 and 7 kills my slider css completely. I can't figure out why, but for some reason I can't hide the non active slides with overflow: hidden; I've tried tweaking the css back and forth, but haven't been able to figure out what's causing the problem. I've recreated the problem in a more isolated html page. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="da" lang="da" dir="ltr"> <head> <style> body { width: 900px; } .column-1 { width: 500px; float: left; } .column-2 { width: 200px; float: left; } .column-3 { width: 200px; float: left; } ul { width: 2000px; left: -499px; position: relative; } li { list-style: none; display: block; float: left; } .item-list { overflow: hidden; width: 499px; } </style> </head> <body> <div class="column-1"> <div class="item-list clearfix"> <ul> <li class="first"> <div class="node-slide"> <img src="http://www.hanselman.com/blog/content/binary/lolcats-funny-pictures-leroy-jenkins.jpg" /> <div class="infobox"> <h4>Title 1</h4> <p>Teaser 1</p> </div> </div> </li> <li> <div class="slide"> <img src="http://www.hanselman.com/blog/content/binary/lolcats-funny-pictures-leroy-jenkins.jpg" /> <div class="infobox"> <h4>Title 2</h4> <p>Teaser 2</p> </div> </div> </li> <li class="last"> <div class="slide"> <img src="http://www.hanselman.com/blog/content/binary/lolcats-funny-pictures-leroy-jenkins.jpg" /> <div class="infobox"> <h4>Title 3</h4> <p>Teaser 3</p> </div> </div> </li> </ul> </div> </div> <div class="column-2"> ... </div> <div class="column-3"> ... </div> </body> </html> I've tracked down that it is the ul { position: relative; } on the ul element that is causing the overflow: hidden not to work, but why that is, I don't know. Also this is needed to make the slider javascript work using the left attribute on the ul to slide it. Any ideas as to how you can fix this is most welcome.

    Read the article

  • Questions, Knowledge Checks and Assessments

    - by ted.henson
    Questions should be used to reinforce concepts throughout the title. You have the option to include questions in the course, in assessments, in Knowledge Checks, or in any combination. Questions are required for creating knowledge checks and assessments. It is important to remember that questions that are not in assessments are not tracked. Be sure to structure your outline so that questions are added to the appropriate assignable unit. I usually recommend that questions appear directly below their relative section. This serves two purposes. First, it helps ensure that the related content and question stay relative to one another. Secondly, it ensures that when the "link to subject" option is used it will relate back to the relative content. Knowledge checks are created using the questions that have been added to the related assignable unit. Use Knowledge Checks to give users an additional opportunity to review what they have learned. Knowledge Check allows users to check their own knowledge without being tracked or scored. Many users like having this self check option, especially if they know they are going to be tested later. Each assignable unit can have its own Knowledge Check. Assessments provide a way to measure knowledge or understanding of the course material. The results of each assessment are scored and tracked. Assessments are created using the questions that have been added to the relative assignable unit(s). Each assignable unit, including the Title AU, can have multiple assessments. Consider how your knowledge paths will be structured when planning your assessments. For instance, you can create a multiple-activity knowledge path, with multiple assessments from the same title or assignable unit. Also remember, in Manager an assessment can be either a pre or post assessment. Pre-assessments allow the student to discover what is already known in a specific topic or subject and important if the personal course feature is being used. Post-assessments allow you test the student knowledge or understanding after completing the material.

    Read the article

  • How to fix issue with my 3D first person camera?

    - by dxCUDA
    My camera moves and rotates, but relative to the worlds origin, instead of the players. I am having difficulty rotating the camera and then translating the camera in the direction relative to the camera facing angle. I have been able to translate the camera and rotate relative to the players origin, but not then rotate and translate in the direction relative to the cameras facing direction. My goal is to have a standard FPS-style camera. float yaw, pitch, roll; D3DXMATRIX rotationMatrix; D3DXVECTOR3 Direction; D3DXMATRIX matRotAxis,matRotZ; D3DXVECTOR3 RotAxis; // Set the yaw (Y axis), pitch (X axis), and roll (Z axis) rotations in radians. pitch = m_rotationX * 0.0174532925f; yaw = m_rotationY * 0.0174532925f; roll = m_rotationZ * 0.0174532925f; up = D3DXVECTOR3(0.0f, 1.0f, 0.0f);//Create the up vector //Build eye ,lookat and rotation vectors from player input data eye = D3DXVECTOR3(m_fCameraX, m_fCameraY, m_fCameraZ); lookat = D3DXVECTOR3(m_fLookatX, m_fLookatY, m_fLookatZ); rotation = D3DXVECTOR3(m_rotationX, m_rotationY, m_rotationZ); D3DXVECTOR3 camera[3] = {eye,//Eye lookat,//LookAt up };//Up RotAxis.x = pitch; RotAxis.y = yaw; RotAxis.z = roll; D3DXVec3Normalize(&Direction, &(camera[1] - camera[0]));//Direction vector D3DXVec3Cross(&RotAxis, &Direction, &camera[2]);//Strafe vector D3DXVec3Normalize(&RotAxis, &RotAxis); // Create the rotation matrix from the yaw, pitch, and roll values. D3DXMatrixRotationYawPitchRoll(&matRotAxis, pitch,yaw, roll); //rotate direction D3DXVec3TransformCoord(&Direction,&Direction,&matRotAxis); //Translate up vector D3DXVec3TransformCoord(&camera[2], &camera[2], &matRotAxis); //Translate in the direction of player rotation D3DXVec3TransformCoord(&camera[0], &camera[0], &matRotAxis); camera[1] = Direction + camera[0];//Avoid gimble locking D3DXMatrixLookAtLH(&in_viewMatrix, &camera[0], &camera[1], &camera[2]);

    Read the article

  • Positioned element adding to total div height [migrated]

    - by Max
    I have a 800 x 600 rotatable image with forward and back buttons repositioned to the sides. The height of the div is suppose to be 600px, but the actual height of the div was pushed to 690, including the height of the button image. And the div was blocking a row of clickable menu on top. So I made the div height to 518px and moved top -75px to get the real dimension I want. But I feel dirty doing this... Is there a correct way to do this? Or is this workaround more or less correct? Below is the code. Thanks! <div class="Content Wide" id="LayoutColumn1"> <div style=" width: 980px; height: 518px; display: block; position: relative; float: left;"> <a href="#" onClick="prev();"><img src="/template/img/next_button.png" style="position: relative; top: 200px; left: 5px; z-index: 2;"></a> <a href="/chef-special/" id="mainLink"><img src="/template/img/chef_special_large.png" id="main" style="margin: 0 0 0 50px; position: relative; float: left; top: -75px; z-index: 1;"></a> <a href="#" onClick="next();"><img src="/template/img/next_button.png" style="position: relative; top: 200px; left: 787px; z-index: 2;"></a> </div> </div>

    Read the article

  • Hosting the Razor Engine for Templating in Non-Web Applications

    - by Rick Strahl
    Microsoft’s new Razor HTML Rendering Engine that is currently shipping with ASP.NET MVC previews can be used outside of ASP.NET. Razor is an alternative view engine that can be used instead of the ASP.NET Page engine that currently works with ASP.NET WebForms and MVC. It provides a simpler and more readable markup syntax and is much more light weight in terms of functionality than the full blown WebForms Page engine, focusing only on features that are more along the lines of a pure view engine (or classic ASP!) with focus on expression and code rendering rather than a complex control/object model. Like the Page engine though, the parser understands .NET code syntax which can be embedded into templates, and behind the scenes the engine compiles markup and script code into an executing piece of .NET code in an assembly. Although it ships as part of the ASP.NET MVC and WebMatrix the Razor Engine itself is not directly dependent on ASP.NET or IIS or HTTP in any way. And although there are some markup and rendering features that are optimized for HTML based output generation, Razor is essentially a free standing template engine. And what’s really nice is that unlike the ASP.NET Runtime, Razor is fairly easy to host inside of your own non-Web applications to provide templating functionality. Templating in non-Web Applications? Yes please! So why might you host a template engine in your non-Web application? Template rendering is useful in many places and I have a number of applications that make heavy use of it. One of my applications – West Wind Html Help Builder - exclusively uses template based rendering to merge user supplied help text content into customizable and executable HTML markup templates that provide HTML output for CHM style HTML Help. This is an older product and it’s not actually using .NET at the moment – and this is one reason I’m looking at Razor for script hosting at the moment. For a few .NET applications though I’ve actually used the ASP.NET Runtime hosting to provide templating and mail merge style functionality and while that works reasonably well it’s a very heavy handed approach. It’s very resource intensive and has potential issues with versioning in various different versions of .NET. The generic implementation I created in the article above requires a lot of fix up to mimic an HTTP request in a non-HTTP environment and there are a lot of little things that have to happen to ensure that the ASP.NET runtime works properly most of it having nothing to do with the templating aspect but just satisfying ASP.NET’s requirements. The Razor Engine on the other hand is fairly light weight and completely decoupled from the ASP.NET runtime and the HTTP processing. Rather it’s a pure template engine whose sole purpose is to render text templates. Hosting this engine in your own applications can be accomplished with a reasonable amount of code (actually just a few lines with the tools I’m about to describe) and without having to fake HTTP requests. It’s also much lighter on resource usage and you can easily attach custom properties to your base template implementation to easily pass context from the parent application into templates all of which was rather complicated with ASP.NET runtime hosting. Installing the Razor Template Engine You can get Razor as part of the MVC 3 (RC and later) or Web Matrix. Both are available as downloadable components from the Web Platform Installer Version 3.0 (!important – V2 doesn’t show these components). If you already have that version of the WPI installed just fire it up. You can get the latest version of the Web Platform Installer from here: http://www.microsoft.com/web/gallery/install.aspx Once the platform Installer 3.0 is installed install either MVC 3 or ASP.NET Web Pages. Once installed you’ll find a System.Web.Razor assembly in C:\Program Files\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\Assemblies\System.Web.Razor.dll which you can add as a reference to your project. Creating a Wrapper The basic Razor Hosting API is pretty simple and you can host Razor with a (large-ish) handful of lines of code. I’ll show the basics of it later in this article. However, if you want to customize the rendering and handle assembly and namespace includes for the markup as well as deal with text and file inputs as well as forcing Razor to run in a separate AppDomain so you can unload the code-generated assemblies and deal with assembly caching for re-used templates little more work is required to create something that is more easily reusable. For this reason I created a Razor Hosting wrapper project that combines a bunch of this functionality into an easy to use hosting class, a hosting factory that can load the engine in a separate AppDomain and a couple of hosting containers that provided folder based and string based caching for templates for an easily embeddable and reusable engine with easy to use syntax. If you just want the code and play with the samples and source go grab the latest code from the Subversion Repository at: http://www.west-wind.com:8080/svn/articles/trunk/RazorHosting/ or a snapshot from: http://www.west-wind.com/files/tools/RazorHosting.zip Getting Started Before I get into how hosting with Razor works, let’s take a look at how you can get up and running quickly with the wrapper classes provided. It only takes a few lines of code. The easiest way to use these Razor Hosting Wrappers is to use one of the two HostContainers provided. One is for hosting Razor scripts in a directory and rendering them as relative paths from these script files on disk. The other HostContainer serves razor scripts from string templates… Let’s start with a very simple template that displays some simple expressions, some code blocks and demonstrates rendering some data from contextual data that you pass to the template in the form of a ‘context’. Here’s a simple Razor template: @using System.Reflection Hello @Context.FirstName! Your entry was entered on: @Context.Entered @{ // Code block: Update the host Windows Form passed in through the context Context.WinForm.Text = "Hello World from Razor at " + DateTime.Now.ToString(); } AppDomain Id: @AppDomain.CurrentDomain.FriendlyName Assembly: @Assembly.GetExecutingAssembly().FullName Code based output: @{ // Write output with Response object from code string output = string.Empty; for (int i = 0; i < 10; i++) { output += i.ToString() + " "; } Response.Write(output); } Pretty easy to see what’s going on here. The only unusual thing in this code is the Context object which is an arbitrary object I’m passing from the host to the template by way of the template base class. I’m also displaying the current AppDomain and the executing Assembly name so you can see how compiling and running a template actually loads up new assemblies. Also note that as part of my context I’m passing a reference to the current Windows Form down to the template and changing the title from within the script. It’s a silly example, but it demonstrates two-way communication between host and template and back which can be very powerful. The easiest way to quickly render this template is to use the RazorEngine<TTemplateBase> class. The generic parameter specifies a template base class type that is used by Razor internally to generate the class it generates from a template. The default implementation provided in my RazorHosting wrapper is RazorTemplateBase. Here’s a simple one that renders from a string and outputs a string: var engine = new RazorEngine<RazorTemplateBase>(); // we can pass any object as context - here create a custom context var context = new CustomContext() { WinForm = this, FirstName = "Rick", Entered = DateTime.Now.AddDays(-10) }; string output = engine.RenderTemplate(this.txtSource.Text new string[] { "System.Windows.Forms.dll" }, context); if (output == null) this.txtResult.Text = "*** ERROR:\r\n" + engine.ErrorMessage; else this.txtResult.Text = output; Simple enough. This code renders a template from a string input and returns a result back as a string. It  creates a custom context and passes that to the template which can then access the Context’s properties. Note that anything passed as ‘context’ must be serializable (or MarshalByRefObject) – otherwise you get an exception when passing the reference over AppDomain boundaries (discussed later). Passing a context is optional, but is a key feature in being able to share data between the host application and the template. Note that we use the Context object to access FirstName, Entered and even the host Windows Form object which is used in the template to change the Window caption from within the script! In the code above all the work happens in the RenderTemplate method which provide a variety of overloads to read and write to and from strings, files and TextReaders/Writers. Here’s another example that renders from a file input using a TextReader: using (reader = new StreamReader("templates\\simple.csHtml", true)) { result = host.RenderTemplate(reader, new string[] { "System.Windows.Forms.dll" }, this.CustomContext); } RenderTemplate() is fairly high level and it handles loading of the runtime, compiling into an assembly and rendering of the template. If you want more control you can use the lower level methods to control each step of the way which is important for the HostContainers I’ll discuss later. Basically for those scenarios you want to separate out loading of the engine, compiling into an assembly and then rendering the template from the assembly. Why? So we can keep assemblies cached. In the code above a new assembly is created for each template rendered which is inefficient and uses up resources. Depending on the size of your templates and how often you fire them you can chew through memory very quickly. This slighter lower level approach is only a couple of extra steps: // we can pass any object as context - here create a custom context var context = new CustomContext() { WinForm = this, FirstName = "Rick", Entered = DateTime.Now.AddDays(-10) }; var engine = new RazorEngine<RazorTemplateBase>(); string assId = null; using (StringReader reader = new StringReader(this.txtSource.Text)) { assId = engine.ParseAndCompileTemplate(new string[] { "System.Windows.Forms.dll" }, reader); } string output = engine.RenderTemplateFromAssembly(assId, context); if (output == null) this.txtResult.Text = "*** ERROR:\r\n" + engine.ErrorMessage; else this.txtResult.Text = output; The difference here is that you can capture the assembly – or rather an Id to it – and potentially hold on to it to render again later assuming the template hasn’t changed. The HostContainers take advantage of this feature to cache the assemblies based on certain criteria like a filename and file time step or a string hash that if not change indicate that an assembly can be reused. Note that ParseAndCompileTemplate returns an assembly Id rather than the assembly itself. This is done so that that the assembly always stays in the host’s AppDomain and is not passed across AppDomain boundaries which would cause load failures. We’ll talk more about this in a minute but for now just realize that assemblies references are stored in a list and are accessible by this ID to allow locating and re-executing of the assembly based on that id. Reuse of the assembly avoids recompilation overhead and creation of yet another assembly that loads into the current AppDomain. You can play around with several different versions of the above code in the main sample form:   Using Hosting Containers for more Control and Caching The above examples simply render templates into assemblies each and every time they are executed. While this works and is even reasonably fast, it’s not terribly efficient. If you render templates more than once it would be nice if you could cache the generated assemblies for example to avoid re-compiling and creating of a new assembly each time. Additionally it would be nice to load template assemblies into a separate AppDomain optionally to be able to be able to unload assembli es and also to protect your host application from scripting attacks with malicious template code. Hosting containers provide also provide a wrapper around the RazorEngine<T> instance, a factory (which allows creation in separate AppDomains) and an easy way to start and stop the container ‘runtime’. The Razor Hosting samples provide two hosting containers: RazorFolderHostContainer and StringHostContainer. The folder host provides a simple runtime environment for a folder structure similar in the way that the ASP.NET runtime handles a virtual directory as it’s ‘application' root. Templates are loaded from disk in relative paths and the resulting assemblies are cached unless the template on disk is changed. The string host also caches templates based on string hashes – if the same string is passed a second time a cached version of the assembly is used. Here’s how HostContainers work. I’ll use the FolderHostContainer because it’s likely the most common way you’d use templates – from disk based templates that can be easily edited and maintained on disk. The first step is to create an instance of it and keep it around somewhere (in the example it’s attached as a property to the Form): RazorFolderHostContainer Host = new RazorFolderHostContainer(); public RazorFolderHostForm() { InitializeComponent(); // The base path for templates - templates are rendered with relative paths // based on this path. Host.TemplatePath = Path.Combine(Environment.CurrentDirectory, TemplateBaseFolder); // Add any assemblies you want reference in your templates Host.ReferencedAssemblies.Add("System.Windows.Forms.dll"); // Start up the host container Host.Start(); } Next anytime you want to render a template you can use simple code like this: private void RenderTemplate(string fileName) { // Pass the template path via the Context var relativePath = Utilities.GetRelativePath(fileName, Host.TemplatePath); if (!Host.RenderTemplate(relativePath, this.Context, Host.RenderingOutputFile)) { MessageBox.Show("Error: " + Host.ErrorMessage); return; } this.webBrowser1.Navigate("file://" + Host.RenderingOutputFile); } You can also render the output to a string instead of to a file: string result = Host.RenderTemplateToString(relativePath,context); Finally if you want to release the engine and shut down the hosting AppDomain you can simply do: Host.Stop(); Stopping the AppDomain and restarting it (ie. calling Stop(); followed by Start()) is also a nice way to release all resources in the AppDomain. The FolderBased domain also supports partial Rendering based on root path based relative paths with the same caching characteristics as the main templates. From within a template you can call out to a partial like this: @RenderPartial(@"partials\PartialRendering.cshtml", Context) where partials\PartialRendering.cshtml is a relative to the template root folder. The folder host example lets you load up templates from disk and display the result in a Web Browser control which demonstrates using Razor HTML output from templates that contain HTML syntax which happens to me my target scenario for Html Help Builder.   The Razor Engine Wrapper Project The project I created to wrap Razor hosting has a fair bit of code and a number of classes associated with it. Most of the components are internally used and as you can see using the final RazorEngine<T> and HostContainer classes is pretty easy. The classes are extensible and I suspect developers will want to build more customized host containers for their applications. Host containers are the key to wrapping up all functionality – Engine, BaseTemplate, AppDomain Hosting, Caching etc in a logical piece that is ready to be plugged into an application. When looking at the code there are a couple of core features provided: Core Razor Engine Hosting This is the core Razor hosting which provides the basics of loading a template, compiling it into an assembly and executing it. This is fairly straightforward, but without a host container that can cache assemblies based on some criteria templates are recompiled and re-created each time which is inefficient (although pretty fast). The base engine wrapper implementation also supports hosting the Razor runtime in a separate AppDomain for security and the ability to unload it on demand. Host Containers The engine hosting itself doesn’t provide any sort of ‘runtime’ service like picking up files from disk, caching assemblies and so forth. So my implementation provides two HostContainers: RazorFolderHostContainer and RazorStringHostContainer. The FolderHost works off a base directory and loads templates based on relative paths (sort of like the ASP.NET runtime does off a virtual). The HostContainers also deal with caching of template assemblies – for the folder host the file date is tracked and checked for updates and unless the template is changed a cached assembly is reused. The StringHostContainer similiarily checks string hashes to figure out whether a particular string template was previously compiled and executed. The HostContainers also act as a simple startup environment and a single reference to easily store and reuse in an application. TemplateBase Classes The template base classes are the base classes that from which the Razor engine generates .NET code. A template is parsed into a class with an Execute() method and the class is based on this template type you can specify. RazorEngine<TBaseTemplate> can receive this type and the HostContainers default to specific templates in their base implementations. Template classes are customizable to allow you to create templates that provide application specific features and interaction from the template to your host application. How does the RazorEngine wrapper work? You can browse the source code in the links above or in the repository or download the source, but I’ll highlight some key features here. Here’s part of the RazorEngine implementation that can be used to host the runtime and that demonstrates the key code required to host the Razor runtime. The RazorEngine class is implemented as a generic class to reflect the Template base class type: public class RazorEngine<TBaseTemplateType> : MarshalByRefObject where TBaseTemplateType : RazorTemplateBase The generic type is used to internally provide easier access to the template type and assignments on it as part of the template processing. The class also inherits MarshalByRefObject to allow execution over AppDomain boundaries – something that all the classes discussed here need to do since there is much interaction between the host and the template. The first two key methods deal with creating a template assembly: /// <summary> /// Creates an instance of the RazorHost with various options applied. /// Applies basic namespace imports and the name of the class to generate /// </summary> /// <param name="generatedNamespace"></param> /// <param name="generatedClass"></param> /// <returns></returns> protected RazorTemplateEngine CreateHost(string generatedNamespace, string generatedClass) { Type baseClassType = typeof(TBaseTemplateType); RazorEngineHost host = new RazorEngineHost(new CSharpRazorCodeLanguage()); host.DefaultBaseClass = baseClassType.FullName; host.DefaultClassName = generatedClass; host.DefaultNamespace = generatedNamespace; host.NamespaceImports.Add("System"); host.NamespaceImports.Add("System.Text"); host.NamespaceImports.Add("System.Collections.Generic"); host.NamespaceImports.Add("System.Linq"); host.NamespaceImports.Add("System.IO"); return new RazorTemplateEngine(host); } /// <summary> /// Parses and compiles a markup template into an assembly and returns /// an assembly name. The name is an ID that can be passed to /// ExecuteTemplateByAssembly which picks up a cached instance of the /// loaded assembly. /// /// </summary> /// <param name="namespaceOfGeneratedClass">The namespace of the class to generate from the template</param> /// <param name="generatedClassName">The name of the class to generate from the template</param> /// <param name="ReferencedAssemblies">Any referenced assemblies by dll name only. Assemblies must be in execution path of host or in GAC.</param> /// <param name="templateSourceReader">Textreader that loads the template</param> /// <remarks> /// The actual assembly isn't returned here to allow for cross-AppDomain /// operation. If the assembly was returned it would fail for cross-AppDomain /// calls. /// </remarks> /// <returns>An assembly Id. The Assembly is cached in memory and can be used with RenderFromAssembly.</returns> public string ParseAndCompileTemplate( string namespaceOfGeneratedClass, string generatedClassName, string[] ReferencedAssemblies, TextReader templateSourceReader) { RazorTemplateEngine engine = CreateHost(namespaceOfGeneratedClass, generatedClassName); // Generate the template class as CodeDom GeneratorResults razorResults = engine.GenerateCode(templateSourceReader); // Create code from the codeDom and compile CSharpCodeProvider codeProvider = new CSharpCodeProvider(); CodeGeneratorOptions options = new CodeGeneratorOptions(); // Capture Code Generated as a string for error info // and debugging LastGeneratedCode = null; using (StringWriter writer = new StringWriter()) { codeProvider.GenerateCodeFromCompileUnit(razorResults.GeneratedCode, writer, options); LastGeneratedCode = writer.ToString(); } CompilerParameters compilerParameters = new CompilerParameters(ReferencedAssemblies); // Standard Assembly References compilerParameters.ReferencedAssemblies.Add("System.dll"); compilerParameters.ReferencedAssemblies.Add("System.Core.dll"); compilerParameters.ReferencedAssemblies.Add("Microsoft.CSharp.dll"); // dynamic support! // Also add the current assembly so RazorTemplateBase is available compilerParameters.ReferencedAssemblies.Add(Assembly.GetExecutingAssembly().CodeBase.Substring(8)); compilerParameters.GenerateInMemory = Configuration.CompileToMemory; if (!Configuration.CompileToMemory) compilerParameters.OutputAssembly = Path.Combine(Configuration.TempAssemblyPath, "_" + Guid.NewGuid().ToString("n") + ".dll"); CompilerResults compilerResults = codeProvider.CompileAssemblyFromDom(compilerParameters, razorResults.GeneratedCode); if (compilerResults.Errors.Count > 0) { var compileErrors = new StringBuilder(); foreach (System.CodeDom.Compiler.CompilerError compileError in compilerResults.Errors) compileErrors.Append(String.Format(Resources.LineX0TColX1TErrorX2RN, compileError.Line, compileError.Column, compileError.ErrorText)); this.SetError(compileErrors.ToString() + "\r\n" + LastGeneratedCode); return null; } AssemblyCache.Add(compilerResults.CompiledAssembly.FullName, compilerResults.CompiledAssembly); return compilerResults.CompiledAssembly.FullName; } Think of the internal CreateHost() method as setting up the assembly generated from each template. Each template compiles into a separate assembly. It sets up namespaces, and assembly references, the base class used and the name and namespace for the generated class. ParseAndCompileTemplate() then calls the CreateHost() method to receive the template engine generator which effectively generates a CodeDom from the template – the template is turned into .NET code. The code generated from our earlier example looks something like this: //------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // Runtime Version:4.0.30319.1 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ namespace RazorTest { using System; using System.Text; using System.Collections.Generic; using System.Linq; using System.IO; using System.Reflection; public class RazorTemplate : RazorHosting.RazorTemplateBase { #line hidden public RazorTemplate() { } public override void Execute() { WriteLiteral("Hello "); Write(Context.FirstName); WriteLiteral("! Your entry was entered on: "); Write(Context.Entered); WriteLiteral("\r\n\r\n"); // Code block: Update the host Windows Form passed in through the context Context.WinForm.Text = "Hello World from Razor at " + DateTime.Now.ToString(); WriteLiteral("\r\nAppDomain Id:\r\n "); Write(AppDomain.CurrentDomain.FriendlyName); WriteLiteral("\r\n \r\nAssembly:\r\n "); Write(Assembly.GetExecutingAssembly().FullName); WriteLiteral("\r\n\r\nCode based output: \r\n"); // Write output with Response object from code string output = string.Empty; for (int i = 0; i < 10; i++) { output += i.ToString() + " "; } } } } Basically the template’s body is turned into code in an Execute method that is called. Internally the template’s Write method is fired to actually generate the output. Note that the class inherits from RazorTemplateBase which is the generic parameter I used to specify the base class when creating an instance in my RazorEngine host: var engine = new RazorEngine<RazorTemplateBase>(); This template class must be provided and it must implement an Execute() and Write() method. Beyond that you can create any class you chose and attach your own properties. My RazorTemplateBase class implementation is very simple: public class RazorTemplateBase : MarshalByRefObject, IDisposable { /// <summary> /// You can pass in a generic context object /// to use in your template code /// </summary> public dynamic Context { get; set; } /// <summary> /// Class that generates output. Currently ultra simple /// with only Response.Write() implementation. /// </summary> public RazorResponse Response { get; set; } public object HostContainer {get; set; } public object Engine { get; set; } public RazorTemplateBase() { Response = new RazorResponse(); } public virtual void Write(object value) { Response.Write(value); } public virtual void WriteLiteral(object value) { Response.Write(value); } /// <summary> /// Razor Parser implements this method /// </summary> public virtual void Execute() {} public virtual void Dispose() { if (Response != null) { Response.Dispose(); Response = null; } } } Razor fills in the Execute method when it generates its subclass and uses the Write() method to output content. As you can see I use a RazorResponse() class here to generate output. This isn’t necessary really, as you could use a StringBuilder or StringWriter() directly, but I prefer using Response object so I can extend the Response behavior as needed. The RazorResponse class is also very simple and merely acts as a wrapper around a TextWriter: public class RazorResponse : IDisposable { /// <summary> /// Internal text writer - default to StringWriter() /// </summary> public TextWriter Writer = new StringWriter(); public virtual void Write(object value) { Writer.Write(value); } public virtual void WriteLine(object value) { Write(value); Write("\r\n"); } public virtual void WriteFormat(string format, params object[] args) { Write(string.Format(format, args)); } public override string ToString() { return Writer.ToString(); } public virtual void Dispose() { Writer.Close(); } public virtual void SetTextWriter(TextWriter writer) { // Close original writer if (Writer != null) Writer.Close(); Writer = writer; } } The Rendering Methods of RazorEngine At this point I’ve talked about the assembly generation logic and the template implementation itself. What’s left is that once you’ve generated the assembly is to execute it. The code to do this is handled in the various RenderXXX methods of the RazorEngine class. Let’s look at the lowest level one of these which is RenderTemplateFromAssembly() and a couple of internal support methods that handle instantiating and invoking of the generated template method: public string RenderTemplateFromAssembly( string assemblyId, string generatedNamespace, string generatedClass, object context, TextWriter outputWriter) { this.SetError(); Assembly generatedAssembly = AssemblyCache[assemblyId]; if (generatedAssembly == null) { this.SetError(Resources.PreviouslyCompiledAssemblyNotFound); return null; } string className = generatedNamespace + "." + generatedClass; Type type; try { type = generatedAssembly.GetType(className); } catch (Exception ex) { this.SetError(Resources.UnableToCreateType + className + ": " + ex.Message); return null; } // Start with empty non-error response (if we use a writer) string result = string.Empty; using(TBaseTemplateType instance = InstantiateTemplateClass(type)) { if (instance == null) return null; if (outputWriter != null) instance.Response.SetTextWriter(outputWriter); if (!InvokeTemplateInstance(instance, context)) return null; // Capture string output if implemented and return // otherwise null is returned if (outputWriter == null) result = instance.Response.ToString(); } return result; } protected virtual TBaseTemplateType InstantiateTemplateClass(Type type) { TBaseTemplateType instance = Activator.CreateInstance(type) as TBaseTemplateType; if (instance == null) { SetError(Resources.CouldnTActivateTypeInstance + type.FullName); return null; } instance.Engine = this; // If a HostContainer was set pass that to the template too instance.HostContainer = this.HostContainer; return instance; } /// <summary> /// Internally executes an instance of the template, /// captures errors on execution and returns true or false /// </summary> /// <param name="instance">An instance of the generated template</param> /// <returns>true or false - check ErrorMessage for errors</returns> protected virtual bool InvokeTemplateInstance(TBaseTemplateType instance, object context) { try { instance.Context = context; instance.Execute(); } catch (Exception ex) { this.SetError(Resources.TemplateExecutionError + ex.Message); return false; } finally { // Must make sure Response is closed instance.Response.Dispose(); } return true; } The RenderTemplateFromAssembly method basically requires the namespace and class to instantate and creates an instance of the class using InstantiateTemplateClass(). It then invokes the method with InvokeTemplateInstance(). These two methods are broken out because they are re-used by various other rendering methods and also to allow subclassing and providing additional configuration tasks to set properties and pass values to templates at execution time. In the default mode instantiation sets the Engine and HostContainer (discussed later) so the template can call back into the template engine, and the context is set when the template method is invoked. The various RenderXXX methods use similar code although they create the assemblies first. If you’re after potentially cashing assemblies the method is the one to call and that’s exactly what the two HostContainer classes do. More on that in a minute, but before we get into HostContainers let’s talk about AppDomain hosting and the like. Running Templates in their own AppDomain With the RazorEngine class above, when a template is parsed into an assembly and executed the assembly is created (in memory or on disk – you can configure that) and cached in the current AppDomain. In .NET once an assembly has been loaded it can never be unloaded so if you’re loading lots of templates and at some time you want to release them there’s no way to do so. If however you load the assemblies in a separate AppDomain that new AppDomain can be unloaded and the assemblies loaded in it with it. In order to host the templates in a separate AppDomain the easiest thing to do is to run the entire RazorEngine in a separate AppDomain. Then all interaction occurs in the other AppDomain and no further changes have to be made. To facilitate this there is a RazorEngineFactory which has methods that can instantiate the RazorHost in a separate AppDomain as well as in the local AppDomain. The host creates the remote instance and then hangs on to it to keep it alive as well as providing methods to shut down the AppDomain and reload the engine. Sounds complicated but cross-AppDomain invocation is actually fairly easy to implement. Here’s some of the relevant code from the RazorEngineFactory class. Like the RazorEngine this class is generic and requires a template base type in the generic class name: public class RazorEngineFactory<TBaseTemplateType> where TBaseTemplateType : RazorTemplateBase Here are the key methods of interest: /// <summary> /// Creates an instance of the RazorHost in a new AppDomain. This /// version creates a static singleton that that is cached and you /// can call UnloadRazorHostInAppDomain to unload it. /// </summary> /// <returns></returns> public static RazorEngine<TBaseTemplateType> CreateRazorHostInAppDomain() { if (Current == null) Current = new RazorEngineFactory<TBaseTemplateType>(); return Current.GetRazorHostInAppDomain(); } public static void UnloadRazorHostInAppDomain() { if (Current != null) Current.UnloadHost(); Current = null; } /// <summary> /// Instance method that creates a RazorHost in a new AppDomain. /// This method requires that you keep the Factory around in /// order to keep the AppDomain alive and be able to unload it. /// </summary> /// <returns></returns> public RazorEngine<TBaseTemplateType> GetRazorHostInAppDomain() { LocalAppDomain = CreateAppDomain(null); if (LocalAppDomain == null) return null; /// Create the instance inside of the new AppDomain /// Note: remote domain uses local EXE's AppBasePath!!! RazorEngine<TBaseTemplateType> host = null; try { Assembly ass = Assembly.GetExecutingAssembly(); string AssemblyPath = ass.Location; host = (RazorEngine<TBaseTemplateType>) LocalAppDomain.CreateInstanceFrom(AssemblyPath, typeof(RazorEngine<TBaseTemplateType>).FullName).Unwrap(); } catch (Exception ex) { ErrorMessage = ex.Message; return null; } return host; } /// <summary> /// Internally creates a new AppDomain in which Razor templates can /// be run. /// </summary> /// <param name="appDomainName"></param> /// <returns></returns> private AppDomain CreateAppDomain(string appDomainName) { if (appDomainName == null) appDomainName = "RazorHost_" + Guid.NewGuid().ToString("n"); AppDomainSetup setup = new AppDomainSetup(); // *** Point at current directory setup.ApplicationBase = AppDomain.CurrentDomain.BaseDirectory; AppDomain localDomain = AppDomain.CreateDomain(appDomainName, null, setup); return localDomain; } /// <summary> /// Allow unloading of the created AppDomain to release resources /// All internal resources in the AppDomain are released including /// in memory compiled Razor assemblies. /// </summary> public void UnloadHost() { if (this.LocalAppDomain != null) { AppDomain.Unload(this.LocalAppDomain); this.LocalAppDomain = null; } } The static CreateRazorHostInAppDomain() is the key method that startup code usually calls. It uses a Current singleton instance to an instance of itself that is created cross AppDomain and is kept alive because it’s static. GetRazorHostInAppDomain actually creates a cross-AppDomain instance which first creates a new AppDomain and then loads the RazorEngine into it. The remote Proxy instance is returned as a result to the method and can be used the same as a local instance. The code to run with a remote AppDomain is simple: private RazorEngine<RazorTemplateBase> CreateHost() { if (this.Host != null) return this.Host; // Use Static Methods - no error message if host doesn't load this.Host = RazorEngineFactory<RazorTemplateBase>.CreateRazorHostInAppDomain(); if (this.Host == null) { MessageBox.Show("Unable to load Razor Template Host", "Razor Hosting", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } return this.Host; } This code relies on a local reference of the Host which is kept around for the duration of the app (in this case a form reference). To use this you’d simply do: this.Host = CreateHost(); if (host == null) return; string result = host.RenderTemplate( this.txtSource.Text, new string[] { "System.Windows.Forms.dll", "Westwind.Utilities.dll" }, this.CustomContext); if (result == null) { MessageBox.Show(host.ErrorMessage, "Template Execution Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } this.txtResult.Text = result; Now all templates run in a remote AppDomain and can be unloaded with simple code like this: RazorEngineFactory<RazorTemplateBase>.UnloadRazorHostInAppDomain(); this.Host = null; One Step further – Providing a caching ‘Runtime’ Once we can load templates in a remote AppDomain we can add some additional functionality like assembly caching based on application specific features. One of my typical scenarios is to render templates out of a scripts folder. So all templates live in a folder and they change infrequently. So a Folder based host that can compile these templates once and then only recompile them if something changes would be ideal. Enter host containers which are basically wrappers around the RazorEngine<t> and RazorEngineFactory<t>. They provide additional logic for things like file caching based on changes on disk or string hashes for string based template inputs. The folder host also provides for partial rendering logic through a custom template base implementation. There’s a base implementation in RazorBaseHostContainer, which provides the basics for hosting a RazorEngine, which includes the ability to start and stop the engine, cache assemblies and add references: public abstract class RazorBaseHostContainer<TBaseTemplateType> : MarshalByRefObject where TBaseTemplateType : RazorTemplateBase, new() { public RazorBaseHostContainer() { UseAppDomain = true; GeneratedNamespace = "__RazorHost"; } /// <summary> /// Determines whether the Container hosts Razor /// in a separate AppDomain. Seperate AppDomain /// hosting allows unloading and releasing of /// resources. /// </summary> public bool UseAppDomain { get; set; } /// <summary> /// Base folder location where the AppDomain /// is hosted. By default uses the same folder /// as the host application. /// /// Determines where binary dependencies are /// found for assembly references. /// </summary> public string BaseBinaryFolder { get; set; } /// <summary> /// List of referenced assemblies as string values. /// Must be in GAC or in the current folder of the host app/ /// base BinaryFolder /// </summary> public List<string> ReferencedAssemblies = new List<string>(); /// <summary> /// Name of the generated namespace for template classes /// </summary> public string GeneratedNamespace {get; set; } /// <summary> /// Any error messages /// </summary> public string ErrorMessage { get; set; } /// <summary> /// Cached instance of the Host. Required to keep the /// reference to the host alive for multiple uses. /// </summary> public RazorEngine<TBaseTemplateType> Engine; /// <summary> /// Cached instance of the Host Factory - so we can unload /// the host and its associated AppDomain. /// </summary> protected RazorEngineFactory<TBaseTemplateType> EngineFactory; /// <summary> /// Keep track of each compiled assembly /// and when it was compiled. /// /// Use a hash of the string to identify string /// changes. /// </summary> protected Dictionary<int, CompiledAssemblyItem> LoadedAssemblies = new Dictionary<int, CompiledAssemblyItem>(); /// <summary> /// Call to start the Host running. Follow by a calls to RenderTemplate to /// render individual templates. Call Stop when done. /// </summary> /// <returns>true or false - check ErrorMessage on false </returns> public virtual bool Start() { if (Engine == null) { if (UseAppDomain) Engine = RazorEngineFactory<TBaseTemplateType>.CreateRazorHostInAppDomain(); else Engine = RazorEngineFactory<TBaseTemplateType>.CreateRazorHost(); Engine.Configuration.CompileToMemory = true; Engine.HostContainer = this; if (Engine == null) { this.ErrorMessage = EngineFactory.ErrorMessage; return false; } } return true; } /// <summary> /// Stops the Host and releases the host AppDomain and cached /// assemblies. /// </summary> /// <returns>true or false</returns> public bool Stop() { this.LoadedAssemblies.Clear(); RazorEngineFactory<RazorTemplateBase>.UnloadRazorHostInAppDomain(); this.Engine = null; return true; } … } This base class provides most of the mechanics to host the runtime, but no application specific implementation for rendering. There are rendering functions but they just call the engine directly and provide no caching – there’s no context to decide how to cache and reuse templates. The key methods are Start and Stop and their main purpose is to start a new AppDomain (optionally) and shut it down when requested. The RazorFolderHostContainer – Folder Based Runtime Hosting Let’s look at the more application specific RazorFolderHostContainer implementation which is defined like this: public class RazorFolderHostContainer : RazorBaseHostContainer<RazorTemplateFolderHost> Note that a customized RazorTemplateFolderHost class template is used for this implementation that supports partial rendering in form of a RenderPartial() method that’s available to templates. The folder host’s features are: Render templates based on a Template Base Path (a ‘virtual’ if you will) Cache compiled assemblies based on the relative path and file time stamp File changes on templates cause templates to be recompiled into new assemblies Support for partial rendering using base folder relative pathing As shown in the startup examples earlier host containers require some startup code with a HostContainer tied to a persistent property (like a Form property): // The base path for templates - templates are rendered with relative paths // based on this path. HostContainer.TemplatePath = Path.Combine(Environment.CurrentDirectory, TemplateBaseFolder); // Default output rendering disk location HostContainer.RenderingOutputFile = Path.Combine(HostContainer.TemplatePath, "__Preview.htm"); // Add any assemblies you want reference in your templates HostContainer.ReferencedAssemblies.Add("System.Windows.Forms.dll"); // Start up the host container HostContainer.Start(); Once that’s done, you can render templates with the host container: // Pass the template path for full filename seleted with OpenFile Dialog // relativepath is: subdir\file.cshtml or file.cshtml or ..\file.cshtml var relativePath = Utilities.GetRelativePath(fileName, HostContainer.TemplatePath); if (!HostContainer.RenderTemplate(relativePath, Context, HostContainer.RenderingOutputFile)) { MessageBox.Show("Error: " + HostContainer.ErrorMessage); return; } webBrowser1.Navigate("file://" + HostContainer.RenderingOutputFile); The most critical task of the RazorFolderHostContainer implementation is to retrieve a template from disk, compile and cache it and then deal with deciding whether subsequent requests need to re-compile the template or simply use a cached version. Internally the GetAssemblyFromFileAndCache() handles this task: /// <summary> /// Internally checks if a cached assembly exists and if it does uses it /// else creates and compiles one. Returns an assembly Id to be /// used with the LoadedAssembly list. /// </summary> /// <param name="relativePath"></param> /// <param name="context"></param> /// <returns></returns> protected virtual CompiledAssemblyItem GetAssemblyFromFileAndCache(string relativePath) { string fileName = Path.Combine(TemplatePath, relativePath).ToLower(); int fileNameHash = fileName.GetHashCode(); if (!File.Exists(fileName)) { this.SetError(Resources.TemplateFileDoesnTExist + fileName); return null; } CompiledAssemblyItem item = null; this.LoadedAssemblies.TryGetValue(fileNameHash, out item); string assemblyId = null; // Check for cached instance if (item != null) { var fileTime = File.GetLastWriteTimeUtc(fileName); if (fileTime <= item.CompileTimeUtc) assemblyId = item.AssemblyId; } else item = new CompiledAssemblyItem(); // No cached instance - create assembly and cache if (assemblyId == null) { string safeClassName = GetSafeClassName(fileName); StreamReader reader = null; try { reader = new StreamReader(fileName, true); } catch (Exception ex) { this.SetError(Resources.ErrorReadingTemplateFile + fileName); return null; } assemblyId = Engine.ParseAndCompileTemplate(this.ReferencedAssemblies.ToArray(), reader); // need to ensure reader is closed if (reader != null) reader.Close(); if (assemblyId == null) { this.SetError(Engine.ErrorMessage); return null; } item.AssemblyId = assemblyId; item.CompileTimeUtc = DateTime.UtcNow; item.FileName = fileName; item.SafeClassName = safeClassName; this.LoadedAssemblies[fileNameHash] = item; } return item; } This code uses a LoadedAssembly dictionary which is comprised of a structure that holds a reference to a compiled assembly, a full filename and file timestamp and an assembly id. LoadedAssemblies (defined on the base class shown earlier) is essentially a cache for compiled assemblies and they are identified by a hash id. In the case of files the hash is a GetHashCode() from the full filename of the template. The template is checked for in the cache and if not found the file stamp is checked. If that’s newer than the cache’s compilation date the template is recompiled otherwise the version in the cache is used. All the core work defers to a RazorEngine<T> instance to ParseAndCompileTemplate(). The three rendering specific methods then are rather simple implementations with just a few lines of code dealing with parameter and return value parsing: /// <summary> /// Renders a template to a TextWriter. Useful to write output into a stream or /// the Response object. Used for partial rendering. /// </summary> /// <param name="relativePath">Relative path to the file in the folder structure</param> /// <param name="context">Optional context object or null</param> /// <param name="writer">The textwriter to write output into</param> /// <returns></returns> public bool RenderTemplate(string relativePath, object context, TextWriter writer) { // Set configuration data that is to be passed to the template (any object) Engine.TemplatePerRequestConfigurationData = new RazorFolderHostTemplateConfiguration() { TemplatePath = Path.Combine(this.TemplatePath, relativePath), TemplateRelativePath = relativePath, }; CompiledAssemblyItem item = GetAssemblyFromFileAndCache(relativePath); if (item == null) { writer.Close(); return false; } try { // String result will be empty as output will be rendered into the // Response object's stream output. However a null result denotes // an error string result = Engine.RenderTemplateFromAssembly(item.AssemblyId, context, writer); if (result == null) { this.SetError(Engine.ErrorMessage); return false; } } catch (Exception ex) { this.SetError(ex.Message); return false; } finally { writer.Close(); } return true; } /// <summary> /// Render a template from a source file on disk to a specified outputfile. /// </summary> /// <param name="relativePath">Relative path off the template root folder. Format: path/filename.cshtml</param> /// <param name="context">Any object that will be available in the template as a dynamic of this.Context</param> /// <param name="outputFile">Optional - output file where output is written to. If not specified the /// RenderingOutputFile property is used instead /// </param> /// <returns>true if rendering succeeds, false on failure - check ErrorMessage</returns> public bool RenderTemplate(string relativePath, object context, string outputFile) { if (outputFile == null) outputFile = RenderingOutputFile; try { using (StreamWriter writer = new StreamWriter(outputFile, false, Engine.Configuration.OutputEncoding, Engine.Configuration.StreamBufferSize)) { return RenderTemplate(relativePath, context, writer); } } catch (Exception ex) { this.SetError(ex.Message); return false; } return true; } /// <summary> /// Renders a template to string. Useful for RenderTemplate /// </summary> /// <param name="relativePath"></param> /// <param name="context"></param> /// <returns></returns> public string RenderTemplateToString(string relativePath, object context) { string result = string.Empty; try { using (StringWriter writer = new StringWriter()) { // String result will be empty as output will be rendered into the // Response object's stream output. However a null result denotes // an error if (!RenderTemplate(relativePath, context, writer)) { this.SetError(Engine.ErrorMessage); return null; } result = writer.ToString(); } } catch (Exception ex) { this.SetError(ex.Message); return null; } return result; } The idea is that you can create custom host container implementations that do exactly what you want fairly easily. Take a look at both the RazorFolderHostContainer and RazorStringHostContainer classes for the basic concepts you can use to create custom implementations. Notice also that you can set the engine’s PerRequestConfigurationData() from the host container: // Set configuration data that is to be passed to the template (any object) Engine.TemplatePerRequestConfigurationData = new RazorFolderHostTemplateConfiguration() { TemplatePath = Path.Combine(this.TemplatePath, relativePath), TemplateRelativePath = relativePath, }; which when set to a non-null value is passed to the Template’s InitializeTemplate() method. This method receives an object parameter which you can cast as needed: public override void InitializeTemplate(object configurationData) { // Pick up configuration data and stuff into Request object RazorFolderHostTemplateConfiguration config = configurationData as RazorFolderHostTemplateConfiguration; this.Request.TemplatePath = config.TemplatePath; this.Request.TemplateRelativePath = config.TemplateRelativePath; } With this data you can then configure any custom properties or objects on your main template class. It’s an easy way to pass data from the HostContainer all the way down into the template. The type you use is of type object so you have to cast it yourself, and it must be serializable since it will likely run in a separate AppDomain. This might seem like an ugly way to pass data around – normally I’d use an event delegate to call back from the engine to the host, but since this is running over AppDomain boundaries events get really tricky and passing a template instance back up into the host over AppDomain boundaries doesn’t work due to serialization issues. So it’s easier to pass the data from the host down into the template using this rather clumsy approach of set and forward. It’s ugly, but it’s something that can be hidden in the host container implementation as I’ve done here. It’s also not something you have to do in every implementation so this is kind of an edge case, but I know I’ll need to pass a bunch of data in some of my applications and this will be the easiest way to do so. Summing Up Hosting the Razor runtime is something I got jazzed up about quite a bit because I have an immediate need for this type of templating/merging/scripting capability in an application I’m working on. I’ve also been using templating in many apps and it’s always been a pain to deal with. The Razor engine makes this whole experience a lot cleaner and more light weight and with these wrappers I can now plug .NET based templating into my code literally with a few lines of code. That’s something to cheer about… I hope some of you will find this useful as well… Resources The examples and code require that you download the Razor runtimes. Projects are for Visual Studio 2010 running on .NET 4.0 Platform Installer 3.0 (install WebMatrix or MVC 3 for Razor Runtimes) Latest Code in Subversion Repository Download Snapshot of the Code Documentation (CHM Help File) © Rick Strahl, West Wind Technologies, 2005-2010Posted in ASP.NET  .NET  

    Read the article

  • Twitter Bootstrap styling conflicts with plug-ins like jqGrid and other third part libraries

    - by Renso
    Issues:The concern is that the Twitter Bootstrap framework is that some of their css selectors are simply too generic and have incompatibility issues and conflicts with most third party plug-ins and css libraries, like jQuery-UI and jqGrid.My most pressing concern is only with the generic selector for the styling of "INPUT" controls.Some concerns:So basically anyone using BS (Bootstrap) will have to override styling 100% of the time on all input controls on all their web pages for all the plug-ins they use that render their own styling for input controls. This seems to chisel away any reason for using Bootstrap. Overriding Bootstrap css in this case seems illogical at best as it implies the BS styling is not correct or as granular as it is supposed to be. It also suggests you realize there is an issue here. Any person who has written a fair amount of css will realize that it is a mammoth task to to take an existing app, converting it to BS and then having to find all non-BS input controls and styling them all. The worst part is that there is no generic styling for this as each input control has a different source/context, some are regular tags and some belong to plug-ins, each with their own flavor of styling. For new web apps the challenge is not that different, each time you add a new plug-in you will have to test all facets of it, and I mean all of it, pop-ups, etc, that contain any kind of input control to make sure it is styled correctly. I am having a hard time seeing the benefits of BS in this context. So until the BS team addresses the issue, or not, you may be wondering what is the easiest solution.Help the community to drive this issue home by creating a new issue on github, see my entry here: https://github.com/twitter/bootstrap/issues/4008. As you can see I got some good and some negative feedback, but we all agree it is an issue. I do believe my solution below should be reverse compatible if the proper class declarations were followed as recommended by Bootstrap.The solution:Add a higher-level qualifier to the input selector, which may not break anything.  Add "control-group" and "controls" classes as higher-level selectors, as they have to be declared inside those classes anyway as far as I understand the design approach of BS. So in my example below can modify the css without possible breaking anything, see the css at the bottom. I tested this briefly and seems to render just as expected. May not be complete as I only spent a few minutes on the css. Your feedback will be greatly appreciated. <div class="control-group">    <label title="" for="Contact_FirstName" class="control-label">First Name</label>    <div class="controls">        <input type="text" value="" name="Contact.FirstName" id="Contact_FirstName" data-val-required="The Reader Contact&amp;#39;s First Name is required" data-val-length-min="2" data-val-length-max="250" data-val-length="The maximum length allowed for the Reader Contact&amp;#39;s First Name is 250 characters and must be two or more characters long" data-val="true" class="input-medium">        <span data-valmsg-replace="true" data-valmsg-for="Contact.FirstName" class="field-validation-valid"></span>    </div></div>Here are the SCSS (SASS) updates. In stead of just including the updates I decided to include the entire bootstrap SCSS file so you can just copy-and-paste it in stead of trying to figure out what selectors have changed./*! * Bootstrap v2.0.4 * Enhacement by Renso Hollhumer * Copyright 2012 Twitter, Inc * Licensed under the Apache License v2.0 * http://www.apache.org/licenses/LICENSE-2.0 * * Designed and built with all the love in the world @twitter by @mdo and @fat. * Enhancement by Renso Hollhumer: To isolate styling of INPUT tags to the Bootstrap context only */.clearfix {  *zoom: 1;}.clearfix:before,.clearfix:after {  display: table;  content: "";}.clearfix:after {  clear: both;}.hide-text {  font: 0/0 a;  color: transparent;  text-shadow: none;  background-color: transparent;  border: 0;}.input-block-level {  display: block;  width: 100%;  min-height: 28px;  -webkit-box-sizing: border-box;  -moz-box-sizing: border-box;  -ms-box-sizing: border-box;  box-sizing: border-box;}article,aside,details,figcaption,figure,footer,header,hgroup,nav,section {  display: block;}audio,canvas,video {  display: inline-block;  *display: inline;  *zoom: 1;}audio:not([controls]) {  display: none;}html {  font-size: 100%;  -webkit-text-size-adjust: 100%;  -ms-text-size-adjust: 100%;}a:focus {  outline: thin dotted #333;  outline: 5px auto -webkit-focus-ring-color;  outline-offset: -2px;}a:hover,a:active {  outline: 0;}sub,sup {  position: relative;  font-size: 75%;  line-height: 0;  vertical-align: baseline;}sup {  top: -0.5em;}sub {  bottom: -0.25em;}img {  max-width: 100%;  vertical-align: middle;  border: 0;  -ms-interpolation-mode: bicubic;}#map_canvas img {  max-width: none;}button,input,select,textarea {  margin: 0;  font-size: 100%;  vertical-align: middle;}button,input {  *overflow: visible;  line-height: normal;}button::-moz-focus-inner,input::-moz-focus-inner {  padding: 0;  border: 0;}button,input[type="button"],input[type="reset"],input[type="submit"] {  cursor: pointer;  -webkit-appearance: button;}input[type="search"] {  -webkit-box-sizing: content-box;  -moz-box-sizing: content-box;  box-sizing: content-box;  -webkit-appearance: textfield;}input[type="search"]::-webkit-search-decoration,input[type="search"]::-webkit-search-cancel-button {  -webkit-appearance: none;}textarea {  overflow: auto;  vertical-align: top;}body {  margin: 0;  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;  font-size: 13px;  line-height: 18px;  color: #333333;  background-color: #ffffff;}a {  color: #0088cc;  text-decoration: none;}a:hover {  color: #005580;  text-decoration: underline;}.row {  margin-left: -20px;  *zoom: 1;}.row:before,.row:after {  display: table;  content: "";}.row:after {  clear: both;}[class*="span"] {  float: left;  margin-left: 20px;}.container,.navbar-fixed-top .container,.navbar-fixed-bottom .container {  width: 940px;}.span12 {  width: 940px;}.span11 {  width: 860px;}.span10 {  width: 780px;}.span9 {  width: 700px;}.span8 {  width: 620px;}.span7 {  width: 540px;}.span6 {  width: 460px;}.span5 {  width: 380px;}.span4 {  width: 300px;}.span3 {  width: 220px;}.span2 {  width: 140px;}.span1 {  width: 60px;}.offset12 {  margin-left: 980px;}.offset11 {  margin-left: 900px;}.offset10 {  margin-left: 820px;}.offset9 {  margin-left: 740px;}.offset8 {  margin-left: 660px;}.offset7 {  margin-left: 580px;}.offset6 {  margin-left: 500px;}.offset5 {  margin-left: 420px;}.offset4 {  margin-left: 340px;}.offset3 {  margin-left: 260px;}.offset2 {  margin-left: 180px;}.offset1 {  margin-left: 100px;}.row-fluid {  width: 100%;  *zoom: 1;}.row-fluid:before,.row-fluid:after {  display: table;  content: "";}.row-fluid:after {  clear: both;}.row-fluid [class*="span"] {  display: block;  width: 100%;  min-height: 28px;  -webkit-box-sizing: border-box;  -moz-box-sizing: border-box;  -ms-box-sizing: border-box;  box-sizing: border-box;  float: left;  margin-left: 2.127659574%;  *margin-left: 2.0744680846382977%;}.row-fluid [class*="span"]:first-child {  margin-left: 0;}.row-fluid .span12 {  width: 99.99999998999999%;  *width: 99.94680850063828%;}.row-fluid .span11 {  width: 91.489361693%;  *width: 91.4361702036383%;}.row-fluid .span10 {  width: 82.97872339599999%;  *width: 82.92553190663828%;}.row-fluid .span9 {  width: 74.468085099%;  *width: 74.4148936096383%;}.row-fluid .span8 {  width: 65.95744680199999%;  *width: 65.90425531263828%;}.row-fluid .span7 {  width: 57.446808505%;  *width: 57.3936170156383%;}.row-fluid .span6 {  width: 48.93617020799999%;  *width: 48.88297871863829%;}.row-fluid .span5 {  width: 40.425531911%;  *width: 40.3723404216383%;}.row-fluid .span4 {  width: 31.914893614%;  *width: 31.8617021246383%;}.row-fluid .span3 {  width: 23.404255317%;  *width: 23.3510638276383%;}.row-fluid .span2 {  width: 14.89361702%;  *width: 14.8404255306383%;}.row-fluid .span1 {  width: 6.382978723%;  *width: 6.329787233638298%;}.container {  margin-right: auto;  margin-left: auto;  *zoom: 1;}.container:before,.container:after {  display: table;  content: "";}.container:after {  clear: both;}.container-fluid {  padding-right: 20px;  padding-left: 20px;  *zoom: 1;}.container-fluid:before,.container-fluid:after {  display: table;  content: "";}.container-fluid:after {  clear: both;}p {  margin: 0 0 9px;}p small {  font-size: 11px;  color: #999999;}.lead {  margin-bottom: 18px;  font-size: 20px;  font-weight: 200;  line-height: 27px;}h1,h2,h3,h4,h5,h6 {  margin: 0;  font-family: inherit;  font-weight: bold;  color: inherit;  text-rendering: optimizelegibility;}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small {  font-weight: normal;  color: #999999;}h1 {  font-size: 30px;  line-height: 36px;}h1 small {  font-size: 18px;}h2 {  font-size: 24px;  line-height: 36px;}h2 small {  font-size: 18px;}h3 {  font-size: 18px;  line-height: 27px;}h3 small {  font-size: 14px;}h4,h5,h6 {  line-height: 18px;}h4 {  font-size: 14px;}h4 small {  font-size: 12px;}h5 {  font-size: 12px;}h6 {  font-size: 11px;  color: #999999;  text-transform: uppercase;}.page-header {  padding-bottom: 17px;  margin: 18px 0;  border-bottom: 1px solid #eeeeee;}.page-header h1 {  line-height: 1;}ul,ol {  padding: 0;  margin: 0 0 9px 25px;}ul ul,ul ol,ol ol,ol ul {  margin-bottom: 0;}ul {  list-style: disc;}ol {  list-style: decimal;}li {  line-height: 18px;}ul.unstyled,ol.unstyled {  margin-left: 0;  list-style: none;}dl {  margin-bottom: 18px;}dt,dd {  line-height: 18px;}dt {  font-weight: bold;  line-height: 17px;}dd {  margin-left: 9px;}.dl-horizontal dt {  float: left;  width: 120px;  clear: left;  text-align: right;  overflow: hidden;  text-overflow: ellipsis;  white-space: nowrap;}.dl-horizontal dd {  margin-left: 130px;}hr {  margin: 18px 0;  border: 0;  border-top: 1px solid #eeeeee;  border-bottom: 1px solid #ffffff;}strong {  font-weight: bold;}em {  font-style: italic;}.muted {  color: #999999;}abbr[title] {  cursor: help;  border-bottom: 1px dotted #999999;}abbr.initialism {  font-size: 90%;  text-transform: uppercase;}blockquote {  padding: 0 0 0 15px;  margin: 0 0 18px;  border-left: 5px solid #eeeeee;}blockquote p {  margin-bottom: 0;  font-size: 16px;  font-weight: 300;  line-height: 22.5px;}blockquote small {  display: block;  line-height: 18px;  color: #999999;}blockquote small:before {  content: '\2014 \00A0';}blockquote.pull-right {  float: right;  padding-right: 15px;  padding-left: 0;  border-right: 5px solid #eeeeee;  border-left: 0;}blockquote.pull-right p,blockquote.pull-right small {  text-align: right;}q:before,q:after,blockquote:before,blockquote:after {  content: "";}address {  display: block;  margin-bottom: 18px;  font-style: normal;  line-height: 18px;}small {  font-size: 100%;}cite {  font-style: normal;}code,pre {  padding: 0 3px 2px;  font-family: Menlo, Monaco, Consolas, "Courier New", monospace;  font-size: 12px;  color: #333333;  -webkit-border-radius: 3px;  -moz-border-radius: 3px;  border-radius: 3px;}code {  padding: 2px 4px;  color: #d14;  background-color: #f7f7f9;  border: 1px solid #e1e1e8;}pre {  display: block;  padding: 8.5px;  margin: 0 0 9px;  font-size: 12.025px;  line-height: 18px;  word-break: break-all;  word-wrap: break-word;  white-space: pre;  white-space: pre-wrap;  background-color: #f5f5f5;  border: 1px solid #ccc;  border: 1px solid rgba(0, 0, 0, 0.15);  -webkit-border-radius: 4px;  -moz-border-radius: 4px;  border-radius: 4px;}pre.prettyprint {  margin-bottom: 18px;}pre code {  padding: 0;  color: inherit;  background-color: transparent;  border: 0;}.pre-scrollable {  max-height: 340px;  overflow-y: scroll;}.label,.badge {  font-size: 10.998px;  font-weight: bold;  line-height: 14px;  color: #ffffff;  vertical-align: baseline;  white-space: nowrap;  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);  background-color: #999999;}.label {  padding: 1px 4px 2px;  -webkit-border-radius: 3px;  -moz-border-radius: 3px;  border-radius: 3px;}.badge {  padding: 1px 9px 2px;  -webkit-border-radius: 9px;  -moz-border-radius: 9px;  border-radius: 9px;}a.label:hover,a.badge:hover {  color: #ffffff;  text-decoration: none;  cursor: pointer;}.label-important,.badge-important {  background-color: #b94a48;}.label-important[href],.badge-important[href] {  background-color: #953b39;}.label-warning,.badge-warning {  background-color: #f89406;}.label-warning[href],.badge-warning[href] {  background-color: #c67605;}.label-success,.badge-success {  background-color: #468847;}.label-success[href],.badge-success[href] {  background-color: #356635;}.label-info,.badge-info {  background-color: #3a87ad;}.label-info[href],.badge-info[href] {  background-color: #2d6987;}.label-inverse,.badge-inverse {  background-color: #333333;}.label-inverse[href],.badge-inverse[href] {  background-color: #1a1a1a;}table {  max-width: 100%;  background-color: transparent;  border-collapse: collapse;  border-spacing: 0;}.table {  width: 100%;  margin-bottom: 18px;}.table th,.table td {  padding: 8px;  line-height: 18px;  text-align: left;  vertical-align: top;  border-top: 1px solid #dddddd;}.table th {  font-weight: bold;}.table thead th {  vertical-align: bottom;}.table caption + thead tr:first-child th,.table caption + thead tr:first-child td,.table colgroup + thead tr:first-child th,.table colgroup + thead tr:first-child td,.table thead:first-child tr:first-child th,.table thead:first-child tr:first-child td {  border-top: 0;}.table tbody + tbody {  border-top: 2px solid #dddddd;}.table-condensed th,.table-condensed td {  padding: 4px 5px;}.table-bordered {  border: 1px solid #dddddd;  border-collapse: separate;  *border-collapse: collapsed;  border-left: 0;  -webkit-border-radius: 4px;  -moz-border-radius: 4px;  border-radius: 4px;}.table-bordered th,.table-bordered td {  border-left: 1px solid #dddddd;}.table-bordered caption + thead tr:first-child th,.table-bordered caption + tbody tr:first-child th,.table-bordered caption + tbody tr:first-child td,.table-bordered colgroup + thead tr:first-child th,.table-bordered colgroup + tbody tr:first-child th,.table-bordered colgroup + tbody tr:first-child td,.table-bordered thead:first-child tr:first-child th,.table-bordered tbody:first-child tr:first-child th,.table-bordered tbody:first-child tr:first-child td {  border-top: 0;}.table-bordered thead:first-child tr:first-child th:first-child,.table-bordered tbody:first-child tr:first-child td:first-child {  -webkit-border-top-left-radius: 4px;  border-top-left-radius: 4px;  -moz-border-radius-topleft: 4px;}.table-bordered thead:first-child tr:first-child th:last-child,.table-bordered tbody:first-child tr:first-child td:last-child {  -webkit-border-top-right-radius: 4px;  border-top-right-radius: 4px;  -moz-border-radius-topright: 4px;}.table-bordered thead:last-child tr:last-child th:first-child,.table-bordered tbody:last-child tr:last-child td:first-child {  -webkit-border-radius: 0 0 0 4px;  -moz-border-radius: 0 0 0 4px;  border-radius: 0 0 0 4px;  -webkit-border-bottom-left-radius: 4px;  border-bottom-left-radius: 4px;  -moz-border-radius-bottomleft: 4px;}.table-bordered thead:last-child tr:last-child th:last-child,.table-bordered tbody:last-child tr:last-child td:last-child {  -webkit-border-bottom-right-radius: 4px;  border-bottom-right-radius: 4px;  -moz-border-radius-bottomright: 4px;}.table-striped tbody tr:nth-child(odd) td,.table-striped tbody tr:nth-child(odd) th {  background-color: #f9f9f9;}.table tbody tr:hover td,.table tbody tr:hover th {  background-color: #f5f5f5;}table .span1 {  float: none;  width: 44px;  margin-left: 0;}table .span2 {  float: none;  width: 124px;  margin-left: 0;}table .span3 {  float: none;  width: 204px;  margin-left: 0;}table .span4 {  float: none;  width: 284px;  margin-left: 0;}table .span5 {  float: none;  width: 364px;  margin-left: 0;}table .span6 {  float: none;  width: 444px;  margin-left: 0;}table .span7 {  float: none;  width: 524px;  margin-left: 0;}table .span8 {  float: none;  width: 604px;  margin-left: 0;}table .span9 {  float: none;  width: 684px;  margin-left: 0;}table .span10 {  float: none;  width: 764px;  margin-left: 0;}table .span11 {  float: none;  width: 844px;  margin-left: 0;}table .span12 {  float: none;  width: 924px;  margin-left: 0;}table .span13 {  float: none;  width: 1004px;  margin-left: 0;}table .span14 {  float: none;  width: 1084px;  margin-left: 0;}table .span15 {  float: none;  width: 1164px;  margin-left: 0;}table .span16 {  float: none;  width: 1244px;  margin-left: 0;}table .span17 {  float: none;  width: 1324px;  margin-left: 0;}table .span18 {  float: none;  width: 1404px;  margin-left: 0;}table .span19 {  float: none;  width: 1484px;  margin-left: 0;}table .span20 {  float: none;  width: 1564px;  margin-left: 0;}table .span21 {  float: none;  width: 1644px;  margin-left: 0;}table .span22 {  float: none;  width: 1724px;  margin-left: 0;}table .span23 {  float: none;  width: 1804px;  margin-left: 0;}table .span24 {  float: none;  width: 1884px;  margin-left: 0;}form {  margin: 0 0 18px;}fieldset {  padding: 0;  margin: 0;  border: 0;}legend {  display: block;  width: 100%;  padding: 0;  margin-bottom: 27px;  font-size: 19.5px;  line-height: 36px;  color: #333333;  border: 0;  border-bottom: 1px solid #e5e5e5;}legend small {  font-size: 13.5px;  color: #999999;}.control-group .controls {    label,    input,    button,    select,    textarea {      font-size: 13px;      font-weight: normal;      line-height: 18px;    }}.control-group .controls {    input,    button,    select,    textarea {      font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;    }}label {  display: block;  margin-bottom: 5px;}.control-group .controls {    select,    textarea,    input[type="text"],    input[type="password"],    input[type="datetime"],    input[type="datetime-local"],    input[type="date"],    input[type="month"],    input[type="time"],    input[type="week"],    input[type="number"],    input[type="email"],    input[type="url"],    input[type="search"],    input[type="tel"],    input[type="color"],    .uneditable-input {      display: inline-block;      height: 18px;      padding: 4px;      margin-bottom: 9px;      font-size: 13px;      line-height: 18px;      color: #555555;    }}.control-group .controls {    input,    textarea {      width: 210px;    }}.control-group .controls {    textarea {      height: auto;    }}.control-group .controls {    textarea,    input[type="text"],    input[type="password"],    input[type="datetime"],    input[type="datetime-local"],    input[type="date"],    input[type="month"],    input[type="time"],    input[type="week"],    input[type="number"],    input[type="email"],    input[type="url"],    input[type="search"],    input[type="tel"],    input[type="color"],    .uneditable-input {      background-color: #ffffff;      border: 1px solid #cccccc;      -webkit-border-radius: 3px;      -moz-border-radius: 3px;      border-radius: 3px;      -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);      -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);      box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);      -webkit-transition: border linear 0.2s, box-shadow linear 0.2s;      -moz-transition: border linear 0.2s, box-shadow linear 0.2s;      -ms-transition: border linear 0.2s, box-shadow linear 0.2s;      -o-transition: border linear 0.2s, box-shadow linear 0.2s;      transition: border linear 0.2s, box-shadow linear 0.2s;    }}.control-group .controls {    textarea:focus,    input[type="text"]:focus,    input[type="password"]:focus,    input[type="datetime"]:focus,    input[type="datetime-local"]:focus,    input[type="date"]:focus,    input[type="month"]:focus,    input[type="time"]:focus,    input[type="week"]:focus,    input[type="number"]:focus,    input[type="email"]:focus,    input[type="url"]:focus,    input[type="search"]:focus,    input[type="tel"]:focus,    input[type="color"]:focus,    .uneditable-input:focus {      border-color: rgba(82, 168, 236, 0.8);      outline: 0;      outline: thin dotted \9;      /* IE6-9 */      -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6);      -moz-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6);      box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6);    }}.control-group .controls {    input[type="radio"],    input[type="checkbox"] {      margin: 3px 0;      *margin-top: 0;      /* IE7 */      line-height: normal;      cursor: pointer;    }}.control-group .controls {    input[type="submit"],    input[type="reset"],    input[type="button"],    input[type="radio"],    input[type="checkbox"] {      width: auto;    }}.uneditable-textarea {  width: auto;  height: auto;}.control-group .controls {    select,    input[type="file"] {      height: 28px;      /* In IE7, the height of the select element cannot be changed by height, only font-size */      *margin-top: 4px;      /* For IE7, add top margin to align select with labels */      line-height: 28px;    }}.control-group .controls {    select {      width: 220px;      border: 1px solid #bbb;    }}.control-group .controls {    select[multiple],    select[size] {      height: auto;    }}.control-group .controls {    select:focus,    input[type="file"]:focus,    input[type="radio"]:focus,    input[type="checkbox"]:focus {      outline: thin dotted #333;      outline: 5px auto -webkit-focus-ring-color;      outline-offset: -2px;    }}.radio,.checkbox {  min-height: 18px;  padding-left: 18px;}.radio input[type="radio"],.checkbox input[type="checkbox"] {  float: left;  margin-left: -18px;}.controls > .radio:first-child,.controls > .checkbox:first-child {  padding-top: 5px;}.radio.inline,.checkbox.inline {  display: inline-block;  padding-top: 5px;  margin-bottom: 0;  vertical-align: middle;}.radio.inline + .radio.inline,.checkbox.inline + .checkbox.inline {  margin-left: 10px;}.control-group .controls {    .input-mini {      width: 60px;    }}.control-group .controls {    .input-small {      width: 90px;    }}.control-group .controls {    .input-medium {      width: 150px;    }}.control-group .controls {    .input-large {      width: 210px;    }}.input-xlarge {    .input-xlarge {      width: 270px;    }}.input-xxlarge {    .input-xxlarge {      width: 530px;    }}.control-group .controls {    input[class*="span"],    select[class*="span"],    textarea[class*="span"],    .uneditable-input[class*="span"],    .row-fluid input[class*="span"],    .row-fluid select[class*="span"],    .row-fluid textarea[class*="span"],    .row-fluid .uneditable-input[class*="span"] {      float: none;      margin-left: 0;    }}.input-append input[class*="span"],.input-append .uneditable-input[class*="span"],.input-prepend input[class*="span"],.input-prepend .uneditable-input[class*="span"],.row-fluid .input-prepend [class*="span"],.row-fluid .input-append [class*="span"] {  display: inline-block;}.control-group .controls {    input,    textarea,    .uneditable-input {      margin-left: 0;    }}input.span12, textarea.span12, .uneditable-input.span12 {  width: 930px;}input.span11, textarea.span11, .uneditable-input.span11 {  width: 850px;}input.span10, textarea.span10, .uneditable-input.span10 {  width: 770px;}input.span9, textarea.span9, .uneditable-input.span9 {  width: 690px;}input.span8, textarea.span8, .uneditable-input.span8 {  width: 610px;}input.span7, textarea.span7, .uneditable-input.span7 {  width: 530px;}input.span6, textarea.span6, .uneditable-input.span6 {  width: 450px;}input.span5, textarea.span5, .uneditable-input.span5 {  width: 370px;}input.span4, textarea.span4, .uneditable-input.span4 {  width: 290px;}input.span3, textarea.span3, .uneditable-input.span3 {  width: 210px;}input.span2, textarea.span2, .uneditable-input.span2 {  width: 130px;}input.span1, textarea.span1, .uneditable-input.span1 {  width: 50px;}input[disabled],select[disabled],textarea[disabled],input[readonly],select[readonly],textarea[readonly] {  cursor: not-allowed;  background-color: #eeeeee;  border-color: #ddd;}input[type="radio"][disabled],input[type="checkbox"][disabled],input[type="radio"][readonly],input[type="checkbox"][readonly] {  background-color: transparent;}.control-group.warning > label,.control-group.warning .help-block,.control-group.warning .help-inline {  color: #c09853;}.control-group.warning .checkbox,.control-group.warning .radio,.control-group.warning input,.control-group.warning select,.control-group.warning textarea {  color: #c09853;  border-color: #c09853;}.control-group.warning .checkbox:focus,.control-group.warning .radio:focus,.control-group.warning input:focus,.control-group.warning select:focus,.control-group.warning textarea:focus {  border-color: #a47e3c;  -webkit-box-shadow: 0 0 6px #dbc59e;  -moz-box-shadow: 0 0 6px #dbc59e;  box-shadow: 0 0 6px #dbc59e;}.control-group.warning .input-prepend .add-on,.control-group.warning .input-append .add-on {  color: #c09853;  background-color: #fcf8e3;  border-color: #c09853;}.control-group.error > label,.control-group.error .help-block,.control-group.error .help-inline {  color: #b94a48;}.control-group.error .checkbox,.control-group.error .radio,.control-group.error input,.control-group.error select,.control-group.error textarea {  color: #b94a48;  border-color: #b94a48;}.control-group.error .checkbox:focus,.control-group.error .radio:focus,.control-group.error input:focus,.control-group.error select:focus,.control-group.error textarea:focus {  border-color: #953b39;  -webkit-box-shadow: 0 0 6px #d59392;  -moz-box-shadow: 0 0 6px #d59392;  box-shadow: 0 0 6px #d59392;}.control-group.error .input-prepend .add-on,.control-group.error .input-append .add-on {  color: #b94a48;  background-color: #f2dede;  border-color: #b94a48;}.control-group.success > label,.control-group.success .help-block,.control-group.success .help-inline {  color: #468847;}.control-group.success .checkbox,.control-group.success .radio,.control-group.success input,.control-group.success select,.control-group.success textarea {  color: #468847;  border-color: #468847;}.control-group.success .checkbox:focus,.control-group.success .radio:focus,.control-group.success input:focus,.control-group.success select:focus,.control-group.success textarea:focus {  border-color: #356635;  -webkit-box-shadow: 0 0 6px #7aba7b;  -moz-box-shadow: 0 0 6px #7aba7b;  box-shadow: 0 0 6px #7aba7b;}.control-group.success .input-prepend .add-on,.control-group.success .input-append .add-on {  color: #468847;  background-color: #dff0d8;  border-color: #468847;}input:focus:required:invalid,textarea:focus:required:invalid,select:focus:required:invalid {  color: #b94a48;  border-color: #ee5f5b;}input:focus:required:invalid:focus,textarea:focus:required:invalid:focus,select:focus:required:invalid:focus {  border-color: #e9322d;  -webkit-box-shadow: 0 0 6px #f8b9b7;  -moz-box-shadow: 0 0 6px #f8b9b7;  box-shadow: 0 0 6px #f8b9b7;}.form-actions {  padding: 17px 20px 18px;  margin-top: 18px;  margin-bottom: 18px;  background-color: #f5f5f5;  border-top: 1px solid #e5e5e5;  *zoom: 1;}.form-actions:before,.form-actions:after {  display: table;  content: "";}.form-actions:after {  clear: both;}.uneditable-input {  overflow: hidden;  white-space: nowrap;  cursor: not-allowed;  background-color: #ffffff;  border-color: #eee;  -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025);  -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025);  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025);}:-moz-placeholder {  color: #999999;}:-ms-input-placeholder {  color: #999999;}::-webkit-input-placeholder {  color: #999999;}.help-block,.help-inline {  color: #555555;}.help-block {  display: block;  margin-bottom: 9px;}.help-inline {  display: inline-block;  *display: inline;  /* IE7 inline-block hack */  *zoom: 1;  vertical-align: middle;  padding-left: 5px;}.input-prepend,.input-append {  margin-bottom: 5px;}.input-prepend input,.input-append input,.input-prepend select,.input-append select,.input-prepend .uneditable-input,.input-append .uneditable-input {  position: relative;  margin-bottom: 0;  *margin-left: 0;  vertical-align: middle;  -webkit-border-radius: 0 3px 3px 0;  -moz-border-radius: 0 3px 3px 0;  border-radius: 0 3px 3px 0;}.input-prepend input:focus,.input-append input:focus,.input-prepend select:focus,.input-append select:focus,.input-prepend .uneditable-input:focus,.input-append .uneditable-input:focus {  z-index: 2;}.input-prepend .uneditable-input,.input-append .uneditable-input {  border-left-color: #ccc;}.input-prepend .add-on,.input-append .add-on {  display: inline-block;  width: auto;  height: 18px;  min-width: 16px;  padding: 4px 5px;  font-weight: normal;  line-height: 18px;  text-align: center;  text-shadow: 0 1px 0 #ffffff;  vertical-align: middle;  background-color: #eeeeee;  border: 1px solid #ccc;}.input-prepend .add-on,.input-append .add-on,.input-prepend .btn,.input-append .btn {  margin-left: -1px;  -webkit-border-radius: 0;  -moz-border-radius: 0;  border-radius: 0;}.input-prepend .active,.input-append .active {  background-color: #a9dba9;  border-color: #46a546;}.input-prepend .add-on,.input-prepend .btn {  margin-right: -1px;}.input-prepend .add-on:first-child,.input-prepend .btn:first-child {  -webkit-border-radius: 3px 0 0 3px;  -moz-border-radius: 3px 0 0 3px;  border-radius: 3px 0 0 3px;}.input-append input,.input-append select,.input-append .uneditable-input {  -webkit-border-radius: 3px 0 0 3px;  -moz-border-radius: 3px 0 0 3px;  border-radius: 3px 0 0 3px;}.input-append .uneditable-input {  border-right-color: #ccc;  border-left-color: #eee;}.input-append .add-on:last-child,.input-append .btn:last-child {  -webkit-border-radius: 0 3px 3px 0;  -moz-border-radius: 0 3px 3px 0;  border-radius: 0 3px 3px 0;}.input-prepend.input-append input,.input-prepend.input-append select,.input-prepend.input-append .uneditable-input {  -webkit-border-radius: 0;  -moz-border-radius: 0;  border-radius: 0;}.input-prepend.input-append .add-on:first-child,.input-prepend.input-append .btn:first-child {  margin-right: -1px;  -webkit-border-radius: 3px 0 0 3px;  -moz-border-radius: 3px 0 0 3px;  border-radius: 3px 0 0 3px;}.input-prepend.input-append .add-on:last-child,.input-prepend.input-append .btn:last-child {  margin-left: -1px;  -webkit-border-radius: 0 3px 3px 0;  -moz-border-radius: 0 3px 3px 0;  border-radius: 0 3px 3px 0;}.search-query {  padding-right: 14px;  padding-right: 4px \9;  padding-left: 14px;  padding-left: 4px \9;  /* IE7-8 doesn't have border-radius, so don't indent the padding */  margin-bottom: 0;  -webkit-border-radius: 14px;  -moz-border-radius: 14px;  border-radius: 14px;}.form-search input,.form-inline input,.form-horizontal input,.form-search textarea,.form-inline textarea,.form-horizontal textarea,.form-search select,.form-inline select,.form-horizontal select,.form-search .help-inline,.form-inline .help-inline,.form-horizontal .help-inline,.form-search .uneditable-input,.form-inline .uneditable-input,.form-horizontal .uneditable-input,.form-search .input-prepend,.form-inline .input-prepend,.form-horizontal .input-prepend,.form-search .input-append,.form-inline .input-append,.form-horizontal .input-append {  display: inline-block;  *display: inline;  /* IE7 inline-block hack */  *zoom: 1;  margin-bottom: 0;}.form-search .hide,.form-inline .hide,.form-horizontal .hide {  display: none;}.form-search label,.form-inline label {  display: inline-block;}.form-search .input-append,.form-inline .input-append,.form-search .input-prepend,.form-inline .input-prepend {  margin-bottom: 0;}.form-search .radio,.form-search .checkbox,.form-inline .radio,.form-inline .checkbox {  padding-left: 0;  margin-bottom: 0;  vertical-align: middle;}.form-search .radio input[type="radio"],.form-search .checkbox input[type="checkbox"],.form-inline .radio input[type="radio"],.form-inline .checkbox input[type="checkbox"] {  float: left;  margin-right: 3px;  margin-left: 0;}.control-group {  margin-bottom: 9px;}legend + .control-group {  margin-top: 18px;  -webkit-margin-top-collapse: separate;}.form-horizontal .control-group {  margin-bottom: 18px;  *zoom: 1;}.form-horizontal .control-group:before,.form-horizontal .control-group:after {  display: table;  content: "";}.form-horizontal .control-group:after {  clear: both;}.form-horizontal .control-label {  float: left;  width: 140px;  padding-top: 5px;  text-align: right;}.form-horizontal .controls {  *display: inline-block;  *padding-left: 20px;  margin-left: 160px;  *margin-left: 0;}.form-horizontal .controls:first-child {  *padding-left: 160px;}.form-horizontal .help-block {  margin-top: 9px;  margin-bottom: 0;}.form-horizontal .form-actions {  padding-left: 160px;}.btn {  display: inline-block;  *display: inline;  /* IE7 inline-block hack */  *zoom: 1;  padding: 4px 10px 4px;  margin-bottom: 0;  font-size: 13px;  line-height: 18px;  *line-height: 20px;  color: #333333;  text-align: center;  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);  vertical-align: middle;  cursor: pointer;  background-color: #f5f5f5;  background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);  background-image: -ms-linear-gradient(top, #ffffff, #e6e6e6);  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6));  background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6);  background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);  background-image: linear-gradient(top, #ffffff, #e6e6e6);  background-repeat: repeat-x;  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#e6e6e6', GradientType=0);  border-color: #e6e6e6 #e6e6e6 #bfbfbf;  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);  *background-color: #e6e6e6;  /* Darken IE7 buttons by default so they stand out more given they won't have borders */  filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);  border: 1px solid #cccccc;  *border: 0;  border-bottom-color: #b3b3b3;  -webkit-border-radius: 4px;  -moz-border-radius: 4px;  border-radius: 4px;  *margin-left: .3em;  -webkit-box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05);  -moz-box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05);  box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05);}.btn:hover,.btn:active,.btn.active,.btn.disabled,.btn[disabled] {  background-color: #e6e6e6;  *background-color: #d9d9d9;}.btn:active,.btn.active {  background-color: #cccccc \9;}.btn:first-child {  *margin-left: 0;}.btn:hover {  color: #333333;  text-decoration: none;  background-color: #e6e6e6;  *background-color: #d9d9d9;  /* Buttons in IE7 don't get borders, so darken on hover */  background-position: 0 -15px;  -webkit-transition: background-position 0.1s linear;  -moz-transition: background-position 0.1s linear;  -ms-transition: background-position 0.1s linear;  -o-transition: background-position 0.1s linear;  transition: background-position 0.1s linear;}.btn:focus {  outline: thin dotted #333;  outline: 5px auto -webkit-focus-ring-color;  outline-offset: -2px;}.btn.active,.btn:active {  background-color: #e6e6e6;  background-color: #d9d9d9 \9;  background-image: none;  outline: 0;  -webkit-box-shadow: inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05);  -moz-box-shadow: inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05);  box-shadow: inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05);}.btn.disabled,.btn[disabled] {  cursor: default;  background-color: #e6e6e6;  background-image: none;  opacity: 0.65;  filter: alpha(opacity=65);  -webkit-box-shadow: none;  -moz-box-shadow: none;  box-shadow: none;}.btn-large {  padding: 9px 14px;  font-size: 15px;  line-height: normal;  -webkit-border-radius: 5px;  -moz-border-radius: 5px;  border-radius: 5px;}.btn-large [class^="icon-"] {  margin-top: 1px;}.btn-small {  padding: 5px 9px;  font-size: 11px;  line-height: 16px;}.btn-small [class^="icon-"] {  margin-top: -1px;}.btn-mini {  padding: 2px 6px;  font-size: 11px;  line-height: 14px;}.btn-primary,.btn-primary:hover,.btn-warning,.btn-warning:hover,.btn-danger,.btn-danger:hover,.btn-success,.btn-success:hover,.btn-info,.btn-info:hover,.btn-inverse,.btn-inverse:hover {  color: #ffffff;  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);}.btn-primary.active,.btn-warning.active,.btn-danger.active,.btn-success.active,.btn-info.active,.btn-inverse.active {  color: rgba(255, 255, 255, 0.75);}.btn {  border-color: #ccc;  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);}.btn-primary {  background-color: #0074cc;  background-image: -moz-linear-gradient(top, #0088cc, #0055cc);  background-image: -ms-linear-gradient(top, #0088cc, #0055cc);  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0055cc));  background-image: -webkit-linear-gradient(top, #0088cc, #0055cc);  background-image: -o-linear-gradient(top, #0088cc, #0055cc);  background-image: linear-gradient(top, #0088cc, #0055cc);  background-repeat: repeat-x;  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0088cc', endColorstr='#0055cc', GradientType=0);  border-color: #0055cc #0055cc #003580;  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);  *background-color: #0055cc;  /* Darken IE7 buttons by default so they stand out more given they won't have borders */  filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);}.btn-primary:hover,.btn-primary:active,.btn-primary.active,.btn-primary.disabled,.btn-primary[disabled] {  background-color: #0055cc;  *background-color: #004ab3;}.btn-primary:active,.btn-primary.active {  background-color: #004099 \9;}.btn-warning {  background-color: #faa732;  background-image: -moz-linear-gradient(top, #fbb450, #f89406);  background-image: -ms-linear-gradient(top, #fbb450, #f89406);  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fbb450), to(#f89406));  background-image: -webkit-linear-gradient(top, #fbb450, #f89406);  background-image: -o-linear-gradient(top, #fbb450, #f89406);  background-image: linear-gradient(top, #fbb450, #f89406);  background-repeat: repeat-x;  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fbb450', endColorstr='#f89406', GradientType=0);  border-color: #f89406 #f89406 #ad6704;  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);  *background-color: #f89406;  /* Darken IE7 buttons by default so they stand out more given they won't have borders */  filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);}.btn-warning:hover,.btn-warning:active,.btn-warning.active,.btn-warning.disabled,.btn-warning[disabled] {  background-color: #f89406;  *background-color: #df8505;}.btn-warning:active,.btn-warning.active {  background-color: #c67605 \9;}.btn-danger {  background-color: #da4f49;  background-image: -moz-linear-gradient(top, #ee5f5b, #bd362f);  background-image: -ms-linear-gradient(top, #ee5f5b, #bd362f);  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#bd362f));  background-image: -webkit-linear-gradient(top, #ee5f5b, #bd362f);  background-image: -o-linear-gradient(top, #ee5f5b, #bd362f);  background-image: linear-gradient(top, #ee5f5b, #bd362f);  background-repeat: repeat-x;  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ee5f5b', endColorstr='#bd362f', GradientType=0);  border-color: #bd362f #bd362f #802420;  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);  *background-color: #bd362f;  /* Darken IE7 buttons by default so they stand out more given they won't have borders */  filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);}.btn-danger:hover,.btn-danger:active,.btn-danger.active,.btn-danger.disabled,.btn-danger[disabled] {  background-color: #bd362f;  *background-color: #a9302a;}.btn-danger:active,.btn-danger.active {  background-color: #942a25 \9;}.btn-success {  background-color: #5bb75b;  background-image: -moz-linear-gradient(top, #62c462, #51a351);  background-image: -ms-linear-gradient(top, #62c462, #51a351);  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#62c462), to(#51a351));  background-image: -webkit-linear-gradient(top, #62c462, #51a351);  background-image: -o-linear-gradient(top, #62c462, #51a351);  background-image: linear-gradient(top, #62c462, #51a351);  background-repeat: repeat-x;  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#62c462', endColorstr='#51a351', GradientType=0);  border-color: #51a351 #51a351 #387038;  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);  *background-color: #51a351;  /* Darken IE7 buttons by default so they stand out more given they won't have borders */  filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);}.btn-success:hover,.btn-success:active,.btn-success.active,.btn-success.disabled,.btn-success[disabled] {  background-color: #51a351;  *background-color: #499249;}.btn-success:active,.btn-success.active {  background-color: #408140 \9;}.btn-info {  background-color: #49afcd;  background-image: -moz-linear-gradient(top, #5bc0de, #2f96b4);  background-image: -ms-linear-gradient(top, #5bc0de, #2f96b4);  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#5bc0de), to(#2f96b4));  background-image: -webkit-linear-gradient(top, #5bc0de, #2f96b4);  background-image: -o-linear-gradient(top, #5bc0de, #2f96b4);  background-image: linear-gradient(top, #5bc0de, #2f96b4);  background-repeat: repeat-x;  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#5bc0de', endColorstr='#2f96b4', GradientType=0);  border-color: #2f96b4 #2f96b4 #1f6377;  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);  *background-color: #2f96b4;  /* Darken IE7 buttons by default so they stand out more given they won't have borders */  filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);}.btn-info:hover,.btn-info:active,.btn-info.active,.btn-info.disabled,.btn-info[disabled] {  background-color: #2f96b4;  *background-color: #2a85a0;}.btn-info:active,.btn-info.active {  background-color: #24748c \9;}.btn-inverse {  background-color: #414141;  background-image: -moz-linear-gradient(top, #555555, #222222);  background-image: -ms-linear-gradient(top, #555555, #222222);  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#555555), to(#222222));  background-image: -webkit-linear-gradient(top, #555555, #222222);  background-image: -o-linear-gradient(top, #555555, #222222);  background-image: linear-gradient(top, #555555, #222222);  background-repeat: repeat-x;  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#555555', endColorstr='#222222', GradientType=0);  border-color: #222222 #222222 #000000;  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);  *background-color: #222222;  /* Darken IE7 buttons by default so they stand out more given they won't have borders */  filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);}.btn-inverse:hover,.btn-inverse:active,.btn-inverse.active,.btn-inverse.disabled,.btn-inverse[disabled] {  background-color: #222222;  *background-color: #151515;}.btn-inverse:active,.btn-inverse.active {  background-color: #080808 \9;}button.btn,input[type="submit"].btn {  *padding-top: 2px;  *padding-bottom: 2px;}button.btn::-moz-focus-inner,input[type="submit"].btn::-moz-focus-inner {  padding: 0;  border: 0;}button.btn.btn-large,input[type="submit"].btn.btn-large {  *padding-top: 7px;  *padding-bottom: 7px;}button.btn.btn-small,input[type="submit"].btn.btn-small {  *padding-top: 3px;  *padding-bottom: 3px;}button.btn.btn-mini,input[type="submit"].btn.btn-mini {  *padding-top: 1px;  *padding-bottom: 1px;}.btn-group {  position: relative;  *zoom: 1;  *margin-left: .3em;}.btn-group:before,.btn-group:after {  display: table;  content: "";}.btn-group:after {  clear: both;}.btn-group:first-child {  *margin-left: 0;}.btn-group + .btn-group {  margin-left: 5px;}.btn-toolbar {  margin-top: 9px;  margin-bottom: 9px;}.btn-toolbar .btn-group {  display: inline-block;  *display: inline;  /* IE7 inline-block hack */  *zoom: 1;}.btn-group > .btn {  position: relative;  float: left;  margin-left: -1px;  -webkit-border-radius: 0;  -moz-border-radius: 0;  border-radius: 0;}.btn-group > .btn:first-child {  margin-left: 0;  -webkit-border-top-left-radius: 4px;  -moz-border-radius-topleft: 4px;  border-top-left-radius: 4px;  -webkit-border-bottom-left-radius: 4px;  -moz-border-radius-bottomleft: 4px;  border-bottom-left-radius: 4px;}.btn-group > .btn:last-child,.btn-group > .dropdown-toggle {  -webkit-border-top-right-radius: 4px;  -moz-border-radius-topright: 4px;  border-top-right-radius: 4px;  -webkit-border-bottom-right-radius: 4px;  -moz-border-radius-bottomright: 4px;  border-bottom-right-radius: 4px;}.btn-group > .btn.large:first-child {  margin-left: 0;  -webkit-border-top-left-radius: 6px;  -moz-border-radius-topleft: 6px;  border-top-left-radius: 6px;  -webkit-border-bottom-left-radius: 6px;  -moz-border-radius-bottomleft: 6px;  border-bottom-left-radius: 6px;}.btn-group > .btn.large:last-child,.btn-group > .large.dropdown-toggle {  -webkit-border-top-right-radius: 6px;  -moz-border-radius-topright: 6px;  border-top-right-radius: 6px;  -webkit-border-bottom-right-radius: 6px;  -moz-border-radius-bottomright: 6px;  border-bottom-right-radius: 6px;}.btn-group > .btn:hover,.btn-group > .btn:focus,.btn-group > .btn:active,.btn-group > .btn.active {  z-index: 2;}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle {  outline: 0;}.btn-group > .dropdown-toggle {  padding-left: 8px;  padding-right: 8px;  -webkit-box-shadow: inset 1px 0 0 rgba(255,255,255,.125), inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05);  -moz-box-shadow: inset 1px 0 0 rgba(255,255,255,.125), inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05);  box-shadow: inset 1px 0 0 rgba(255,255,255,.125), inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05);  *padding-top: 4px;  *padding-bottom: 4px;}.btn-group > .btn-mini.dropdown-toggle {  padding-left: 5px;  padding-right: 5px;}.btn-group > .btn-small.dropdown-toggle {  *padding-top: 4px;  *padding-bottom: 4px;}.btn-group > .btn-large.dropdown-toggle {  padding-left: 12px;  padding-right: 12px;}.btn-group.open .dropdown-toggle {  background-image: none;  -webkit-box-shadow: inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05);  -moz-box-shadow: inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05);  box-shadow: inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05);}.btn-group.open .btn.dropdown-toggle {  background-color: #e6e6e6;}.btn-group.open .btn-primary.dropdown-toggle {  background-color: #0055cc;}.btn-group.open .btn-warning.dropdown-toggle {  background-color: #f89406;}.btn-group.open .btn-danger.dropdown-toggle {  background-color: #bd362f;}.btn-group.open .btn-success.dropdown-toggle {  background-color: #51a351;}.btn-group.open .btn-info.dropdown-toggle {  background-color: #2f96b4;}.btn-group.open .btn-inverse.dropdown-toggle {  background-color: #222222;}.btn .caret {  margin-top: 7px;  margin-left: 0;}.btn:hover .caret,.open.btn-group .caret {  opacity: 1;  filter: alpha(opacity=100);}.btn-mini .caret {  margin-top: 5px;}.btn-small .caret {  margin-top: 6px;}.btn-large .caret {  margin-top: 6px;  border-left-width: 5px;  border-right-width: 5px;  border-top-width: 5px;}.dropup .btn-large .caret {  border-bottom: 5px solid #000000;  border-top: 0;}.btn-primary .caret,.btn-warning .caret,.btn-danger .caret,.btn-info .caret,.btn-success .caret,.btn-inverse .caret {  border-top-color: #ffffff;  border-bottom-color: #ffffff;  opacity: 0.75;  filter: alpha(opacity=75);}.nav {  margin-left: 0;  margin-bottom: 18px;  list-style: none;}.nav > li > a {  display: block;}.nav > li > a:hover {  text-decoration: none;  background-color: #eeeeee;}.nav > .pull-right {  float: right;}.nav .nav-header {  display: block;  padding: 3px 15px;  font-size: 11px;  font-weight: bold;  line-height: 18px;  color: #999999;  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);  text-transform: uppercase;}.nav li + .nav-header {  margin-top: 9px;}.nav-list {  padding-left: 15px;  padding-right: 15px;  margin-bottom: 0;}.nav-list > li > a,.nav-list .nav-header {  margin-left: -15px;  margin-right: -15px;  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);}.nav-list > li > a {  padding: 3px 15px;}.nav-list > .active > a,.nav-list > .active > a:hover {  color: #ffffff;  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.2);  background-color: #0088cc;}.nav-list [class^="icon-"] {  margin-right: 2px;}.nav-list .divider {  *width: 100%;  height: 1px;  margin: 8px 1px;  *margin: -5px 0 5px;  overflow: hidden;  background-color: #e5e5e5;  border-bottom: 1px solid #ffffff;}.nav-tabs,.nav-pills {  *zoom: 1;}.nav-tabs:before,.nav-pills:before,.nav-tabs:after,.nav-pills:after {  display: table;  content: "";}.nav-tabs:after,.nav-pills:after {  clear: both;}.nav-tabs > li,.nav-pills > li {  float: left;}.nav-tabs > li > a,.nav-pills > li > a {  padding-right: 12px;  padding-left: 12px;  margin-right: 2px;  line-height: 14px;}.nav-tabs {  border-bottom: 1px solid #ddd;}.nav-tabs > li {  margin-bottom: -1px;}.nav-tabs > li > a {  padding-top: 8px;  padding-bottom: 8px;  line-height: 18px;  border: 1px solid transparent;  -webkit-border-radius: 4px 4px 0 0;  -moz-border-radius: 4px 4px 0 0;  border-radius: 4px 4px 0 0;}.nav-tabs > li > a:hover {  border-color: #eeeeee #eeeeee #dddddd;}.nav-tabs > .active > a,.nav-tabs > .active > a:hover {  color: #555555;  background-color: #ffffff;  border: 1px solid #ddd;  border-bottom-color: transparent;  cursor: default;}.nav-pills > li > a {  padding-top: 8px;  padding-bottom: 8px;  margin-top: 2px;  margin-bottom: 2px;  -webkit-border-radius: 5px;  -moz-border-radius: 5px;  border-radius: 5px;}.nav-pills > .active > a,.nav-pills > .active > a:hover {  color: #ffffff;  background-color: #0088cc;}.nav-stacked > li {  float: none;}.nav-stacked > li > a {  margin-right: 0;}.nav-tabs.nav-stacked {  border-bottom: 0;}.nav-tabs.nav-stacked > li > a {  border: 1px solid #ddd;  -webkit-border-radius: 0;  -moz-border-radius: 0;  border-radius: 0;}.nav-tabs.nav-stacked > li:first-child > a {  -webkit-border-radius: 4px 4px 0 0;  -moz-border-radius: 4px 4px 0 0;  border-radius: 4px 4px 0 0;}.nav-tabs.nav-stacked > li:last-child > a {  -webkit-border-radius: 0 0 4px 4px;  -moz-border-radius: 0 0 4px 4px;  border-radius: 0 0 4px 4px;}.nav-tabs.nav-stacked > li > a:hover {  border-color: #ddd;  z-index: 2;}.nav-pills.nav-stacked > li > a {  margin-bottom: 3px;}.nav-pills.nav-stacked > li:last-child > a {  margin-bottom: 1px;}.nav-tabs .dropdown-menu {  -webkit-border-radius: 0 0 5px 5px;  -moz-border-radius: 0 0 5px 5px;  border-radius: 0 0 5px 5px;}.nav-pills .dropdown-menu {  -webkit-border-radius: 4px;  -moz-border-radius: 4px;  border-radius: 4px;}.nav-tabs .dropdown-toggle .caret,.nav-pills .dropdown-toggle .caret {  border-top-color: #0088cc;  border-bottom-color: #0088cc;  margin-top: 6px;}.nav-tabs .dropdown-toggle:hover .caret,.nav-pills .dropdown-toggle:hover .caret {  border-top-color: #005580;  border-bottom-color: #005580;}.nav-tabs .active .dropdown-toggle .caret,.nav-pills .active .dropdown-toggle .caret {  border-top-color: #333333;  border-bottom-color: #333333;}.nav > .dropdown.active > a:hover {  color: #000000;  cursor: pointer;}.nav-tabs .open .dropdown-toggle,.nav-pills .open .dropdown-toggle,.nav > li.dropdown.open.active > a:hover {  color: #ffffff;  background-color: #999999;  border-color: #999999;}.nav li.dropdown.open .caret,.nav li.dropdown.open.active .caret,.nav li.dropdown.open a:hover .caret {  border-top-color: #ffffff;  border-bottom-color: #ffffff;  opacity: 1;  filter: alpha(opacity=100);}.tabs-stacked .open > a:hover {  border-color: #999999;}.tabbable {  *zoom: 1;}.tabbable:before,.tabbable:after {  display: table;  content: "";}.tabbable:after {  clear: both;}.tab-content {  overflow: auto;}.tabs-below > .nav-tabs,.tabs-right > .nav-tabs,.tabs-left > .nav-tabs {  border-bottom: 0;}.tab-content > .tab-pane,.pill-content > .pill-pane {  display: none;}.tab-content > .active,.pill-content > .active {  display: block;}.tabs-below > .nav-tabs {  border-top: 1px solid #ddd;}.tabs-below > .nav-tabs > li {  margin-top: -1px;  margin-bottom: 0;}.tabs-below > .nav-tabs > li > a {  -webkit-border-radius: 0 0 4px 4px;  -moz-border-radius: 0 0 4px 4px;  border-radius: 0 0 4px 4px;}.tabs-below > .nav-tabs > li > a:hover {  border-bottom-color: transparent;  border-top-color: #ddd;}.tabs-below > .nav-tabs > .active > a,.tabs-below > .nav-tabs > .active > a:hover {  border-color: transparent #ddd #ddd #ddd;}.tabs-left > .nav-tabs > li,.tabs-right > .nav-tabs > li {  float: none;}.tabs-left > .nav-tabs > li > a,.tabs-right > .nav-tabs > li > a {  min-width: 74px;  margin-right: 0;  margin-bottom: 3px;}.tabs-left > .nav-tabs {  float: left;  margin-right: 19px;  border-right: 1px solid #ddd;}.tabs-left > .nav-tabs > li > a {  margin-right: -1px;  -webkit-border-radius: 4px 0 0 4px;  -moz-border-radius: 4px 0 0 4px;  border-radius: 4px 0 0 4px;}.tabs-left > .nav-tabs > li > a:hover {  border-color: #eeeeee #dddddd #eeeeee #eeeeee;}.tabs-left > .nav-tabs .active > a,.tabs-left > .nav-tabs .active > a:hover {  border-color: #ddd transparent #ddd #ddd;  *border-right-color: #ffffff;}.tabs-right > .nav-tabs {  float: right;  margin-left: 19px;  border-left: 1px solid #ddd;}.tabs-right > .nav-tabs > li > a {  margin-left: -1px;  -webkit-border-radius: 0 4px 4px 0;  -moz-border-radius: 0 4px 4px 0;  border-radius: 0 4px 4px 0;}.tabs-right > .nav-tabs > li > a:hover {  border-color: #eeeeee #eeeeee #eeeeee #dddddd;}.tabs-right > .nav-tabs .active > a,.tabs-right > .nav-tabs .active > a:hover {  border-color: #ddd #ddd #ddd transparent;  *border-left-color: #ffffff;}.navbar {  *position: relative;  *z-index: 2;  overflow: visible;  margin-bottom: 18px;}.navbar-inner {  min-height: 40px;  padding-left: 20px;  padding-right: 20px;  background-color: #2c2c2c;  background-image: -moz-linear-gradient(top, #333333, #222222);  background-image: -ms-linear-gradient(top, #333333, #222222);  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#333333), to(#222222));  background-image: -webkit-linear-gradient(top, #333333, #222222);  background-image: -o-linear-gradient(top, #333333, #222222);  background-image: linear-gradient(top, #333333, #222222);  background-repeat: repeat-x;  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#333333', endColorstr='#222222', GradientType=0);  -webkit-border-radius: 4px;  -moz-border-radius: 4px;  border-radius: 4px;  -webkit-box-shadow: 0 1px 3px rgba(0,0,0,.25), inset 0 -1px 0 rgba(0,0,0,.1);  -moz-box-shadow: 0 1px 3px rgba(0,0,0,.25), inset 0 -1px 0 rgba(0,0,0,.1);  box-shadow: 0 1px 3px rgba(0,0,0,.25), inset 0 -1px 0 rgba(0,0,0,.1);}.navbar .container {  width: auto;}.nav-collapse.collapse {  height: auto;}.navbar {  color: #999999;}.navbar .brand:hover {  text-decoration: none;}.navbar .brand {  float: left;  display: block;  padding: 8px 20px 12px;  margin-left: -20px;  font-size: 20px;  font-weight: 200;  line-height: 1;  color: #999999;}.navbar .navbar-text {  margin-bottom: 0;  line-height: 40px;}.navbar .navbar-link {  color: #999999;}.navbar .navbar-link:hover {  color: #ffffff;}.navbar .btn,.navbar .btn-group {  margin-top: 5px;}.navbar .btn-group .btn {  margin: 0;}.navbar-form {  margin-bottom: 0;  *zoom: 1;}.navbar-form:before,.navbar-form:after {  display: table;  content: "";}.navbar-form:after {  clear: both;}.navbar-form input,.navbar-form select,.navbar-form .radio,.navbar-form .checkbox {  margin-top: 5px;}.navbar-form input,.navbar-form select {  display: inline-block;  margin-bottom: 0;}.navbar-form input[type="image"],.navbar-form input[type="checkbox"],.navbar-form input[type="radio"] {  margin-top: 3px;}.navbar-form .input-append,.navbar-form .input-prepend {  margin-top: 6px;  white-space: nowrap;}.navbar-form .input-append input,.navbar-form .input-prepend input {  margin-top: 0;}.navbar-search {  position: relative;  float: left;  margin-top: 6px;  margin-bottom: 0;}.navbar-search .search-query {  padding: 4px 9px;  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;  font-size: 13px;  font-weight: normal;  line-height: 1;  color: #ffffff;  background-color: #626262;  border: 1px solid #151515;  -webkit-box-shadow: inset 0 1px 2px rgba(0,0,0,.1), 0 1px 0 rgba(255,255,255,.15);  -moz-box-shadow: inset 0 1px 2px rgba(0,0,0,.1), 0 1px 0 rgba(255,255,255,.15);  box-shadow: inset 0 1px 2px rgba(0,0,0,.1), 0 1px 0 rgba(255,255,255,.15);  -webkit-transition: none;  -moz-transition: none;  -ms-transition: none;  -o-transition: none;  transition: none;}.navbar-search .search-query:-moz-placeholder {  color: #cccccc;}.navbar-search .search-query:-ms-input-placeholder {  color: #cccccc;}.navbar-search .search-query::-webkit-input-placeholder {  color: #cccccc;}.navbar-search .search-query:focus,.navbar-search .search-query.focused {  padding: 5px 10px;  color: #333333;  text-shadow: 0 1px 0 #ffffff;  background-color: #ffffff;  border: 0;  -webkit-box-shadow: 0 0 3px rgba(0, 0, 0, 0.15);  -moz-box-shadow: 0 0 3px rgba(0, 0, 0, 0.15);  box-shadow: 0 0 3px rgba(0, 0, 0, 0.15);  outline: 0;}.navbar-fixed-top,.navbar-fixed-bottom {  position: fixed;  right: 0;  left: 0;  z-index: 1030;  margin-bottom: 0;}.navbar-fixed-top .navbar-inner,.navbar-fixed-bottom .navbar-inner {  padding-left: 0;  padding-right: 0;  -webkit-border-radius: 0;  -moz-border-radius: 0;  border-radius: 0;}.navbar-fixed-top .container,.navbar-fixed-bottom .container {  width: 940px;}.navbar-fixed-top {  top: 0;}.navbar-fixed-bottom {  bottom: 0;}.navbar .nav {  position: relative;  left: 0;  display: block;  float: left;  margin: 0 10px 0 0;}.navbar .nav.pull-right {  float: right;}.navbar .nav > li {  display: block;  float: left;}.navbar .nav > li > a {  float: none;  padding: 9px 10px 11px;  line-height: 19px;  color: #999999;  text-decoration: none;  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);}.navbar .btn {  display: inline-block;  padding: 4px 10px 4px;  margin: 5px 5px 6px;  line-height: 18px;}.navbar .btn-group {  margin: 0;  padding: 5px 5px 6px;}.navbar .nav > li > a:hover {  background-color: transparent;  color: #ffffff;  text-decoration: none;}.navbar .nav .active > a,.navbar .nav .active > a:hover {  color: #ffffff;  text-decoration: none;  background-color: #222222;}.navbar .divider-vertical {  height: 40px;  width: 1px;  margin: 0 9px;  overflow: hidden;  background-color: #222222;  border-right: 1px solid #333333;}.navbar .nav.pull-right {  margin-left: 10px;  margin-right: 0;}.navbar .btn-navbar {  display: none;  float: right;  padding: 7px 10px;  margin-left: 5px;  margin-right: 5px;  background-color: #2c2c2c;  background-image: -moz-linear-gradient(top, #333333, #222222);  background-image: -ms-linear-gradient(top, #333333, #222222);  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#333333), to(#222222));  background-image: -webkit-linear-gradient(top, #333333, #222222);  background-image: -o-linear-gradient(top, #333333, #222222);  background-image: linear-gradient(top, #333333, #222222);  background-repeat: repeat-x;  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#333333', endColorstr='#222222', GradientType=0);  border-color: #222222 #222222 #000000;  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);  *background-color: #222222;  /* Darken IE7 buttons by default so they stand out more given they won't have borders */  filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);  -webkit-box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 1px 0 rgba(255,255,255,.075);  -moz-box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 1px 0 rgba(255,255,255,.075);  box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 1px 0 rgba(255,255,255,.075);}.navbar .btn-navbar:hover,.navbar .btn-navbar:active,.navbar .btn-navbar.active,.navbar .btn-navbar.disabled,.navbar .btn-navbar[disabled] {  background-color: #222222;  *background-color: #151515;}.navbar .btn-navbar:active,.navbar .btn-navbar.active {  background-color: #080808 \9;}.navbar .btn-navbar .icon-bar {  display: block;  width: 18px;  height: 2px;  background-color: #f5f5f5;  -webkit-border-radius: 1px;  -moz-border-radius: 1px;  border-radius: 1px;  -webkit-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);  -moz-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);}.btn-navbar .icon-bar + .icon-bar {  margin-top: 3px;}.navbar .dropdown-menu:before {  content: '';  display: inline-block;  border-left: 7px solid transparent;  border-right: 7px solid transparent;  border-bottom: 7px solid #ccc;  border-bottom-color: rgba(0, 0, 0, 0.2);  position: absolute;  top: -7px;  left: 9px;}.navbar .dropdown-menu:after {  content: '';  display: inline-block;  border-left: 6px solid transparent;  border-right: 6px solid transparent;  border-bottom: 6px solid #ffffff;  position: absolute;  top: -6px;  left: 10px;}.navbar-fixed-bottom .dropdown-menu:before {  border-top: 7px solid #ccc;  border-top-color: rgba(0, 0, 0, 0.2);  border-bottom: 0;  bottom: -7px;  top: auto;}.navbar-fixed-bottom .dropdown-menu:after {  border-top: 6px solid #ffffff;  border-bottom: 0;  bottom: -6px;  top: auto;}.navbar .nav li.dropdown .dropdown-toggle .caret,.navbar .nav li.dropdown.open .caret {  border-top-color: #ffffff;  border-bottom-color: #ffffff;}.navbar .nav li.dropdown.active .caret {  opacity: 1;  filter: alpha(opacity=100);}.navbar .nav li.dropdown.open > .dropdown-toggle,.navbar .nav li.dropdown.active > .dropdown-toggle,.navbar .nav li.dropdown.open.active > .dropdown-toggle {  background-color: transparent;}.navbar .nav li.dropdown.active > .dropdown-toggle:hover {  color: #ffffff;}.navbar .pull-right .dropdown-menu,.navbar .dropdown-menu.pull-right {  left: auto;  right: 0;}.navbar .pull-right .dropdown-menu:before,.navbar .dropdown-menu.pull-right:before {  left: auto;  right: 12px;}.navbar .pull-right .dropdown-menu:after,.navbar .dropdown-menu.pull-right:after {  left: auto;  right: 13px;}.breadcrumb {  padding: 7px 14px;  margin: 0 0 18px;  list-style: none;  background-color: #fbfbfb;  background-image: -moz-linear-gradient(top, #ffffff, #f5f5f5);  background-image: -ms-linear-gradient(top, #ffffff, #f5f5f5);  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#f5f5f5));  background-image: -webkit-linear-gradient(top, #ffffff, #f5f5f5);  background-image: -o-linear-gradient(top, #ffffff, #f5f5f5);  background-image: linear-gradient(top, #ffffff, #f5f5f5);  background-repeat: repeat-x;  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#f5f5f5', GradientType=0);  border: 1px solid #ddd;  -webkit-border-radius: 3px;  -moz-border-radius: 3px;  border-radius: 3px;  -webkit-box-shadow: inset 0 1px 0 #ffffff;  -moz-box-shadow: inset 0 1px 0 #ffffff;  box-shadow: inset 0 1px 0 #ffffff;}.breadcrumb li {  display: inline-block;  *display: inline;  /* IE7 inline-block hack */  *zoom: 1;  text-shadow: 0 1px 0 #ffffff;}.breadcrumb .divider {  padding: 0 5px;  color: #999999;}.breadcrumb .active a {  color: #333333;}.pagination {  height: 36px;  margin: 18px 0;}.pagination ul {  display: inline-block;  *display: inline;  /* IE7 inline-block hack */  *zoom: 1;  margin-left: 0;  margin-bottom: 0;  -webkit-border-radius: 3px;  -moz-border-radius: 3px;  border-radius: 3px;  -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);  -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);}.pagination li {  display: inline;}.pagination a {  float: left;  padding: 0 14px;  line-height: 34px;  text-decoration: none;  border: 1px solid #ddd;  border-left-width: 0;}.pagination a:hover,.pagination .active a {  background-color: #f5f5f5;}.pagination .active a {  color: #999999;  cursor: default;}.pagination .disabled span,.pagination .disabled a,.pagination .disabled a:hover {  color: #999999;  background-color: transparent;  cursor: default;}.pagination li:first-child a {  border-left-width: 1px;  -webkit-border-radius: 3px 0 0 3px;  -moz-border-radius: 3px 0 0 3px;  border-radius: 3px 0 0 3px;}.pagination li:last-child a {  -webkit-border-radius: 0 3px 3px 0;  -moz-border-radius: 0 3px 3px 0;  border-radius: 0 3px 3px 0;}.pagination-centered {  text-align: center;}.pagination-right {  text-align: right;}.pager {  margin-left: 0;  margin-bottom: 18px;  list-style: none;  text-align: center;  *zoom: 1;}.pager:before,.pager:after {  display: table;  content: "";}.pager:after {  clear: both;}.pager li {  display: inline;}.pager a {  display: inline-block;  padding: 5px 14px;  background-color: #fff;  border: 1px solid #ddd;  -webkit-border-radius: 15px;  -moz-border-radius: 15px;  border-radius: 15px;}.pager a:hover {  text-decoration: none;  background-color: #f5f5f5;}.pager .next a {  float: right;}.pager .previous a {  float: left;}.pager .disabled a,.pager .disabled a:hover {  color: #999999;  background-color: #fff;  cursor: default;}.thumbnails {  margin-left: -20px;  list-style: none;  *zoom: 1;}.thumbnails:before,.thumbnails:after {  display: table;  content: "";}.thumbnails:after {  clear: both;}.row-fluid .thumbnails {  margin-left: 0;}.thumbnails > li {  float: left;  margin-bottom: 18px;  margin-left: 20px;}.thumbnail {  display: block;  padding: 4px;  line-height: 1;  border: 1px solid #ddd;  -webkit-border-radius: 4px;  -moz-border-radius: 4px;  border-radius: 4px;  -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075);  -moz-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075);  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075);}a.thumbnail:hover {  border-color: #0088cc;  -webkit-box-shadow: 0 1px 4px rgba(0, 105, 214, 0.25);  -moz-box-shadow: 0 1px 4px rgba(0, 105, 214, 0.25);  box-shadow: 0 1px 4px rgba(0, 105, 214, 0.25);}.thumbnail > img {  display: block;  max-width: 100%;  margin-left: auto;  margin-right: auto;}.thumbnail .caption {  padding: 9px;}.alert {  padding: 8px 35px 8px 14px;  margin-bottom: 18px;  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);  background-color: #fcf8e3;  border: 1px solid #fbeed5;  -webkit-border-radius: 4px;  -moz-border-radius: 4px;  border-radius: 4px;  color: #c09853;}.alert-heading {  color: inherit;}.alert .close {  position: relative;  top: -2px;  right: -21px;  line-height: 18px;}.alert-success {  background-color: #dff0d8;  border-color: #d6e9c6;  color: #468847;}.alert-danger,.alert-error {  background-color: #f2dede;  border-color: #eed3d7;  color: #b94a48;}.alert-info {  background-color: #d9edf7;  border-color: #bce8f1;  color: #3a87ad;}.alert-block {  padding-top: 14px;  padding-bottom: 14px;}.alert-block > p,.alert-block > ul {  margin-bottom: 0;}.alert-block p + p {  margin-top: 5px;}@-webkit-keyframes progress-bar-stripes {  from {    background-position: 40px 0;  }  to {    background-position: 0 0;  }}@-moz-keyframes progress-bar-stripes {  from {    background-position: 40px 0;  }  to {    background-position: 0 0;  }}@-ms-keyframes progress-bar-stripes {  from {    background-position: 40px 0;  }  to {    background-position: 0 0;  }}@-o-keyframes progress-bar-stripes {  from {    background-position: 0 0;  }  to {    background-position: 40px 0;  }}@keyframes progress-bar-stripes {  from {    background-position: 40px 0;  }  to {    background-position: 0 0;  }}.progress {  overflow: hidden;  height: 18px;  margin-bottom: 18px;  background-color: #f7f7f7;  background-image: -moz-linear-gradient(top, #f5f5f5, #f9f9f9);  background-image: -ms-linear-gradient(top, #f5f5f5, #f9f9f9);  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#f5f5f5), to(#f9f9f9));  background-image: -webkit-linear-gradient(top, #f5f5f5, #f9f9f9);  background-image: -o-linear-gradient(top, #f5f5f5, #f9f9f9);  background-image: linear-gradient(top, #f5f5f5, #f9f9f9);  background-repeat: repeat-x;  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#f5f5f5', endColorstr='#f9f9f9', GradientType=0);  -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);  -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);  -webkit-border-radius: 4px;  -moz-border-radius: 4px;  border-radius: 4px;}.progress .bar {  width: 0%;  height: 18px;  color: #ffffff;  font-size: 12px;  text-align: center;  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);  background-color: #0e90d2;  background-image: -moz-linear-gradient(top, #149bdf, #0480be);  background-image: -ms-linear-gradient(top, #149bdf, #0480be);  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#149bdf), to(#0480be));  background-image: -webkit-linear-gradient(top, #149bdf, #0480be);  background-image: -o-linear-gradient(top, #149bdf, #0480be);  background-image: linear-gradient(top, #149bdf, #0480be);  background-repeat: repeat-x;  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#149bdf', endColorstr='#0480be', GradientType=0);  -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);  -moz-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);  -webkit-box-sizing: border-box;  -moz-box-sizing: border-box;  -ms-box-sizing: border-box;  box-sizing: border-box;  -webkit-transition: width 0.6s ease;  -moz-transition: width 0.6s ease;  -ms-transition: width 0.6s ease;  -o-transition: width 0.6s ease;  transition: width 0.6s ease;}.progress-striped .bar {  background-color: #149bdf;  background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));  background-image: -webkit-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);  background-image: -moz-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);  background-image: -ms-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);  background-image: -o-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);  background-image: linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);  -webkit-background-size: 40px 40px;  -moz-background-size: 40px 40px;  -o-background-size: 40px 40px;  background-size: 40px 40px;}.progress.active .bar {  -webkit-animation: progress-bar-stripes 2s linear infinite;  -moz-animation: progress-bar-stripes 2s linear infinite;  -ms-animation: progress-bar-stripes 2s linear infinite;  -o-animation: progress-bar-stripes 2s linear infinite;  animation: progress-bar-stripes 2s linear infinite;}.progress-danger .bar {  background-color: #dd514c;  background-image: -moz-linear-gradient(top, #ee5f5b, #c43c35);  background-image: -ms-linear-gradient(top, #ee5f5b, #c43c35);  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#c43c35));  background-image: -webkit-linear-gradient(top, #ee5f5b, #c43c35);  background-image: -o-linear-gradient(top, #ee5f5b, #c43c35);  background-image: linear-gradient(top, #ee5f5b, #c43c35);  background-repeat: repeat-x;  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ee5f5b', endColorstr='#c43c35', GradientType=0);}.progress-danger.progress-striped .bar {  background-color: #ee5f5b;  background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));  background-image: -webkit-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);  background-image: -moz-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);  background-image: -ms-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);  background-image: -o-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);  background-image: linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);}.progress-success .bar {  background-color: #5eb95e;  background-image: -moz-linear-gradient(top, #62c462, #57a957);  background-image: -ms-linear-gradient(top, #62c462, #57a957);  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#62c462), to(#57a957));  background-image: -webkit-linear-gradient(top, #62c462, #57a957);  background-image: -o-linear-gradient(top, #62c462, #57a957);  background-image: linear-gradient(top, #62c462, #57a957);  background-repeat: repeat-x;  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#62c462', endColorstr='#57a957', GradientType=0);}.progress-success.progress-striped .bar {  background-color: #62c462;  background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));  background-image: -webkit-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);  background-image: -moz-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);  background-image: -ms-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);  background-image: -o-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);  background-image: linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);}.progress-info .bar {  background-color: #4bb1cf;  background-image: -moz-linear-gradient(top, #5bc0de, #339bb9);  background-image: -ms-linear-gradient(top, #5bc0de, #339bb9);  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#5bc0de), to(#339bb9));  background-image: -webkit-linear-gradient(top, #5bc0de, #339bb9);  background-image: -o-linear-gradient(top, #5bc0de, #339bb9);  background-image: linear-gradient(top, #5bc0de, #339bb9);  background-repeat: repeat-x;  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#5bc0de', endColorstr='#339bb9', GradientType=0);}.progress-info.progress-striped .bar {  background-color: #5bc0de;  background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));  background-image: -webkit-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);  background-image: -moz-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);  background-image: -ms-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);  background-image: -o-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);  background-image: linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);}.progress-warning .bar {  background-color: #faa732;  background-image: -moz-linear-gradient(top, #fbb450, #f89406);  background-image: -ms-linear-gradient(top, #fbb450, #f89406);  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fbb450), to(#f89406));  background-image: -webkit-linear-gradient(top, #fbb450, #f89406);  background-image: -o-linear-gradient(top, #fbb450, #f89406);  background-image: linear-gradient(top, #fbb450, #f89406);  background-repeat: repeat-x;  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fbb450', endColorstr='#f89406', GradientType=0);}.progress-warning.progress-striped .bar {  background-color: #fbb450;  background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));  background-image: -webkit-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);  background-image: -moz-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);  background-image: -ms-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);  background-image: -o-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);  background-image: linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);}.hero-unit {  padding: 60px;  margin-bottom: 30px;  background-color: #eeeeee;  -webkit-border-radius: 6px;  -moz-border-radius: 6px;  border-radius: 6px;}.hero-unit h1 {  margin-bottom: 0;  font-size: 60px;  line-height: 1;  color: inherit;  letter-spacing: -1px;}.hero-unit p {  font-size: 18px;  font-weight: 200;  line-height: 27px;  color: inherit;}.tooltip {  position: absolute;  z-index: 1020;  display: block;  visibility: visible;  padding: 5px;  font-size: 11px;  opacity: 0;  filter: alpha(opacity=0);}.tooltip.in {  opacity: 0.8;  filter: alpha(opacity=80);}.tooltip.top {  margin-top: -2px;}.tooltip.right {  margin-left: 2px;}.tooltip.bottom {  margin-top: 2px;}.tooltip.left {  margin-left: -2px;}.tooltip.top .tooltip-arrow {  bottom: 0;  left: 50%;  margin-left: -5px;  border-left: 5px solid transparent;  border-right: 5px solid transparent;  border-top: 5px solid #000000;}.tooltip.left .tooltip-arrow {  top: 50%;  right: 0;  margin-top: -5px;  border-top: 5px solid transparent;  border-bottom: 5px solid transparent;  border-left: 5px solid #000000;}.tooltip.bottom .tooltip-arrow {  top: 0;  left: 50%;  margin-left: -5px;  border-left: 5px solid transparent;  border-right: 5px solid transparent;  border-bottom: 5px solid #000000;}.tooltip.right .tooltip-arrow {  top: 50%;  left: 0;  margin-top: -5px;  border-top: 5px solid transparent;  border-bottom: 5px solid transparent;  border-right: 5px solid #000000;}.tooltip-inner {  max-width: 200px;  padding: 3px 8px;  color: #ffffff;  text-align: center;  text-decoration: none;  background-color: #000000;  -webkit-border-radius: 4px;  -moz-border-radius: 4px;  border-radius: 4px;}.tooltip-arrow {  position: absolute;  width: 0;  height: 0;}.popover {  position: absolute;  top: 0;  left: 0;  z-index: 1010;  display: none;  padding: 5px;}.popover.top {  margin-top: -5px;}.popover.right {  margin-left: 5px;}.popover.bottom {  margin-top: 5px;}.popover.left {  margin-left: -5px;}.popover.top .arrow {  bottom: 0;  left: 50%;  margin-left: -5px;  border-left: 5px solid transparent;  border-right: 5px solid transparent;  border-top: 5px solid #000000;}.popover.right .arrow {  top: 50%;  left: 0;  margin-top: -5px;  border-top: 5px solid transparent;  border-bottom: 5px solid transparent;  border-right: 5px solid #000000;}.popover.bottom .arrow {  top: 0;  left: 50%;  margin-left: -5px;  border-left: 5px solid transparent;  border-right: 5px solid transparent;  border-bottom: 5px solid #000000;}.popover.left .arrow {  top: 50%;  right: 0;  margin-top: -5px;  border-top: 5px solid transparent;  border-bottom: 5px solid transparent;  border-left: 5px solid #000000;}.popover .arrow {  position: absolute;  width: 0;  height: 0;}.popover-inner {  padding: 3px;  width: 280px;  overflow: hidden;  background: #000000;  background: rgba(0, 0, 0, 0.8);  -webkit-border-radius: 6px;  -moz-border-radius: 6px;  border-radius: 6px;  -webkit-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3);  -moz-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3);  box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3);}.popover-title {  padding: 9px 15px;  line-height: 1;  background-color: #f5f5f5;  border-bottom: 1px solid #eee;  -webkit-border-radius: 3px 3px 0 0;  -moz-border-radius: 3px 3px 0 0;  border-radius: 3px 3px 0 0;}.popover-content {  padding: 14px;  background-color: #ffffff;  -webkit-border-radius: 0 0 3px 3px;  -moz-border-radius: 0 0 3px 3px;  border-radius: 0 0 3px 3px;  -webkit-background-clip: padding-box;  -moz-background-clip: padding-box;  background-clip: padding-box;}.popover-content p,.popover-content ul,.popover-content ol {  margin-bottom: 0;}.modal-open .dropdown-menu {  z-index: 2050;}.modal-open .dropdown.open {  *z-index: 2050;}.modal-open .popover {  z-index: 2060;}.modal-open .tooltip {  z-index: 2070;}.modal-backdrop {  position: fixed;  top: 0;  right: 0;  bottom: 0;  left: 0;  z-index: 1040;  background-color: #000000;}.modal-backdrop.fade {  opacity: 0;}.modal-backdrop,.modal-backdrop.fade.in {  opacity: 0.8;  filter: alpha(opacity=80);}.modal {  position: fixed;  top: 50%;  left: 50%;  z-index: 1050;  overflow: auto;  width: 560px;  margin: -250px 0 0 -280px;  background-color: #ffffff;  border: 1px solid #999;  border: 1px solid rgba(0, 0, 0, 0.3);  *border: 1px solid #999;  /* IE6-7 */  -webkit-border-radius: 6px;  -moz-border-radius: 6px;  border-radius: 6px;  -webkit-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3);  -moz-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3);  box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3);  -webkit-background-clip: padding-box;  -moz-background-clip: padding-box;  background-clip: padding-box;}.modal.fade {  -webkit-transition: opacity .3s linear, top .3s ease-out;  -moz-transition: opacity .3s linear, top .3s ease-out;  -ms-transition: opacity .3s linear, top .3s ease-out;  -o-transition: opacity .3s linear, top .3s ease-out;  transition: opacity .3s linear, top .3s ease-out;  top: -25%;}.modal.fade.in {  top: 50%;}.modal-header {  padding: 9px 15px;  border-bottom: 1px solid #eee;}.modal-header .close {  margin-top: 2px;}.modal-body {  overflow-y: auto;  max-height: 400px;  padding: 15px;}.modal-form {  margin-bottom: 0;}.modal-footer {  padding: 14px 15px 15px;  margin-bottom: 0;  text-align: right;  background-color: #f5f5f5;  border-top: 1px solid #ddd;  -webkit-border-radius: 0 0 6px 6px;  -moz-border-radius: 0 0 6px 6px;  border-radius: 0 0 6px 6px;  -webkit-box-shadow: inset 0 1px 0 #ffffff;  -moz-box-shadow: inset 0 1px 0 #ffffff;  box-shadow: inset 0 1px 0 #ffffff;  *zoom: 1;}.modal-footer:before,.modal-footer:after {  display: table;  content: "";}.modal-footer:after {  clear: both;}.modal-footer .btn + .btn {  margin-left: 5px;  margin-bottom: 0;}.modal-footer .btn-group .btn + .btn {  margin-left: -1px;}.dropup,.dropdown {  position: relative;}.dropdown-toggle {  *margin-bottom: -3px;}.dropdown-toggle:active,.open .dropdown-toggle {  outline: 0;}.caret {  display: inline-block;  width: 0;  height: 0;  vertical-align: top;  border-top: 4px solid #000000;  border-right: 4px solid transparent;  border-left: 4px solid transparent;  content: "";  opacity: 0.3;  filter: alpha(opacity=30);}.dropdown .caret {  margin-top: 8px;  margin-left: 2px;}.dropdown:hover .caret,.open .caret {  opacity: 1;  filter: alpha(opacity=100);}.dropdown-menu {  position: absolute;  top: 100%;  left: 0;  z-index: 1000;  display: none;  float: left;  min-width: 160px;  padding: 4px 0;  margin: 1px 0 0;  list-style: none;  background-color: #ffffff;  border: 1px solid #ccc;  border: 1px solid rgba(0, 0, 0, 0.2);  *border-right-width: 2px;  *border-bottom-width: 2px;  -webkit-border-radius: 5px;  -moz-border-radius: 5px;  border-radius: 5px;  -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);  -moz-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);  -webkit-background-clip: padding-box;  -moz-background-clip: padding;  background-clip: padding-box;}.dropdown-menu.pull-right {  right: 0;  left: auto;}.dropdown-menu .divider {  *width: 100%;  height: 1px;  margin: 8px 1px;  *margin: -5px 0 5px;  overflow: hidden;  background-color: #e5e5e5;  border-bottom: 1px solid #ffffff;}.dropdown-menu a {  display: block;  padding: 3px 15px;  clear: both;  font-weight: normal;  line-height: 18px;  color: #333333;  white-space: nowrap;}.dropdown-menu li > a:hover,.dropdown-menu .active > a,.dropdown-menu .active > a:hover {  color: #ffffff;  text-decoration: none;  background-color: #0088cc;}.open {  *z-index: 1000;}.open  > .dropdown-menu {  display: block;}.pull-right > .dropdown-menu {  right: 0;  left: auto;}.dropup .caret,.navbar-fixed-bottom .dropdown .caret {  border-top: 0;  border-bottom: 4px solid #000000;  content: "\2191";}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu {  top: auto;  bottom: 100%;  margin-bottom: 1px;}.typeahead {  margin-top: 2px;  -webkit-border-radius: 4px;  -moz-border-radius: 4px;  border-radius: 4px;}.accordion {  margin-bottom: 18px;}.accordion-group {  margin-bottom: 2px;  border: 1px solid #e5e5e5;  -webkit-border-radius: 4px;  -moz-border-radius: 4px;  border-radius: 4px;}.accordion-heading {  border-bottom: 0;}.accordion-heading .accordion-toggle {  display: block;  padding: 8px 15px;}.accordion-toggle {  cursor: pointer;}.accordion-inner {  padding: 9px 15px;  border-top: 1px solid #e5e5e5;}.carousel {  position: relative;  margin-bottom: 18px;  line-height: 1;}.carousel-inner {  overflow: hidden;  width: 100%;  position: relative;}.carousel .item {  display: none;  position: relative;  -webkit-transition: 0.6s ease-in-out left;  -moz-transition: 0.6s ease-in-out left;  -ms-transition: 0.6s ease-in-out left;  -o-transition: 0.6s ease-in-out left;  transition: 0.6s ease-in-out left;}.carousel .item > img {  display: block;  line-height: 1;}.carousel .active,.carousel .next,.carousel .prev {  display: block;}.carousel .active {  left: 0;}.carousel .next,.carousel .prev {  position: absolute;  top: 0;  width: 100%;}.carousel .next {  left: 100%;}.carousel .prev {  left: -100%;}.carousel .next.left,.carousel .prev.right {  left: 0;}.carousel .active.left {  left: -100%;}.carousel .active.right {  left: 100%;}.carousel-control {  position: absolute;  top: 40%;  left: 15px;  width: 40px;  height: 40px;  margin-top: -20px;  font-size: 60px;  font-weight: 100;  line-height: 30px;  color: #ffffff;  text-align: center;  background: #222222;  border: 3px solid #ffffff;  -webkit-border-radius: 23px;  -moz-border-radius: 23px;  border-radius: 23px;  opacity: 0.5;  filter: alpha(opacity=50);}.carousel-control.right {  left: auto;  right: 15px;}.carousel-control:hover {  color: #ffffff;  text-decoration: none;  opacity: 0.9;  filter: alpha(opacity=90);}.carousel-caption {  position: absolute;  left: 0;  right: 0;  bottom: 0;  padding: 10px 15px 5px;  background: #333333;  background: rgba(0, 0, 0, 0.75);}.carousel-caption h4,.carousel-caption p {  color: #ffffff;}.well {  min-height: 20px;  padding: 19px;  margin-bottom: 20px;  background-color: #f5f5f5;  border: 1px solid #eee;  border: 1px solid rgba(0, 0, 0, 0.05);  -webkit-border-radius: 4px;  -moz-border-radius: 4px;  border-radius: 4px;  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);  -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);}.well blockquote {  border-color: #ddd;  border-color: rgba(0, 0, 0, 0.15);}.well-large {  padding: 24px;  -webkit-border-radius: 6px;  -moz-border-radius: 6px;  border-radius: 6px;}.well-small {  padding: 9px;  -webkit-border-radius: 3px;  -moz-border-radius: 3px;  border-radius: 3px;}.close {  float: right;  font-size: 20px;  font-weight: bold;  line-height: 18px;  color: #000000;  text-shadow: 0 1px 0 #ffffff;  opacity: 0.2;  filter: alpha(opacity=20);}.close:hover {  color: #000000;  text-decoration: none;  cursor: pointer;  opacity: 0.4;  filter: alpha(opacity=40);}button.close {  padding: 0;  cursor: pointer;  background: transparent;  border: 0;  -webkit-appearance: none;}.pull-right {  float: right;}.pull-left {  float: left;}.hide {  display: none;}.show {  display: block;}.invisible {  visibility: hidden;}.fade {  opacity: 0;  -webkit-transition: opacity 0.15s linear;  -moz-transition: opacity 0.15s linear;  -ms-transition: opacity 0.15s linear;  -o-transition: opacity 0.15s linear;  transition: opacity 0.15s linear;}.fade.in {  opacity: 1;}.collapse {  position: relative;  height: 0;  overflow: hidden;  -webkit-transition: height 0.35s ease;  -moz-transition: height 0.35s ease;  -ms-transition: height 0.35s ease;  -o-transition: height 0.35s ease;  transition: height 0.35s ease;}.collapse.in {  height: auto;}.hidden {  display: none;  visibility: hidden;}.visible-phone {  display: none !important;}.visible-tablet {  display: none !important;}.hidden-desktop {  display: none !important;}@media (max-width: 767px) {  .visible-phone {    display: inherit !important;  }  .hidden-phone {    display: none !important;  }  .hidden-desktop {    display: inherit !important;  }  .visible-desktop {    display: none !important;  }}@media (min-width: 768px) and (max-width: 979px) {  .visible-tablet {    display: inherit !important;  }  .hidden-tablet {    display: none !important;  }  .hidden-desktop {    display: inherit !important;  }  .visible-desktop {    display: none !important ;  }}@media (max-width: 480px) {  .nav-collapse {    -webkit-transform: translate3d(0, 0, 0);  }  .page-header h1 small {    display: block;    line-height: 18px;  }  input[type="checkbox"],  input[type="radio"] {    border: 1px solid #ccc;  }  .form-horizontal .control-group > label {    float: none;    width: auto;    padding-top: 0;    text-align: left;  }  .form-horizontal .controls {    margin-left: 0;  }  .form-horizontal .control-list {    padding-top: 0;  }  .form-horizontal .form-actions {    padding-left: 10px;    padding-right: 10px;  }  .modal {    position: absolute;    top: 10px;    left: 10px;    right: 10px;    width: auto;    margin: 0;  }  .modal.fade.in {    top: auto;  }  .modal-header .close {    padding: 10px;    margin: -10px;  }  .carousel-caption {    position: static;  }}@media (max-width: 767px) {  body {    padding-left: 20px;    padding-right: 20px;  }  .navbar-fixed-top,  .navbar-fixed-bottom {    margin-left: -20px;    margin-right: -20px;  }  .container-fluid {    padding: 0;  }  .dl-horizontal dt {    float: none;    clear: none;    width: auto;    text-align: left;  }  .dl-horizontal dd {    margin-left: 0;  }  .container {    width: auto;  }  .row-fluid {    width: 100%;  }  .row,  .thumbnails {    margin-left: 0;  }  [class*="span"],  .row-fluid [class*="span"] {    float: none;    display: block;    width: auto;    margin-left: 0;  }  .input-large,  .input-xlarge,  .input-xxlarge,  input[class*="span"],  select[class*="span"],  textarea[class*="span"],  .uneditable-input {    display: block;    width: 100%;    min-height: 28px;    -webkit-box-sizing: border-box;    -moz-box-sizing: border-box;    -ms-box-sizing: border-box;    box-sizing: border-box;  }  .input-prepend input,  .input-append input,  .input-prepend input[class*="span"],  .input-append input[class*="span"] {    display: inline-block;    width: auto;  }}@media (min-width: 768px) and (max-width: 979px) {  .row {    margin-left: -20px;    *zoom: 1;  }  .row:before,  .row:after {    display: table;    content: "";  }  .row:after {    clear: both;  }  [class*="span"] {    float: left;    margin-left: 20px;  }  .container,  .navbar-fixed-top .container,  .navbar-fixed-bottom .container {    width: 724px;  }  .span12 {    width: 724px;  }  .span11 {    width: 662px;  }  .span10 {    width: 600px;  }  .span9 {    width: 538px;  }  .span8 {    width: 476px;  }  .span7 {    width: 414px;  }  .span6 {    width: 352px;  }  .span5 {    width: 290px;  }  .span4 {    width: 228px;  }  .span3 {    width: 166px;  }  .span2 {    width: 104px;  }  .span1 {    width: 42px;  }  .offset12 {    margin-left: 764px;  }  .offset11 {    margin-left: 702px;  }  .offset10 {    margin-left: 640px;  }  .offset9 {    margin-left: 578px;  }  .offset8 {    margin-left: 516px;  }  .offset7 {    margin-left: 454px;  }  .offset6 {    margin-left: 392px;  }  .offset5 {    margin-left: 330px;  }  .offset4 {    margin-left: 268px;  }  .offset3 {    margin-left: 206px;  }  .offset2 {    margin-left: 144px;  }  .offset1 {    margin-left: 82px;  }  .row-fluid {    width: 100%;    *zoom: 1;  }  .row-fluid:before,  .row-fluid:after {    display: table;    content: "";  }  .row-fluid:after {    clear: both;  }  .row-fluid [class*="span"] {    display: block;    width: 100%;    min-height: 28px;    -webkit-box-sizing: border-box;    -moz-box-sizing: border-box;    -ms-box-sizing: border-box;    box-sizing: border-box;    float: left;    margin-left: 2.762430939%;    *margin-left: 2.709239449638298%;  }  .row-fluid [class*="span"]:first-child {    margin-left: 0;  }  .row-fluid .span12 {    width: 99.999999993%;    *width: 99.9468085036383%;  }  .row-fluid .span11 {    width: 91.436464082%;    *width: 91.38327259263829%;  }  .row-fluid .span10 {    width: 82.87292817100001%;    *width: 82.8197366816383%;  }  .row-fluid .span9 {    width: 74.30939226%;    *width: 74.25620077063829%;  }  .row-fluid .span8 {    width: 65.74585634900001%;    *width: 65.6926648596383%;  }  .row-fluid .span7 {    width: 57.182320438000005%;    *width: 57.129128948638304%;  }  .row-fluid .span6 {    width: 48.618784527%;    *width: 48.5655930376383%;  }  .row-fluid .span5 {    width: 40.055248616%;    *width: 40.0020571266383%;  }  .row-fluid .span4 {    width: 31.491712705%;    *width: 31.4385212156383%;  }  .row-fluid .span3 {    width: 22.928176794%;    *width: 22.874985304638297%;  }  .row-fluid .span2 {    width: 14.364640883%;    *width: 14.311449393638298%;  }  .row-fluid .span1 {    width: 5.801104972%;    *width: 5.747913482638298%;  }  input,  textarea,  .uneditable-input {    margin-left: 0;  }  input.span12, textarea.span12, .uneditable-input.span12 {    width: 714px;  }  input.span11, textarea.span11, .uneditable-input.span11 {    width: 652px;  }  input.span10, textarea.span10, .uneditable-input.span10 {    width: 590px;  }  input.span9, textarea.span9, .uneditable-input.span9 {    width: 528px;  }  input.span8, textarea.span8, .uneditable-input.span8 {    width: 466px;  }  input.span7, textarea.span7, .uneditable-input.span7 {    width: 404px;  }  input.span6, textarea.span6, .uneditable-input.span6 {    width: 342px;  }  input.span5, textarea.span5, .uneditable-input.span5 {    width: 280px;  }  input.span4, textarea.span4, .uneditable-input.span4 {    width: 218px;  }  input.span3, textarea.span3, .uneditable-input.span3 {    width: 156px;  }  input.span2, textarea.span2, .uneditable-input.span2 {    width: 94px;  }  input.span1, textarea.span1, .uneditable-input.span1 {    width: 32px;  }}@media (min-width: 1200px) {  .row {    margin-left: -30px;    *zoom: 1;  }  .row:before,  .row:after {    display: table;    content: "";  }  .row:after {    clear: both;  }  [class*="span"] {    float: left;    margin-left: 30px;  }  .container,  .navbar-fixed-top .container,  .navbar-fixed-bottom .container {    width: 1170px;  }  .span12 {    width: 1170px;  }  .span11 {    width: 1070px;  }  .span10 {    width: 970px;  }  .span9 {    width: 870px;  }  .span8 {    width: 770px;  }  .span7 {    width: 670px;  }  .span6 {    width: 570px;  }  .span5 {    width: 470px;  }  .span4 {    width: 370px;  }  .span3 {    width: 270px;  }  .span2 {    width: 170px;  }  .span1 {    width: 70px;  }  .offset12 {    margin-left: 1230px;  }  .offset11 {    margin-left: 1130px;  }  .offset10 {    margin-left: 1030px;  }  .offset9 {    margin-left: 930px;  }  .offset8 {    margin-left: 830px;  }  .offset7 {    margin-left: 730px;  }  .offset6 {    margin-left: 630px;  }  .offset5 {    margin-left: 530px;  }  .offset4 {    margin-left: 430px;  }  .offset3 {    margin-left: 330px;  }  .offset2 {    margin-left: 230px;  }  .offset1 {    margin-left: 130px;  }  .row-fluid {    width: 100%;    *zoom: 1;  }  .row-fluid:before,  .row-fluid:after {    display: table;    content: "";  }  .row-fluid:after {    clear: both;  }  .row-fluid [class*="span"] {    display: block;    width: 100%;    min-height: 28px;    -webkit-box-sizing: border-box;    -moz-box-sizing: border-box;    -ms-box-sizing: border-box;    box-sizing: border-box;    float: left;    margin-left: 2.564102564%;    *margin-left: 2.510911074638298%;  }  .row-fluid [class*="span"]:first-child {    margin-left: 0;  }  .row-fluid .span12 {    width: 100%;    *width: 99.94680851063829%;  }  .row-fluid .span11 {    width: 91.45299145300001%;    *width: 91.3997999636383%;  }  .row-fluid .span10 {    width: 82.905982906%;    *width: 82.8527914166383%;  }  .row-fluid .span9 {    width: 74.358974359%;    *width: 74.30578286963829%;  }  .row-fluid .span8 {    width: 65.81196581200001%;    *width: 65.7587743226383%;  }  .row-fluid .span7 {    width: 57.264957265%;    *width: 57.2117657756383%;  }  .row-fluid .span6 {    width: 48.717948718%;    *width: 48.6647572286383%;  }  .row-fluid .span5 {    width: 40.170940171000005%;    *width: 40.117748681638304%;  }  .row-fluid .span4 {    width: 31.623931624%;    *width: 31.5707401346383%;  }  .row-fluid .span3 {    width: 23.076923077%;    *width: 23.0237315876383%;  }  .row-fluid .span2 {    width: 14.529914530000001%;    *width: 14.4767230406383%;  }  .row-fluid .span1 {    width: 5.982905983%;    *width: 5.929714493638298%;  }  input,  textarea,  .uneditable-input {    margin-left: 0;  }  input.span12, textarea.span12, .uneditable-input.span12 {    width: 1160px;  }  input.span11, textarea.span11, .uneditable-input.span11 {    width: 1060px;  }  input.span10, textarea.span10, .uneditable-input.span10 {    width: 960px;  }  input.span9, textarea.span9, .uneditable-input.span9 {    width: 860px;  }  input.span8, textarea.span8, .uneditable-input.span8 {    width: 760px;  }  input.span7, textarea.span7, .uneditable-input.span7 {    width: 660px;  }  input.span6, textarea.span6, .uneditable-input.span6 {    width: 560px;  }  input.span5, textarea.span5, .uneditable-input.span5 {    width: 460px;  }  input.span4, textarea.span4, .uneditable-input.span4 {    width: 360px;  }  input.span3, textarea.span3, .uneditable-input.span3 {    width: 260px;  }  input.span2, textarea.span2, .uneditable-input.span2 {    width: 160px;  }  input.span1, textarea.span1, .uneditable-input.span1 {    width: 60px;  }  .thumbnails {    margin-left: -30px;  }  .thumbnails > li {    margin-left: 30px;  }  .row-fluid .thumbnails {    margin-left: 0;  }}@media (max-width: 979px) {  body {    padding-top: 0;  }  .navbar-fixed-top,  .navbar-fixed-bottom {    position: static;  }  .navbar-fixed-top {    margin-bottom: 18px;  }  .navbar-fixed-bottom {    margin-top: 18px;  }  .navbar-fixed-top .navbar-inner,  .navbar-fixed-bottom .navbar-inner {    padding: 5px;  }  .navbar .container {    width: auto;    padding: 0;  }  .navbar .brand {    padding-left: 10px;    padding-right: 10px;    margin: 0 0 0 -5px;  }  .nav-collapse {    clear: both;  }  .nav-collapse .nav {    float: none;    margin: 0 0 9px;  }  .nav-collapse .nav > li {    float: none;  }  .nav-collapse .nav > li > a {    margin-bottom: 2px;  }  .nav-collapse .nav > .divider-vertical {    display: none;  }  .nav-collapse .nav .nav-header {    color: #999999;    text-shadow: none;  }  .nav-collapse .nav > li > a,  .nav-collapse .dropdown-menu a {    padding: 6px 15px;    font-weight: bold;    color: #999999;    -webkit-border-radius: 3px;    -moz-border-radius: 3px;    border-radius: 3px;  }  .nav-collapse .btn {    padding: 4px 10px 4px;    font-weight: normal;    -webkit-border-radius: 4px;    -moz-border-radius: 4px;    border-radius: 4px;  }  .nav-collapse .dropdown-menu li + li a {    margin-bottom: 2px;  }  .nav-collapse .nav > li > a:hover,  .nav-collapse .dropdown-menu a:hover {    background-color: #222222;  }  .nav-collapse.in .btn-group {    margin-top: 5px;    padding: 0;  }  .nav-collapse .dropdown-menu {    position: static;    top: auto;    left: auto;    float: none;    display: block;    max-width: none;    margin: 0 15px;    padding: 0;    background-color: transparent;    border: none;    -webkit-border-radius: 0;    -moz-border-radius: 0;    border-radius: 0;    -webkit-box-shadow: none;    -moz-box-shadow: none;    box-shadow: none;  }  .nav-collapse .dropdown-menu:before,  .nav-collapse .dropdown-menu:after {    display: none;  }  .nav-collapse .dropdown-menu .divider {    display: none;  }  .nav-collapse .navbar-form,  .nav-collapse .navbar-search {    float: none;    padding: 9px 15px;    margin: 9px 0;    border-top: 1px solid #222222;    border-bottom: 1px solid #222222;    -webkit-box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 1px 0 rgba(255,255,255,.1);    -moz-box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 1px 0 rgba(255,255,255,.1);    box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 1px 0 rgba(255,255,255,.1);  }  .navbar .nav-collapse .nav.pull-right {    float: none;    margin-left: 0;  }  .nav-collapse,  .nav-collapse.collapse {    overflow: hidden;    height: 0;  }  .navbar .btn-navbar {    display: block;  }  .navbar-static .navbar-inner {    padding-left: 10px;    padding-right: 10px;  }}@media (min-width: 980px) {  .nav-collapse.collapse {    height: auto !important;    overflow: visible !important;  }}

    Read the article

  • jtreg update, December 2012

    - by jjg
    There is a new version of jtreg available. The primary new feature is support for tests that have been written for use with TestNG, the popular open source testing framework. TestNG is supported by a variety of tools and plugins, which means that it is now possible to develop tests for OpenJDK using those tools, while still retaining the ability to have the tests be part of the OpenJDK test suite, and run with a single test harness, jtreg. jtreg can be downloaded from the OpenJDK jtreg page: http://openjdk.java.net/jtreg. TestNG support jtreg supports both single TestNG tests, which can be freely intermixed with other types of jtreg tests, and groups of TestNG tests. A single TestNG test class can be compiled and run by providing a test description using the new action tag: @run testng classname The test will be executed by using org.testng.TestNG. No main method is required. A group of TestNG tests organized in a standard package hierarchy can also be compiled and run by jtreg. Any such group must be identified by specifying the root directory of the package hierarchy. You can either do this in the top level TEST.ROOT file, or in a TEST.properties file in any subdirectory enclosing the group of tests. In either case, add a line to the file of the form: TestNG.dirs = dir ... Directories beginning with '/' are evaluated relative to the root directory of the test suite; otherwise they are evaluated relative to the directory containing the declaring file. In particular, note that you can simply use "TestNG.dirs = ." in a TEST.properties file in the root directory of the test group's package hierarchy. No additional test descriptions are necessary, but test descriptions containing information tags, such as @bug, @summary, etc are permitted. All the Java source files in the group will be compiled if necessary, before any of the tests in the group are run. The selected tests within the group will be run, one at a time, using org.testng.TestNG. Library classes The specification for the @library tag has been extended so that any paths beginning with '/' will be evaluated relative to the root directory of the test suite. In addition, some bugs have been fixed that prevented sharing the compiled versions of library classes between tests in different directories. Note: This has uncovered some issues in tests that use a combination of @build and @library tags, such that some tests may fail unexpectedly with ClassNotFoundException. The workaround for now is to ensure that library classes are listed before the test classes in any @build tags. To specify one or more library directories for a group of TestNG tests, add a line of the following form to the TEST.properties file in the root directory of the group's package hierarchy: lib.dirs = dir ... As before, directories beginning with '/' are evaluated relative to the root directory of the test suite; otherwise they are evaluated relative to the directory containing the declaring file. The libraries will be available to all classes in the group; you cannot specify different libraries for different tests within the group. Coming soon ... From this point on, jtreg development will be using the new jtreg repository in the OpenJDK code-tools project. There is a new email alias jtreg-dev at openjdk.java.net for discussions about jtreg development. The existing alias jtreg-use at openjdk.java.net will continue to be available for questions about using jtreg. For more information ... An updated version of the jtreg Tag Language Specification is being prepared, and will be made available when it is ready. In the meantime, you can find more information about the support for TestNG by executing the following command: $ jtreg -onlinehelp TestNG For more information on TestNG itself, visit testng.org.

    Read the article

  • What is the most platform- and Python-version-independent way to make a fast loop for use in Python?

    - by Statto
    I'm writing a scientific application in Python with a very processor-intensive loop at its core. I would like to optimise this as far as possible, at minimum inconvenience to end users, who will probably use it as an uncompiled collection of Python scripts, and will be using Windows, Mac, and (mainly Ubuntu) Linux. It is currently written in Python with a dash of NumPy, and I've included the code below. Is there a solution which would be reasonably fast which would not require compilation? This would seem to be the easiest way to maintain platform-independence. If using something like Pyrex, which does require compilation, is there an easy way to bundle many modules and have Python choose between them depending on detected OS and Python version? Is there an easy way to build the collection of modules without needing access to every system with every version of Python? Does one method lend itself particularly to multi-processor optimisation? (If you're interested, the loop is to calculate the magnetic field at a given point inside a crystal by adding together the contributions of a large number of nearby magnetic ions, treated as tiny bar magnets. Basically, a massive sum of these.) # calculate_dipole # ------------------------- # calculate_dipole works out the dipole field at a given point within the crystal unit cell # --- # INPUT # mu = position at which to calculate the dipole field # r_i = array of atomic positions # mom_i = corresponding array of magnetic moments # --- # OUTPUT # B = the B-field at this point def calculate_dipole(mu, r_i, mom_i): relative = mu - r_i r_unit = unit_vectors(relative) #4pi / mu0 (at the front of the dipole eqn) A = 1e-7 #initalise dipole field B = zeros(3,float) for i in range(len(relative)): #work out the dipole field and add it to the estimate so far B += A*(3*dot(mom_i[i],r_unit[i])*r_unit[i] - mom_i[i]) / sqrt(dot(relative[i],relative[i]))**3 return B

    Read the article

  • Generate canonical / real URL based on base.href or location

    - by blueyed
    Is there a method/function to get the canonical / transformed URL, respecting any base.href setting of the page? I can get the base URL via (in jQuery) using $("base").attr("href") and I could use string methods to parse the URL meant to being made relative to this, but $("base").attr("href") has no host, path etc attributes (like window.location has) manually putting this together is rather tedious E.g., given a base.href of "http://example.com/foo/" and a relative URL "/bar.js", the result should be: "http://example.com/bar.js" If base.href is not present, the URL should be made relative to window.location. This should handle non-existing base.href (using location as base in this case). Is there a standard method available for this already? (I'm looking for this, since jQuery.getScript fails when using a relative URL like "/foo.js" and BASE tag is being used (FF3.6 makes an OPTIONS request, and nginx cannot handle this). When using the full URL (base.href.host + "/foo.js", it works).)

    Read the article

  • Background image help (Solved)

    - by J2
    thanks for help, ended up with this html{ position:relative; min-width:950px; height:100%; background:black url(images/GrassBG.png) repeat-y top center; font:13px "Lucida Grande",Helvetica,Arial,sans-serif; } body.main{ width:950px; margin:0 auto; position:relative; } is there any way when using a div for a background image- to limit the height to only the content displayed? im putting the background image in a div because i want it centered via position:relative but the image doesnt show up unless i put a height on the div, and thats not what i want because i dont want to be able to just scroll down to the bottom of the image where theres no content ive tried putting the background image on the body css but if the browser is less than the width of the image, it just throws it over to the left and you can only see half of it- is there no way to make the background position:relative on the body? sorry if that doesnt make sense < thanks why can you not use Position:relative; on the body?

    Read the article

  • Open Select using Javascript/jQuery?

    - by Newbie
    Hello! Is there a way to open a select box using Javascript (and jQuery)? <select style="width:150px;"> <option value="1">1</option> <option value="2">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc arcu nunc, rhoncus ac dignissim at, rhoncus ac tellus.</option> <option value="3">3</option> </select> I have to open my select, cause of ie bug. All versions of IE (6,7,8) cut my options. As far as I know, there is no css bugfix for this. At the moment I try to do the following: var original_width = 0; var selected_val = false; if (jQuery.browser.msie) { $('select').click(function(){ if (selected_val == false){ if(original_width == 0) original_width = $(this).width(); $(this).css({ 'position' : 'absolute', 'width' : 'auto' }); }else{ $(this).css({ 'position' : 'relative', 'width' : original_width }); selected_val = false; } }); $('select').blur(function(){ $(this).css({ 'position' : 'relative', 'width' : original_width }); }); $('select').blur(function(){ $(this).css({ 'position' : 'relative', 'width' : original_width }); }); $('select').change(function(){ $(this).css({ 'position' : 'relative', 'width' : original_width }); }); $('select option').click(function(){ $(this).css({ 'position' : 'relative', 'width' : original_width }); selected_val = true; }); } But clicking on my select the first time will change the width of the select but I have to click again to open it.

    Read the article

  • Why does my Google maps api v3 and side panel not fill my page upon resizing?

    - by Gavin
    I'm developing a web page and I have a side panel on the left with a search bar and a Google maps api v3 filling the rest of the page to the right. When I make the browser very small vertically, there is a white space between the side panel and the map, and the bottom of the browser. However, the text continues to the bottom of the browser. It looks like: Here's my css code: <style type="text/css"> body {margin:0;} #panel {height:100%; width:300px; position:absolute; padding:0;background-color:#8C95A0;} #header {padding:2px; text-align:center} #address_instruction {position:relative; top:7%; padding:2px; text-align:center} #geocoder {position:relative; top:8%; padding:2px; text-align:center} #toggle_instruction {position:relative; top:22%; padding:2px; text-align:center} #layers {position:relative; top:25%; padding:2px; text-align:center} #layer0 {padding:2px; text-align:center} #layer1 {padding:2px; text-align:center} #layer2 {padding:2px; text-align:center} #link {top:50%; position:relative; padding:2px; text-align:center} #map_canvas {height:100%; left:300px; right:0px; position:absolute; padding:0;} </style> The IDs within #panel refer to the items on the left hand side in the panel. Why don't the side panel background color and map extend to the bottom of the browser?

    Read the article

  • POST and PUT requests – is it just the convention?

    - by bckpwrld
    I've read quite a few articles on the difference between POST and PUT and in when the two should be used. But there are still few things confusing me ( hopefully questions will make some sense ): 1) We should use PUT to create resources when we want clients to specify the URI of the newly created resources and we should use POST to create resources when we let service generate the URI of the newly created resources. a) Is it just by convention that POST create request doesn't contain an URI of the newly created resource or POST create request actually can't contain the URI of the newly created resource? b) PUT has idempotent semantics and thus can be safely used for absolute updates ( ie we send entire state of the resource to the server ), but not also for relative updates ( ie we send just changes to the resource state ), since that would violate its semantics. But I assume it's still possible for PUT to send relative updates to the server, it's just that in that case the PUT update won't be idempotent? 2) I've read somewhere that we should "use POST to append a resource to a collection identified by a service-generated URI". a) What exactly does that mean? That if URIs for the resources were generated by a server ( thus the resources were created via POST ), then ALL subsequent resources should also be created via POST? Thus, in such situation no resource should be created via PUT? b) If my assumption under a) is correct, could you elaborate why we shouldn't create some resources via POST and some via PUT ( assuming server already contains a collection of resources created via POST )? REPLY: 1) Please correct me if I'm wrong, but from your post and from the link you've posted, it seems: a) The Request-URI in POST is interpreted by server as the URI of the service. Thus, it could just as easily be interpreted as an URI of a newly created resource, if server code was written to recognize Request-URI as such b) Similarly, PUT is able to send relative updates, it's just that service code is usually written such that it will complain if PUT updates are relative. 2) Usually, create has fallen into the POST camp, because of the idea of "appending to a collection." It's become the way to append a resource to a list of resources. I don't quite understand the reasoning behind the idea of "appending to a collection" and why this idea prefers POST for create. Namely, if we create 10 resources via PUT, then server will contain a collection of 10 resources and if we then create another resource, then server will append this resource to that collection ( which will now contain 11 resources )?! Uh, this is kinda confusing thank you

    Read the article

  • How to combine try_files and sendfile on Nginx?

    - by hcalves
    I need Nginx to serve a file relative from document root if it exists, then fallback to an upstream server if it doesn't. This can be accomplished with something like: server { listen 80; server_name localhost; location / { root /var/www/nginx/; try_files $uri @my_upstream; } location @my_upstream { internal; proxy_pass http://127.0.0.1:8000; } } Fair enough. The problem is, my upstream is not serving the contents of URI directly, but instead, returning X-Accel-Redirect with a location relative to document root (it generates this file on-the-fly): % curl -I http://127.0.0.1:8000/animals/kitten.jpg__100x100__crop.jpg HTTP/1.0 200 OK Date: Mon, 26 Nov 2012 20:58:25 GMT Server: WSGIServer/0.1 Python/2.7.2 X-Accel-Redirect: animals/kitten.jpg__100x100__crop.jpg Content-Type: text/html; charset=utf-8 Apparently, this should work. The problem though is that Nginx tries to serve this file from some internal default document root instead of using the one specified in the location block: 2012/11/26 18:44:55 [error] 824#0: *54 open() "/usr/local/Cellar/nginx/1.2.4/htmlanimals/kitten.jpg__100x100__crop.jpg" failed (2: No such file or directory), client: 127.0.0.1, server: localhost, request: "GET /animals/kitten.jpg__100x100__crop.jpg HTTP/1.1", upstream: "http://127.0.0.1:8000/animals/kitten.jpg__100x100__crop.jpg", host: "127.0.0.1:80" How do I force Nginx to serve the file relative to the right document root? According to XSendfile documentation the returned path should be relative, so my upstream is doing the right thing.

    Read the article

  • 2D OBB collision detection, resolving collisions?

    - by Milo
    I currently use OBBs and I have a vehicle that is a rigid body and some buildings. Here is my update() private void update() { camera.setPosition((vehicle.getPosition().x * camera.getScale()) - ((getWidth() ) / 2.0f), (vehicle.getPosition().y * camera.getScale()) - ((getHeight() ) / 2.0f)); //camera.move(input.getAnalogStick().getStickValueX() * 15.0f, input.getAnalogStick().getStickValueY() * 15.0f); if(input.isPressed(ControlButton.BUTTON_GAS)) { vehicle.setThrottle(1.0f, false); } if(input.isPressed(ControlButton.BUTTON_BRAKE)) { vehicle.setBrakes(1.0f); } vehicle.setSteering(input.getAnalogStick().getStickValueX()); vehicle.update(16.6666f / 1000.0f); ArrayList<Building> buildings = city.getBuildings(); for(Building b : buildings) { if(vehicle.getRect().overlaps(b.getRect())) { vehicle.update(-17.0f / 1000.0f); break; } } } The collision detection works well. What doesn't is how they are dealt with. My goal is simple. If the vehicle hits a building, it should stop, and never go into the building. When I apply negative torque to reverse the car should not feel buggy and move away from the building. I don't want this to look buggy. This is my rigid body class: class RigidBody extends Entity { //linear private Vector2D velocity = new Vector2D(); private Vector2D forces = new Vector2D(); private float mass; //angular private float angularVelocity; private float torque; private float inertia; //graphical private Vector2D halfSize = new Vector2D(); private Bitmap image; public RigidBody() { //set these defaults so we don't get divide by zeros mass = 1.0f; inertia = 1.0f; } //intialize out parameters public void initialize(Vector2D halfSize, float mass, Bitmap bitmap) { //store physical parameters this.halfSize = halfSize; this.mass = mass; image = bitmap; inertia = (1.0f / 20.0f) * (halfSize.x * halfSize.x) * (halfSize.y * halfSize.y) * mass; RectF rect = new RectF(); float scalar = 10.0f; rect.left = (int)-halfSize.x * scalar; rect.top = (int)-halfSize.y * scalar; rect.right = rect.left + (int)(halfSize.x * 2.0f * scalar); rect.bottom = rect.top + (int)(halfSize.y * 2.0f * scalar); setRect(rect); } public void setLocation(Vector2D position, float angle) { getRect().set(position, getWidth(), getHeight(), angle); } public Vector2D getPosition() { return getRect().getCenter(); } @Override public void update(float timeStep) { //integrate physics //linear Vector2D acceleration = Vector2D.scalarDivide(forces, mass); velocity = Vector2D.add(velocity, Vector2D.scalarMultiply(acceleration, timeStep)); Vector2D c = getRect().getCenter(); c = Vector2D.add(getRect().getCenter(), Vector2D.scalarMultiply(velocity , timeStep)); setCenter(c.x, c.y); forces = new Vector2D(0,0); //clear forces //angular float angAcc = torque / inertia; angularVelocity += angAcc * timeStep; setAngle(getAngle() + angularVelocity * timeStep); torque = 0; //clear torque } //take a relative Vector2D and make it a world Vector2D public Vector2D relativeToWorld(Vector2D relative) { Matrix mat = new Matrix(); float[] Vector2Ds = new float[2]; Vector2Ds[0] = relative.x; Vector2Ds[1] = relative.y; mat.postRotate(JMath.radToDeg(getAngle())); mat.mapVectors(Vector2Ds); return new Vector2D(Vector2Ds[0], Vector2Ds[1]); } //take a world Vector2D and make it a relative Vector2D public Vector2D worldToRelative(Vector2D world) { Matrix mat = new Matrix(); float[] Vectors = new float[2]; Vectors[0] = world.x; Vectors[1] = world.y; mat.postRotate(JMath.radToDeg(-getAngle())); mat.mapVectors(Vectors); return new Vector2D(Vectors[0], Vectors[1]); } //velocity of a point on body public Vector2D pointVelocity(Vector2D worldOffset) { Vector2D tangent = new Vector2D(-worldOffset.y, worldOffset.x); return Vector2D.add( Vector2D.scalarMultiply(tangent, angularVelocity) , velocity); } public void applyForce(Vector2D worldForce, Vector2D worldOffset) { //add linear force forces = Vector2D.add(forces ,worldForce); //add associated torque torque += Vector2D.cross(worldOffset, worldForce); } @Override public void draw( GraphicsContext c) { c.drawRotatedScaledBitmap(image, getPosition().x, getPosition().y, getWidth(), getHeight(), getAngle()); } } Essentially, when any rigid body hits a building it should exhibit the same behavior. How is collision solving usually done? Thanks

    Read the article

  • Opposite Force to Apply to a Collided Rigid Body?

    - by Milo
    I'm working on the physics for my GTA2-like game so I can learn more about game physics. The collision detection and resolution are working great. I'm now just unsure how to compute the force to apply to a body after it collides with a wall. My rigid body looks like this: /our simulation object class RigidBody extends Entity { //linear private Vector2D velocity = new Vector2D(); private Vector2D forces = new Vector2D(); private float mass; private Vector2D v = new Vector2D(); //angular private float angularVelocity; private float torque; private float inertia; //graphical private Vector2D halfSize = new Vector2D(); private Bitmap image; private Matrix mat = new Matrix(); private float[] Vector2Ds = new float[2]; private Vector2D tangent = new Vector2D(); private static Vector2D worldRelVec = new Vector2D(); private static Vector2D relWorldVec = new Vector2D(); private static Vector2D pointVelVec = new Vector2D(); private static Vector2D acceleration = new Vector2D(); public RigidBody() { //set these defaults so we don't get divide by zeros mass = 1.0f; inertia = 1.0f; setLayer(LAYER_OBJECTS); } protected void rectChanged() { if(getWorld() != null) { getWorld().updateDynamic(this); } } //intialize out parameters public void initialize(Vector2D halfSize, float mass, Bitmap bitmap) { //store physical parameters this.halfSize = halfSize; this.mass = mass; image = bitmap; inertia = (1.0f / 20.0f) * (halfSize.x * halfSize.x) * (halfSize.y * halfSize.y) * mass; RectF rect = new RectF(); float scalar = 10.0f; rect.left = (int)-halfSize.x * scalar; rect.top = (int)-halfSize.y * scalar; rect.right = rect.left + (int)(halfSize.x * 2.0f * scalar); rect.bottom = rect.top + (int)(halfSize.y * 2.0f * scalar); setRect(rect); } public void setLocation(Vector2D position, float angle) { getRect().set(position.x,position.y, getWidth(), getHeight(), angle); rectChanged(); } public Vector2D getPosition() { return getRect().getCenter(); } @Override public void update(float timeStep) { doUpdate(timeStep); } public void doUpdate(float timeStep) { //integrate physics //linear acceleration.x = forces.x / mass; acceleration.y = forces.y / mass; velocity.x += (acceleration.x * timeStep); velocity.y += (acceleration.y * timeStep); //velocity = Vector2D.add(velocity, Vector2D.scalarMultiply(acceleration, timeStep)); Vector2D c = getRect().getCenter(); v.x = getRect().getCenter().getX() + (velocity.x * timeStep); v.y = getRect().getCenter().getY() + (velocity.y * timeStep); setCenter(v.x, v.y); forces.x = 0; //clear forces forces.y = 0; //angular float angAcc = torque / inertia; angularVelocity += angAcc * timeStep; setAngle(getAngle() + angularVelocity * timeStep); torque = 0; //clear torque } //take a relative Vector2D and make it a world Vector2D public Vector2D relativeToWorld(Vector2D relative) { mat.reset(); Vector2Ds[0] = relative.x; Vector2Ds[1] = relative.y; mat.postRotate(JMath.radToDeg(getAngle())); mat.mapVectors(Vector2Ds); relWorldVec.x = Vector2Ds[0]; relWorldVec.y = Vector2Ds[1]; return relWorldVec; } //take a world Vector2D and make it a relative Vector2D public Vector2D worldToRelative(Vector2D world) { mat.reset(); Vector2Ds[0] = world.x; Vector2Ds[1] = world.y; mat.postRotate(JMath.radToDeg(-getAngle())); mat.mapVectors(Vector2Ds); worldRelVec.x = Vector2Ds[0]; worldRelVec.y = Vector2Ds[1]; return worldRelVec; } //velocity of a point on body public Vector2D pointVelocity(Vector2D worldOffset) { tangent.x = -worldOffset.y; tangent.y = worldOffset.x; pointVelVec.x = (tangent.x * angularVelocity) + velocity.x; pointVelVec.y = (tangent.y * angularVelocity) + velocity.y; return pointVelVec; } public void applyForce(Vector2D worldForce, Vector2D worldOffset) { //add linear force forces.x += worldForce.x; forces.y += worldForce.y; //add associated torque torque += Vector2D.cross(worldOffset, worldForce); } @Override public void draw( GraphicsContext c) { c.drawRotatedScaledBitmap(image, getPosition().x, getPosition().y, getWidth(), getHeight(), getAngle()); } public Vector2D getVelocity() { return velocity; } public void setVelocity(Vector2D velocity) { this.velocity = velocity; } } The way it is given force is by the applyForce method, this method considers angular torque. I'm just not sure how to come up with the vectors in the case where: RigidBody hits static entity RigidBody hits other RigidBody that may or may not be in motion. Would anyone know a way (without too complex math) that I could figure out the opposite force I need to apply to the car? I know the normal it is colliding with and how deep it collided. My main goal is so that say I hit a building from the side, well the car should not just stay there, it should slowly rotate out of it if I'm more than 45 degrees. Right now when I hit a wall I only change the velocity directly which does not consider angular force. Thanks!

    Read the article

  • Calculating RAM Performance? Example: DDR3-2133 CL9-11-10-28 1.65V vs DDR3-1600 CL10-10-10-30 1.5V

    - by user1131467
    How do you calculate the relative performance of PC RAM? For example, what is the relative performance of the following: G.Skill Ripjaws Z 8 x 4GB Kit, DDR3-2133, [email protected] G.Skill Ripjaws Z 4 x 8GB Kit, DDR3-1600, [email protected] If it's relevant, when they are used in a top of the line ASUS Rampage IV Extreme motherboard and Intel i7 3960X? By performance, I mean relative: read latency write latency read bandwidth write bandwidth Please include working. (I mean how did you arrive at the figures based on timing and DDR3-speed)

    Read the article

  • "'0.offsetWidth' is null or not an object" - Coda Slider - Javascript Error Question

    - by bgadoci
    I implemented the Coda Slider tutorial successfully that is located here: http://jqueryfordesigners.com/coda-slider-effect/ The slider works great but I am getting a javascript error that I am not sure how to fix. The error says: '0.offsetWidth' is null or not an object coda-slider.js, line 19 character 3 Not sure how to fix it. Anyone have any ideas? Here is my js and css (don't think I need to upload the HTML but let me know if that helps). JS (coda-slider.js) // when the DOM is ready... $(document).ready(function () { var $panels = $('#slider .scrollContainer > div'); var $container = $('#slider .scrollContainer'); // if false, we'll float all the panels left and fix the width // of the container var horizontal = true; // float the panels left if we're going horizontal if (horizontal) { $panels.css({ 'float' : 'left', 'position' : 'relative' // IE fix to ensure overflow is hidden }); // calculate a new width for the container (so it holds all panels) $container.css('width', $panels[0].offsetWidth * $panels.length); <------line 19 } // collect the scroll object, at the same time apply the hidden overflow // to remove the default scrollbars that will appear var $scroll = $('#slider .scroll').css('overflow', 'hidden'); // apply our left + right buttons $scroll .before('<img class="scrollButtons left" src="/images/layout/navigation/scroll_left.png" />') .after('<img class="scrollButtons right" src="/images/layout/navigation/scroll_right.png" />'); // handle nav selection function selectNav() { $(this) .parents('ul:first') .find('a') .removeClass('selected') .end() .end() .addClass('selected'); } $('#slider .navigation').find('a').click(selectNav); // go find the navigation link that has this target and select the nav function trigger(data) { var el = $('#slider .navigation').find('a[href$="' + data.id + '"]').get(0); selectNav.call(el); } if (window.location.hash) { trigger({ id : window.location.hash.substr(1) }); } else { $('ul.navigation a:first').click(); } // offset is used to move to *exactly* the right place, since I'm using // padding on my example, I need to subtract the amount of padding to // the offset. Try removing this to get a good idea of the effect var offset = parseInt((horizontal ? $container.css('paddingTop') : $container.css('paddingLeft')) || 0) * -1; var scrollOptions = { target: $scroll, // the element that has the overflow // can be a selector which will be relative to the target items: $panels, navigation: '.navigation a', // selectors are NOT relative to document, i.e. make sure they're unique prev: 'img.left', next: 'img.right', // allow the scroll effect to run both directions axis: 'xy', onAfter: trigger, // our final callback offset: offset, // duration of the sliding effect duration: 500, // easing - can be used with the easing plugin: // http://gsgd.co.uk/sandbox/jquery/easing/ easing: 'swing' }; // apply serialScroll to the slider - we chose this plugin because it // supports// the indexed next and previous scroll along with hooking // in to our navigation. $('#slider').serialScroll(scrollOptions); // now apply localScroll to hook any other arbitrary links to trigger // the effect $.localScroll(scrollOptions); // finally, if the URL has a hash, move the slider in to position, // setting the duration to 1 because I don't want it to scroll in the // very first page load. We don't always need this, but it ensures // the positioning is absolutely spot on when the pages loads. scrollOptions.duration = 1; $.localScroll.hash(scrollOptions); }); CSS #slider { margin-left: 35px; position: relative; width: 875px; } .scroll { position: relative; width: 875px; height: 268px; overflow: auto; /* fix for IE to respect overflow */ background: #FFFFFF scroll 0; } .scrollContainer div.panel { position: relative; height: 210px; width: 875px; /* change to 560px if not using JS to remove rh.scroll */ } .scrollButtons { position: absolute; top: 115px; cursor: pointer; } .scrollButtons.left { left: -20px; } .scrollButtons.right { right: -20px; }

    Read the article

  • datagrid height issue in nested datagrid( when using three data grid)

    - by prince23
    hi, i have a nested datagrid(which is of three data grid). here i am able to show data with no issue. the first datagrid has 5 rows the main problem that comes here is when you click any row in first datagrid i show 2 datagrid( which has 10 rows) lets say i click 3 row in 2 data grid. it show further records in third datagrid. again when i click 5 row in 2 data grid it show further records in third datagrid. now all the recods are shown fine when u try to collpase the 3 row in 2 data grid it collpase but the issue is the height what the third datagrid which took space for showing the records( we can see a blank space showing between the main 2 datagrid and third data grid) in every grid first column i have an button where i am writing this code for expand and collpase this is the functionality i am implementing in all the datagrid button where i do expand collpase. hope my question is clear . any help would great private void btn1_Click(object sender, RoutedEventArgs e) { try { Button btnExpandCollapse = sender as Button; Image imgScore = (Image)btnExpandCollapse.FindName("img"); DependencyObject dep = (DependencyObject)e.OriginalSource; while ((dep != null) && !(dep is DataGridRow)) { dep = VisualTreeHelper.GetParent(dep); } // if we found the clicked row if (dep != null && dep is DataGridRow) { DataGridRow row = (DataGridRow)dep; // change the details visibility if (row.DetailsVisibility == Visibility.Collapsed) { imgScore.Source = new BitmapImage(new Uri("/Images/a1.JPG", UriKind.Relative)); row.DetailsVisibility = Visibility.Visible; } else { imgScore.Source = new BitmapImage(new Uri("/Images/a2JPG", UriKind.Relative)); row.DetailsVisibility = Visibility.Collapsed; } } } catch (System.Exception) { } } --------------------------------------- 2 datagrid private void btn2_Click(object sender, RoutedEventArgs e) { try { Button btnExpandCollapse = sender as Button; Image imgScore = (Image)btnExpandCollapse.FindName("img"); DependencyObject dep = (DependencyObject)e.OriginalSource; while ((dep != null) && !(dep is DataGridRow)) { dep = VisualTreeHelper.GetParent(dep); } // if we found the clicked row if (dep != null && dep is DataGridRow) { DataGridRow row = (DataGridRow)dep; // change the details visibility if (row.DetailsVisibility == Visibility.Collapsed) { imgScore.Source = new BitmapImage(new Uri("/Images/a1.JPG", UriKind.Relative)); row.DetailsVisibility = Visibility.Visible; } else { imgScore.Source = new BitmapImage(new Uri("/Images/a2JPG", UriKind.Relative)); row.DetailsVisibility = Visibility.Collapsed; } } } catch (System.Exception) { } } ----------------- 3 datagrid private void btn1_Click(object sender, RoutedEventArgs e) { try { Button btnExpandCollapse = sender as Button; Image imgScore = (Image)btnExpandCollapse.FindName("img"); DependencyObject dep = (DependencyObject)e.OriginalSource; while ((dep != null) && !(dep is DataGridRow)) { dep = VisualTreeHelper.GetParent(dep); } // if we found the clicked row if (dep != null && dep is DataGridRow) { DataGridRow row = (DataGridRow)dep; // change the details visibility if (row.DetailsVisibility == Visibility.Collapsed) { imgScore.Source = new BitmapImage(new Uri("/Images/a1.JPG", UriKind.Relative)); row.DetailsVisibility = Visibility.Visible; } else { imgScore.Source = new BitmapImage(new Uri("/Images/a2JPG", UriKind.Relative)); row.DetailsVisibility = Visibility.Collapsed; } } } catch (System.Exception) { } }**

    Read the article

< Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >