stats reduce view
stats reduce view


Former-commit-id: 501735ca670b5f69a7b39c250edd14003970c2ae

[submodule "couchdb/couchdb-lucene"] [submodule "couchdb/couchdb-lucene"]
path = couchdb/couchdb-lucene path = couchdb/couchdb-lucene
url = https://github.com/rnewson/couchdb-lucene.git url = https://github.com/rnewson/couchdb-lucene.git
[submodule "couchdb/settee"]  
path = couchdb/settee  
url = https://github.com/inadarei/settee.git  
[submodule "lib/php-diff"] [submodule "lib/php-diff"]
path = lib/php-diff path = lib/php-diff
url = https://github.com/chrisboulton/php-diff.git url = https://github.com/chrisboulton/php-diff.git
[submodule "lib/Requests"] [submodule "lib/Requests"]
path = lib/Requests path = lib/Requests
url = https://github.com/rmccue/Requests.git url = https://github.com/rmccue/Requests.git
[submodule "js/flotr2"] [submodule "js/flotr2"]
path = js/flotr2 path = js/flotr2
url = https://github.com/HumbleSoftware/Flotr2.git url = https://github.com/HumbleSoftware/Flotr2.git
[submodule "lib/phpquery"] [submodule "lib/phpquery"]
path = lib/phpquery path = lib/phpquery
url = https://github.com/TobiaszCudnik/phpquery.git url = https://github.com/TobiaszCudnik/phpquery.git
[submodule "js/sigma"] [submodule "js/sigma"]
path = js/sigma path = js/sigma
url = https://github.com/jacomyal/sigma.js.git url = https://github.com/jacomyal/sigma.js.git
[submodule "js/bubbletree"] [submodule "js/bubbletree"]
path = js/bubbletree path = js/bubbletree
url = https://github.com/okfn/bubbletree.git url = https://github.com/okfn/bubbletree.git
[submodule "lib/querypath"] [submodule "lib/querypath"]
path = lib/querypath path = lib/querypath
url = https://github.com/technosophos/querypath.git url = https://github.com/technosophos/querypath.git
[submodule "lib/amon-php"] [submodule "lib/amon-php"]
path = lib/amon-php path = lib/amon-php
url = https://github.com/martinrusev/amon-php.git url = https://github.com/martinrusev/amon-php.git
[submodule "documents/lib/parsedatetime"] [submodule "documents/lib/parsedatetime"]
path = documents/lib/parsedatetime path = documents/lib/parsedatetime
url = git://github.com/bear/parsedatetime.git url = git://github.com/bear/parsedatetime.git
  [submodule "lib/FeedWriter"]
  path = lib/FeedWriter
  url = https://github.com/mibe/FeedWriter
   
<?php <?php
   
include_once("../include/common.inc.php"); include_once("../include/common.inc.php");
   
$format = "csv"; $format = "csv";
//$format = "json"; //$format = "json";
if (isset($_REQUEST['format'])) $format = $_REQUEST['format']; if (isset($_REQUEST['format']))
  $format = $_REQUEST['format'];
setlocale(LC_CTYPE, 'C'); setlocale(LC_CTYPE, 'C');
if ($format == "csv") { if ($format == "csv") {
$headers = Array("name"); $headers = Array("name");
} else { } else {
$headers = Array(); $headers = Array();
} }
   
$db = $server->get_db('disclosr-agencies'); $db = $server->get_db('disclosr-agencies');
try { try {
$rows = $db->get_view("app", "all", null, true)->rows; $rows = $db->get_view("app", "all", null, true)->rows;
   
$dataValues = Array(); $dataValues = Array();
foreach ($rows as $row) { foreach ($rows as $row) {
if (isset($row->value->statistics->employees)) { if (isset($row->value->statistics->employees)) {
   
$headers = array_unique(array_merge($headers, array_keys(object_to_array($row->value->statistics->employees)))); $headers = array_unique(array_merge($headers, array_keys(object_to_array($row->value->statistics->employees))));
   
} }
} }
} catch (SetteeRestClientException $e) { } catch (SetteeRestClientException $e) {
setteErrorHandler($e); setteErrorHandler($e);
} }
   
$fp = fopen('php://output', 'w'); $fp = fopen('php://output', 'w');
if ($fp && $db) { if ($fp && $db) {
if ($format == "csv") { if ($format == "csv") {
header('Content-Type: text/csv; charset=utf-8'); header('Content-Type: text/csv; charset=utf-8');
header('Content-Disposition: attachment; filename="export.employeestats.' . date("c") . '.csv"'); header('Content-Disposition: attachment; filename="export.employeestats.' . date("c") . '.csv"');
} }
header('Pragma: no-cache'); header('Pragma: no-cache');
header('Expires: 0'); header('Expires: 0');
if ($format == "csv") { if ($format == "csv") {
fputcsv($fp, $headers); fputcsv($fp, $headers);
} else if ($format == "json") { } else if ($format == "json") {
echo '{ echo '{
"labels" : ["' . implode('","', $headers) . '"],'.PHP_EOL; "labels" : ["' . implode('","', $headers) . '"],' . PHP_EOL;
} }
try { try {
$agencies = $db->get_view("app", "all", null, true)->rows; $agencies = $db->get_view("app", "all", null, true)->rows;
//print_r($agencies); //print_r($agencies);
$first = true; $first = true;
if ($format == "json") { if ($format == "json") {
echo '"data" : ['.PHP_EOL; echo '"data" : [' . PHP_EOL;
   
} }
foreach ($agencies as $agency) { foreach ($agencies as $agency) {
   
if (isset($agency->value->statistics->employees)) { if (isset($agency->value->statistics->employees)) {
$row = Array(); $row = Array();
$agencyEmployeesArray = object_to_array($agency->value->statistics->employees); $agencyEmployeesArray = object_to_array($agency->value->statistics->employees);
foreach ($headers as $i => $fieldName) { foreach ($headers as $i => $fieldName) {
  if ($format == "csv") {
  if (isset($agencyEmployeesArray[$fieldName])) {
  $row[] = $agencyEmployeesArray[$fieldName]["value"] ;
  } else if ($i == 0) {
  $row[] = $agency->value->name;
  } else {
  $row[] = 0;
  }
  } else if ($format == "json") {
if (isset($agencyEmployeesArray[$fieldName])) { if (isset($agencyEmployeesArray[$fieldName])) {
$row[] = '['.$i.','.$agencyEmployeesArray[$fieldName]["value"].']'; $row[] = '[' . $i . ',' . $agencyEmployeesArray[$fieldName]["value"] . ']';
} else { } else {
$row[] = '['.$i.',0]'; $row[] = '[' . $i . ',0]';
} }
  }
} }
if ($format == "csv") { if ($format == "csv") {
fputcsv($fp, array_values($row)); fputcsv($fp, array_values($row));
} else if ($format == "json") { } else if ($format == "json") {
if (!$first) echo ","; if (!$first)
echo '{"data" : [' . implode(",", array_values($row)) . '], "label": "'.$agency->value->name.'", "lines" : { "show" : true }, "points" : { "show" : true }}'.PHP_EOL; echo ",";
  echo '{"data" : [' . implode(",", array_values($row)) . '], "label": "' . $agency->value->name . '", "lines" : { "show" : true }, "points" : { "show" : true }}' . PHP_EOL;
$first = false; $first = false;
} }
} }
} }
if ($format == "json") { if ($format == "json") {
echo '] echo ']
}'.PHP_EOL; }' . PHP_EOL;
   
} }
} catch (SetteeRestClientException $e) { } catch (SetteeRestClientException $e) {
setteErrorHandler($e); setteErrorHandler($e);
} }
   
die; die;
} }
?> ?>
   
<?php <?php
   
include_once("../include/common.inc.php"); include_once("../include/common.inc.php");
require($basePath . 'lib/phpquery/phpQuery/phpQuery.php'); require($basePath . 'lib/phpquery/phpQuery/phpQuery.php');
   
setlocale(LC_CTYPE, 'C'); setlocale(LC_CTYPE, 'C');
   
   
$db = $server->get_db('disclosr-agencies'); $db = $server->get_db('disclosr-agencies');
  // metatags
  try {
  $agencies = $db->get_view("app", "byCanonicalName", null, true)->rows;
  //print_r($rows);
  foreach ($agencies as $agency) {
  if (isset($agency->value->scrapeDepth)) {
  unset($agency->value->scrapeDepth);
  }
   
  if (isset($agency->value->lastScraped)) {
  unset($agency->value->lastScraped);
  }
  $db->save($agency->value);
  echo "<hr>";
  flush();
  }
  } catch (SetteeRestClientException $e) {
  setteErrorHandler($e);
  }
  // metatags
try { try {
$agencies = $db->get_view("app", "byCanonicalName", null, true)->rows; $agencies = $db->get_view("app", "byCanonicalName", null, true)->rows;
//print_r($rows); //print_r($rows);
foreach ($agencies as $agency) { foreach ($agencies as $agency) {
//echo $agency->value->name . " ".$agency->value->website."<br />\n"; //echo $agency->value->name . " ".$agency->value->website."<br />\n";
// print_r($agency); // print_r($agency);
//hasRestricitiveLicence" hasRestrictiveLicense -> has Restrictive Licence //hasRestricitiveLicence" hasRestrictiveLicense -> has Restrictive Licence
// "hasYoutube" -> Tube // "hasYoutube" -> Tube
// "comment" -> "comments" // "comment" -> "comments"
if (!isset($agency->value->metaTags) && isset($agency->value->website)) { if (!isset($agency->value->metaTags) && isset($agency->value->website)) {
echo $agency->value->name . " ".$agency->value->website."<br />\n"; echo $agency->value->name . " " . $agency->value->website . "<br />\n";
$agency->value->metaTags = Array(); $agency->value->metaTags = Array();
$request = Requests::get($agency->value->website); $request = Requests::get($agency->value->website);
$html = phpQuery::newDocumentHTML($request->body); $html = phpQuery::newDocumentHTML($request->body);
phpQuery::selectDocument($html); phpQuery::selectDocument($html);
foreach (pq('meta')->elements as $meta) { foreach (pq('meta')->elements as $meta) {
$tagName = $meta->getAttribute('name');; $tagName = $meta->getAttribute('name');
  ;
$content = $meta->getAttribute('content'); $content = $meta->getAttribute('content');
if ($tagName != "") { if ($tagName != "") {
echo "$tagName == $content <br>\n"; echo "$tagName == $content <br>\n";
$agency->value->metaTags[$tagName] = $content; $agency->value->metaTags[$tagName] = $content;
} }
} }
//print_r($agency->value->metaTags); //print_r($agency->value->metaTags);
$db->save($agency->value); $db->save($agency->value);
echo "<hr>"; echo "<hr>";
flush(); flush();
} }
} }
} catch (SetteeRestClientException $e) { } catch (SetteeRestClientException $e) {
setteErrorHandler($e); setteErrorHandler($e);
} }
?> ?>
   
<?php <?php
   
require_once '../include/common.inc.php'; require_once '../include/common.inc.php';
   
$db = $server->get_db('disclosr-agencies'); $db = $server->get_db('disclosr-agencies');
$rows = $db->get_view("app", "byName")->rows; $rows = $db->get_view("app", "byName")->rows;
$nametoid = Array(); $nametoid = Array();
$sums = Array(); $sums = Array();
foreach ($rows as $row) { foreach ($rows as $row) {
$nametoid[trim($row->key)] = $row->value; $nametoid[trim($row->key)] = $row->value;
} }
$employeeCSVs = Array("2002-2003" => "0203apsemployees.csv", $employeeCSVs = Array("2002-2003" => "0203apsemployees.csv",
"2003-2004" => "0304apsemployees.csv", "2003-2004" => "0304apsemployees.csv",
"2004-2005" => "0405apsemployees.csv", "2004-2005" => "0405apsemployees.csv",
"2005-2006" => "0506apsemployees.csv", "2005-2006" => "0506apsemployees.csv",
"2006-2007" => "0607apsemployees.csv", "2006-2007" => "0607apsemployees.csv",
"2007-2008" => "0708apsemployees.csv", "2007-2008" => "0708apsemployees.csv",
"2008-2009" => "0809apsemployees.csv", "2008-2009" => "0809apsemployees.csv",
"2009-2010" => "0910apsemployees.csv", "2009-2010" => "0910apsemployees.csv",
"2010-2011" => "1011apsemployees.csv" "2010-2011" => "1011apsemployees.csv"
); );
foreach ($employeeCSVs as $timePeriod => $employeeCSV) { foreach ($employeeCSVs as $timePeriod => $employeeCSV) {
echo $employeeCSV . "<br>" . PHP_EOL; echo $employeeCSV . "<br>" . PHP_EOL;
$row = 1; $row = 1;
if (($handle = fopen($employeeCSV, "r")) !== FALSE) { if (($handle = fopen($employeeCSV, "r")) !== FALSE) {
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) { while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
//print_r($data); //print_r($data);
$name = trim($data[0]); $name = trim($data[0]);
if (isset($nametoid[$name])) { if (isset($nametoid[$name])) {
$id = $nametoid[$name]; $id = $nametoid[$name];
//echo $id . "<br>" . PHP_EOL; //echo $id . "<br>" . PHP_EOL;
@$sums[$id][$timePeriod] += $data[1]; @$sums[$id][$timePeriod] += $data[1];
} else { } else {
echo "<br>ERROR NAME MISSING FROM ID LIST<br><bR>" . PHP_EOL; echo "<br>ERROR NAME MISSING FROM ID LIST<br><bR>" . PHP_EOL;
   
die(); die();
} }
} }
fclose($handle); fclose($handle);
} }
} }
foreach ($sums as $id => $sum) { foreach ($sums as $id => $sum) {
echo $id . "<br>" . PHP_EOL; echo $id . "<br>" . PHP_EOL;
$doc = $db->get($id); $doc = $db->get($id);
echo $doc->name . "<br>" . PHP_EOL; echo $doc->name . "<br>" . PHP_EOL;
// print_r($doc); // print_r($doc);
$changed = false; $changed = false;
if (!isset($doc->statistics)) { if (!isset($doc->statistics)) {
$changed = true; $changed = true;
$doc->statistics = Array(); $doc->statistics = new stdClass();
  }
  if (!isset($doc->statistics->employees)) {
  $changed = true;
  $doc->statistics->employees = new stdClass();
} }
foreach ($sum as $timePeriod => $value) { foreach ($sum as $timePeriod => $value) {
if (!isset($doc->statistics->employees->$timePeriod->value) if (!isset($doc->statistics->employees->$timePeriod->value)
|| $doc->statistics->employees->$timePeriod->value != $value) { || $doc->statistics->employees->$timePeriod->value != $value) {
$changed = true; $changed = true;
$doc->statistics["employees"][$timePeriod] = Array("value" => $value, "source" => "http://apsc.gov.au/stateoftheservice/"); $doc->statistics->employees->$timePeriod = Array("value" => $value, "source" => "http://apsc.gov.au/stateoftheservice/");
} }
} }
if ($changed) { if ($changed) {
$db->save($doc); $db->save($doc);
} else { } else {
echo "not changed" . "<br>" . PHP_EOL; echo "not changed" . "<br>" . PHP_EOL;
} }
} }
// employees: timeperiod, source = apsc state of service, value // employees: timeperiod, source = apsc state of service, value
?> ?>
   
  <?php
 
  require_once '../include/common.inc.php';
  require($basePath . 'lib/phpquery/phpQuery/phpQuery.php');
  $db = $server->get_db('disclosr-agencies');
  $rows = $db->get_view("app", "byName")->rows;
  $nametoid = Array();
  $sums = Array();
  $functions = Array();
  foreach ($rows as $row) {
  $nametoid[trim($row->key)] = $row->value;
  }
 
 
  $request = Requests::get("http://www.apsc.gov.au/publications-and-media/parliamentary/state-of-the-service/new-sosr/appendix-2-aps-agencies");
  $doc = phpQuery::newDocumentHTML($request->body);
  phpQuery::selectDocument($doc);
  foreach (pq('tr')->elements as $tr) {
  //echo $tr->nodeValue.PHP_EOL;
  $agency = "";
  $employees = "";
  $function = "";
  $i = 0;
  foreach ($tr->childNodes as $td) {
  //echo $td->nodeValue." $i <br>";
  if ($i == 0)
  $agency = $td->nodeValue;
  if ($i == 2) {
  $employees = trim(str_replace(",", "", $td->nodeValue));
  }
  if ($i == 4) {
  $function = $td->nodeValue;
  }
  $i++;
  }
  if ($agency != "" && $employees != "" && $function != "") {
  $name = trim(str_replace('2','',$agency));
  //echo "$name<br><bR>" . PHP_EOL;
  if (isset($nametoid[$name])) {
  $id = $nametoid[$name];
  //echo $id . "<br>" . PHP_EOL;
  @$sums[$id]["2011-2012"] += $employees;
  $functions[$id] = $function;
  } else if ($agency != "Agency"){
  echo "<br>ERROR NAME '$agency' MISSING FROM ID LIST<br><bR>" . PHP_EOL;
 
  die();
  }
  } else {
  echo "skipped $agency";
  }
  }
  //print_r($sums);
  foreach ($sums as $id => $sum) {
  echo $id . "<br>" . PHP_EOL;
  $doc = $db->get($id);
  echo $doc->name . "<br>" . PHP_EOL;
  // print_r($doc);
  $changed = false;
  if (!isset($doc->statistics)) {
  $changed = true;
  $doc->statistics = new stdClass();
  }
  if (!isset($doc->statistics->employees)) {
  $changed = true;
  $doc->statistics->employees = new stdClass();
  }
  foreach ($sum as $timePeriod => $value) {
  if (!isset($doc->statistics->employees->$timePeriod->value)
  || $doc->statistics->employees->$timePeriod->value != $value) {
  $changed = true;
  $doc->statistics->employees->$timePeriod = Array("value" => $value, "source" => "http://apsc.gov.au/stateoftheservice/");
  $doc->employees = $value;
  $doc->functionClassification = $functions[$id];
  }
  }
 
  if ($changed) {
  $db->save($doc);
  } else {
  echo "not changed" . "<br>" . PHP_EOL;
  }
  }
  // employees: timeperiod, source = apsc state of service, value
  ?>
 
<?php <?php
   
require_once '../include/common.inc.php'; require_once '../include/common.inc.php';
   
$db = $server->get_db('disclosr-agencies'); $db = $server->get_db('disclosr-agencies');
$rows = $db->get_view("app", "byName")->rows; $rows = $db->get_view("app", "byName")->rows;
$nametoid = Array(); $nametoid = Array();
$accounts = Array(); $accounts = Array();
foreach ($rows as $row) { foreach ($rows as $row) {
$nametoid[trim($row->key)] = $row->value; $nametoid[trim($row->key)] = $row->value;
} }
   
function extractCSVAccounts($url, $nameField, $accountField, $filter) { function extractCSVAccounts($url, $nameField, $accountField, $filter) {
global $accounts, $nametoid; global $accounts, $nametoid;
$request = Requests::get($url); $request = Requests::get($url);
echo $url; echo $url;
$Data = str_getcsv($request->body, "\n"); //parse the rows $Data = str_getcsv($request->body, "\n"); //parse the rows
$headers = Array(); $headers = Array();
foreach ($Data as $num => $line) { foreach ($Data as $num => $line) {
$Row = str_getcsv($line, ","); $Row = str_getcsv($line, ",");
if ($num == 0) { if ($num == 0) {
$headers = $Row; $headers = $Row;
print_r($headers); print_r($headers);
} else { } else {
if (isset($Row[array_search($nameField, $headers)])) { if (isset($Row[array_search($nameField, $headers)])) {
$agencyName = $Row[array_search($nameField, $headers)]; $agencyName = $Row[array_search($nameField, $headers)];
if (!in_array(trim($agencyName), array_keys($nametoid))) { if (!in_array(trim($agencyName), array_keys($nametoid))) {
echo "$agencyName missing" . PHP_EOL; echo "$agencyName missing" . PHP_EOL;
} else { } else {
echo $Row[array_search($nameField, $headers)] . PHP_EOL; echo $Row[array_search($nameField, $headers)] . PHP_EOL;
$accounts[$nametoid[trim($agencyName)]]["rtkURLs"][$agencyName] = 'http://www.righttoknow.org.au/body/'.$Row[array_search($accountField, $headers)]; $accounts[$nametoid[trim($agencyName)]]["rtkURLs"][$agencyName] = 'http://www.righttoknow.org.au/body/'.$Row[array_search($accountField, $headers)];
  $accounts[$nametoid[trim($agencyName)]]["rtkDescriptions"][$agencyName] = $Row[array_search("Notes", $headers)];
} }
} else { } else {
echo "error finding any agency" . $line . PHP_EOL; echo "error finding any agency" . $line . PHP_EOL;
} }
} }
} }
} }
   
extractCSVAccounts("http://www.righttoknow.org.au/body/all-authorities.csv","Agency","URL name"); extractCSVAccounts("http://www.righttoknow.org.au/body/all-authorities.csv","Agency","URL name");
print_r($accounts); //print_r($accounts);
/* foreach ($accounts as $id => $accountTypes) { foreach ($accounts as $id => $allvalues) {
echo $id . "<br>" . PHP_EOL; echo $id . "<br>" . PHP_EOL;
$doc = object_to_array($db->get($id)); $doc = object_to_array($db->get($id));
// print_r($doc); // print_r($doc);
   
foreach ($accountTypes as $accountType => $accounts) { foreach ($allvalues as $valueType => $values) {
if (!isset($doc["has" . $accountType]) || !is_array($doc["has" . $accountType])) { if (!isset($doc[ $valueType]) || !is_array($doc[ $valueType])) {
$doc["has" . $accountType] = Array(); $doc[ $valueType] = Array();
} }
$doc["has" . $accountType] = array_unique(array_merge($doc["has" . $accountType], $accounts)); $doc[ $valueType] = array_unique(array_merge($doc[ $valueType], $values));
  if ( $valueType == "rtkDescriptions") {
  foreach ($values as $descriptionAgency => $descriptionValue) {
  if ($descriptionAgency == $doc->value->name) {
  $doc->value->description = $descriptionValue;
  }
  }
  }
} }
$db->save($doc); $db->save($doc);
}*/ }
?> ?>
   
<?php <?php
   
require_once '../include/common.inc.php'; require_once '../include/common.inc.php';
//function createFOIDocumentsDesignDoc() { //function createFOIDocumentsDesignDoc() {
   
$foidb = $server->get_db('disclosr-foidocuments'); $foidb = $server->get_db('disclosr-foidocuments');
$obj = new stdClass(); $obj = new stdClass();
$obj->_id = "_design/" . urlencode("app"); $obj->_id = "_design/" . urlencode("app");
$obj->language = "javascript"; $obj->language = "javascript";
$obj->views->all->map = "function(doc) { emit(doc._id, doc); };"; $obj->views->all->map = "function(doc) { emit(doc._id, doc); };";
$obj->views->byDate->map = "function(doc) { emit(doc.date, doc); };"; $obj->views->byDate->map = "function(doc) { emit(doc.date, doc); };";
$obj->views->byDate->reduce = "_count"; $obj->views->byDateMonthYear->map = "function(doc) { emit(doc.date, doc); };";
$obj->views->byAgencyID->map = "function(doc) { emit(doc.agencyID, doc); };"; $obj->views->byDateMonthYear->reduce = "_count";
$obj->views->byAgencyID->reduce = "_count"; $obj->views->byAgencyID->map = "function(doc) { emit(doc.agencyID, doc); };";
  $obj->views->byAgencyID->reduce = "_count";
   
// allow safe updates (even if slightly slower due to extra: rev-detection check). // allow safe updates (even if slightly slower due to extra: rev-detection check).
$foidb->save($obj, true); $foidb->save($obj, true);
   
   
function createDocumentsDesignDoc() { //function createDocumentsDesignDoc() {
/* $docdb = $server->get_db('disclosr-documents');
global $db;  
$obj = new stdClass(); $obj = new stdClass();
$obj->_id = "_design/" . urlencode("app"); $obj->_id = "_design/" . urlencode("app");
$obj->language = "javascript"; $obj->language = "javascript";
$obj->views->all->map = "function(doc) { emit(doc._id, doc); };"; $obj->views->web_server->map = "function(doc) {\n emit(doc.web_server, 1);\n}";
$obj->views->byABN->map = "function(doc) { emit(doc.abn, doc); };"; $obj->views->web_server->reduce = "_sum";
"views": { $obj->views->byAgency->map = "function(doc) {\n emit(doc.agencyID, 1);\n}";
"web_server": { $obj->views->byAgency->reduce = "_sum";
"map": "function(doc) {\n emit(doc.web_server, 1);\n}", $obj->views->byURL->map = "function(doc) {\n emit(doc.url, doc);\n}";
"reduce": "function (key, values, rereduce) {\n return sum(values);\n}" $obj->views->agency->map = "function(doc) {\n emit(doc.agencyID, doc);\n}";
}, $obj->views->byWebServer->map = "function(doc) {\n emit(doc.web_server, doc);\n}";
"byAgency": { $obj->views->getValidationRequired = "function(doc) {\nif (doc.mime_type == \"text/html\" \n&& typeof(doc.validation) == \"undefined\") {\n emit(doc._id, doc._attachments);\n}\n}";
"map": "function(doc) {\n emit(doc.agencyID, 1);\n}",  
"reduce": "function (key, values, rereduce) {\n return sum(values);\n}"  
},  
"byURL": {  
"map": "function(doc) {\n emit(doc.url, doc);\n}"  
},  
"agency": {  
"map": "function(doc) {\n emit(doc.agencyID, doc);\n}"  
},  
"byWebServer": {  
"map": "function(doc) {\n emit(doc.web_server, doc);\n}"  
},  
"getValidationRequired": {  
"map": "function(doc) {\nif (doc.mime_type == \"text/html\" \n&& typeof(doc.validation) == \"undefined\") {\n emit(doc._id, doc._attachments);\n}\n}"  
}  
} */  
}  
   
//function createAgencyDesignDoc() { //function createAgencyDesignDoc() {
$db = $server->get_db('disclosr-agencies'); $db = $server->get_db('disclosr-agencies');
$obj = new stdClass(); $obj = new stdClass();
$obj->_id = "_design/" . urlencode("app"); $obj->_id = "_design/" . urlencode("app");
$obj->language = "javascript"; $obj->language = "javascript";
$obj->views->all->map = "function(doc) { emit(doc._id, doc); };"; $obj->views->all->map = "function(doc) { emit(doc._id, doc); };";
$obj->views->byABN->map = "function(doc) { emit(doc.abn, doc); };"; $obj->views->byABN->map = "function(doc) { emit(doc.abn, doc); };";
$obj->views->byCanonicalName->map = "function(doc) { $obj->views->byCanonicalName->map = "function(doc) {
if (doc.parentOrg || doc.orgType == 'FMA-DepartmentOfState') { if (doc.parentOrg || doc.orgType == 'FMA-DepartmentOfState') {
emit(doc.name, doc); emit(doc.name, doc);
} }
};"; };";
$obj->views->byDeptStateName->map = "function(doc) { $obj->views->byDeptStateName->map = "function(doc) {
if (doc.orgType == 'FMA-DepartmentOfState') { if (doc.orgType == 'FMA-DepartmentOfState') {
emit(doc.name, doc._id); emit(doc.name, doc._id);
} }
};"; };";
$obj->views->parentOrgs->map = "function(doc) { $obj->views->parentOrgs->map = "function(doc) {
if (doc.parentOrg) { if (doc.parentOrg) {
emit(doc._id, doc.parentOrg); emit(doc._id, doc.parentOrg);
} }
};"; };";
$obj->views->byName->map = 'function(doc) { $obj->views->byName->map = 'function(doc) {
if (typeof(doc["status"]) == "undefined" || doc["status"] != "suspended") { if (typeof(doc["status"]) == "undefined" || doc["status"] != "suspended") {
emit(doc.name, doc._id); emit(doc.name, doc._id);
if (typeof(doc.shortName) != "undefined" && doc.shortName != doc.name) { if (typeof(doc.shortName) != "undefined" && doc.shortName != doc.name) {
emit(doc.shortName, doc._id); emit(doc.shortName, doc._id);
} }
for (name in doc.otherNames) { for (name in doc.otherNames) {
if (doc.otherNames[name] != "" && doc.otherNames[name] != doc.name) { if (doc.otherNames[name] != "" && doc.otherNames[name] != doc.name) {
emit(doc.otherNames[name], doc._id); emit(doc.otherNames[name], doc._id);
} }
} }
for (name in doc.foiBodies) { for (name in doc.foiBodies) {
if (doc.foiBodies[name] != "" && doc.foiBodies[name] != doc.name) { if (doc.foiBodies[name] != "" && doc.foiBodies[name] != doc.name) {
emit(doc.foiBodies[name], doc._id); emit(doc.foiBodies[name], doc._id);
} }
} }
for (name in doc.positions) { for (name in doc.positions) {
if (doc.positions[name] != "" && doc.positions[name] != doc.name) { if (doc.positions[name] != "" && doc.positions[name] != doc.name) {
emit(doc.positions[name], doc._id); emit(doc.positions[name], doc._id);
} }
} }
} }
};'; };';
   
$obj->views->foiEmails->map = "function(doc) { $obj->views->foiEmails->map = "function(doc) {
emit(doc._id, doc.foiEmail); emit(doc._id, doc.foiEmail);
};"; };";
   
$obj->views->byLastModified->map = "function(doc) { emit(doc.metadata.lastModified, doc); }"; $obj->views->byLastModified->map = "function(doc) { emit(doc.metadata.lastModified, doc); }";
$obj->views->getActive->map = 'function(doc) { if (doc.status == "active") { emit(doc._id, doc); } };'; $obj->views->getActive->map = 'function(doc) { if (doc.status == "active") { emit(doc._id, doc); } };';
$obj->views->getSuspended->map = 'function(doc) { if (doc.status == "suspended") { emit(doc._id, doc); } };'; $obj->views->getSuspended->map = 'function(doc) { if (doc.status == "suspended") { emit(doc._id, doc); } };';
$obj->views->getScrapeRequired->map = "function(doc) { $obj->views->getScrapeRequired->map = "function(doc) {
   
var lastScrape = Date.parse(doc.metadata.lastScraped); var lastScrape = Date.parse(doc.metadata.lastScraped);
   
var today = new Date(); var today = new Date();
   
if (!lastScrape || lastScrape.getTime() + 1000 != today.getTime()) { if (!lastScrape || lastScrape.getTime() + 1000 != today.getTime()) {
emit(doc._id, doc); emit(doc._id, doc);
} }
   
};"; };";
$obj->views->showNamesABNs->map = "function(doc) { emit(doc._id, {name: doc.name, abn: doc.abn}); };"; $obj->views->showNamesABNs->map = "function(doc) { emit(doc._id, {name: doc.name, abn: doc.abn}); };";
$obj->views->getConflicts->map = "function(doc) { $obj->views->getConflicts->map = "function(doc) {
if (doc._conflicts) { if (doc._conflicts) {
emit(null, [doc._rev].concat(doc._conflicts)); emit(null, [doc._rev].concat(doc._conflicts));
} }
}"; }";
// http://stackoverflow.com/questions/646628/javascript-startswith $obj->views->getStatistics->map =
$obj->views->score->map = 'if(!String.prototype.startsWith){ "function(doc) {
  if (doc.statistics) {
  for (var statisticSet in doc.statistics) {
  for (var statisticPeriod in doc.statistics[statisticSet]) {
  emit([statisticSet,statisticPeriod], doc.statistics[statisticSet][statisticPeriod]['value']);
  }
  }
  }
  }";
  $obj->views->getStatistics->reduce = '_sum';
  // http://stackoverflow.com/questions/646628/javascript-startswith
  $obj->views->score->map = 'if(!String.prototype.startsWith){
String.prototype.startsWith = function (str) { String.prototype.startsWith = function (str) {
return !this.indexOf(str); return !this.indexOf(str);
} }
} }
   
function(doc) { function(doc) {
count = 0; count = 0;
if (doc["status"] != "suspended") { if (doc["status"] != "suspended") {
for(var propName in doc) { for(var propName in doc) {
if(typeof(doc[propName]) != "undefined" && doc[propName] != "") { if(typeof(doc[propName]) != "undefined" && doc[propName] != "") {
count++; count++;
} }
} }
portfolio = doc.parentOrg; portfolio = doc.parentOrg;
if (doc.orgType == "FMA-DepartmentOfState") { if (doc.orgType == "FMA-DepartmentOfState") {
portfolio = doc._id; portfolio = doc._id;
} }
if (doc.orgType == "Court-Commonwealth" || doc.orgType == "FMA-DepartmentOfParliament") { if (doc.orgType == "Court-Commonwealth" || doc.orgType == "FMA-DepartmentOfParliament") {
portfolio = doc.orgType; portfolio = doc.orgType;
} }
emit(count+doc._id, {id:doc._id, name: doc.name, score:count, orgType: doc.orgType, portfolio:portfolio}); emit(count+doc._id, {id:doc._id, name: doc.name, score:count, orgType: doc.orgType, portfolio:portfolio});
} }
}'; }';
$obj->views->scoreHas->map = 'if(!String.prototype.startsWith){ $obj->views->scoreHas->map = 'if(!String.prototype.startsWith){
String.prototype.startsWith = function (str) { String.prototype.startsWith = function (str) {
return !this.indexOf(str); return !this.indexOf(str);
} }
} }
if(!String.prototype.endsWith){ if(!String.prototype.endsWith){
String.prototype.endsWith = function(suffix) { String.prototype.endsWith = function(suffix) {
    return this.indexOf(suffix, this.length - suffix.length) !== -1;     return this.indexOf(suffix, this.length - suffix.length) !== -1;
}; };
} }
function(doc) { function(doc) {
if (typeof(doc["status"]) == "undefined" || doc["status"] != "suspended") { if (typeof(doc["status"]) == "undefined" || doc["status"] != "suspended") {
for(var propName in doc) { for(var propName in doc) {
if(typeof(doc[propName]) != "undefined" && (propName.startsWith("has") || propName.endsWith("URL"))) { if(typeof(doc[propName]) != "undefined" && (propName.startsWith("has") || propName.endsWith("URL"))) {
emit(propName, 1); emit(propName, 1);
} }
} }
emit("total", 1); emit("total", 1);
} }
}'; }';
$obj->views->scoreHas->reduce = 'function (key, values, rereduce) { $obj->views->scoreHas->reduce = '_sum';
return sum(values); $obj->views->fieldNames->map = '
}';  
$obj->views->fieldNames->map = '  
function(doc) { function(doc) {
for(var propName in doc) { for(var propName in doc) {
emit(propName, doc._id); emit(propName, doc._id);
} }
}'; }';
$obj->views->fieldNames->reduce = 'function (key, values, rereduce) { $obj->views->fieldNames->reduce = '_count';
return values.length; // allow safe updates (even if slightly slower due to extra: rev-detection check).
}'; $db->save($obj, true);
// allow safe updates (even if slightly slower due to extra: rev-detection check).  
$db->save($obj, true);  
   
   
?> ?>
   
<?php  
 
/**  
* Databaase class.  
*/  
class SetteeDatabase {  
 
/**  
* Base URL of the CouchDB REST API  
*/  
private $conn_url;  
 
/**  
* HTTP REST Client instance  
*/  
protected $rest_client;  
 
/**  
* Name of the database  
*/  
private $dbname;  
 
/**  
* Default constructor  
*/  
function __construct($conn_url, $dbname) {  
$this->conn_url = $conn_url;  
$this->dbname = $dbname;  
$this->rest_client = SetteeRestClient::get_instance($this->conn_url);  
}  
 
 
/**  
* Get UUID from CouchDB  
*  
* @return  
* CouchDB-generated UUID string  
*  
*/  
function gen_uuid() {  
$ret = $this->rest_client->http_get('_uuids');  
return $ret['decoded']->uuids[0]; // should never be empty at this point, so no checking  
}  
 
/**  
* Create or update a document database  
*  
* @param $document  
* PHP object, a PHP associative array, or a JSON String representing the document to be saved. PHP Objects and arrays are JSON-encoded automatically.  
*  
* <p>If $document has a an "_id" property set, it will be used as document's unique id (even for "create" operation).  
* If "_id" is missing, CouchDB will be used to generate a UUID.  
*  
* <p>If $document has a "_rev" property (revision), document will be updated, rather than creating a new document.  
* You have to provide "_rev" if you want to update an existing document, otherwise operation will be assumed to be  
* one of creation and you will get a duplicate document exception from CouchDB. Also, you may not provide "_rev" but  
* not provide "_id" since that is an invalid input.  
*  
* @param $allowRevAutoDetection  
* Default: false. When true and _rev is missing from the document, save() function will auto-detect latest revision  
* for a document and use it. This option is "false" by default because it involves an extra http HEAD request and  
* therefore can make save() operation slightly slower if such auto-detection is not required.  
*  
* @return  
* document object with the database id (uuid) and revision attached;  
*  
* @throws SetteeCreateDatabaseException  
*/  
function save($document, $allowRevAutoDetection = false) {  
if (is_string($document)) {  
$document = json_decode($document);  
}  
 
// Allow passing of $document as an array (for syntactic simplicity and also because in JSON world it does not matter)  
if(is_array($document)) {  
$document = (object) $document;  
}  
 
if (empty($document->_id) && empty($document->_rev)) {  
$id = $this->gen_uuid();  
}  
elseif (empty($document->_id) && !empty($document->_rev)) {  
throw new SetteeWrongInputException("Error: You can not save a document with a revision provided, but missing id");  
}  
else {  
$id = $document->_id;  
 
if ($allowRevAutoDetection) {  
try {  
$rev = $this->get_rev($id);  
} catch (SetteeRestClientException $e) {  
// auto-detection may fail legitimately, if a document has never been saved before (new doc), so skipping error  
}  
if (!empty($rev)) {  
$document->_rev = $rev;  
}  
}  
}  
 
$full_uri = $this->dbname . "/" . $this->safe_urlencode($id);  
$document_json = json_encode($document, JSON_NUMERIC_CHECK);  
 
$ret = $this->rest_client->http_put($full_uri, $document_json);  
 
$document->_id = $ret['decoded']->id;  
$document->_rev = $ret['decoded']->rev;  
 
return $document;  
}  
 
/**  
* @param $doc  
* @param $name  
* @param $content  
* Content of the attachment in a string-buffer format. This function will automatically base64-encode content for  
* you, so you don't have to do it.  
* @param $mime_type  
* Optional. Will be auto-detected if not provided  
* @return void  
*/  
public function add_attachment($doc, $name, $content, $mime_type = null) {  
if (empty($doc->_attachments) || !is_object($doc->_attachments)) {  
$doc->_attachments = new stdClass();  
}  
 
if (empty($mime_type)) {  
$mime_type = $this->rest_client->content_mime_type($content);  
}  
 
$doc->_attachments->$name = new stdClass();  
$doc->_attachments->$name->content_type = $mime_type;  
$doc->_attachments->$name->data = base64_encode($content);  
}  
 
/**  
* @param $doc  
* @param $name  
* @param $file  
* Full path to a file (e.g. as returned by PHP's realpath function).  
* @param $mime_type  
* Optional. Will be auto-detected if not provided  
* @return void  
*/  
public function add_attachment_file($doc, $name, $file, $mime_type = null) {  
$content = file_get_contents($file);  
$this->add_attachment($doc, $name, $content, $mime_type);  
}  
 
/**  
*  
* Retrieve a document from CouchDB  
*  
* @throws SetteeWrongInputException  
*  
* @param $id  
* Unique ID (usually: UUID) of the document to be retrieved.  
* @return  
* database document in PHP object format.  
*/  
function get($id) {  
if (empty($id)) {  
throw new SetteeWrongInputException("Error: Can't retrieve a document without a uuid.");  
}  
 
$full_uri = $this->dbname . "/" . $this->safe_urlencode($id);  
$full_uri = str_replace("%3Frev%3D","?rev=",$full_uri);  
$ret = $this->rest_client->http_get($full_uri);  
return $ret['decoded'];  
}  
 
/**  
*  
* Get the latest revision of a document with document id: $id in CouchDB.  
*  
* @throws SetteeWrongInputException  
*  
* @param $id  
* Unique ID (usually: UUID) of the document to be retrieved.  
* @return  
* database document in PHP object format.  
*/  
function get_rev($id) {  
if (empty($id)) {  
throw new SetteeWrongInputException("Error: Can't query a document without a uuid.");  
}  
 
$full_uri = $this->dbname . "/" . $this->safe_urlencode($id);  
$headers = $this->rest_client->http_head($full_uri);  
if (empty($headers['Etag'])) {  
throw new SetteeRestClientException("Error: could not retrieve revision. Server unexpectedly returned empty Etag");  
}  
$etag = str_replace('"', '', $headers['Etag']);  
return $etag;  
}  
 
/**  
* Delete a document  
*  
* @param $document  
* a PHP object or JSON representation of the document that has _id and _rev fields.  
*  
* @return void  
*/  
function delete($document) {  
if (!is_object($document)) {  
$document = json_decode($document);  
}  
 
$full_uri = $this->dbname . "/" . $this->safe_urlencode($document->_id) . "?rev=" . $document->_rev;  
$this->rest_client->http_delete($full_uri);  
}  
 
 
/*----------------- View-related functions --------------*/  
 
/**  
* Create a new view or update an existing one.  
*  
* @param $design_doc  
* @param $view_name  
* @param $map_src  
* Source code of the map function in Javascript  
* @param $reduce_src  
* Source code of the reduce function in Javascript (optional)  
* @return void  
*/  
function save_view($design_doc, $view_name, $map_src, $reduce_src = null) {  
$obj = new stdClass();  
$obj->_id = "_design/" . urlencode($design_doc);  
$view_name = urlencode($view_name);  
$obj->views->$view_name->map = $map_src;  
if (!empty($reduce_src)) {  
$obj->views->$view_name->reduce = $reduce_src;  
}  
 
// allow safe updates (even if slightly slower due to extra: rev-detection check).  
return $this->save($obj, true);  
}  
 
/**  
* Create a new view or update an existing one.  
*  
* @param $design_doc  
* @param $view_name  
* @param $key  
* key parameter to a view. Can be a single value or an array (for a range). If passed an array, function assumes  
* that first element is startkey, second: endkey.  
* @param $descending  
* return results in descending order. Please don't forget that if you are using a startkey/endkey, when you change  
* order you also need to swap startkey and endkey values!  
*  
* @return void  
*/  
function get_view($design_doc, $view_name, $key = null, $descending = false) {  
$id = "_design/" . urlencode($design_doc);  
$view_name = urlencode($view_name);  
$id .= "/_view/$view_name";  
 
$data = array();  
if (!empty($key)) {  
if (is_string($key)) {  
$data = "key=" . '"' . $key . '"';  
}  
elseif (is_array($key)) {  
list($startkey, $endkey) = $key;  
$data = "startkey=" . '"' . $startkey . '"&' . "endkey=" . '"' . $endkey . '"';  
}  
 
if ($descending) {  
$data .= "&descending=true";  
}  
}  
 
 
 
if (empty($id)) {  
throw new SetteeWrongInputException("Error: Can't retrieve a document without a uuid.");  
}  
 
$full_uri = $this->dbname . "/" . $this->safe_urlencode($id);  
$full_uri = str_replace("%253Fgroup%253Dtrue","?group=true",$full_uri);  
$ret = $this->rest_client->http_get($full_uri, $data);  
return $ret['decoded'];  
 
}  
 
/**  
* @param $id  
* @return  
* return a properly url-encoded id.  
*/  
private function safe_urlencode($id) {  
//-- System views like _design can have "/" in their URLs.  
$id = rawurlencode($id);  
if (substr($id, 0, 1) == '_') {  
$id = str_replace('%2F', '/', $id);  
}  
return $id;  
}  
 
/** Getter for a database name */  
function get_name() {  
return $this->dbname;  
}  
 
}  
directory:a/couchdb/settee (deleted)
 
  language: php
  phps:
  - 5.3
  - 5.4
  before_script: cd tests/
 
  (The MIT License)
 
  Copyright (c) 2011 Irakli Nadareishvili
 
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
 
  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
 
  THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  Inspired by: "CouchRest library for Ruby":http://jchrisa.net/drl/_design/sofa/_list/post/post-page?startkey=%5B%22couchrest__restful_ruby_client_%22%5D and the "couchdb-python":http://packages.python.org/CouchDB/client.html#document library.
 
  h3. Server Functions
 
  # Specify a server:
  @$server = new SetteeServer('http://127.0.0.1:5984');@
  # Database API
  ## Create a database:
  @$ret = $server->create_db('irakli_test');@
  ## Drop a database:
  @$ret = $server->drop_db('irakli_test');@
  ## List all databases:
  @$ret = $server->list_dbs();@
  ## Get a database object
  @$db = $server->get_db('irakli_test');@
  # Document API
  ## Create/Update a document:
  @$ret = $db->save($doc);@
  ## Retrieve a document:
  @$db_doc = $db->get($id);@
  ## Determine the latest revision_id for a document:
  @$rev = $db->get_rev($id);@
  ## Delete a document:
  @$db_doc = $db->delete($doc);@
  # Attachments API
  ## Add content as attachment:
  @$db->add_attachment($doc, "foo.txt", "Some text that will be base64 encoded", "text/plain");@
  ## Add a file path to be attached:
  @$db->add_attachment_file($doc, "foo.pdf", $file_path, "application/pdf");@
  ## Add a file path to be attached (mime-type is auto-detected):
  @$db->add_attachment_file($doc, "foo.pdf", $file_path);@
  ## Full attachment saving example:
  $doc = new stdClass();
  $doc->_id = "attachment_doc";
  $file_path = dirname(__FILE__) . "/resources/couch-logo.pdf";
  $this->db->add_attachment_file($doc, "foo.pdf", $file_path, "application/pdf");
  $db_doc = $this->db->save($doc);
  ## ATTENTION: there is no "load_attachments" method, because when you load a document, all its attachments get loaded with it, as well.
  # Views API
  ## Create a new view or save a view:
  @$view = $db->save_view("some_design_document_id", "a_view_name", $map_src);@
  @$view = $db->save_view("some_design_document_id", "a_view_name", $map_src, $reduce_src);@
  ## Get a view (run query and get results):
  @$view = $db->get_view("some_design_document_id", "a_view_name");@
  ## Parametrized view:
  @$view = $db->get_view("some_design_document_id", "a_view_name", "2009/02/17 21:13:39");@
  ## Parametrized view with key range:
  @$view = $db->get_view("some_design_document_id", "a_view_name", array("2009/01/30 18:04:11", "2009/02/17 21:13:39"));@
  ## Parametrized view with key range, ordered descending:
  @$view = $db->get_view("some_design_document_id", "a_view_name", array("2009/01/30 18:04:11", "2009/02/17 21:13:39"), true);@
 
 
  h3. Requirements
  # PHP 5.2 or newer
 
  h3. Recommended
  # PHP 5.3 or newer. With PHP 5.2 following functionality will not work:
  ## Some unit-tests
  ## Mime type auto-detection.
  # pecl_http
  #!/usr/bin/env php
 
  <?php
 
  require (realpath(dirname(__FILE__) . '/../src/settee.php'));
 
  $server = new SetteeServer('http://127.0.0.1:5984');
 
 
  $dbs = array (
  1 => "settee_test_perf_01",
  2 => "settee_test_perf_02",
  3 => "settee_test_perf_03",
  );
 
  print ("creating databases: \n");
 
  foreach ($dbs as $db) {
  $start = microtime(true);
  try {
  $ret = $server->create_db($db);
  } catch (Exception $e) {
  //-- re-throw. this is just for demo
  throw $e;
  }
  $elapsed = microtime(true) - $start;
  print("Time elapsed: $elapsed \n");
  }
 
  $ret = $server->list_dbs();
  print_r($ret);
  print ("\n");
 
  print ("dropping databases: \n");
 
  foreach ($dbs as $db) {
  $start = microtime(true);
  try {
  $ret = $server->drop_db($db);
  } catch (Exception $e) {
  //-- re-throw. this is just for demo
  throw $e;
  }
  $elapsed = microtime(true) - $start;
  print("Time elapsed: $elapsed \n");
  }
 
  $ret = $server->list_dbs();
  print_r($ret);
 
  #!/usr/bin/env php
 
  <?php
 
  require (realpath(dirname(__FILE__) . '/../src/settee.php'));
 
  $server = new SetteeServer('http://127.0.0.1:5984');
  $dname = 'irakli';
  $db = $server->get_db('irakli');
 
  try {
  $server->create_db($db);
  } catch (Exception $e) {
  print_r("database irakli already exists! \n");
  }
 
  $doc = new StdClass();
  $doc->firstName = "Irakli";
  $doc->lastName = "Nadareishvili";
  $doc->IQ = 200;
  $doc->hobbies = array("skiing", "swimming");
  $doc->pets = array ("whitey" => "labrador", "mikey" => "pug");
 
  // Should work with json string as well:
  //$doc = '{"firstName":"irakli","lastName":"Nadareishvili","IQ":200,"hobbies":["skiing","swimming"],"pets":{"whitey":"labrador","mikey":"pug"}}';
 
  $doc = $db->save($doc);
  print_r($doc);
 
  $doc = $db->get($doc->_id);
  print_r($doc);
 
  $doc->firstName = "Ika";
  $doc = $db->save($doc);
  print_r($doc);
 
  $db->delete($doc);
 
 
 
  <?php
 
  /**
  * Databaase class.
  */
  class SetteeDatabase {
 
  /**
  * Base URL of the CouchDB REST API
  */
  private $conn_url;
 
  /**
  * HTTP REST Client instance
  */
  protected $rest_client;
 
  /**
  * Name of the database
  */
  private $dbname;
 
  /**
  * Default constructor
  */
  function __construct($conn_url, $dbname) {
  $this->conn_url = $conn_url;
  $this->dbname = $dbname;
  $this->rest_client = SetteeRestClient::get_instance($this->conn_url);
  }
 
  /**
  * Get UUID from CouchDB
  *
  * @return
  * CouchDB-generated UUID string
  *
  */
  function gen_uuid() {
  $ret = $this->rest_client->http_get('_uuids');
  return $ret['decoded']->uuids[0]; // should never be empty at this point, so no checking
  }
 
  /**
  * Create or update a document database
  *
  * @param $document
  * PHP object, a PHP associative array, or a JSON String representing the document to be saved. PHP Objects and arrays are JSON-encoded automatically.
  *
  * <p>If $document has a an "_id" property set, it will be used as document's unique id (even for "create" operation).
  * If "_id" is missing, CouchDB will be used to generate a UUID.
  *
  * <p>If $document has a "_rev" property (revision), document will be updated, rather than creating a new document.
  * You have to provide "_rev" if you want to update an existing document, otherwise operation will be assumed to be
  * one of creation and you will get a duplicate document exception from CouchDB. Also, you may not provide "_rev" but
  * not provide "_id" since that is an invalid input.
  *
  * @param $allowRevAutoDetection
  * Default: false. When true and _rev is missing from the document, save() function will auto-detect latest revision
  * for a document and use it. This option is "false" by default because it involves an extra http HEAD request and
  * therefore can make save() operation slightly slower if such auto-detection is not required.
  *
  * @return
  * document object with the database id (uuid) and revision attached;
  *
  * @throws SetteeCreateDatabaseException
  */
  function save($document, $allowRevAutoDetection = false) {
  if (is_string($document)) {
  $document = json_decode($document);
  }
 
  // Allow passing of $document as an array (for syntactic simplicity and also because in JSON world it does not matter)
  if (is_array($document)) {
  $document = (object) $document;
  }
 
  if (empty($document->_id) && empty($document->_rev)) {
  $id = $this->gen_uuid();
  } elseif (empty($document->_id) && !empty($document->_rev)) {
  throw new SetteeWrongInputException("Error: You can not save a document with a revision provided, but missing id");
  } else {
  $id = $document->_id;
 
  if ($allowRevAutoDetection) {
  try {
  $rev = $this->get_rev($id);
  } catch (SetteeRestClientException $e) {
  // auto-detection may fail legitimately, if a document has never been saved before (new doc), so skipping error
  }
  if (!empty($rev)) {
  $document->_rev = $rev;
  }
  }
  }
 
  $full_uri = $this->dbname . "/" . $this->safe_urlencode($id);
  $document_json = json_encode($document, JSON_NUMERIC_CHECK);
 
  $ret = $this->rest_client->http_put($full_uri, $document_json);
 
  $document->_id = $ret['decoded']->id;
  $document->_rev = $ret['decoded']->rev;
 
  return $document;
  }
 
  /**
  * @param $doc
  * @param $name
  * @param $content
  * Content of the attachment in a string-buffer format. This function will automatically base64-encode content for
  * you, so you don't have to do it.
  * @param $mime_type
  * Optional. Will be auto-detected if not provided
  * @return void
  */
  public function add_attachment($doc, $name, $content, $mime_type = null) {
  if (empty($doc->_attachments) || !is_object($doc->_attachments)) {
  $doc->_attachments = new stdClass();
  }
 
  if (empty($mime_type)) {
  $mime_type = $this->rest_client->content_mime_type($content);
  }
 
  $doc->_attachments->$name = new stdClass();
  $doc->_attachments->$name->content_type = $mime_type;
  $doc->_attachments->$name->data = base64_encode($content);
  }
 
  /**
  * @param $doc
  * @param $name
  * @param $file
  * Full path to a file (e.g. as returned by PHP's realpath function).
  * @param $mime_type
  * Optional. Will be auto-detected if not provided
  * @return void
  */
  public function add_attachment_file($doc, $name, $file, $mime_type = null) {
  $content = file_get_contents($file);
  $this->add_attachment($doc, $name, $content, $mime_type);
  }
 
  /**
  *
  * Retrieve a document from CouchDB
  *
  * @throws SetteeWrongInputException
  *
  * @param $id
  * Unique ID (usually: UUID) of the document to be retrieved.
  * @return
  * database document in PHP object format.
  */
  function get($id) {
  if (empty($id)) {
  throw new SetteeWrongInputException("Error: Can't retrieve a document without a uuid.");
  }
 
  $full_uri = $this->dbname . "/" . $this->safe_urlencode($id);
  $full_uri = str_replace("%3Frev%3D", "?rev=", $full_uri);
  $ret = $this->rest_client->http_get($full_uri);
  return $ret['decoded'];
  }
 
  /**
  *
  * Get the latest revision of a document with document id: $id in CouchDB.
  *
  * @throws SetteeWrongInputException
  *
  * @param $id
  * Unique ID (usually: UUID) of the document to be retrieved.
  * @return
  * database document in PHP object format.
  */
  function get_rev($id) {
  if (empty($id)) {
  throw new SetteeWrongInputException("Error: Can't query a document without a uuid.");
  }
 
  $full_uri = $this->dbname . "/" . $this->safe_urlencode($id);
  $headers = $this->rest_client->http_head($full_uri);
  if (empty($headers['Etag'])) {
  throw new SetteeRestClientException("Error: could not retrieve revision. Server unexpectedly returned empty Etag");
  }
  $etag = str_replace('"', '', $headers['Etag']);
  return $etag;
  }
 
  /**
  * Delete a document
  *
  * @param $document
  * a PHP object or JSON representation of the document that has _id and _rev fields.
  *
  * @return void
  */
  function delete($document) {
  if (!is_object($document)) {
  $document = json_decode($document);
  }
 
  $full_uri = $this->dbname . "/" . $this->safe_urlencode($document->_id) . "?rev=" . $document->_rev;
  $this->rest_client->http_delete($full_uri);
  }
 
  /* ----------------- View-related functions -------------- */
 
  /**
  * Create a new view or update an existing one.
  *
  * @param $design_doc
  * @param $view_name
  * @param $map_src
  * Source code of the map function in Javascript
  * @param $reduce_src
  * Source code of the reduce function in Javascript (optional)
  * @return void
  */
  function save_view($design_doc, $view_name, $map_src, $reduce_src = null) {
  $obj = new stdClass();
  $obj->_id = "_design/" . urlencode($design_doc);
  $view_name = urlencode($view_name);
  $obj->views->$view_name->map = $map_src;
  if (!empty($reduce_src)) {
  $obj->views->$view_name->reduce = $reduce_src;
  }
 
  // allow safe updates (even if slightly slower due to extra: rev-detection check).
  return $this->save($obj, true);
  }
 
  /**
  * Create a new view or update an existing one.
  *
  * @param $design_doc
  * @param $view_name
  * @param $key
  * key parameter to a view. Can be a single value or an array (for a range). If passed an array, function assumes
  * that first element is startkey, second: endkey.
  * @param $descending
  * return results in descending order. Please don't forget that if you are using a startkey/endkey, when you change
  * order you also need to swap startkey and endkey values!
  *
  * @return void
  */
  function get_view($design_doc, $view_name, $key = null, $descending = false, $limit = false, $reduce = null, $startdocid = null) {
  $id = "_design/" . urlencode($design_doc);
  $view_name = urlencode($view_name);
  $id .= "/_view/$view_name";
 
  $data = array();
  if (!empty($key)) {
  if (is_string($key)) {
  $data = "key=" . '"' . $key . '"';
  } elseif (is_array($key)) {
  list($startkey, $endkey) = $key;
  $data = "startkey=" . '"' . $startkey . '"&' . "endkey=" . '"' . $endkey . '"';
  }
 
  if ($descending) {
  $data .= "&descending=true";
  }
  if ($startdocid != null) {
  $data .= "&startkey_docid='$startdocid'";
  }
  if ($reduce === true) {
  $data .= "&reduce=true";
  } else if ($reduce === false){
 
  $data .= "&reduce=false";
  }
  if ($limit) {
  $data .= "&limit=" . $limit;
  }
  }
 
 
 
  if (empty($id)) {
  throw new SetteeWrongInputException("Error: Can't retrieve a document without a uuid.");
  }
 
  $full_uri = $this->dbname . "/" . $this->safe_urlencode($id);
 
  $full_uri = str_replace("%253Fgroup%253D", "?group=", $full_uri);
  $full_uri = str_replace("%253Flimit%253D", "?limit=", $full_uri);
  $ret = $this->rest_client->http_get($full_uri, $data);
  //$ret['decoded'] = str_replace("?k","&k",$ret['decoded']);
  return $ret['decoded'];
  }
 
  /**
  * @param $id
  * @return
  * return a properly url-encoded id.
  */
  private function safe_urlencode($id) {
  //-- System views like _design can have "/" in their URLs.
  $id = rawurlencode($id);
  if (substr($id, 0, 1) == '_') {
  $id = str_replace('%2F', '/', $id);
  }
  return $id;
  }
 
  /** Getter for a database name */
  function get_name() {
  return $this->dbname;
  }
 
  }
 
  <?php
 
  /**
  * HTTP REST Client for CouchDB API
  */
  class SetteeRestClient {
 
  /**
  * HTTP Timeout in Milliseconds
  */
  const HTTP_TIMEOUT = 2000;
 
  private $base_url;
  private $curl;
 
  private static $curl_workers = array();
 
  /**
  * Singleton factory method
  */
  static function get_instance($base_url) {
 
  if (empty(self::$curl_workers[$base_url])) {
  self::$curl_workers[$base_url] = new SetteeRestClient($base_url);
  }
 
  return self::$curl_workers[$base_url];
  }
 
  /**
  * Class constructor
  */
  private function __construct($base_url) {
  $this->base_url = $base_url;
 
  $curl = curl_init();
  curl_setopt($curl, CURLOPT_USERAGENT, "Settee CouchDB Client/1.0");
  curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
  curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt($curl, CURLOPT_HEADER, 0);
  curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
  curl_setopt($curl, CURLOPT_TIMEOUT_MS, self::HTTP_TIMEOUT);
  curl_setopt($curl, CURLOPT_FORBID_REUSE, false); // Connection-pool for CURL
 
  $this->curl = $curl;
 
  }
 
  /**
  * Class destructor cleans up any resources
  */
  function __destruct() {
  curl_close($this->curl);
  }
 
  /**
  * HTTP HEAD
  *
  * @return
  * Raw HTTP Headers of the response.
  *
  * @see: http://www.php.net/manual/en/context.params.php
  *
  */
  function http_head($uri) {
  curl_setopt($this->curl, CURLOPT_HEADER, 1);
 
  $full_url = $this->get_full_url($uri);
  curl_setopt($this->curl, CURLOPT_URL, $full_url);
  curl_setopt($this->curl, CURLOPT_CUSTOMREQUEST, 'HEAD');
  curl_setopt($this->curl, CURLOPT_NOBODY, true);
 
 
  $response = curl_exec($this->curl);
  // Restore default values
  curl_setopt($this->curl, CURLOPT_NOBODY, false);
  curl_setopt($this->curl, CURLOPT_HEADER, false);
 
  $resp_code = curl_getinfo($this->curl, CURLINFO_HTTP_CODE);
  if ($resp_code == 404 ) {
  throw new SetteeRestClientException("Couch document not found at: '$full_url'");
  }
 
  if (function_exists('http_parse_headers')) {
  $headers = http_parse_headers($response);
  }
  else {
  $headers = $this->_http_parse_headers($response);
  }
 
  return $headers;
  }
 
  /**
  * Backup PHP impl. for when PECL http_parse_headers() function is not available
  *
  * @param $header
  * @return array
  * @source http://www.php.net/manual/en/function.http-parse-headers.php#77241
  */
  private function _http_parse_headers( $header ) {
  $retVal = array();
  $fields = explode("\r\n", preg_replace('/\x0D\x0A[\x09\x20]+/', ' ', $header));
  foreach( $fields as $field ) {
  if( preg_match('/([^:]+): (.+)/m', $field, $match) ) {
  $match[1] = preg_replace('/(?<=^|[\x09\x20\x2D])./e', 'strtoupper("\0")', strtolower(trim($match[1])));
  if( isset($retVal[$match[1]]) ) {
  $retVal[$match[1]] = array($retVal[$match[1]], $match[2]);
  } else {
  $retVal[$match[1]] = trim($match[2]);
  }
  }
  }
  return $retVal;
  }
 
  /**
  * HTTP GET
  */
  function http_get($uri, $data = array()) {
  $data = (is_array($data)) ? http_build_query($data) : $data;
  if (!empty($data)) {
  $uri .= "?$data";
  }
  return $this->http_request('GET', $uri);
  }
 
  /**
  * HTTP PUT
  */
  function http_put($uri, $data = array()) {
  return $this->http_request('PUT', $uri, $data);
  }
 
  /**
  * HTTP DELETE
  */
  function http_delete($uri, $data = array()) {
  return $this->http_request('DELETE', $uri, $data);
  }
 
  /**
  * Generic implementation of a HTTP Request.
  *
  * @param $http_method
  * @param $uri
  * @param array $data
  * @return
  * an array containing json and decoded versions of the response.
  */
  private function http_request($http_method, $uri, $data = array()) {
  $data = (is_array($data)) ? http_build_query($data) : $data;
 
  if (!empty($data)) {
  curl_setopt($this->curl, CURLOPT_HTTPHEADER, array('Content-Length: ' . strlen($data)));
  curl_setopt($this->curl, CURLOPT_POSTFIELDS, $data);
  }
 
  curl_setopt($this->curl, CURLOPT_URL, $this->get_full_url($uri));
  curl_setopt($this->curl, CURLOPT_CUSTOMREQUEST, $http_method);
 
  $response = curl_exec($this->curl);
  $response_decoded = $this->decode_response($response);
  $response = array('json' => $response, 'decoded'=>$response_decoded);
 
  $this->check_status($response,$uri);
 
  return $response;
  }
 
  /**
  * Check http status for safe return codes
  *
  * @throws SetteeRestClientException
  */
  private function check_status($response,$uri) {
  $resp_code = curl_getinfo($this->curl, CURLINFO_HTTP_CODE);
 
  if ($resp_code < 199 || $resp_code > 399 || !empty($response['decoded']->error)) {
  $msg = "CouchDB returned: \"HTTP 1.1. $resp_code\". ERROR: " . $response['json'] . $uri;
  throw new SetteeRestClientException($msg);
  }
  }
 
  /**
  * @param $path
  * Full path to a file (e.g. as returned by PHP's realpath function).
  * @return void
  */
  public function file_mime_type ($path) {
  $ftype = 'application/octet-stream';
 
  if (function_exists("finfo_file")) {
  $finfo = new finfo(FILEINFO_MIME_TYPE | FILEINFO_SYMLINK);
  $fres = $finfo->file($path);
  if (is_string($fres) && !empty($fres)) {
  $ftype = $fres;
  }
  }
 
  return $ftype;
  }
 
  /**
  * @param $content
  * content of a file in a string buffer format.
  * @return void
  */
  public function content_mime_type ($content) {
  $ftype = 'application/octet-stream';
 
  if (function_exists("finfo_file")) {
  $finfo = new finfo(FILEINFO_MIME_TYPE | FILEINFO_SYMLINK);
  $fres = $finfo->buffer($content);
  if (is_string($fres) && !empty($fres)) {
  $ftype = $fres;
  }
  }
 
  return $ftype;
  }
 
 
  /**
  *
  * @param $json
  * json-encoded response from CouchDB
  *
  * @return
  * decoded PHP object
  */
  private function decode_response($json) {
  return json_decode($json);
  }
 
  /**
  * Get full URL from a partial one
  */
  private function get_full_url($uri) {
  // We do not want "/", "?", "&" and "=" separators to be encoded!!!
  $uri = str_replace(array('%2F', '%3F', '%3D', '%26'), array('/', '?', '=', '&'), urlencode($uri));
  return $this->base_url . '/' . $uri;
  }
  }
 
  class SetteeRestClientException extends Exception {}
 
  <?php
 
  /**
  * CouchDB Server Manager
  */
  class SetteeServer {
 
  /**
  * Base URL of the CouchDB REST API
  */
  private $conn_url;
 
  /**
  * HTTP REST Client instance
  */
  protected $rest_client;
 
 
  /**
  * Class constructor
  *
  * @param $conn_url
  * (optional) URL of the CouchDB server to connect to. Default value: http://127.0.0.1:5984
  */
  function __construct($conn_url = "http://127.0.0.1:5984") {
  $this->conn_url = rtrim($conn_url, ' /');
  $this->rest_client = SetteeRestClient::get_instance($this->conn_url);
  }
 
  /**
  * Create database
  *
  * @param $db
  * Either a database object or a String name of the database.
  *
  * @return
  * json string from the server.
  *
  * @throws SetteeCreateDatabaseException
  */
  function create_db($db) {
  if ($db instanceof SetteeDatabase) {
  $db = $db->get_name();
  }
  $ret = $this->rest_client->http_put($db);
  if (!empty($ret['decoded']->error)) {
  throw new SetteeDatabaseException("Could not create database: " . $ret["json"]);
  }
  return $ret['decoded'];
  }
 
  /**
  * Drop database
  *
  * @param $db
  * Either a database object or a String name of the database.
  *
  * @return
  * json string from the server.
  *
  * @throws SetteeDropDatabaseException
  */
  function drop_db($db) {
  if ($db instanceof SetteeDatabase) {
  $db = $db->get_name();
  }
  $ret = $this->rest_client->http_delete($db);
  if (!empty($ret['decoded']->error)) {
  throw new SetteeDatabaseException("Could not create database: " . $ret["json"]);
  }
  return $ret['decoded'];
  }
 
  /**
  * Instantiate a database object
  *
  * @param $dbname
  * name of the newly created database
  *
  * @return SetteeDatabase
  * new SetteeDatabase instance.
  */
  function get_db($dbname) {
  return new SetteeDatabase($this->conn_url, $dbname);
  }
 
 
  /**
  * Return an array containing all databases
  *
  * @return Array
  * an array of database names in the CouchDB instance
  */
  function list_dbs() {
  $ret = $this->rest_client->http_get('_all_dbs');
  if (!empty($ret['decoded']["error"])) {
  throw new SetteeDatabaseException("Could not get list of databases: " . $ret["json"]);
  }
  return $ret['decoded'];
  }
 
  }
 
  class SetteeServerErrorException extends Exception {}
  class SetteeDatabaseException extends Exception {}
  class SetteeWrongInputException extends Exception {}
  <?php
 
  require(dirname(__FILE__) . '/classes/SetteeRestClient.class.php');
 
  require(dirname(__FILE__) . '/classes/SetteeServer.class.php');
  require(dirname(__FILE__) . '/classes/SetteeDatabase.class.php');
  1. Make sure you have latest PEAR PHPUnit installed:
  > sudo upgrade pear
  > sudo pear channel-discover pear.phpunit.de
  > sudo pear install phpunit/PHPUnit
 
  2. You need PHP 5.3.2 or later to run some tests that deal with private or protected methods. If you use an earlier
  version of PHP, these tests will be skipped.
 
  3. Run all tests with:
  > phpunit .
  <?php
 
  require_once (realpath(dirname(__FILE__) . '/../src/settee.php'));
  require_once (dirname(__FILE__) . '/SetteeTestCase.class.php');
 
  class SetteeDatabaseTest extends SetteeTestCase {
 
  private $db;
 
  public function setUp() {
  parent::setUp();
  $dbname = "settee_tests_" . md5(microtime(true));
  $this->db = $this->server->get_db($dbname);
  $this->server->create_db($this->db);
  }
 
  public function test_document_lifecycle_objectbased() {
  $doc = new StdClass();
  $doc->firstName = "Irakli";
  $doc->lastName = "Nadareishvili";
  $doc->IQ = 200;
  $doc->hobbies = array("skiing", "swimming");
  $doc->pets = array ("whitey" => "labrador", "mikey" => "pug");
 
  $doc = $this->db->save($doc);
  $this->assertTrue(!empty($doc->_id) && !empty($doc->_rev), "Document creation success [object-based]");
 
  $_rev = $doc->_rev;
  $doc = $this->db->get($doc->_id);
  $this->assertEquals($_rev, $doc->_rev, "Document retrieval success [object-based] test");
 
  $doc->firstName = "Ika";
  $db_doc = $this->db->save($doc);
  $this->assertEquals($doc->firstName, $db_doc->firstName, "Document update success [object-based]");
 
  $this->db->delete($doc);
 
 
  try {
  $doc = $this->db->get($doc->_id);
  } catch (SetteeRestClientException $e) {
  // we expect exception to fire, so this is good.
  return;
  }
 
  $this->fail('Document still available for retrieval after being deleted. [object-based]');
  }
 
  // Should work with json string as well:
  //
 
 
  public function test_document_lifecycle_jsonbased() {
  $doc = '{"firstName":"Irakli","lastName":"Nadareishvili","IQ":200,"hobbies":["skiing","swimming"],"pets":{"whitey":"labrador","mikey":"pug"}}';
 
  $doc = $this->db->save($doc);
  $this->assertTrue(!empty($doc->_id) && !empty($doc->_rev), "Document creation success [json-based]");
 
  $_rev = $doc->_rev;
 
  $db_doc = $this->db->get($doc->_id);
  $this->assertEquals($_rev, $db_doc->_rev, "Document retrieval success [json-based] test");
 
  $doc = '{';
  $doc .= '"_id":"' . $db_doc->_id . '",';
  $doc .= '"_rev":"' . $db_doc->_rev . '",';
  $doc .= '"firstName":"Ika","lastName":"Nadareishvili","IQ":200,"hobbies":["skiing","swimming"],"pets":{"whitey":"labrador","mikey":"pug"}}';
 
  $orig_doc = json_decode($doc);
  $db_doc = $this->db->save($doc);
  $this->assertEquals($orig_doc->firstName, $db_doc->firstName, "Document update success [json-based]");
 
  $doc = '{';
  $doc .= '"_id":"' . $db_doc->_id . '",';
  $doc .= '"_rev":"' . $db_doc->_rev . '",';
  $doc .= '"firstName":"Ika","lastName":"Nadareishvili","IQ":200,"hobbies":["skiing","swimming"],"pets":{"whitey":"labrador","mikey":"pug"}}';
 
  $this->db->delete($doc);
 
  try {
  $doc = $this->db->get($db_doc->_id);
  } catch (SetteeRestClientException $e) {
  // we expect exception to fire, so this is good.
  return;
  }
 
  $this->fail('Document still available for retrieval after being deleted. [object-based]');
  }
 
  public function test_invalid_document() {
  $doc = 12345;
  try {
  $doc = $this->db->save($doc);
  } catch (SetteeRestClientException $e) {
  // we expect exception to fire, so this is good.
  return;
  }
 
  $this->fail('Document saved with invalid format');
  }
 
  public function test_get_rev() {
  $doc = new stdClass();
  $doc->_id = "some_fixed_id";
  $doc = $this->db->save($doc);
 
  $_rev = $doc->_rev;
 
  $db_rev = $this->db->get_rev($doc->_id);
  $this->assertEquals($_rev, $db_rev, "Document Revision retrieval success");
 
  // _rev is now attached to this object due to last ->save() call
  $doc->_id = "some_fixed_id";
  $doc->title = "Some Fixed ID";
  $doc = $this->db->save($doc);
 
  $_rev = $doc->_rev;
 
  $db_rev = $this->db->get_rev($doc->_id);
  $this->assertEquals($_rev, $db_rev, "Document Revision retrieval success after re-save");
 
  }
 
  public function test_save_auto_revision_detection() {
  $doc = new stdClass();
  $doc->_id = "some_fixed_id";
  $this->db->save($doc);
 
  $doc = new stdClass();
  $doc->_id = "some_fixed_id";
  $doc->extra_field = "some other value";
 
  $new_doc = $this->db->save($doc, true);
  $this->assertEquals ($new_doc->extra_field, "some other value", "Testing auto-rev detection by save method");
  }
 
  public function test_inline_attachment_json() {
  $doc = '{
  "_id":"attachment_doc",
  "_attachments":
  {
  "foo.txt":
  {
  "content_type":"text\/plain",
  "data": "VGhpcyBpcyBhIGJhc2U2NCBlbmNvZGVkIHRleHQ="
  }
  }
  }';
  $db_doc = $this->db->save($doc);
  $this->assertTrue(is_object($db_doc->_attachments), "Inline attachment save successful [json-based]");
  }
 
  public function test_inline_attachment_obj_content() {
  $doc = new stdClass();
  $doc->_id = "attachment_doc";
  $this->db->add_attachment($doc, "foo.txt", "This is some text to be encoded", "text/plain");
  $db_doc = $this->db->save($doc);
  $this->assertTrue(is_object($db_doc->_attachments), "Inline attachment save successful [object-based]");
 
  $doc = new stdClass();
  $doc->_id = "attachment_doc_autodetect";
  $this->db->add_attachment($doc, "foo.txt", "This is some other text to be encoded");
  $db_doc = $this->db->save($doc);
  $this->assertTrue(is_object($db_doc->_attachments), "Inline attachment save successful [object-based, mime auto-detection]");
  }
 
  public function test_inline_attachment_obj_file() {
  $doc = new stdClass();
  $doc->_id = "attachment_doc";
  $file_path = dirname(__FILE__) . "/resources/couch-logo.pdf";
  $this->db->add_attachment_file($doc, "foo.pdf", $file_path, "application/pdf");
  $db_doc = $this->db->save($doc);
  $this->assertTrue(is_object($db_doc->_attachments), "Inline attachment of file successful");
 
  $doc = new stdClass();
  $doc->_id = "attachment_doc_autodetect";
  $file_path = dirname(__FILE__) . "/resources/couch-logo.pdf";
  $this->db->add_attachment_file($doc, "foo.pdf", $file_path);
  $db_doc = $this->db->save($doc);
  $this->assertTrue(is_object($db_doc->_attachments), "Inline attachment of file successful w/ mime type auto-detection");
  }
 
  public function test_view_lifecycle() {
  $this->_create_some_sample_docs();
 
  $map_src = <<<VIEW
  function(doc) {
  if(doc.date && doc.title) {
  emit(doc.date, doc.title);
  }
  }
  VIEW;
 
  $view = $this->db->save_view("foo_views", "bar_view", $map_src);
  $this->assertEquals("_design/foo_views", $view->_id, "View Creation Success");
 
  $view = $this->db->get_view("foo_views", "bar_view");
  $this->assertEquals(3, $view->total_rows, "Running a View Success");
 
  $map_src = <<<VIEW
  function(doc) {
  if(doc.date) {
  emit(doc.date, doc);
  }
  }
  VIEW;
 
  $view = $this->db->save_view("foo_views", "bar_view", $map_src);
  $this->assertEquals("_design/foo_views", $view->_id, "View Update Success");
 
  $view = $this->db->get_view("foo_views", "bar_view");
  $this->assertEquals("Well hello and welcome to my new blog...", $view->rows[0]->value->body, "Running a View Success (after update)");
 
  $view = $this->db->get_view("foo_views", "bar_view", "2009/02/17 21:13:39");
  $this->assertEquals("Bought a Cat", $view->rows[0]->value->title, "Running a Parametrized View");
 
  $view = $this->db->get_view("foo_views", "bar_view", array("2009/01/30 18:04:11", "2009/02/17 21:13:39"));
  $this->assertEquals("Biking", $view->rows[0]->value->title, "Running a Parametrized View with range");
 
  $view = $this->db->get_view("foo_views", "bar_view", array("2009/02/17 21:13:39", "2009/01/30 18:04:11"), true);
  $this->assertEquals("Bought a Cat", $view->rows[0]->value->title, "Running a Parametrized View with range, descending");
  $this->assertEquals(2, count($view->rows), "Running a Parametrized View with range, descending [count]");
 
  }
 
  function test_two_views_in_a_design_doc() {
 
  $map_src = <<<VIEW
  function(doc) {
  if(doc.date && doc.title) {
  emit(doc.date, doc.title);
  }
  }
  VIEW;
 
  $view = $this->db->save_view("a_settee_design_doc", "foo_view", $map_src);
  $this->assertTrue(isset($view->views->foo_view), "View1 Creation Success");
 
  $view = $this->db->save_view("a_settee_design_doc", "bar_view", $map_src);
  $this->assertTrue(isset($view->views->bar_view), "View2 Creation Success");
  }
 
  /**
  * Create some sample docs for running tests on them.
  *
  * <p>This sample was taken from a wonderful book:
  * CouchDB: The Definitive Guide (Animal Guide) by J. Chris Anderson, Jan Lehnardt and Noah Slater
  * http://www.amazon.com/CouchDB-Definitive-Guide-Relax-Animal/dp/0596155891/ref=sr_1_1?ie=UTF8&qid=1311533443&sr=8-1
  *
  * @return void
  */
  private function _create_some_sample_docs() {
  $doc = new stdClass();
  $doc->_id = "biking";
  $doc->title = "Biking";
  $doc->body = "My biggest hobby is mountainbiking";
  $doc->date = "2009/01/30 18:04:11";
  $this->db->save($doc);
 
  $doc = new stdClass();
  $doc->_id = "bought-a-cat";
  $doc->title = "Bought a Cat";
  $doc->body = "I went to the the pet store earlier and brought home a little kitty...";
  $doc->date = "2009/02/17 21:13:39";
  $this->db->save($doc);
 
  $doc = new stdClass();
  $doc->_id = "hello-world";
  $doc->title = "Hello World";
  $doc->body = "Well hello and welcome to my new blog...";
  $doc->date = "2009/01/15 15:52:20";
  $this->db->save($doc);
  }
 
  public function tearDown() {
  $ret = $this->server->drop_db($this->db);
  }
 
  }
 
 
  <?php
 
  require_once (realpath(dirname(__FILE__) . '/../src/settee.php'));
  require_once (dirname(__FILE__) . '/SetteeTestCase.class.php');
 
  class SetteeRestClientTest extends SetteeTestCase {
 
  private $rest_client;
 
  public function setUp() {
  parent::setUp();
  $this->rest_client = SetteeRestClient::get_instance($this->db_url);
  }
 
  public function test_get_full_url() {
 
  //-- Can't run this test in PHP versions earlier than 5.3.2, which do not support ReflectionMethod class.
  if (!class_exists('ReflectionMethod')) {
  return;
  }
 
  //-- Prepare for testing the private full_url_method method.
  $get_full_url_method = new ReflectionMethod('SetteeRestClient', 'get_full_url');
  $get_full_url_method->setAccessible(TRUE);
 
  $uri = 'irakli/26cede9ab9cd8fcd67895eb05200d1ea';
  //-- Equivalent to: $calc = $this->rest_client->get_full_url($uri); but for a private method.
  $calc = $get_full_url_method->invokeArgs($this->rest_client, array($uri));
  //--
  $expected = $this->db_url . '/irakli/26cede9ab9cd8fcd67895eb05200d1ea';
  $this->assertEquals($expected, $calc, "Full URL Generation with DB and ID");
 
  $uri = 'irakli/26cede9ab9cd8fcd67895eb05200d1ea?rev=2-21587f7dffc43b4100f40168f309a267';
  $calc = $get_full_url_method->invokeArgs($this->rest_client, array($uri));
  $expected = $this->db_url . '/irakli/26cede9ab9cd8fcd67895eb05200d1ea?rev=2-21587f7dffc43b4100f40168f309a267';
  $this->assertEquals($expected, $calc, "Full URL Generation with DB, ID and Single Query Parameter");
 
  $uri = 'irakli/26cede9ab9cd8fcd67895eb05200d1ea?rev=2-21587f7dffc43b4100f40168f309a267&second=foo';
  $calc = $get_full_url_method->invokeArgs($this->rest_client, array($uri));
  $expected = $this->db_url . '/irakli/26cede9ab9cd8fcd67895eb05200d1ea?rev=2-21587f7dffc43b4100f40168f309a267&second=foo';
  $this->assertEquals($expected, $calc, "Full URL Generation with DB, ID and Two Query Parameters");
 
  }
 
  public function test_file_mime_type() {
 
  $type = $this->rest_client->file_mime_type(dirname(__FILE__) . "/resources/couch-logo.jpg");
  $this->assertEquals("image/jpeg", $type, "Jpeg Mime Type Detection");
 
  $type = $this->rest_client->file_mime_type(dirname(__FILE__) . "/resources/couch-logo.pdf");
  $this->assertEquals("application/pdf", $type, "PDF Mime Type Detection");
 
 
  $type = $this->rest_client->file_mime_type(dirname(__FILE__) . "/resources/couch-logo.png");
  $this->assertEquals("image/png", $type, "PNG Mime Type Detection");
 
  $type = $this->rest_client->file_mime_type(dirname(__FILE__) . "/resources/couch-tag.ini");
  $this->assertEquals("text/plain", $type, "Text Mime Type Detection");
 
  $type = $this->rest_client->file_mime_type(dirname(__FILE__) . "/resources/couch-tag.xml");
  $this->assertEquals("application/xml", $type, "XML Mime Type Detection");
  }
 
  public function test_content_mime_type() {
  $content = file_get_contents(dirname(__FILE__) . "/resources/couch-logo.jpg");
  $type = $this->rest_client->content_mime_type($content);
  $this->assertEquals("image/jpeg", $type, "Jpeg Mime Type Detection");
 
  $content = file_get_contents(dirname(__FILE__) . "/resources/couch-logo.pdf");
  $type = $this->rest_client->content_mime_type($content);
  $this->assertEquals("application/pdf", $type, "PDF Mime Type Detection");
 
  $content = file_get_contents(dirname(__FILE__) . "/resources/couch-logo.png");
  $type = $this->rest_client->content_mime_type($content);
  $this->assertEquals("image/png", $type, "PNG Mime Type Detection");
 
  $content = file_get_contents(dirname(__FILE__) . "/resources/couch-tag.ini");
  $type = $this->rest_client->content_mime_type($content);
  $this->assertEquals("text/plain", $type, "Text Mime Type Detection");
 
  $content = file_get_contents(dirname(__FILE__) . "/resources/couch-tag.xml");
  $type = $this->rest_client->content_mime_type($content);
  $this->assertEquals("application/xml", $type, "XML Mime Type Detection");
  }
 
 
 
  }
 
 
  <?php
 
  require_once (realpath(dirname(__FILE__) . '/../src/settee.php'));
  require_once (dirname(__FILE__) . '/SetteeTestCase.class.php');
 
  class SetteeServerTest extends SetteeTestCase {
 
  private $dbname;
 
  public function setUp() {
  parent::setUp();
  $this->dbname = "settee_tests_" . md5(microtime(true));
  }
 
  public function test_database_lifecycle_namebased() {
  $db = $this->server->get_db($this->dbname);
  $ret = $this->server->create_db($this->dbname);
  $this->assertTrue($ret->ok, "Database Creation Success Response [name-based]");
 
  $database_list = $this->server->list_dbs();
  $this->assertTrue(is_array($database_list) && in_array($this->dbname, $database_list),
  "Verifying Database in the List on the Server [name-based]");
 
  $ret = $this->server->drop_db($this->dbname);
  $this->assertTrue($ret->ok, "Database Deletion Success Response [name-based]");
  }
 
  public function test_database_lifecycle_objectbased() {
  $db = $this->server->get_db($this->dbname);
  $ret = $this->server->create_db($db);
  $this->assertTrue($ret->ok, "Database Creation Success Response [object-based]");
 
  $database_list = $this->server->list_dbs();
  $this->assertTrue(is_array($database_list) && in_array($this->dbname, $database_list),
  "Verifying Database in the List on the Server [object-based]");
 
  $ret = $this->server->drop_db($db);
  $this->assertTrue($ret->ok, "Database Deletion Success Response [object-based]");
  }
 
  }
 
 
  <?php
 
  /**
  * Abstract parent for Settee test classes.
  */
  abstract class SetteeTestCase extends PHPUnit_Framework_TestCase {
 
  protected $server;
  protected $db_url;
  protected $db_user;
  protected $db_pass;
 
  public function setUp() {
  $this->db_url = isset($GLOBALS['db_url']) ? $GLOBALS['db_url'] : 'http://127.0.0.1:5984';
  $this->db_user = isset($GLOBALS['db_user']) ? $GLOBALS['db_user'] : 'admin';
  $this->db_pass = isset($GLOBALS['db_pass']) ? $GLOBALS['db_pass'] : 'admin';
  $this->server = new SetteeServer($this->db_url);
  }
 
  }
  <phpunit>
  <php>
  <var name="db_url" value="http://127.0.0.1:5984"/>
  <var name="db_user" value="admin"/>
  <var name="db_pass" value="passwd"/>
  </php>
  </phpunit>
 
 Binary files /dev/null and b/couchdb/settee/tests/resources/couch-logo.jpg differ
 Binary files /dev/null and b/couchdb/settee/tests/resources/couch-logo.pdf differ
 Binary files /dev/null and b/couchdb/settee/tests/resources/couch-logo.png differ
  Couchdb=relax
 
  <?xml version="1.0" encoding="UTF-8" ?>
  <tagline>
  <main>CouchDB - Relax</main>
  </tagline>
 
  /*!
  * Bootstrap Responsive v2.2.1
  *
  * 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.
  */
 
  .clearfix {
  *zoom: 1;
  }
 
  .clearfix:before,
  .clearfix:after {
  display: table;
  line-height: 0;
  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: 30px;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
  }
 
  .hidden {
  display: none;
  visibility: hidden;
  }
 
  .visible-phone {
  display: none !important;
  }
 
  .visible-tablet {
  display: none !important;
  }
 
  .hidden-desktop {
  display: none !important;
  }
 
  .visible-desktop {
  display: inherit !important;
  }
 
  @media (min-width: 768px) and (max-width: 979px) {
  .hidden-desktop {
  display: inherit !important;
  }
  .visible-desktop {
  display: none !important ;
  }
  .visible-tablet {
  display: inherit !important;
  }
  .hidden-tablet {
  display: none !important;
  }
  }
 
  @media (max-width: 767px) {
  .hidden-desktop {
  display: inherit !important;
  }
  .visible-desktop {
  display: none !important;
  }
  .visible-phone {
  display: inherit !important;
  }
  .hidden-phone {
  display: none !important;
  }
  }
 
  @media (min-width: 1200px) {
  .row {
  margin-left: -30px;
  *zoom: 1;
  }
  .row:before,
  .row:after {
  display: table;
  line-height: 0;
  content: "";
  }
  .row:after {
  clear: both;
  }
  [class*="span"] {
  float: left;
  min-height: 1px;
  margin-left: 30px;
  }
  .container,
  .navbar-static-top .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;
  line-height: 0;
  content: "";
  }
  .row-fluid:after {
  clear: both;
  }
  .row-fluid [class*="span"] {
  display: block;
  float: left;
  width: 100%;
  min-height: 30px;
  margin-left: 2.564102564102564%;
  *margin-left: 2.5109110747408616%;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
  }
  .row-fluid [class*="span"]:first-child {
  margin-left: 0;
  }
  .row-fluid .controls-row [class*="span"] + [class*="span"] {
  margin-left: 2.564102564102564%;
  }
  .row-fluid .span12 {
  width: 100%;
  *width: 99.94680851063829%;
  }
  .row-fluid .span11 {
  width: 91.45299145299145%;
  *width: 91.39979996362975%;
  }
  .row-fluid .span10 {
  width: 82.90598290598291%;
  *width: 82.8527914166212%;
  }
  .row-fluid .span9 {
  width: 74.35897435897436%;
  *width: 74.30578286961266%;
  }
  .row-fluid .span8 {
  width: 65.81196581196582%;
  *width: 65.75877432260411%;
  }
  .row-fluid .span7 {
  width: 57.26495726495726%;
  *width: 57.21176577559556%;
  }
  .row-fluid .span6 {
  width: 48.717948717948715%;
  *width: 48.664757228587014%;
  }
  .row-fluid .span5 {
  width: 40.17094017094017%;
  *width: 40.11774868157847%;
  }
  .row-fluid .span4 {
  width: 31.623931623931625%;
  *width: 31.570740134569924%;
  }
  .row-fluid .span3 {
  width: 23.076923076923077%;
  *width: 23.023731587561375%;
  }
  .row-fluid .span2 {
  width: 14.52991452991453%;
  *width: 14.476723040552828%;
  }
  .row-fluid .span1 {
  width: 5.982905982905983%;
  *width: 5.929714493544281%;
  }
  .row-fluid .offset12 {
  margin-left: 105.12820512820512%;
  *margin-left: 105.02182214948171%;
  }
  .row-fluid .offset12:first-child {
  margin-left: 102.56410256410257%;
  *margin-left: 102.45771958537915%;
  }
  .row-fluid .offset11 {
  margin-left: 96.58119658119658%;
  *margin-left: 96.47481360247316%;
  }
  .row-fluid .offset11:first-child {
  margin-left: 94.01709401709402%;
  *margin-left: 93.91071103837061%;
  }
  .row-fluid .offset10 {
  margin-left: 88.03418803418803%;
  *margin-left: 87.92780505546462%;
  }
  .row-fluid .offset10:first-child {
  margin-left: 85.47008547008548%;
  *margin-left: 85.36370249136206%;
  }
  .row-fluid .offset9 {
  margin-left: 79.48717948717949%;
  *margin-left: 79.38079650845607%;
  }
  .row-fluid .offset9:first-child {
  margin-left: 76.92307692307693%;
  *margin-left: 76.81669394435352%;
  }
  .row-fluid .offset8 {
  margin-left: 70.94017094017094%;
  *margin-left: 70.83378796144753%;
  }
  .row-fluid .offset8:first-child {
  margin-left: 68.37606837606839%;
  *margin-left: 68.26968539734497%;
  }
  .row-fluid .offset7 {
  margin-left: 62.393162393162385%;
  *margin-left: 62.28677941443899%;
  }
  .row-fluid .offset7:first-child {
  margin-left: 59.82905982905982%;
  *margin-left: 59.72267685033642%;
  }
  .row-fluid .offset6 {
  margin-left: 53.84615384615384%;
  *margin-left: 53.739770867430444%;
  }
  .row-fluid .offset6:first-child {
  margin-left: 51.28205128205128%;
  *margin-left: 51.175668303327875%;
  }
  .row-fluid .offset5 {
  margin-left: 45.299145299145295%;
  *margin-left: 45.1927623204219%;
  }
  .row-fluid .offset5:first-child {
  margin-left: 42.73504273504273%;
  *margin-left: 42.62865975631933%;
  }
  .row-fluid .offset4 {
  margin-left: 36.75213675213675%;
  *margin-left: 36.645753773413354%;
  }
  .row-fluid .offset4:first-child {
  margin-left: 34.18803418803419%;
  *margin-left: 34.081651209310785%;
  }
  .row-fluid .offset3 {
  margin-left: 28.205128205128204%;
  *margin-left: 28.0987452264048%;
  }
  .row-fluid .offset3:first-child {
  margin-left: 25.641025641025642%;
  *margin-left: 25.53464266230224%;
  }
  .row-fluid .offset2 {
  margin-left: 19.65811965811966%;
  *margin-left: 19.551736679396257%;
  }
  .row-fluid .offset2:first-child {
  margin-left: 17.094017094017094%;
  *margin-left: 16.98763411529369%;
  }
  .row-fluid .offset1 {
  margin-left: 11.11111111111111%;
  *margin-left: 11.004728132387708%;
  }
  .row-fluid .offset1:first-child {
  margin-left: 8.547008547008547%;
  *margin-left: 8.440625568285142%;
  }
  input,
  textarea,
  .uneditable-input {
  margin-left: 0;
  }
  .controls-row [class*="span"] + [class*="span"] {
  margin-left: 30px;
  }
  input.span12,
  textarea.span12,
  .uneditable-input.span12 {
  width: 1156px;
  }
  input.span11,
  textarea.span11,
  .uneditable-input.span11 {
  width: 1056px;
  }
  input.span10,
  textarea.span10,
  .uneditable-input.span10 {
  width: 956px;
  }
  input.span9,
  textarea.span9,
  .uneditable-input.span9 {
  width: 856px;
  }
  input.span8,
  textarea.span8,
  .uneditable-input.span8 {
  width: 756px;
  }
  input.span7,
  textarea.span7,
  .uneditable-input.span7 {
  width: 656px;
  }
  input.span6,
  textarea.span6,
  .uneditable-input.span6 {
  width: 556px;
  }
  input.span5,
  textarea.span5,
  .uneditable-input.span5 {
  width: 456px;
  }
  input.span4,
  textarea.span4,
  .uneditable-input.span4 {
  width: 356px;
  }
  input.span3,
  textarea.span3,
  .uneditable-input.span3 {
  width: 256px;
  }
  input.span2,
  textarea.span2,
  .uneditable-input.span2 {
  width: 156px;
  }
  input.span1,
  textarea.span1,
  .uneditable-input.span1 {
  width: 56px;
  }
  .thumbnails {
  margin-left: -30px;
  }
  .thumbnails > li {
  margin-left: 30px;
  }
  .row-fluid .thumbnails {
  margin-left: 0;
  }
  }
 
  @media (min-width: 768px) and (max-width: 979px) {
  .row {
  margin-left: -20px;
  *zoom: 1;
  }
  .row:before,
  .row:after {
  display: table;
  line-height: 0;
  content: "";
  }
  .row:after {
  clear: both;
  }
  [class*="span"] {
  float: left;
  min-height: 1px;
  margin-left: 20px;
  }
  .container,
  .navbar-static-top .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;
  line-height: 0;
  content: "";
  }
  .row-fluid:after {
  clear: both;
  }
  .row-fluid [class*="span"] {
  display: block;
  float: left;
  width: 100%;
  min-height: 30px;
  margin-left: 2.7624309392265194%;
  *margin-left: 2.709239449864817%;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
  }
  .row-fluid [class*="span"]:first-child {
  margin-left: 0;
  }
  .row-fluid .controls-row [class*="span"] + [class*="span"] {
  margin-left: 2.7624309392265194%;
  }
  .row-fluid .span12 {
  width: 100%;
  *width: 99.94680851063829%;
  }
  .row-fluid .span11 {
  width: 91.43646408839778%;
  *width: 91.38327259903608%;
  }
  .row-fluid .span10 {
  width: 82.87292817679558%;
  *width: 82.81973668743387%;
  }
  .row-fluid .span9 {
  width: 74.30939226519337%;
  *width: 74.25620077583166%;
  }
  .row-fluid .span8 {
  width: 65.74585635359117%;
  *width: 65.69266486422946%;
  }
  .row-fluid .span7 {
  width: 57.18232044198895%;
  *width: 57.12912895262725%;
  }
  .row-fluid .span6 {
  width: 48.61878453038674%;
  *width: 48.56559304102504%;
  }
  .row-fluid .span5 {
  width: 40.05524861878453%;
  *width: 40.00205712942283%;
  }
  .row-fluid .span4 {
  width: 31.491712707182323%;
  *width: 31.43852121782062%;
  }
  .row-fluid .span3 {
  width: 22.92817679558011%;
  *width: 22.87498530621841%;
  }
  .row-fluid .span2 {
  width: 14.3646408839779%;
  *width: 14.311449394616199%;
  }
  .row-fluid .span1 {
  width: 5.801104972375691%;
  *width: 5.747913483013988%;
  }
  .row-fluid .offset12 {
  margin-left: 105.52486187845304%;
  *margin-left: 105.41847889972962%;
  }
  .row-fluid .offset12:first-child {
  margin-left: 102.76243093922652%;
  *margin-left: 102.6560479605031%;
  }
  .row-fluid .offset11 {
  margin-left: 96.96132596685082%;
  *margin-left: 96.8549429881274%;
  }
  .row-fluid .offset11:first-child {
  margin-left: 94.1988950276243%;
  *margin-left: 94.09251204890089%;
  }
  .row-fluid .offset10 {
  margin-left: 88.39779005524862%;
  *margin-left: 88.2914070765252%;
  }
  .row-fluid .offset10:first-child {
  margin-left: 85.6353591160221%;
  *margin-left: 85.52897613729868%;
  }
  .row-fluid .offset9 {
  margin-left: 79.8342541436464%;
  *margin-left: 79.72787116492299%;
  }
  .row-fluid .offset9:first-child {
  margin-left: 77.07182320441989%;
  *margin-left: 76.96544022569647%;
  }
  .row-fluid .offset8 {
  margin-left: 71.2707182320442%;
  *margin-left: 71.16433525332079%;
  }
  .row-fluid .offset8:first-child {
  margin-left: 68.50828729281768%;
  *margin-left: 68.40190431409427%;
  }
  .row-fluid .offset7 {
  margin-left: 62.70718232044199%;
  *margin-left: 62.600799341718584%;
  }
  .row-fluid .offset7:first-child {
  margin-left: 59.94475138121547%;
  *margin-left: 59.838368402492065%;
  }
  .row-fluid .offset6 {
  margin-left: 54.14364640883978%;
  *margin-left: 54.037263430116376%;
  }
  .row-fluid .offset6:first-child {
  margin-left: 51.38121546961326%;
  *margin-left: 51.27483249088986%;
  }
  .row-fluid .offset5 {
  margin-left: 45.58011049723757%;
  *margin-left: 45.47372751851417%;
  }
  .row-fluid .offset5:first-child {
  margin-left: 42.81767955801105%;
  *margin-left: 42.71129657928765%;
  }
  .row-fluid .offset4 {
  margin-left: 37.01657458563536%;
  *margin-left: 36.91019160691196%;
  }
  .row-fluid .offset4:first-child {
  margin-left: 34.25414364640884%;
  *margin-left: 34.14776066768544%;
  }
  .row-fluid .offset3 {
  margin-left: 28.45303867403315%;
  *margin-left: 28.346655695309746%;
  }
  .row-fluid .offset3:first-child {
  margin-left: 25.69060773480663%;
  *margin-left: 25.584224756083227%;
  }
  .row-fluid .offset2 {
  margin-left: 19.88950276243094%;
  *margin-left: 19.783119783707537%;
  }
  .row-fluid .offset2:first-child {
  margin-left: 17.12707182320442%;
  *margin-left: 17.02068884448102%;
  }
  .row-fluid .offset1 {
  margin-left: 11.32596685082873%;
  *margin-left: 11.219583872105325%;
  }
  .row-fluid .offset1:first-child {
  margin-left: 8.56353591160221%;
  *margin-left: 8.457152932878806%;
  }
  input,
  textarea,
  .uneditable-input {
  margin-left: 0;
  }
  .controls-row [class*="span"] + [class*="span"] {
  margin-left: 20px;
  }
  input.span12,
  textarea.span12,
  .uneditable-input.span12 {
  width: 710px;
  }
  input.span11,
  textarea.span11,
  .uneditable-input.span11 {
  width: 648px;
  }
  input.span10,
  textarea.span10,
  .uneditable-input.span10 {
  width: 586px;
  }
  input.span9,
  textarea.span9,
  .uneditable-input.span9 {
  width: 524px;
  }
  input.span8,
  textarea.span8,
  .uneditable-input.span8 {
  width: 462px;
  }
  input.span7,
  textarea.span7,
  .uneditable-input.span7 {
  width: 400px;
  }
  input.span6,
  textarea.span6,
  .uneditable-input.span6 {
  width: 338px;
  }
  input.span5,
  textarea.span5,
  .uneditable-input.span5 {
  width: 276px;
  }
  input.span4,
  textarea.span4,
  .uneditable-input.span4 {
  width: 214px;
  }
  input.span3,
  textarea.span3,
  .uneditable-input.span3 {
  width: 152px;
  }
  input.span2,
  textarea.span2,
  .uneditable-input.span2 {
  width: 90px;
  }
  input.span1,
  textarea.span1,
  .uneditable-input.span1 {
  width: 28px;
  }
  }
 
  @media (max-width: 767px) {
  body {
  padding-right: 20px;
  padding-left: 20px;
  }
  .navbar-fixed-top,
  .navbar-fixed-bottom,
  .navbar-static-top {
  margin-right: -20px;
  margin-left: -20px;
  }
  .container-fluid {
  padding: 0;
  }
  .dl-horizontal dt {
  float: none;
  width: auto;
  clear: none;
  text-align: left;
  }
  .dl-horizontal dd {
  margin-left: 0;
  }
  .container {
  width: auto;
  }
  .row-fluid {
  width: 100%;
  }
  .row,
  .thumbnails {
  margin-left: 0;
  }
  .thumbnails > li {
  float: none;
  margin-left: 0;
  }
  [class*="span"],
  .uneditable-input[class*="span"],
  .row-fluid [class*="span"] {
  display: block;
  float: none;
  width: 100%;
  margin-left: 0;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
  }
  .span12,
  .row-fluid .span12 {
  width: 100%;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
  }
  .row-fluid [class*="offset"]:first-child {
  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: 30px;
  -webkit-box-sizing: border-box;
  -moz-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;
  }
  .controls-row [class*="span"] + [class*="span"] {
  margin-left: 0;
  }
  .modal {
  position: fixed;
  top: 20px;
  right: 20px;
  left: 20px;
  width: auto;
  margin: 0;
  }
  .modal.fade {
  top: -100px;
  }
  .modal.fade.in {
  top: 20px;
  }
  }
 
  @media (max-width: 480px) {
  .nav-collapse {
  -webkit-transform: translate3d(0, 0, 0);
  }
  .page-header h1 small {
  display: block;
  line-height: 20px;
  }
  input[type="checkbox"],
  input[type="radio"] {
  border: 1px solid #ccc;
  }
  .form-horizontal .control-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-right: 10px;
  padding-left: 10px;
  }
  .media .pull-left,
  .media .pull-right {
  display: block;
  float: none;
  margin-bottom: 10px;
  }
  .media-object {
  margin-right: 0;
  margin-left: 0;
  }
  .modal {
  top: 10px;
  right: 10px;
  left: 10px;
  }
  .modal-header .close {
  padding: 10px;
  margin: -10px;
  }
  .carousel-caption {
  position: static;
  }
  }
 
  @media (max-width: 979px) {
  body {
  padding-top: 0;
  }
  .navbar-fixed-top,
  .navbar-fixed-bottom {
  position: static;
  }
  .navbar-fixed-top {
  margin-bottom: 20px;
  }
  .navbar-fixed-bottom {
  margin-top: 20px;
  }
  .navbar-fixed-top .navbar-inner,
  .navbar-fixed-bottom .navbar-inner {
  padding: 5px;
  }
  .navbar .container {
  width: auto;
  padding: 0;
  }
  .navbar .brand {
  padding-right: 10px;
  padding-left: 10px;
  margin: 0 0 0 -5px;
  }
  .nav-collapse {
  clear: both;
  }
  .nav-collapse .nav {
  float: none;
  margin: 0 0 10px;
  }
  .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: #777777;
  text-shadow: none;
  }
  .nav-collapse .nav > li > a,
  .nav-collapse .dropdown-menu a {
  padding: 9px 15px;
  font-weight: bold;
  color: #777777;
  -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: #f2f2f2;
  }
  .navbar-inverse .nav-collapse .nav > li > a,
  .navbar-inverse .nav-collapse .dropdown-menu a {
  color: #999999;
  }
  .navbar-inverse .nav-collapse .nav > li > a:hover,
  .navbar-inverse .nav-collapse .dropdown-menu a:hover {
  background-color: #111111;
  }
  .nav-collapse.in .btn-group {
  padding: 0;
  margin-top: 5px;
  }
  .nav-collapse .dropdown-menu {
  position: static;
  top: auto;
  left: auto;
  display: none;
  float: none;
  max-width: none;
  padding: 0;
  margin: 0 15px;
  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 .open > .dropdown-menu {
  display: block;
  }
  .nav-collapse .dropdown-menu:before,
  .nav-collapse .dropdown-menu:after {
  display: none;
  }
  .nav-collapse .dropdown-menu .divider {
  display: none;
  }
  .nav-collapse .nav > li > .dropdown-menu:before,
  .nav-collapse .nav > li > .dropdown-menu:after {
  display: none;
  }
  .nav-collapse .navbar-form,
  .nav-collapse .navbar-search {
  float: none;
  padding: 10px 15px;
  margin: 10px 0;
  border-top: 1px solid #f2f2f2;
  border-bottom: 1px solid #f2f2f2;
  -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1);
  -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1);
  }
  .navbar-inverse .nav-collapse .navbar-form,
  .navbar-inverse .nav-collapse .navbar-search {
  border-top-color: #111111;
  border-bottom-color: #111111;
  }
  .navbar .nav-collapse .nav.pull-right {
  float: none;
  margin-left: 0;
  }
  .nav-collapse,
  .nav-collapse.collapse {
  height: 0;
  overflow: hidden;
  }
  .navbar .btn-navbar {
  display: block;
  }
  .navbar-static .navbar-inner {
  padding-right: 10px;
  padding-left: 10px;
  }
  }
 
  @media (min-width: 980px) {
  .nav-collapse.collapse {
  height: auto !important;
  overflow: visible !important;
  }
  }
 
  /*!
  * Bootstrap Responsive v2.2.1
  *
  * 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.
  */.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;line-height:0;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:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.hidden{display:none;visibility:hidden}.visible-phone{display:none!important}.visible-tablet{display:none!important}.hidden-desktop{display:none!important}.visible-desktop{display:inherit!important}@media(min-width:768px) and (max-width:979px){.hidden-desktop{display:inherit!important}.visible-desktop{display:none!important}.visible-tablet{display:inherit!important}.hidden-tablet{display:none!important}}@media(max-width:767px){.hidden-desktop{display:inherit!important}.visible-desktop{display:none!important}.visible-phone{display:inherit!important}.hidden-phone{display:none!important}}@media(min-width:1200px){.row{margin-left:-30px;*zoom:1}.row:before,.row:after{display:table;line-height:0;content:""}.row:after{clear:both}[class*="span"]{float:left;min-height:1px;margin-left:30px}.container,.navbar-static-top .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;line-height:0;content:""}.row-fluid:after{clear:both}.row-fluid [class*="span"]{display:block;float:left;width:100%;min-height:30px;margin-left:2.564102564102564%;*margin-left:2.5109110747408616%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="span"]:first-child{margin-left:0}.row-fluid .controls-row [class*="span"]+[class*="span"]{margin-left:2.564102564102564%}.row-fluid .span12{width:100%;*width:99.94680851063829%}.row-fluid .span11{width:91.45299145299145%;*width:91.39979996362975%}.row-fluid .span10{width:82.90598290598291%;*width:82.8527914166212%}.row-fluid .span9{width:74.35897435897436%;*width:74.30578286961266%}.row-fluid .span8{width:65.81196581196582%;*width:65.75877432260411%}.row-fluid .span7{width:57.26495726495726%;*width:57.21176577559556%}.row-fluid .span6{width:48.717948717948715%;*width:48.664757228587014%}.row-fluid .span5{width:40.17094017094017%;*width:40.11774868157847%}.row-fluid .span4{width:31.623931623931625%;*width:31.570740134569924%}.row-fluid .span3{width:23.076923076923077%;*width:23.023731587561375%}.row-fluid .span2{width:14.52991452991453%;*width:14.476723040552828%}.row-fluid .span1{width:5.982905982905983%;*width:5.929714493544281%}.row-fluid .offset12{margin-left:105.12820512820512%;*margin-left:105.02182214948171%}.row-fluid .offset12:first-child{margin-left:102.56410256410257%;*margin-left:102.45771958537915%}.row-fluid .offset11{margin-left:96.58119658119658%;*margin-left:96.47481360247316%}.row-fluid .offset11:first-child{margin-left:94.01709401709402%;*margin-left:93.91071103837061%}.row-fluid .offset10{margin-left:88.03418803418803%;*margin-left:87.92780505546462%}.row-fluid .offset10:first-child{margin-left:85.47008547008548%;*margin-left:85.36370249136206%}.row-fluid .offset9{margin-left:79.48717948717949%;*margin-left:79.38079650845607%}.row-fluid .offset9:first-child{margin-left:76.92307692307693%;*margin-left:76.81669394435352%}.row-fluid .offset8{margin-left:70.94017094017094%;*margin-left:70.83378796144753%}.row-fluid .offset8:first-child{margin-left:68.37606837606839%;*margin-left:68.26968539734497%}.row-fluid .offset7{margin-left:62.393162393162385%;*margin-left:62.28677941443899%}.row-fluid .offset7:first-child{margin-left:59.82905982905982%;*margin-left:59.72267685033642%}.row-fluid .offset6{margin-left:53.84615384615384%;*margin-left:53.739770867430444%}.row-fluid .offset6:first-child{margin-left:51.28205128205128%;*margin-left:51.175668303327875%}.row-fluid .offset5{margin-left:45.299145299145295%;*margin-left:45.1927623204219%}.row-fluid .offset5:first-child{margin-left:42.73504273504273%;*margin-left:42.62865975631933%}.row-fluid .offset4{margin-left:36.75213675213675%;*margin-left:36.645753773413354%}.row-fluid .offset4:first-child{margin-left:34.18803418803419%;*margin-left:34.081651209310785%}.row-fluid .offset3{margin-left:28.205128205128204%;*margin-left:28.0987452264048%}.row-fluid .offset3:first-child{margin-left:25.641025641025642%;*margin-left:25.53464266230224%}.row-fluid .offset2{margin-left:19.65811965811966%;*margin-left:19.551736679396257%}.row-fluid .offset2:first-child{margin-left:17.094017094017094%;*margin-left:16.98763411529369%}.row-fluid .offset1{margin-left:11.11111111111111%;*margin-left:11.004728132387708%}.row-fluid .offset1:first-child{margin-left:8.547008547008547%;*margin-left:8.440625568285142%}input,textarea,.uneditable-input{margin-left:0}.controls-row [class*="span"]+[class*="span"]{margin-left:30px}input.span12,textarea.span12,.uneditable-input.span12{width:1156px}input.span11,textarea.span11,.uneditable-input.span11{width:1056px}input.span10,textarea.span10,.uneditable-input.span10{width:956px}input.span9,textarea.span9,.uneditable-input.span9{width:856px}input.span8,textarea.span8,.uneditable-input.span8{width:756px}input.span7,textarea.span7,.uneditable-input.span7{width:656px}input.span6,textarea.span6,.uneditable-input.span6{width:556px}input.span5,textarea.span5,.uneditable-input.span5{width:456px}input.span4,textarea.span4,.uneditable-input.span4{width:356px}input.span3,textarea.span3,.uneditable-input.span3{width:256px}input.span2,textarea.span2,.uneditable-input.span2{width:156px}input.span1,textarea.span1,.uneditable-input.span1{width:56px}.thumbnails{margin-left:-30px}.thumbnails>li{margin-left:30px}.row-fluid .thumbnails{margin-left:0}}@media(min-width:768px) and (max-width:979px){.row{margin-left:-20px;*zoom:1}.row:before,.row:after{display:table;line-height:0;content:""}.row:after{clear:both}[class*="span"]{float:left;min-height:1px;margin-left:20px}.container,.navbar-static-top .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;line-height:0;content:""}.row-fluid:after{clear:both}.row-fluid [class*="span"]{display:block;float:left;width:100%;min-height:30px;margin-left:2.7624309392265194%;*margin-left:2.709239449864817%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="span"]:first-child{margin-left:0}.row-fluid .controls-row [class*="span"]+[class*="span"]{margin-left:2.7624309392265194%}.row-fluid .span12{width:100%;*width:99.94680851063829%}.row-fluid .span11{width:91.43646408839778%;*width:91.38327259903608%}.row-fluid .span10{width:82.87292817679558%;*width:82.81973668743387%}.row-fluid .span9{width:74.30939226519337%;*width:74.25620077583166%}.row-fluid .span8{width:65.74585635359117%;*width:65.69266486422946%}.row-fluid .span7{width:57.18232044198895%;*width:57.12912895262725%}.row-fluid .span6{width:48.61878453038674%;*width:48.56559304102504%}.row-fluid .span5{width:40.05524861878453%;*width:40.00205712942283%}.row-fluid .span4{width:31.491712707182323%;*width:31.43852121782062%}.row-fluid .span3{width:22.92817679558011%;*width:22.87498530621841%}.row-fluid .span2{width:14.3646408839779%;*width:14.311449394616199%}.row-fluid .span1{width:5.801104972375691%;*width:5.747913483013988%}.row-fluid .offset12{margin-left:105.52486187845304%;*margin-left:105.41847889972962%}.row-fluid .offset12:first-child{margin-left:102.76243093922652%;*margin-left:102.6560479605031%}.row-fluid .offset11{margin-left:96.96132596685082%;*margin-left:96.8549429881274%}.row-fluid .offset11:first-child{margin-left:94.1988950276243%;*margin-left:94.09251204890089%}.row-fluid .offset10{margin-left:88.39779005524862%;*margin-left:88.2914070765252%}.row-fluid .offset10:first-child{margin-left:85.6353591160221%;*margin-left:85.52897613729868%}.row-fluid .offset9{margin-left:79.8342541436464%;*margin-left:79.72787116492299%}.row-fluid .offset9:first-child{margin-left:77.07182320441989%;*margin-left:76.96544022569647%}.row-fluid .offset8{margin-left:71.2707182320442%;*margin-left:71.16433525332079%}.row-fluid .offset8:first-child{margin-left:68.50828729281768%;*margin-left:68.40190431409427%}.row-fluid .offset7{margin-left:62.70718232044199%;*margin-left:62.600799341718584%}.row-fluid .offset7:first-child{margin-left:59.94475138121547%;*margin-left:59.838368402492065%}.row-fluid .offset6{margin-left:54.14364640883978%;*margin-left:54.037263430116376%}.row-fluid .offset6:first-child{margin-left:51.38121546961326%;*margin-left:51.27483249088986%}.row-fluid .offset5{margin-left:45.58011049723757%;*margin-left:45.47372751851417%}.row-fluid .offset5:first-child{margin-left:42.81767955801105%;*margin-left:42.71129657928765%}.row-fluid .offset4{margin-left:37.01657458563536%;*margin-left:36.91019160691196%}.row-fluid .offset4:first-child{margin-left:34.25414364640884%;*margin-left:34.14776066768544%}.row-fluid .offset3{margin-left:28.45303867403315%;*margin-left:28.346655695309746%}.row-fluid .offset3:first-child{margin-left:25.69060773480663%;*margin-left:25.584224756083227%}.row-fluid .offset2{margin-left:19.88950276243094%;*margin-left:19.783119783707537%}.row-fluid .offset2:first-child{margin-left:17.12707182320442%;*margin-left:17.02068884448102%}.row-fluid .offset1{margin-left:11.32596685082873%;*margin-left:11.219583872105325%}.row-fluid .offset1:first-child{margin-left:8.56353591160221%;*margin-left:8.457152932878806%}input,textarea,.uneditable-input{margin-left:0}.controls-row [class*="span"]+[class*="span"]{margin-left:20px}input.span12,textarea.span12,.uneditable-input.span12{width:710px}input.span11,textarea.span11,.uneditable-input.span11{width:648px}input.span10,textarea.span10,.uneditable-input.span10{width:586px}input.span9,textarea.span9,.uneditable-input.span9{width:524px}input.span8,textarea.span8,.uneditable-input.span8{width:462px}input.span7,textarea.span7,.uneditable-input.span7{width:400px}input.span6,textarea.span6,.uneditable-input.span6{width:338px}input.span5,textarea.span5,.uneditable-input.span5{width:276px}input.span4,textarea.span4,.uneditable-input.span4{width:214px}input.span3,textarea.span3,.uneditable-input.span3{width:152px}input.span2,textarea.span2,.uneditable-input.span2{width:90px}input.span1,textarea.span1,.uneditable-input.span1{width:28px}}@media(max-width:767px){body{padding-right:20px;padding-left:20px}.navbar-fixed-top,.navbar-fixed-bottom,.navbar-static-top{margin-right:-20px;margin-left:-20px}.container-fluid{padding:0}.dl-horizontal dt{float:none;width:auto;clear:none;text-align:left}.dl-horizontal dd{margin-left:0}.container{width:auto}.row-fluid{width:100%}.row,.thumbnails{margin-left:0}.thumbnails>li{float:none;margin-left:0}[class*="span"],.uneditable-input[class*="span"],.row-fluid [class*="span"]{display:block;float:none;width:100%;margin-left:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.span12,.row-fluid .span12{width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="offset"]:first-child{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:30px;-webkit-box-sizing:border-box;-moz-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}.controls-row [class*="span"]+[class*="span"]{margin-left:0}.modal{position:fixed;top:20px;right:20px;left:20px;width:auto;margin:0}.modal.fade{top:-100px}.modal.fade.in{top:20px}}@media(max-width:480px){.nav-collapse{-webkit-transform:translate3d(0,0,0)}.page-header h1 small{display:block;line-height:20px}input[type="checkbox"],input[type="radio"]{border:1px solid #ccc}.form-horizontal .control-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-right:10px;padding-left:10px}.media .pull-left,.media .pull-right{display:block;float:none;margin-bottom:10px}.media-object{margin-right:0;margin-left:0}.modal{top:10px;right:10px;left:10px}.modal-header .close{padding:10px;margin:-10px}.carousel-caption{position:static}}@media(max-width:979px){body{padding-top:0}.navbar-fixed-top,.navbar-fixed-bottom{position:static}.navbar-fixed-top{margin-bottom:20px}.navbar-fixed-bottom{margin-top:20px}.navbar-fixed-top .navbar-inner,.navbar-fixed-bottom .navbar-inner{padding:5px}.navbar .container{width:auto;padding:0}.navbar .brand{padding-right:10px;padding-left:10px;margin:0 0 0 -5px}.nav-collapse{clear:both}.nav-collapse .nav{float:none;margin:0 0 10px}.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:#777;text-shadow:none}.nav-collapse .nav>li>a,.nav-collapse .dropdown-menu a{padding:9px 15px;font-weight:bold;color:#777;-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:#f2f2f2}.navbar-inverse .nav-collapse .nav>li>a,.navbar-inverse .nav-collapse .dropdown-menu a{color:#999}.navbar-inverse .nav-collapse .nav>li>a:hover,.navbar-inverse .nav-collapse .dropdown-menu a:hover{background-color:#111}.nav-collapse.in .btn-group{padding:0;margin-top:5px}.nav-collapse .dropdown-menu{position:static;top:auto;left:auto;display:none;float:none;max-width:none;padding:0;margin:0 15px;background-color:transparent;border:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.nav-collapse .open>.dropdown-menu{display:block}.nav-collapse .dropdown-menu:before,.nav-collapse .dropdown-menu:after{display:none}.nav-collapse .dropdown-menu .divider{display:none}.nav-collapse .nav>li>.dropdown-menu:before,.nav-collapse .nav>li>.dropdown-menu:after{display:none}.nav-collapse .navbar-form,.nav-collapse .navbar-search{float:none;padding:10px 15px;margin:10px 0;border-top:1px solid #f2f2f2;border-bottom:1px solid #f2f2f2;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1)}.navbar-inverse .nav-collapse .navbar-form,.navbar-inverse .nav-collapse .navbar-search{border-top-color:#111;border-bottom-color:#111}.navbar .nav-collapse .nav.pull-right{float:none;margin-left:0}.nav-collapse,.nav-collapse.collapse{height:0;overflow:hidden}.navbar .btn-navbar{display:block}.navbar-static .navbar-inner{padding-right:10px;padding-left:10px}}@media(min-width:980px){.nav-collapse.collapse{height:auto!important;overflow:visible!important}}
 
file:b/css/bootstrap.css (new)
  /*!
  * Bootstrap v2.2.1
  *
  * 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.
  */
 
  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 {
  width: auto\9;
  height: auto;
  max-width: 100%;
  vertical-align: middle;
  border: 0;
  -ms-interpolation-mode: bicubic;
  }
 
  #map_canvas img,
  .google-maps 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,
  html 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;
  }
 
  .clearfix {
  *zoom: 1;
  }
 
  .clearfix:before,
  .clearfix:after {
  display: table;
  line-height: 0;
  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: 30px;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
  }
 
  body {
  margin: 0;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 20px;
  color: #333333;
  background-color: #ffffff;
  }
 
  a {
  color: #0088cc;
  text-decoration: none;
  }
 
  a:hover {
  color: #005580;
  text-decoration: underline;
  }
 
  .img-rounded {
  -webkit-border-radius: 6px;
  -moz-border-radius: 6px;
  border-radius: 6px;
  }
 
  .img-polaroid {
  padding: 4px;
  background-color: #fff;
  border: 1px solid #ccc;
  border: 1px solid rgba(0, 0, 0, 0.2);
  -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  }
 
  .img-circle {
  -webkit-border-radius: 500px;
  -moz-border-radius: 500px;
  border-radius: 500px;
  }
 
  .row {
  margin-left: -20px;
  *zoom: 1;
  }
 
  .row:before,
  .row:after {
  display: table;
  line-height: 0;
  content: "";
  }
 
  .row:after {
  clear: both;
  }
 
  [class*="span"] {
  float: left;
  min-height: 1px;
  margin-left: 20px;
  }
 
  .container,
  .navbar-static-top .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;
  line-height: 0;
  content: "";
  }
 
  .row-fluid:after {
  clear: both;
  }
 
  .row-fluid [class*="span"] {
  display: block;
  float: left;
  width: 100%;
  min-height: 30px;
  margin-left: 2.127659574468085%;
  *margin-left: 2.074468085106383%;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
  }
 
  .row-fluid [class*="span"]:first-child {
  margin-left: 0;
  }
 
  .row-fluid .controls-row [class*="span"] + [class*="span"] {
  margin-left: 2.127659574468085%;
  }
 
  .row-fluid .span12 {
  width: 100%;
  *width: 99.94680851063829%;
  }
 
  .row-fluid .span11 {
  width: 91.48936170212765%;
  *width: 91.43617021276594%;
  }
 
  .row-fluid .span10 {
  width: 82.97872340425532%;
  *width: 82.92553191489361%;
  }
 
  .row-fluid .span9 {
  width: 74.46808510638297%;
  *width: 74.41489361702126%;
  }
 
  .row-fluid .span8 {
  width: 65.95744680851064%;
  *width: 65.90425531914893%;
  }
 
  .row-fluid .span7 {
  width: 57.44680851063829%;
  *width: 57.39361702127659%;
  }
 
  .row-fluid .span6 {
  width: 48.93617021276595%;
  *width: 48.88297872340425%;
  }
 
  .row-fluid .span5 {
  width: 40.42553191489362%;
  *width: 40.37234042553192%;
  }
 
  .row-fluid .span4 {
  width: 31.914893617021278%;
  *width: 31.861702127659576%;
  }
 
  .row-fluid .span3 {
  width: 23.404255319148934%;
  *width: 23.351063829787233%;
  }
 
  .row-fluid .span2 {
  width: 14.893617021276595%;
  *width: 14.840425531914894%;
  }
 
  .row-fluid .span1 {
  width: 6.382978723404255%;
  *width: 6.329787234042553%;
  }
 
  .row-fluid .offset12 {
  margin-left: 104.25531914893617%;
  *margin-left: 104.14893617021275%;
  }
 
  .row-fluid .offset12:first-child {
  margin-left: 102.12765957446808%;
  *margin-left: 102.02127659574467%;
  }
 
  .row-fluid .offset11 {
  margin-left: 95.74468085106382%;
  *margin-left: 95.6382978723404%;
  }
 
  .row-fluid .offset11:first-child {
  margin-left: 93.61702127659574%;
  *margin-left: 93.51063829787232%;
  }
 
  .row-fluid .offset10 {
  margin-left: 87.23404255319149%;
  *margin-left: 87.12765957446807%;
  }
 
  .row-fluid .offset10:first-child {
  margin-left: 85.1063829787234%;
  *margin-left: 84.99999999999999%;
  }
 
  .row-fluid .offset9 {
  margin-left: 78.72340425531914%;
  *margin-left: 78.61702127659572%;
  }
 
  .row-fluid .offset9:first-child {
  margin-left: 76.59574468085106%;
  *margin-left: 76.48936170212764%;
  }
 
  .row-fluid .offset8 {
  margin-left: 70.2127659574468%;
  *margin-left: 70.10638297872339%;
  }
 
  .row-fluid .offset8:first-child {
  margin-left: 68.08510638297872%;
  *margin-left: 67.9787234042553%;
  }
 
  .row-fluid .offset7 {
  margin-left: 61.70212765957446%;
  *margin-left: 61.59574468085106%;
  }
 
  .row-fluid .offset7:first-child {
  margin-left: 59.574468085106375%;
  *margin-left: 59.46808510638297%;
  }
 
  .row-fluid .offset6 {
  margin-left: 53.191489361702125%;
  *margin-left: 53.085106382978715%;
  }
 
  .row-fluid .offset6:first-child {
  margin-left: 51.063829787234035%;
  *margin-left: 50.95744680851063%;
  }
 
  .row-fluid .offset5 {
  margin-left: 44.68085106382979%;
  *margin-left: 44.57446808510638%;
  }
 
  .row-fluid .offset5:first-child {
  margin-left: 42.5531914893617%;
  *margin-left: 42.4468085106383%;
  }
 
  .row-fluid .offset4 {
  margin-left: 36.170212765957444%;
  *margin-left: 36.06382978723405%;
  }
 
  .row-fluid .offset4:first-child {
  margin-left: 34.04255319148936%;
  *margin-left: 33.93617021276596%;
  }
 
  .row-fluid .offset3 {
  margin-left: 27.659574468085104%;
  *margin-left: 27.5531914893617%;
  }
 
  .row-fluid .offset3:first-child {
  margin-left: 25.53191489361702%;
  *margin-left: 25.425531914893618%;
  }
 
  .row-fluid .offset2 {
  margin-left: 19.148936170212764%;
  *margin-left: 19.04255319148936%;
  }
 
  .row-fluid .offset2:first-child {
  margin-left: 17.02127659574468%;
  *margin-left: 16.914893617021278%;
  }
 
  .row-fluid .offset1 {
  margin-left: 10.638297872340425%;
  *margin-left: 10.53191489361702%;
  }
 
  .row-fluid .offset1:first-child {
  margin-left: 8.51063829787234%;
  *margin-left: 8.404255319148938%;
  }
 
  [class*="span"].hide,
  .row-fluid [class*="span"].hide {
  display: none;
  }
 
  [class*="span"].pull-right,
  .row-fluid [class*="span"].pull-right {
  float: right;
  }
 
  .container {
  margin-right: auto;
  margin-left: auto;
  *zoom: 1;
  }
 
  .container:before,
  .container:after {
  display: table;
  line-height: 0;
  content: "";
  }
 
  .container:after {
  clear: both;
  }
 
  .container-fluid {
  padding-right: 20px;
  padding-left: 20px;
  *zoom: 1;
  }
 
  .container-fluid:before,
  .container-fluid:after {
  display: table;
  line-height: 0;
  content: "";
  }
 
  .container-fluid:after {
  clear: both;
  }
 
  p {
  margin: 0 0 10px;
  }
 
  .lead {
  margin-bottom: 20px;
  font-size: 21px;
  font-weight: 200;
  line-height: 30px;
  }
 
  small {
  font-size: 85%;
  }
 
  strong {
  font-weight: bold;
  }
 
  em {
  font-style: italic;
  }
 
  cite {
  font-style: normal;
  }
 
  .muted {
  color: #999999;
  }
 
  .text-warning {
  color: #c09853;
  }
 
  a.text-warning:hover {
  color: #a47e3c;
  }
 
  .text-error {
  color: #b94a48;
  }
 
  a.text-error:hover {
  color: #953b39;
  }
 
  .text-info {
  color: #3a87ad;
  }
 
  a.text-info:hover {
  color: #2d6987;
  }
 
  .text-success {
  color: #468847;
  }
 
  a.text-success:hover {
  color: #356635;
  }
 
  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
  margin: 10px 0;
  font-family: inherit;
  font-weight: bold;
  line-height: 20px;
  color: inherit;
  text-rendering: optimizelegibility;
  }
 
  h1 small,
  h2 small,
  h3 small,
  h4 small,
  h5 small,
  h6 small {
  font-weight: normal;
  line-height: 1;
  color: #999999;
  }
 
  h1,
  h2,
  h3 {
  line-height: 40px;
  }
 
  h1 {
  font-size: 38.5px;
  }
 
  h2 {
  font-size: 31.5px;
  }
 
  h3 {
  font-size: 24.5px;
  }
 
  h4 {
  font-size: 17.5px;
  }
 
  h5 {
  font-size: 14px;
  }
 
  h6 {
  font-size: 11.9px;
  }
 
  h1 small {
  font-size: 24.5px;
  }
 
  h2 small {
  font-size: 17.5px;
  }
 
  h3 small {
  font-size: 14px;
  }
 
  h4 small {
  font-size: 14px;
  }
 
  .page-header {
  padding-bottom: 9px;
  margin: 20px 0 30px;
  border-bottom: 1px solid #eeeeee;
  }
 
  ul,
  ol {
  padding: 0;
  margin: 0 0 10px 25px;
  }
 
  ul ul,
  ul ol,
  ol ol,
  ol ul {
  margin-bottom: 0;
  }
 
  li {
  line-height: 20px;
  }
 
  ul.unstyled,
  ol.unstyled {
  margin-left: 0;
  list-style: none;
  }
 
  dl {
  margin-bottom: 20px;
  }
 
  dt,
  dd {
  line-height: 20px;
  }
 
  dt {
  font-weight: bold;
  }
 
  dd {
  margin-left: 10px;
  }
 
  .dl-horizontal {
  *zoom: 1;
  }
 
  .dl-horizontal:before,
  .dl-horizontal:after {
  display: table;
  line-height: 0;
  content: "";
  }
 
  .dl-horizontal:after {
  clear: both;
  }
 
  .dl-horizontal dt {
  float: left;
  width: 160px;
  overflow: hidden;
  clear: left;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
  }
 
  .dl-horizontal dd {
  margin-left: 180px;
  }
 
  hr {
  margin: 20px 0;
  border: 0;
  border-top: 1px solid #eeeeee;
  border-bottom: 1px solid #ffffff;
  }
 
  abbr[title],
  abbr[data-original-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 20px;
  border-left: 5px solid #eeeeee;
  }
 
  blockquote p {
  margin-bottom: 0;
  font-size: 16px;
  font-weight: 300;
  line-height: 25px;
  }
 
  blockquote small {
  display: block;
  line-height: 20px;
  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;
  }
 
  blockquote.pull-right small:before {
  content: '';
  }
 
  blockquote.pull-right small:after {
  content: '\00A0 \2014';
  }
 
  q:before,
  q:after,
  blockquote:before,
  blockquote:after {
  content: "";
  }
 
  address {
  display: block;
  margin-bottom: 20px;
  font-style: normal;
  line-height: 20px;
  }
 
  code,
  pre {
  padding: 0 3px 2px;
  font-family: Monaco, Menlo, 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: 9.5px;
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 20px;
  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: 20px;
  }
 
  pre code {
  padding: 0;
  color: inherit;
  background-color: transparent;
  border: 0;
  }
 
  .pre-scrollable {
  max-height: 340px;
  overflow-y: scroll;
  }
 
  form {
  margin: 0 0 20px;
  }
 
  fieldset {
  padding: 0;
  margin: 0;
  border: 0;
  }
 
  legend {
  display: block;
  width: 100%;
  padding: 0;
  margin-bottom: 20px;
  font-size: 21px;
  line-height: 40px;
  color: #333333;
  border: 0;
  border-bottom: 1px solid #e5e5e5;
  }
 
  legend small {
  font-size: 15px;
  color: #999999;
  }
 
  label,
  input,
  button,
  select,
  textarea {
  font-size: 14px;
  font-weight: normal;
  line-height: 20px;
  }
 
  input,
  button,
  select,
  textarea {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  }
 
  label {
  display: block;
  margin-bottom: 5px;
  }
 
  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: 20px;
  padding: 4px 6px;
  margin-bottom: 10px;
  font-size: 14px;
  line-height: 20px;
  color: #555555;
  vertical-align: middle;
  -webkit-border-radius: 4px;
  -moz-border-radius: 4px;
  border-radius: 4px;
  }
 
  input,
  textarea,
  .uneditable-input {
  width: 206px;
  }
 
  textarea {
  height: auto;
  }
 
  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-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;
  -o-transition: border linear 0.2s, box-shadow linear 0.2s;
  transition: border linear 0.2s, box-shadow linear 0.2s;
  }
 
  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, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
  -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
  }
 
  input[type="radio"],
  input[type="checkbox"] {
  margin: 4px 0 0;
  margin-top: 1px \9;
  *margin-top: 0;
  line-height: normal;
  cursor: pointer;
  }
 
  input[type="file"],
  input[type="image"],
  input[type="submit"],
  input[type="reset"],
  input[type="button"],
  input[type="radio"],
  input[type="checkbox"] {
  width: auto;
  }
 
  select,
  input[type="file"] {
  height: 30px;
  /* 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: 30px;
  }
 
  select {
  width: 220px;
  background-color: #ffffff;
  border: 1px solid #cccccc;
  }
 
  select[multiple],
  select[size] {
  height: auto;
  }
 
  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;
  }
 
  .uneditable-input,
  .uneditable-textarea {
  color: #999999;
  cursor: not-allowed;
  background-color: #fcfcfc;
  border-color: #cccccc;
  -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);
  }
 
  .uneditable-input {
  overflow: hidden;
  white-space: nowrap;
  }
 
  .uneditable-textarea {
  width: auto;
  height: auto;
  }
 
  input:-moz-placeholder,
  textarea:-moz-placeholder {
  color: #999999;
  }
 
  input:-ms-input-placeholder,
  textarea:-ms-input-placeholder {
  color: #999999;
  }
 
  input::-webkit-input-placeholder,
  textarea::-webkit-input-placeholder {
  color: #999999;
  }
 
  .radio,
  .checkbox {
  min-height: 20px;
  padding-left: 20px;
  }
 
  .radio input[type="radio"],
  .checkbox input[type="checkbox"] {
  float: left;
  margin-left: -20px;
  }
 
  .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;
  }
 
  .input-mini {
  width: 60px;
  }
 
  .input-small {
  width: 90px;
  }
 
  .input-medium {
  width: 150px;
  }
 
  .input-large {
  width: 210px;
  }
 
  .input-xlarge {
  width: 270px;
  }
 
  .input-xxlarge {
  width: 530px;
  }
 
  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[class*="span"],
  .row-fluid select[class*="span"],
  .row-fluid textarea[class*="span"],
  .row-fluid .uneditable-input[class*="span"],
  .row-fluid .input-prepend [class*="span"],
  .row-fluid .input-append [class*="span"] {
  display: inline-block;
  }
 
  input,
  textarea,
  .uneditable-input {
  margin-left: 0;
  }
 
  .controls-row [class*="span"] + [class*="span"] {
  margin-left: 20px;
  }
 
  input.span12,
  textarea.span12,
  .uneditable-input.span12 {
  width: 926px;
  }
 
  input.span11,
  textarea.span11,
  .uneditable-input.span11 {
  width: 846px;
  }
 
  input.span10,
  textarea.span10,
  .uneditable-input.span10 {
  width: 766px;
  }
 
  input.span9,
  textarea.span9,
  .uneditable-input.span9 {
  width: 686px;
  }
 
  input.span8,
  textarea.span8,
  .uneditable-input.span8 {
  width: 606px;
  }
 
  input.span7,
  textarea.span7,
  .uneditable-input.span7 {
  width: 526px;
  }
 
  input.span6,
  textarea.span6,
  .uneditable-input.span6 {
  width: 446px;
  }
 
  input.span5,
  textarea.span5,
  .uneditable-input.span5 {
  width: 366px;
  }
 
  input.span4,
  textarea.span4,
  .uneditable-input.span4 {
  width: 286px;
  }
 
  input.span3,
  textarea.span3,
  .uneditable-input.span3 {
  width: 206px;
  }
 
  input.span2,
  textarea.span2,
  .uneditable-input.span2 {
  width: 126px;
  }
 
  input.span1,
  textarea.span1,
  .uneditable-input.span1 {
  width: 46px;
  }
 
  .controls-row {
  *zoom: 1;
  }
 
  .controls-row:before,
  .controls-row:after {
  display: table;
  line-height: 0;
  content: "";
  }
 
  .controls-row:after {
  clear: both;
  }
 
  .controls-row [class*="span"],
  .row-fluid .controls-row [class*="span"] {
  float: left;
  }
 
  .controls-row .checkbox[class*="span"],
  .controls-row .radio[class*="span"] {
  padding-top: 5px;
  }
 
  input[disabled],
  select[disabled],
  textarea[disabled],
  input[readonly],
  select[readonly],
  textarea[readonly] {
  cursor: not-allowed;
  background-color: #eeeeee;
  }
 
  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;
  }
 
  .control-group.warning input,
  .control-group.warning select,
  .control-group.warning textarea {
  border-color: #c09853;
  -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);
  }
 
  .control-group.warning input:focus,
  .control-group.warning select:focus,
  .control-group.warning textarea:focus {
  border-color: #a47e3c;
  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #dbc59e;
  -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #dbc59e;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 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;
  }
 
  .control-group.error input,
  .control-group.error select,
  .control-group.error textarea {
  border-color: #b94a48;
  -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);
  }
 
  .control-group.error input:focus,
  .control-group.error select:focus,
  .control-group.error textarea:focus {
  border-color: #953b39;
  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #d59392;
  -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #d59392;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 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;
  }
 
  .control-group.success input,
  .control-group.success select,
  .control-group.success textarea {
  border-color: #468847;
  -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);
  }
 
  .control-group.success input:focus,
  .control-group.success select:focus,
  .control-group.success textarea:focus {
  border-color: #356635;
  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7aba7b;
  -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7aba7b;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 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;
  }
 
  .control-group.info > label,
  .control-group.info .help-block,
  .control-group.info .help-inline {
  color: #3a87ad;
  }
 
  .control-group.info .checkbox,
  .control-group.info .radio,
  .control-group.info input,
  .control-group.info select,
  .control-group.info textarea {
  color: #3a87ad;
  }
 
  .control-group.info input,
  .control-group.info select,
  .control-group.info textarea {
  border-color: #3a87ad;
  -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);
  }
 
  .control-group.info input:focus,
  .control-group.info select:focus,
  .control-group.info textarea:focus {
  border-color: #2d6987;
  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7ab5d3;
  -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7ab5d3;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7ab5d3;
  }
 
  .control-group.info .input-prepend .add-on,
  .control-group.info .input-append .add-on {
  color: #3a87ad;
  background-color: #d9edf7;
  border-color: #3a87ad;
  }
 
  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: 19px 20px 20px;
  margin-top: 20px;
  margin-bottom: 20px;
  background-color: #f5f5f5;
  border-top: 1px solid #e5e5e5;
  *zoom: 1;
  }
 
  .form-actions:before,
  .form-actions:after {
  display: table;
  line-height: 0;
  content: "";
  }
 
  .form-actions:after {
  clear: both;
  }
 
  .help-block,
  .help-inline {
  color: #595959;
  }
 
  .help-block {
  display: block;
  margin-bottom: 10px;
  }
 
  .help-inline {
  display: inline-block;
  *display: inline;
  padding-left: 5px;
  vertical-align: middle;
  *zoom: 1;
  }
 
  .input-append,
  .input-prepend {
  margin-bottom: 5px;
  font-size: 0;
  white-space: nowrap;
  }
 
  .input-append input,
  .input-prepend input,
  .input-append select,
  .input-prepend select,
  .input-append .uneditable-input,
  .input-prepend .uneditable-input,
  .input-append .dropdown-menu,
  .input-prepend .dropdown-menu {
  font-size: 14px;
  }
 
  .input-append input,
  .input-prepend input,
  .input-append select,
  .input-prepend select,
  .input-append .uneditable-input,
  .input-prepend .uneditable-input {
  position: relative;
  margin-bottom: 0;
  *margin-left: 0;
  vertical-align: top;
  -webkit-border-radius: 0 4px 4px 0;
  -moz-border-radius: 0 4px 4px 0;
  border-radius: 0 4px 4px 0;
  }
 
  .input-append input:focus,
  .input-prepend input:focus,
  .input-append select:focus,
  .input-prepend select:focus,
  .input-append .uneditable-input:focus,
  .input-prepend .uneditable-input:focus {
  z-index: 2;
  }
 
  .input-append .add-on,
  .input-prepend .add-on {
  display: inline-block;
  width: auto;
  height: 20px;
  min-width: 16px;
  padding: 4px 5px;
  font-size: 14px;
  font-weight: normal;
  line-height: 20px;
  text-align: center;
  text-shadow: 0 1px 0 #ffffff;
  background-color: #eeeeee;
  border: 1px solid #ccc;
  }
 
  .input-append .add-on,
  .input-prepend .add-on,
  .input-append .btn,
  .input-prepend .btn {
  vertical-align: top;
  -webkit-border-radius: 0;
  -moz-border-radius: 0;
  border-radius: 0;
  }
 
  .input-append .active,
  .input-prepend .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: 4px 0 0 4px;
  -moz-border-radius: 4px 0 0 4px;
  border-radius: 4px 0 0 4px;
  }
 
  .input-append input,
  .input-append select,
  .input-append .uneditable-input {
  -webkit-border-radius: 4px 0 0 4px;
  -moz-border-radius: 4px 0 0 4px;
  border-radius: 4px 0 0 4px;
  }
 
  .input-append input + .btn-group .btn,
  .input-append select + .btn-group .btn,
  .input-append .uneditable-input + .btn-group .btn {
  -webkit-border-radius: 0 4px 4px 0;
  -moz-border-radius: 0 4px 4px 0;
  border-radius: 0 4px 4px 0;
  }
 
  .input-append .add-on,
  .input-append .btn,
  .input-append .btn-group {
  margin-left: -1px;
  }
 
  .input-append .add-on:last-child,
  .input-append .btn:last-child {
  -webkit-border-radius: 0 4px 4px 0;
  -moz-border-radius: 0 4px 4px 0;
  border-radius: 0 4px 4px 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 input + .btn-group .btn,
  .input-prepend.input-append select + .btn-group .btn,
  .input-prepend.input-append .uneditable-input + .btn-group .btn {
  -webkit-border-radius: 0 4px 4px 0;
  -moz-border-radius: 0 4px 4px 0;
  border-radius: 0 4px 4px 0;
  }
 
  .input-prepend.input-append .add-on:first-child,
  .input-prepend.input-append .btn:first-child {
  margin-right: -1px;
  -webkit-border-radius: 4px 0 0 4px;
  -moz-border-radius: 4px 0 0 4px;
  border-radius: 4px 0 0 4px;
  }
 
  .input-prepend.input-append .add-on:last-child,
  .input-prepend.input-append .btn:last-child {
  margin-left: -1px;
  -webkit-border-radius: 0 4px 4px 0;
  -moz-border-radius: 0 4px 4px 0;
  border-radius: 0 4px 4px 0;
  }
 
  .input-prepend.input-append .btn-group:first-child {
  margin-left: 0;
  }
 
  input.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: 15px;
  -moz-border-radius: 15px;
  border-radius: 15px;
  }
 
  /* Allow for input prepend/append in search forms */
 
  .form-search .input-append .search-query,
  .form-search .input-prepend .search-query {
  -webkit-border-radius: 0;
  -moz-border-radius: 0;
  border-radius: 0;
  }
 
  .form-search .input-append .search-query {
  -webkit-border-radius: 14px 0 0 14px;
  -moz-border-radius: 14px 0 0 14px;
  border-radius: 14px 0 0 14px;
  }
 
  .form-search .input-append .btn {
  -webkit-border-radius: 0 14px 14px 0;
  -moz-border-radius: 0 14px 14px 0;
  border-radius: 0 14px 14px 0;
  }
 
  .form-search .input-prepend .search-query {
  -webkit-border-radius: 0 14px 14px 0;
  -moz-border-radius: 0 14px 14px 0;
  border-radius: 0 14px 14px 0;
  }
 
  .form-search .input-prepend .btn {
  -webkit-border-radius: 14px 0 0 14px;
  -moz-border-radius: 14px 0 0 14px;
  border-radius: 14px 0 0 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;
  margin-bottom: 0;
  vertical-align: middle;
  *zoom: 1;
  }
 
  .form-search .hide,
  .form-inline .hide,
  .form-horizontal .hide {
  display: none;
  }
 
  .form-search label,
  .form-inline label,
  .form-search .btn-group,
  .form-inline .btn-group {
  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: 10px;
  }
 
  legend + .control-group {
  margin-top: 20px;
  -webkit-margin-top-collapse: separate;
  }
 
  .form-horizontal .control-group {
  margin-bottom: 20px;
  *zoom: 1;
  }
 
  .form-horizontal .control-group:before,
  .form-horizontal .control-group:after {
  display: table;
  line-height: 0;
  content: "";
  }
 
  .form-horizontal .control-group:after {
  clear: both;
  }
 
  .form-horizontal .control-label {
  float: left;
  width: 160px;
  padding-top: 5px;
  text-align: right;
  }
 
  .form-horizontal .controls {
  *display: inline-block;
  *padding-left: 20px;
  margin-left: 180px;
  *margin-left: 0;
  }
 
  .form-horizontal .controls:first-child {
  *padding-left: 180px;
  }
 
  .form-horizontal .help-block {
  margin-bottom: 0;
  }
 
  .form-horizontal input + .help-block,
  .form-horizontal select + .help-block,
  .form-horizontal textarea + .help-block {
  margin-top: 10px;
  }
 
  .form-horizontal .form-actions {
  padding-left: 180px;
  }
 
  table {
  max-width: 100%;
  background-color: transparent;
  border-collapse: collapse;
  border-spacing: 0;
  }
 
  .table {
  width: 100%;
  margin-bottom: 20px;
  }
 
  .table th,
  .table td {
  padding: 8px;
  line-height: 20px;
  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: collapse;
  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,
  .table-bordered tfoot: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,
  .table-bordered tfoot: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-bordered caption + thead tr:first-child th:first-child,
  .table-bordered caption + tbody tr:first-child td:first-child,
  .table-bordered colgroup + thead tr:first-child th:first-child,
  .table-bordered colgroup + tbody tr:first-child td:first-child {
  -webkit-border-top-left-radius: 4px;
  border-top-left-radius: 4px;
  -moz-border-radius-topleft: 4px;
  }
 
  .table-bordered caption + thead tr:first-child th:last-child,
  .table-bordered caption + tbody tr:first-child td:last-child,
  .table-bordered colgroup + thead tr:first-child th:last-child,
  .table-bordered colgroup + tbody tr:first-child td:last-child {
  -webkit-border-top-right-radius: 4px;
  border-top-right-radius: 4px;
  -moz-border-radius-topright: 4px;
  }
 
  .table-striped tbody tr:nth-child(odd) td,
  .table-striped tbody tr:nth-child(odd) th {
  background-color: #f9f9f9;
  }
 
  .table-hover tbody tr:hover td,
  .table-hover tbody tr:hover th {
  background-color: #f5f5f5;
  }
 
  table td[class*="span"],
  table th[class*="span"],
  .row-fluid table td[class*="span"],
  .row-fluid table th[class*="span"] {
  display: table-cell;
  float: none;
  margin-left: 0;
  }
 
  .table td.span1,
  .table th.span1 {
  float: none;
  width: 44px;
  margin-left: 0;
  }
 
  .table td.span2,
  .table th.span2 {
  float: none;
  width: 124px;
  margin-left: 0;
  }
 
  .table td.span3,
  .table th.span3 {
  float: none;
  width: 204px;
  margin-left: 0;
  }
 
  .table td.span4,
  .table th.span4 {
  float: none;
  width: 284px;
  margin-left: 0;
  }
 
  .table td.span5,
  .table th.span5 {
  float: none;
  width: 364px;
  margin-left: 0;
  }
 
  .table td.span6,
  .table th.span6 {
  float: none;
  width: 444px;
  margin-left: 0;
  }
 
  .table td.span7,
  .table th.span7 {
  float: none;
  width: 524px;
  margin-left: 0;
  }
 
  .table td.span8,
  .table th.span8 {
  float: none;
  width: 604px;
  margin-left: 0;
  }
 
  .table td.span9,
  .table th.span9 {
  float: none;
  width: 684px;
  margin-left: 0;
  }
 
  .table td.span10,
  .table th.span10 {
  float: none;
  width: 764px;
  margin-left: 0;
  }
 
  .table td.span11,
  .table th.span11 {
  float: none;
  width: 844px;
  margin-left: 0;
  }
 
  .table td.span12,
  .table th.span12 {
  float: none;
  width: 924px;
  margin-left: 0;
  }
 
  .table tbody tr.success td {
  background-color: #dff0d8;
  }
 
  .table tbody tr.error td {
  background-color: #f2dede;
  }
 
  .table tbody tr.warning td {
  background-color: #fcf8e3;
  }
 
  .table tbody tr.info td {
  background-color: #d9edf7;
  }
 
  .table-hover tbody tr.success:hover td {
  background-color: #d0e9c6;
  }
 
  .table-hover tbody tr.error:hover td {
  background-color: #ebcccc;
  }
 
  .table-hover tbody tr.warning:hover td {
  background-color: #faf2cc;
  }
 
  .table-hover tbody tr.info:hover td {
  background-color: #c4e3f3;
  }
 
  [class^="icon-"],
  [class*=" icon-"] {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-top: 1px;
  *margin-right: .3em;
  line-height: 14px;
  vertical-align: text-top;
  background-image: url("../img/glyphicons-halflings.png");
  background-position: 14px 14px;
  background-repeat: no-repeat;
  }
 
  /* White icons with optional class, or on hover/active states of certain elements */
 
  .icon-white,
  .nav-pills > .active > a > [class^="icon-"],
  .nav-pills > .active > a > [class*=" icon-"],
  .nav-list > .active > a > [class^="icon-"],
  .nav-list > .active > a > [class*=" icon-"],
  .navbar-inverse .nav > .active > a > [class^="icon-"],
  .navbar-inverse .nav > .active > a > [class*=" icon-"],
  .dropdown-menu > li > a:hover > [class^="icon-"],
  .dropdown-menu > li > a:hover > [class*=" icon-"],
  .dropdown-menu > .active > a > [class^="icon-"],
  .dropdown-menu > .active > a > [class*=" icon-"],
  .dropdown-submenu:hover > a > [class^="icon-"],
  .dropdown-submenu:hover > a > [class*=" icon-"] {
  background-image: url("../img/glyphicons-halflings-white.png");
  }
 
  .icon-glass {
  background-position: 0 0;
  }
 
  .icon-music {
  background-position: -24px 0;
  }
 
  .icon-search {
  background-position: -48px 0;
  }
 
  .icon-envelope {
  background-position: -72px 0;
  }
 
  .icon-heart {
  background-position: -96px 0;
  }
 
  .icon-star {
  background-position: -120px 0;
  }
 
  .icon-star-empty {
  background-position: -144px 0;
  }
 
  .icon-user {
  background-position: -168px 0;
  }
 
  .icon-film {
  background-position: -192px 0;
  }
 
  .icon-th-large {
  background-position: -216px 0;
  }
 
  .icon-th {
  background-position: -240px 0;
  }
 
  .icon-th-list {
  background-position: -264px 0;
  }
 
  .icon-ok {
  background-position: -288px 0;
  }
 
  .icon-remove {
  background-position: -312px 0;
  }
 
  .icon-zoom-in {
  background-position: -336px 0;
  }
 
  .icon-zoom-out {
  background-position: -360px 0;
  }
 
  .icon-off {
  background-position: -384px 0;
  }
 
  .icon-signal {
  background-position: -408px 0;
  }
 
  .icon-cog {
  background-position: -432px 0;
  }
 
  .icon-trash {
  background-position: -456px 0;
  }
 
  .icon-home {
  background-position: 0 -24px;
  }
 
  .icon-file {
  background-position: -24px -24px;
  }
 
  .icon-time {
  background-position: -48px -24px;
  }
 
  .icon-road {
  background-position: -72px -24px;
  }
 
  .icon-download-alt {
  background-position: -96px -24px;
  }
 
  .icon-download {
  background-position: -120px -24px;
  }
 
  .icon-upload {
  background-position: -144px -24px;
  }
 
  .icon-inbox {
  background-position: -168px -24px;
  }
 
  .icon-play-circle {
  background-position: -192px -24px;
  }
 
  .icon-repeat {
  background-position: -216px -24px;
  }
 
  .icon-refresh {
  background-position: -240px -24px;
  }
 
  .icon-list-alt {
  background-position: -264px -24px;
  }
 
  .icon-lock {
  background-position: -287px -24px;
  }
 
  .icon-flag {
  background-position: -312px -24px;
  }
 
  .icon-headphones {
  background-position: -336px -24px;
  }
 
  .icon-volume-off {
  background-position: -360px -24px;
  }
 
  .icon-volume-down {
  background-position: -384px -24px;
  }
 
  .icon-volume-up {
  background-position: -408px -24px;
  }
 
  .icon-qrcode {
  background-position: -432px -24px;
  }
 
  .icon-barcode {
  background-position: -456px -24px;
  }
 
  .icon-tag {
  background-position: 0 -48px;
  }
 
  .icon-tags {
  background-position: -25px -48px;
  }
 
  .icon-book {
  background-position: -48px -48px;
  }
 
  .icon-bookmark {
  background-position: -72px -48px;
  }
 
  .icon-print {
  background-position: -96px -48px;
  }
 
  .icon-camera {
  background-position: -120px -48px;
  }
 
  .icon-font {
  background-position: -144px -48px;
  }
 
  .icon-bold {
  background-position: -167px -48px;
  }
 
  .icon-italic {
  background-position: -192px -48px;
  }
 
  .icon-text-height {
  background-position: -216px -48px;
  }
 
  .icon-text-width {
  background-position: -240px -48px;
  }
 
  .icon-align-left {
  background-position: -264px -48px;
  }
 
  .icon-align-center {
  background-position: -288px -48px;
  }
 
  .icon-align-right {
  background-position: -312px -48px;
  }
 
  .icon-align-justify {
  background-position: -336px -48px;
  }
 
  .icon-list {
  background-position: -360px -48px;
  }
 
  .icon-indent-left {
  background-position: -384px -48px;
  }
 
  .icon-indent-right {
  background-position: -408px -48px;
  }
 
  .icon-facetime-video {
  background-position: -432px -48px;
  }
 
  .icon-picture {
  background-position: -456px -48px;
  }
 
  .icon-pencil {
  background-position: 0 -72px;
  }
 
  .icon-map-marker {
  background-position: -24px -72px;
  }
 
  .icon-adjust {
  background-position: -48px -72px;
  }
 
  .icon-tint {
  background-position: -72px -72px;
  }
 
  .icon-edit {
  background-position: -96px -72px;
  }
 
  .icon-share {
  background-position: -120px -72px;
  }
 
  .icon-check {
  background-position: -144px -72px;
  }
 
  .icon-move {
  background-position: -168px -72px;
  }
 
  .icon-step-backward {
  background-position: -192px -72px;
  }
 
  .icon-fast-backward {
  background-position: -216px -72px;
  }
 
  .icon-backward {
  background-position: -240px -72px;
  }
 
  .icon-play {
  background-position: -264px -72px;
  }
 
  .icon-pause {
  background-position: -288px -72px;
  }
 
  .icon-stop {
  background-position: -312px -72px;
  }
 
  .icon-forward {
  background-position: -336px -72px;
  }
 
  .icon-fast-forward {
  background-position: -360px -72px;
  }
 
  .icon-step-forward {
  background-position: -384px -72px;
  }
 
  .icon-eject {
  background-position: -408px -72px;
  }
 
  .icon-chevron-left {
  background-position: -432px -72px;
  }
 
  .icon-chevron-right {
  background-position: -456px -72px;
  }
 
  .icon-plus-sign {
  background-position: 0 -96px;
  }
 
  .icon-minus-sign {
  background-position: -24px -96px;
  }
 
  .icon-remove-sign {
  background-position: -48px -96px;
  }
 
  .icon-ok-sign {
  background-position: -72px -96px;
  }
 
  .icon-question-sign {
  background-position: -96px -96px;
  }
 
  .icon-info-sign {
  background-position: -120px -96px;
  }
 
  .icon-screenshot {
  background-position: -144px -96px;
  }
 
  .icon-remove-circle {
  background-position: -168px -96px;
  }
 
  .icon-ok-circle {
  background-position: -192px -96px;
  }
 
  .icon-ban-circle {
  background-position: -216px -96px;
  }
 
  .icon-arrow-left {
  background-position: -240px -96px;
  }
 
  .icon-arrow-right {
  background-position: -264px -96px;
  }
 
  .icon-arrow-up {
  background-position: -289px -96px;
  }
 
  .icon-arrow-down {
  background-position: -312px -96px;
  }
 
  .icon-share-alt {
  background-position: -336px -96px;
  }
 
  .icon-resize-full {
  background-position: -360px -96px;
  }
 
  .icon-resize-small {
  background-position: -384px -96px;
  }
 
  .icon-plus {
  background-position: -408px -96px;
  }
 
  .icon-minus {
  background-position: -433px -96px;
  }
 
  .icon-asterisk {
  background-position: -456px -96px;
  }
 
  .icon-exclamation-sign {
  background-position: 0 -120px;
  }
 
  .icon-gift {
  background-position: -24px -120px;
  }
 
  .icon-leaf {
  background-position: -48px -120px;
  }
 
  .icon-fire {
  background-position: -72px -120px;
  }
 
  .icon-eye-open {
  background-position: -96px -120px;
  }
 
  .icon-eye-close {
  background-position: -120px -120px;
  }
 
  .icon-warning-sign {
  background-position: -144px -120px;
  }
 
  .icon-plane {
  background-position: -168px -120px;
  }
 
  .icon-calendar {
  background-position: -192px -120px;
  }
 
  .icon-random {
  width: 16px;
  background-position: -216px -120px;
  }
 
  .icon-comment {
  background-position: -240px -120px;
  }
 
  .icon-magnet {
  background-position: -264px -120px;
  }
 
  .icon-chevron-up {
  background-position: -288px -120px;
  }
 
  .icon-chevron-down {
  background-position: -313px -119px;
  }
 
  .icon-retweet {
  background-position: -336px -120px;
  }
 
  .icon-shopping-cart {
  background-position: -360px -120px;
  }
 
  .icon-folder-close {
  background-position: -384px -120px;
  }
 
  .icon-folder-open {
  width: 16px;
  background-position: -408px -120px;
  }
 
  .icon-resize-vertical {
  background-position: -432px -119px;
  }
 
  .icon-resize-horizontal {
  background-position: -456px -118px;
  }
 
  .icon-hdd {
  background-position: 0 -144px;
  }
 
  .icon-bullhorn {
  background-position: -24px -144px;
  }
 
  .icon-bell {
  background-position: -48px -144px;
  }
 
  .icon-certificate {
  background-position: -72px -144px;
  }
 
  .icon-thumbs-up {
  background-position: -96px -144px;
  }
 
  .icon-thumbs-down {
  background-position: -120px -144px;
  }
 
  .icon-hand-right {
  background-position: -144px -144px;
  }
 
  .icon-hand-left {
  background-position: -168px -144px;
  }
 
  .icon-hand-up {
  background-position: -192px -144px;
  }
 
  .icon-hand-down {
  background-position: -216px -144px;
  }
 
  .icon-circle-arrow-right {
  background-position: -240px -144px;
  }
 
  .icon-circle-arrow-left {
  background-position: -264px -144px;
  }
 
  .icon-circle-arrow-up {
  background-position: -288px -144px;
  }
 
  .icon-circle-arrow-down {
  background-position: -312px -144px;
  }
 
  .icon-globe {
  background-position: -336px -144px;
  }
 
  .icon-wrench {
  background-position: -360px -144px;
  }
 
  .icon-tasks {
  background-position: -384px -144px;
  }
 
  .icon-filter {
  background-position: -408px -144px;
  }
 
  .icon-briefcase {
  background-position: -432px -144px;
  }
 
  .icon-fullscreen {
  background-position: -456px -144px;
  }
 
  .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: "";
  }
 
  .dropdown .caret {
  margin-top: 8px;
  margin-left: 2px;
  }
 
  .dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1000;
  display: none;
  float: left;
  min-width: 160px;
  padding: 5px 0;
  margin: 2px 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: 6px;
  -moz-border-radius: 6px;
  border-radius: 6px;
  -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: 9px 1px;
  *margin: -5px 0 5px;
  overflow: hidden;
  background-color: #e5e5e5;
  border-bottom: 1px solid #ffffff;
  }
 
  .dropdown-menu li > a {
  display: block;
  padding: 3px 20px;
  clear: both;
  font-weight: normal;
  line-height: 20px;
  color: #333333;
  white-space: nowrap;
  }
 
  .dropdown-menu li > a:hover,
  .dropdown-menu li > a:focus,
  .dropdown-submenu:hover > a {
  color: #ffffff;
  text-decoration: none;
  background-color: #0081c2;
  background-image: -moz-linear-gradient(top, #0088cc, #0077b3);
  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0077b3));
  background-image: -webkit-linear-gradient(top, #0088cc, #0077b3);
  background-image: -o-linear-gradient(top, #0088cc, #0077b3);
  background-image: linear-gradient(to bottom, #0088cc, #0077b3);
  background-repeat: repeat-x;
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0077b3', GradientType=0);
  }
 
  .dropdown-menu .active > a,
  .dropdown-menu .active > a:hover {
  color: #333333;
  text-decoration: none;
  background-color: #0081c2;
  background-image: -moz-linear-gradient(top, #0088cc, #0077b3);
  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0077b3));
  background-image: -webkit-linear-gradient(top, #0088cc, #0077b3);
  background-image: -o-linear-gradient(top, #0088cc, #0077b3);
  background-image: linear-gradient(to bottom, #0088cc, #0077b3);
  background-repeat: repeat-x;
  outline: 0;
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0077b3', GradientType=0);
  }
 
  .dropdown-menu .disabled > a,
  .dropdown-menu .disabled > a:hover {
  color: #999999;
  }
 
  .dropdown-menu .disabled > a:hover {
  text-decoration: none;
  cursor: default;
  background-color: transparent;
  background-image: none;
  }
 
  .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: "";
  }
 
  .dropup .dropdown-menu,
  .navbar-fixed-bottom .dropdown .dropdown-menu {
  top: auto;
  bottom: 100%;
  margin-bottom: 1px;
  }
 
  .dropdown-submenu {
  position: relative;
  }
 
  .dropdown-submenu > .dropdown-menu {
  top: 0;
  left: 100%;
  margin-top: -6px;
  margin-left: -1px;
  -webkit-border-radius: 0 6px 6px 6px;
  -moz-border-radius: 0 6px 6px 6px;
  border-radius: 0 6px 6px 6px;
  }
 
  .dropdown-submenu:hover > .dropdown-menu {
  display: block;
  }
 
  .dropup .dropdown-submenu > .dropdown-menu {
  top: auto;
  bottom: 0;
  margin-top: 0;
  margin-bottom: -2px;
  -webkit-border-radius: 5px 5px 5px 0;
  -moz-border-radius: 5px 5px 5px 0;
  border-radius: 5px 5px 5px 0;
  }
 
  .dropdown-submenu > a:after {
  display: block;
  float: right;
  width: 0;
  height: 0;
  margin-top: 5px;
  margin-right: -10px;
  border-color: transparent;
  border-left-color: #cccccc;
  border-style: solid;
  border-width: 5px 0 5px 5px;
  content: " ";
  }
 
  .dropdown-submenu:hover > a:after {
  border-left-color: #ffffff;
  }
 
  .dropdown-submenu.pull-left {
  float: none;
  }
 
  .dropdown-submenu.pull-left > .dropdown-menu {
  left: -100%;
  margin-left: 10px;
  -webkit-border-radius: 6px 0 6px 6px;
  -moz-border-radius: 6px 0 6px 6px;
  border-radius: 6px 0 6px 6px;
  }
 
  .dropdown .dropdown-menu .nav-header {
  padding-right: 20px;
  padding-left: 20px;
  }
 
  .typeahead {
  margin-top: 2px;
  -webkit-border-radius: 4px;
  -moz-border-radius: 4px;
  border-radius: 4px;
  }
 
  .well {
  min-height: 20px;
  padding: 19px;
  margin-bottom: 20px;
  background-color: #f5f5f5;
  border: 1px solid #e3e3e3;
  -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;
  }
 
  .fade {
  opacity: 0;
  -webkit-transition: opacity 0.15s linear;
  -moz-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;
  -o-transition: height 0.35s ease;
  transition: height 0.35s ease;
  }
 
  .collapse.in {
  height: auto;
  }
 
  .close {
  float: right;
  font-size: 20px;
  font-weight: bold;
  line-height: 20px;
  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;
  }
 
  .btn {
  display: inline-block;
  *display: inline;
  padding: 4px 12px;
  margin-bottom: 0;
  *margin-left: .3em;
  font-size: 14px;
  line-height: 20px;
  *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-color: #e6e6e6;
  background-image: -moz-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(to bottom, #ffffff, #e6e6e6);
  background-repeat: repeat-x;
  border: 1px solid #bbbbbb;
  *border: 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);
  border-bottom-color: #a2a2a2;
  -webkit-border-radius: 4px;
  -moz-border-radius: 4px;
  border-radius: 4px;
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe6e6e6', GradientType=0);
  filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
  *zoom: 1;
  -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
  -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
  }
 
  .btn:hover,
  .btn:active,
  .btn.active,
  .btn.disabled,
  .btn[disabled] {
  color: #333333;
  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;
  -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, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
  -moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 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: 11px 19px;
  font-size: 17.5px;
  -webkit-border-radius: 6px;
  -moz-border-radius: 6px;
  border-radius: 6px;
  }
 
  .btn-large [class^="icon-"],
  .btn-large [class*=" icon-"] {
  margin-top: 2px;
  }
 
  .btn-small {
  padding: 2px 10px;
  font-size: 11.9px;
  -webkit-border-radius: 3px;
  -moz-border-radius: 3px;
  border-radius: 3px;
  }
 
  .btn-small [class^="icon-"],
  .btn-small [class*=" icon-"] {
  margin-top: 0;
  }
 
  .btn-mini {
  padding: 1px 6px;
  font-size: 10.5px;
  -webkit-border-radius: 3px;
  -moz-border-radius: 3px;
  border-radius: 3px;
  }
 
  .btn-block {
  display: block;
  width: 100%;
  padding-right: 0;
  padding-left: 0;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
  }
 
  .btn-block + .btn-block {
  margin-top: 5px;
  }
 
  input[type="submit"].btn-block,
  input[type="reset"].btn-block,
  input[type="button"].btn-block {
  width: 100%;
  }
 
  .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: #c5c5c5;
  border-color: rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.25);
  }
 
  .btn-primary {
  color: #ffffff;
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
  background-color: #006dcc;
  *background-color: #0044cc;
  background-image: -moz-linear-gradient(top, #0088cc, #0044cc);
  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc));
  background-image: -webkit-linear-gradient(top, #0088cc, #0044cc);
  background-image: -o-linear-gradient(top, #0088cc, #0044cc);
  background-image: linear-gradient(to bottom, #0088cc, #0044cc);
  background-repeat: repeat-x;
  border-color: #0044cc #0044cc #002a80;
  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0044cc', GradientType=0);
  filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
  }
 
  .btn-primary:hover,
  .btn-primary:active,
  .btn-primary.active,
  .btn-primary.disabled,
  .btn-primary[disabled] {
  color: #ffffff;
  background-color: #0044cc;
  *background-color: #003bb3;
  }
 
  .btn-primary:active,
  .btn-primary.active {
  background-color: #003399 \9;
  }
 
  .btn-warning {
  color: #ffffff;
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
  background-color: #faa732;
  *background-color: #f89406;
  background-image: -moz-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(to bottom, #fbb450, #f89406);
  background-repeat: repeat-x;
  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);
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffbb450', endColorstr='#fff89406', GradientType=0);
  filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
  }
 
  .btn-warning:hover,
  .btn-warning:active,
  .btn-warning.active,
  .btn-warning.disabled,
  .btn-warning[disabled] {
  color: #ffffff;
  background-color: #f89406;
  *background-color: #df8505;
  }
 
  .btn-warning:active,
  .btn-warning.active {
  background-color: #c67605 \9;
  }
 
  .btn-danger {
  color: #ffffff;
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
  background-color: #da4f49;
  *background-color: #bd362f;
  background-image: -moz-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(to bottom, #ee5f5b, #bd362f);
  background-repeat: repeat-x;
  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);
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffee5f5b', endColorstr='#ffbd362f', GradientType=0);
  filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
  }
 
  .btn-danger:hover,
  .btn-danger:active,
  .btn-danger.active,
  .btn-danger.disabled,
  .btn-danger[disabled] {
  color: #ffffff;
  background-color: #bd362f;
  *background-color: #a9302a;
  }
 
  .btn-danger:active,
  .btn-danger.active {
  background-color: #942a25 \9;
  }
 
  .btn-success {
  color: #ffffff;
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
  background-color: #5bb75b;
  *background-color: #51a351;
  background-image: -moz-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(to bottom, #62c462, #51a351);
  background-repeat: repeat-x;
  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);
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff62c462', endColorstr='#ff51a351', GradientType=0);
  filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
  }
 
  .btn-success:hover,
  .btn-success:active,
  .btn-success.active,
  .btn-success.disabled,
  .btn-success[disabled] {
  color: #ffffff;
  background-color: #51a351;
  *background-color: #499249;
  }
 
  .btn-success:active,
  .btn-success.active {
  background-color: #408140 \9;
  }
 
  .btn-info {
  color: #ffffff;
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
  background-color: #49afcd;
  *background-color: #2f96b4;
  background-image: -moz-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(to bottom, #5bc0de, #2f96b4);
  background-repeat: repeat-x;
  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);
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff2f96b4', GradientType=0);
  filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
  }
 
  .btn-info:hover,
  .btn-info:active,
  .btn-info.active,
  .btn-info.disabled,
  .btn-info[disabled] {
  color: #ffffff;
  background-color: #2f96b4;
  *background-color: #2a85a0;
  }
 
  .btn-info:active,
  .btn-info.active {
  background-color: #24748c \9;
  }
 
  .btn-inverse {
  color: #ffffff;
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
  background-color: #363636;
  *background-color: #222222;
  background-image: -moz-linear-gradient(top, #444444, #222222);
  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#444444), to(#222222));
  background-image: -webkit-linear-gradient(top, #444444, #222222);
  background-image: -o-linear-gradient(top, #444444, #222222);
  background-image: linear-gradient(to bottom, #444444, #222222);
  background-repeat: repeat-x;
  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);
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff444444', endColorstr='#ff222222', GradientType=0);
  filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
  }
 
  .btn-inverse:hover,
  .btn-inverse:active,
  .btn-inverse.active,
  .btn-inverse.disabled,
  .btn-inverse[disabled] {
  color: #ffffff;
  background-color: #222222;
  *background-color: #151515;
  }
 
  .btn-inverse:active,
  .btn-inverse.active {
  background-color: #080808 \9;
  }
 
  button.btn,
  input[type="submit"].btn {
  *padding-top: 3px;
  *padding-bottom: 3px;
  }
 
  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-link,
  .btn-link:active,
  .btn-link[disabled] {
  background-color: transparent;
  background-image: none;
  -webkit-box-shadow: none;
  -moz-box-shadow: none;
  box-shadow: none;
  }
 
  .btn-link {
  color: #0088cc;
  cursor: pointer;
  border-color: transparent;
  -webkit-border-radius: 0;
  -moz-border-radius: 0;
  border-radius: 0;
  }
 
  .btn-link:hover {
  color: #005580;
  text-decoration: underline;
  background-color: transparent;
  }
 
  .btn-link[disabled]:hover {
  color: #333333;
  text-decoration: none;
  }
 
  .btn-group {
  position: relative;
  display: inline-block;
  *display: inline;
  *margin-left: .3em;
  font-size: 0;
  white-space: nowrap;
  vertical-align: middle;
  *zoom: 1;
  }
 
  .btn-group:first-child {
  *margin-left: 0;
  }
 
  .btn-group + .btn-group {
  margin-left: 5px;
  }
 
  .btn-toolbar {
  margin-top: 10px;
  margin-bottom: 10px;
  font-size: 0;
  }
 
  .btn-toolbar .btn + .btn,
  .btn-toolbar .btn-group + .btn,
  .btn-toolbar .btn + .btn-group {
  margin-left: 5px;
  }
 
  .btn-group > .btn {
  position: relative;
  -webkit-border-radius: 0;
  -moz-border-radius: 0;
  border-radius: 0;
  }
 
  .btn-group > .btn + .btn {
  margin-left: -1px;
  }
 
  .btn-group > .btn,
  .btn-group > .dropdown-menu {
  font-size: 14px;
  }
 
  .btn-group > .btn-mini {
  font-size: 11px;
  }
 
  .btn-group > .btn-small {
  font-size: 12px;
  }
 
  .btn-group > .btn-large {
  font-size: 16px;
  }
 
  .btn-group > .btn:first-child {
  margin-left: 0;
  -webkit-border-bottom-left-radius: 4px;
  border-bottom-left-radius: 4px;
  -webkit-border-top-left-radius: 4px;
  border-top-left-radius: 4px;
  -moz-border-radius-bottomleft: 4px;
  -moz-border-radius-topleft: 4px;
  }
 
  .btn-group > .btn:last-child,
  .btn-group > .dropdown-toggle {
  -webkit-border-top-right-radius: 4px;
  border-top-right-radius: 4px;
  -webkit-border-bottom-right-radius: 4px;
  border-bottom-right-radius: 4px;
  -moz-border-radius-topright: 4px;
  -moz-border-radius-bottomright: 4px;
  }
 
  .btn-group > .btn.large:first-child {
  margin-left: 0;
  -webkit-border-bottom-left-radius: 6px;
  border-bottom-left-radius: 6px;
  -webkit-border-top-left-radius: 6px;
  border-top-left-radius: 6px;
  -moz-border-radius-bottomleft: 6px;
  -moz-border-radius-topleft: 6px;
  }
 
  .btn-group > .btn.large:last-child,
  .btn-group > .large.dropdown-toggle {
  -webkit-border-top-right-radius: 6px;
  border-top-right-radius: 6px;
  -webkit-border-bottom-right-radius: 6px;
  border-bottom-right-radius: 6px;
  -moz-border-radius-topright: 6px;
  -moz-border-radius-bottomright: 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 > .btn + .dropdown-toggle {
  *padding-top: 5px;
  padding-right: 8px;
  *padding-bottom: 5px;
  padding-left: 8px;
  -webkit-box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.125), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
  -moz-box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.125), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
  box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.125), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
  }
 
  .btn-group > .btn-mini + .dropdown-toggle {
  *padding-top: 2px;
  padding-right: 5px;
  *padding-bottom: 2px;
  padding-left: 5px;
  }
 
  .btn-group > .btn-small + .dropdown-toggle {
  *padding-top: 5px;
  *padding-bottom: 4px;
  }
 
  .btn-group > .btn-large + .dropdown-toggle {
  *padding-top: 7px;
  padding-right: 12px;
  *padding-bottom: 7px;
  padding-left: 12px;
  }
 
  .btn-group.open .dropdown-toggle {
  background-image: none;
  -webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
  -moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
  }
 
  .btn-group.open .btn.dropdown-toggle {
  background-color: #e6e6e6;
  }
 
  .btn-group.open .btn-primary.dropdown-toggle {
  background-color: #0044cc;
  }
 
  .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: 8px;
  margin-left: 0;
  }
 
  .btn-mini .caret,
  .btn-small .caret,
  .btn-large .caret {
  margin-top: 6px;
  }
 
  .btn-large .caret {
  border-top-width: 5px;
  border-right-width: 5px;
  border-left-width: 5px;
  }
 
  .dropup .btn-large .caret {
  border-bottom-width: 5px;
  }
 
  .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;
  }
 
  .btn-group-vertical {
  display: inline-block;
  *display: inline;
  /* IE7 inline-block hack */
 
  *zoom: 1;
  }
 
  .btn-group-vertical .btn {
  display: block;
  float: none;
  width: 100%;
  -webkit-border-radius: 0;
  -moz-border-radius: 0;
  border-radius: 0;
  }
 
  .btn-group-vertical .btn + .btn {
  margin-top: -1px;
  margin-left: 0;
  }
 
  .btn-group-vertical .btn:first-child {
  -webkit-border-radius: 4px 4px 0 0;
  -moz-border-radius: 4px 4px 0 0;
  border-radius: 4px 4px 0 0;
  }
 
  .btn-group-vertical .btn:last-child {
  -webkit-border-radius: 0 0 4px 4px;
  -moz-border-radius: 0 0 4px 4px;
  border-radius: 0 0 4px 4px;
  }
 
  .btn-group-vertical .btn-large:first-child {
  -webkit-border-radius: 6px 6px 0 0;
  -moz-border-radius: 6px 6px 0 0;
  border-radius: 6px 6px 0 0;
  }
 
  .btn-group-vertical .btn-large:last-child {
  -webkit-border-radius: 0 0 6px 6px;
  -moz-border-radius: 0 0 6px 6px;
  border-radius: 0 0 6px 6px;
  }
 
  .alert {
  padding: 8px 35px 8px 14px;
  margin-bottom: 20px;
  color: #c09853;
  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;
  }
 
  .alert h4 {
  margin: 0;
  }
 
  .alert .close {
  position: relative;
  top: -2px;
  right: -21px;
  line-height: 20px;
  }
 
  .alert-success {
  color: #468847;
  background-color: #dff0d8;
  border-color: #d6e9c6;
  }
 
  .alert-danger,
  .alert-error {
  color: #b94a48;
  background-color: #f2dede;
  border-color: #eed3d7;
  }
 
  .alert-info {
  color: #3a87ad;
  background-color: #d9edf7;
  border-color: #bce8f1;
  }
 
  .alert-block {
  padding-top: 14px;
  padding-bottom: 14px;
  }
 
  .alert-block > p,
  .alert-block > ul {
  margin-bottom: 0;
  }
 
  .alert-block p + p {
  margin-top: 5px;
  }
 
  .nav {
  margin-bottom: 20px;
  margin-left: 0;
  list-style: none;
  }
 
  .nav > li > a {
  display: block;
  }
 
  .nav > li > a:hover {
  text-decoration: none;
  background-color: #eeeeee;
  }
 
  .nav > .pull-right {
  float: right;
  }
 
  .nav-header {
  display: block;
  padding: 3px 15px;
  font-size: 11px;
  font-weight: bold;
  line-height: 20px;
  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-right: 15px;
  padding-left: 15px;
  margin-bottom: 0;
  }
 
  .nav-list > li > a,
  .nav-list .nav-header {
  margin-right: -15px;
  margin-left: -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-"],
  .nav-list [class*=" icon-"] {
  margin-right: 2px;
  }
 
  .nav-list .divider {
  *width: 100%;
  height: 1px;
  margin: 9px 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;
  line-height: 0;
  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: 20px;
  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;
  cursor: default;
  background-color: #ffffff;
  border: 1px solid #ddd;
  border-bottom-color: transparent;
  }
 
  .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-top-right-radius: 4px;
  border-top-right-radius: 4px;
  -webkit-border-top-left-radius: 4px;
  border-top-left-radius: 4px;
  -moz-border-radius-topright: 4px;
  -moz-border-radius-topleft: 4px;
  }
 
  .nav-tabs.nav-stacked > li:last-child > a {
  -webkit-border-bottom-right-radius: 4px;
  border-bottom-right-radius: 4px;
  -webkit-border-bottom-left-radius: 4px;
  border-bottom-left-radius: 4px;
  -moz-border-radius-bottomright: 4px;
  -moz-border-radius-bottomleft: 4px;
  }
 
  .nav-tabs.nav-stacked > li > a:hover {
  z-index: 2;
  border-color: #ddd;
  }
 
  .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 6px 6px;
  -moz-border-radius: 0 0 6px 6px;
  border-radius: 0 0 6px 6px;
  }
 
  .nav-pills .dropdown-menu {
  -webkit-border-radius: 6px;
  -moz-border-radius: 6px;
  border-radius: 6px;
  }
 
  .nav .dropdown-toggle .caret {
  margin-top: 6px;
  border-top-color: #0088cc;
  border-bottom-color: #0088cc;
  }
 
  .nav .dropdown-toggle:hover .caret {
  border-top-color: #005580;
  border-bottom-color: #005580;
  }
 
  /* move down carets for tabs */
 
  .nav-tabs .dropdown-toggle .caret {
  margin-top: 8px;
  }
 
  .nav .active .dropdown-toggle .caret {
  border-top-color: #fff;
  border-bottom-color: #fff;
  }
 
  .nav-tabs .active .dropdown-toggle .caret {
  border-top-color: #555555;
  border-bottom-color: #555555;
  }
 
  .nav > .dropdown.active > a:hover {
  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;
  line-height: 0;
  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-top-color: #ddd;
  border-bottom-color: transparent;
  }
 
  .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;
  }
 
  .nav > .disabled > a {
  color: #999999;
  }
 
  .nav > .disabled > a:hover {
  text-decoration: none;
  cursor: default;
  background-color: transparent;
  }
 
  .navbar {
  *position: relative;
  *z-index: 2;
  margin-bottom: 20px;
  overflow: visible;
  color: #777777;
  }
 
  .navbar-inner {
  min-height: 40px;
  padding-right: 20px;
  padding-left: 20px;
  background-color: #fafafa;
  background-image: -moz-linear-gradient(top, #ffffff, #f2f2f2);
  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#f2f2f2));
  background-image: -webkit-linear-gradient(top, #ffffff, #f2f2f2);
  background-image: -o-linear-gradient(top, #ffffff, #f2f2f2);
  background-image: linear-gradient(to bottom, #ffffff, #f2f2f2);
  background-repeat: repeat-x;
  border: 1px solid #d4d4d4;
  -webkit-border-radius: 4px;
  -moz-border-radius: 4px;
  border-radius: 4px;
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#fff2f2f2', GradientType=0);
  *zoom: 1;
  -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.065);
  -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.065);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.065);
  }
 
  .navbar-inner:before,
  .navbar-inner:after {
  display: table;
  line-height: 0;
  content: "";
  }
 
  .navbar-inner:after {
  clear: both;
  }
 
  .navbar .container {
  width: auto;
  }
 
  .nav-collapse.collapse {
  height: auto;
  overflow: visible;
  }
 
  .navbar .brand {
  display: block;
  float: left;
  padding: 10px 20px 10px;
  margin-left: -20px;
  font-size: 20px;
  font-weight: 200;
  color: #777777;
  text-shadow: 0 1px 0 #ffffff;
  }
 
  .navbar .brand:hover {
  text-decoration: none;
  }
 
  .navbar-text {
  margin-bottom: 0;
  line-height: 40px;
  }
 
  .navbar-link {
  color: #777777;
  }
 
  .navbar-link:hover {
  color: #333333;
  }
 
  .navbar .divider-vertical {
  height: 40px;
  margin: 0 9px;
  border-right: 1px solid #ffffff;
  border-left: 1px solid #f2f2f2;
  }
 
  .navbar .btn,
  .navbar .btn-group {
  margin-top: 5px;
  }
 
  .navbar .btn-group .btn,
  .navbar .input-prepend .btn,
  .navbar .input-append .btn {
  margin-top: 0;
  }
 
  .navbar-form {
  margin-bottom: 0;
  *zoom: 1;
  }
 
  .navbar-form:before,
  .navbar-form:after {
  display: table;
  line-height: 0;
  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,
  .navbar-form .btn {
  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: 5px;
  margin-bottom: 0;
  }
 
  .navbar-search .search-query {
  padding: 4px 14px;
  margin-bottom: 0;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 13px;
  font-weight: normal;
  line-height: 1;
  -webkit-border-radius: 15px;
  -moz-border-radius: 15px;
  border-radius: 15px;
  }
 
  .navbar-static-top {
  position: static;
  margin-bottom: 0;
  }
 
  .navbar-static-top .navbar-inner {
  -webkit-border-radius: 0;
  -moz-border-radius: 0;
  border-radius: 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-static-top .navbar-inner {
  border-width: 0 0 1px;
  }
 
  .navbar-fixed-bottom .navbar-inner {
  border-width: 1px 0 0;
  }
 
  .navbar-fixed-top .navbar-inner,
  .navbar-fixed-bottom .navbar-inner {
  padding-right: 0;
  padding-left: 0;
  -webkit-border-radius: 0;
  -moz-border-radius: 0;
  border-radius: 0;
  }
 
  .navbar-static-top .container,
  .navbar-fixed-top .container,
  .navbar-fixed-bottom .container {
  width: 940px;
  }
 
  .navbar-fixed-top {
  top: 0;
  }
 
  .navbar-fixed-top .navbar-inner,
  .navbar-static-top .navbar-inner {
  -webkit-box-shadow: 0 1px 10px rgba(0, 0, 0, 0.1);
  -moz-box-shadow: 0 1px 10px rgba(0, 0, 0, 0.1);
  box-shadow: 0 1px 10px rgba(0, 0, 0, 0.1);
  }
 
  .navbar-fixed-bottom {
  bottom: 0;
  }
 
  .navbar-fixed-bottom .navbar-inner {
  -webkit-box-shadow: 0 -1px 10px rgba(0, 0, 0, 0.1);
  -moz-box-shadow: 0 -1px 10px rgba(0, 0, 0, 0.1);
  box-shadow: 0 -1px 10px rgba(0, 0, 0, 0.1);
  }
 
  .navbar .nav {
  position: relative;
  left: 0;
  display: block;
  float: left;
  margin: 0 10px 0 0;
  }
 
  .navbar .nav.pull-right {
  float: right;
  margin-right: 0;
  }
 
  .navbar .nav > li {
  float: left;
  }
 
  .navbar .nav > li > a {
  float: none;
  padding: 10px 15px 10px;
  color: #777777;
  text-decoration: none;
  text-shadow: 0 1px 0 #ffffff;
  }
 
  .navbar .nav .dropdown-toggle .caret {
  margin-top: 8px;
  }
 
  .navbar .nav > li > a:focus,
  .navbar .nav > li > a:hover {
  color: #333333;
  text-decoration: none;
  background-color: transparent;
  }
 
  .navbar .nav > .active > a,
  .navbar .nav > .active > a:hover,
  .navbar .nav > .active > a:focus {
  color: #555555;
  text-decoration: none;
  background-color: #e5e5e5;
  -webkit-box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.125);
  -moz-box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.125);
  box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.125);
  }
 
  .navbar .btn-navbar {
  display: none;
  float: right;
  padding: 7px 10px;
  margin-right: 5px;
  margin-left: 5px;
  color: #ffffff;
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
  background-color: #ededed;
  *background-color: #e5e5e5;
  background-image: -moz-linear-gradient(top, #f2f2f2, #e5e5e5);
  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#f2f2f2), to(#e5e5e5));
  background-image: -webkit-linear-gradient(top, #f2f2f2, #e5e5e5);
  background-image: -o-linear-gradient(top, #f2f2f2, #e5e5e5);
  background-image: linear-gradient(to bottom, #f2f2f2, #e5e5e5);
  background-repeat: repeat-x;
  border-color: #e5e5e5 #e5e5e5 #bfbfbf;
  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2f2f2', endColorstr='#ffe5e5e5', GradientType=0);
  filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
  -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.075);
  -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.075);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.075);
  }
 
  .navbar .btn-navbar:hover,
  .navbar .btn-navbar:active,
  .navbar .btn-navbar.active,
  .navbar .btn-navbar.disabled,
  .navbar .btn-navbar[disabled] {
  color: #ffffff;
  background-color: #e5e5e5;
  *background-color: #d9d9d9;
  }
 
  .navbar .btn-navbar:active,
  .navbar .btn-navbar.active {
  background-color: #cccccc \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 .nav > li > .dropdown-menu:before {
  position: absolute;
  top: -7px;
  left: 9px;
  display: inline-block;
  border-right: 7px solid transparent;
  border-bottom: 7px solid #ccc;
  border-left: 7px solid transparent;
  border-bottom-color: rgba(0, 0, 0, 0.2);
  content: '';
  }
 
  .navbar .nav > li > .dropdown-menu:after {
  position: absolute;
  top: -6px;
  left: 10px;
  display: inline-block;
  border-right: 6px solid transparent;
  border-bottom: 6px solid #ffffff;
  border-left: 6px solid transparent;
  content: '';
  }
 
  .navbar-fixed-bottom .nav > li > .dropdown-menu:before {
  top: auto;
  bottom: -7px;
  border-top: 7px solid #ccc;
  border-bottom: 0;
  border-top-color: rgba(0, 0, 0, 0.2);
  }
 
  .navbar-fixed-bottom .nav > li > .dropdown-menu:after {
  top: auto;
  bottom: -6px;
  border-top: 6px solid #ffffff;
  border-bottom: 0;
  }
 
  .navbar .nav li.dropdown.open > .dropdown-toggle,
  .navbar .nav li.dropdown.active > .dropdown-toggle,
  .navbar .nav li.dropdown.open.active > .dropdown-toggle {
  color: #555555;
  background-color: #e5e5e5;
  }
 
  .navbar .nav li.dropdown > .dropdown-toggle .caret {
  border-top-color: #777777;
  border-bottom-color: #777777;
  }
 
  .navbar .nav li.dropdown.open > .dropdown-toggle .caret,
  .navbar .nav li.dropdown.active > .dropdown-toggle .caret,
  .navbar .nav li.dropdown.open.active > .dropdown-toggle .caret {
  border-top-color: #555555;
  border-bottom-color: #555555;
  }
 
  .navbar .pull-right > li > .dropdown-menu,
  .navbar .nav > li > .dropdown-menu.pull-right {
  right: 0;
  left: auto;
  }
 
  .navbar .pull-right > li > .dropdown-menu:before,
  .navbar .nav > li > .dropdown-menu.pull-right:before {
  right: 12px;
  left: auto;
  }
 
  .navbar .pull-right > li > .dropdown-menu:after,
  .navbar .nav > li > .dropdown-menu.pull-right:after {
  right: 13px;
  left: auto;
  }
 
  .navbar .pull-right > li > .dropdown-menu .dropdown-menu,
  .navbar .nav > li > .dropdown-menu.pull-right .dropdown-menu {
  right: 100%;
  left: auto;
  margin-right: -1px;
  margin-left: 0;
  -webkit-border-radius: 6px 0 6px 6px;
  -moz-border-radius: 6px 0 6px 6px;
  border-radius: 6px 0 6px 6px;
  }
 
  .navbar-inverse {
  color: #999999;
  }
 
  .navbar-inverse .navbar-inner {
  background-color: #1b1b1b;
  background-image: -moz-linear-gradient(top, #222222, #111111);
  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#222222), to(#111111));
  background-image: -webkit-linear-gradient(top, #222222, #111111);
  background-image: -o-linear-gradient(top, #222222, #111111);
  background-image: linear-gradient(to bottom, #222222, #111111);
  background-repeat: repeat-x;
  border-color: #252525;
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff222222', endColorstr='#ff111111', GradientType=0);
  }
 
  .navbar-inverse .brand,
  .navbar-inverse .nav > li > a {
  color: #999999;
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
  }
 
  .navbar-inverse .brand:hover,
  .navbar-inverse .nav > li > a:hover {
  color: #ffffff;
  }
 
  .navbar-inverse .nav > li > a:focus,
  .navbar-inverse .nav > li > a:hover {
  color: #ffffff;
  background-color: transparent;
  }
 
  .navbar-inverse .nav .active > a,
  .navbar-inverse .nav .active > a:hover,
  .navbar-inverse .nav .active > a:focus {
  color: #ffffff;
  background-color: #111111;
  }
 
  .navbar-inverse .navbar-link {
  color: #999999;
  }
 
  .navbar-inverse .navbar-link:hover {
  color: #ffffff;
  }
 
  .navbar-inverse .divider-vertical {
  border-right-color: #222222;
  border-left-color: #111111;
  }
 
  .navbar-inverse .nav li.dropdown.open > .dropdown-toggle,
  .navbar-inverse .nav li.dropdown.active > .dropdown-toggle,
  .navbar-inverse .nav li.dropdown.open.active > .dropdown-toggle {
  color: #ffffff;
  background-color: #111111;
  }
 
  .navbar-inverse .nav li.dropdown > .dropdown-toggle .caret {
  border-top-color: #999999;
  border-bottom-color: #999999;
  }
 
  .navbar-inverse .nav li.dropdown.open > .dropdown-toggle .caret,
  .navbar-inverse .nav li.dropdown.active > .dropdown-toggle .caret,
  .navbar-inverse .nav li.dropdown.open.active > .dropdown-toggle .caret {
  border-top-color: #ffffff;
  border-bottom-color: #ffffff;
  }
 
  .navbar-inverse .navbar-search .search-query {
  color: #ffffff;
  background-color: #515151;
  border-color: #111111;
  -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 0 rgba(255, 255, 255, 0.15);
  -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 0 rgba(255, 255, 255, 0.15);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 0 rgba(255, 255, 255, 0.15);
  -webkit-transition: none;
  -moz-transition: none;
  -o-transition: none;
  transition: none;
  }
 
  .navbar-inverse .navbar-search .search-query:-moz-placeholder {
  color: #cccccc;
  }
 
  .navbar-inverse .navbar-search .search-query:-ms-input-placeholder {
  color: #cccccc;
  }
 
  .navbar-inverse .navbar-search .search-query::-webkit-input-placeholder {
  color: #cccccc;
  }
 
  .navbar-inverse .navbar-search .search-query:focus,
  .navbar-inverse .navbar-search .search-query.focused {
  padding: 5px 15px;
  color: #333333;
  text-shadow: 0 1px 0 #ffffff;
  background-color: #ffffff;
  border: 0;
  outline: 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);
  }
 
  .navbar-inverse .btn-navbar {
  color: #ffffff;
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
  background-color: #0e0e0e;
  *background-color: #040404;
  background-image: -moz-linear-gradient(top, #151515, #040404);
  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#151515), to(#040404));
  background-image: -webkit-linear-gradient(top, #151515, #040404);
  background-image: -o-linear-gradient(top, #151515, #040404);
  background-image: linear-gradient(to bottom, #151515, #040404);
  background-repeat: repeat-x;
  border-color: #040404 #040404 #000000;
  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff151515', endColorstr='#ff040404', GradientType=0);
  filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
  }
 
  .navbar-inverse .btn-navbar:hover,
  .navbar-inverse .btn-navbar:active,
  .navbar-inverse .btn-navbar.active,
  .navbar-inverse .btn-navbar.disabled,
  .navbar-inverse .btn-navbar[disabled] {
  color: #ffffff;
  background-color: #040404;
  *background-color: #000000;
  }
 
  .navbar-inverse .btn-navbar:active,
  .navbar-inverse .btn-navbar.active {
  background-color: #000000 \9;
  }
 
  .breadcrumb {
  padding: 8px 15px;
  margin: 0 0 20px;
  list-style: none;
  background-color: #f5f5f5;
  -webkit-border-radius: 4px;
  -moz-border-radius: 4px;
  border-radius: 4px;
  }
 
  .breadcrumb li {
  display: inline-block;
  *display: inline;
  text-shadow: 0 1px 0 #ffffff;
  *zoom: 1;
  }
 
  .breadcrumb .divider {
  padding: 0 5px;
  color: #ccc;
  }
 
  .breadcrumb .active {
  color: #999999;
  }
 
  .pagination {
  margin: 20px 0;
  }
 
  .pagination ul {
  display: inline-block;
  *display: inline;
  margin-bottom: 0;
  margin-left: 0;
  -webkit-border-radius: 4px;
  -moz-border-radius: 4px;
  border-radius: 4px;
  *zoom: 1;
  -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 ul > li {
  display: inline;
  }
 
  .pagination ul > li > a,
  .pagination ul > li > span {
  float: left;
  padding: 4px 12px;
  line-height: 20px;
  text-decoration: none;
  background-color: #ffffff;
  border: 1px solid #dddddd;
  border-left-width: 0;
  }
 
  .pagination ul > li > a:hover,
  .pagination ul > .active > a,
  .pagination ul > .active > span {
  background-color: #f5f5f5;
  }
 
  .pagination ul > .active > a,
  .pagination ul > .active > span {
  color: #999999;
  cursor: default;
  }
 
  .pagination ul > .disabled > span,
  .pagination ul > .disabled > a,
  .pagination ul > .disabled > a:hover {
  color: #999999;
  cursor: default;
  background-color: transparent;
  }
 
  .pagination ul > li:first-child > a,
  .pagination ul > li:first-child > span {
  border-left-width: 1px;
  -webkit-border-bottom-left-radius: 4px;
  border-bottom-left-radius: 4px;
  -webkit-border-top-left-radius: 4px;
  border-top-left-radius: 4px;
  -moz-border-radius-bottomleft: 4px;
  -moz-border-radius-topleft: 4px;
  }
 
  .pagination ul > li:last-child > a,
  .pagination ul > li:last-child > span {
  -webkit-border-top-right-radius: 4px;
  border-top-right-radius: 4px;
  -webkit-border-bottom-right-radius: 4px;
  border-bottom-right-radius: 4px;
  -moz-border-radius-topright: 4px;
  -moz-border-radius-bottomright: 4px;
  }
 
  .pagination-centered {
  text-align: center;
  }
 
  .pagination-right {
  text-align: right;
  }
 
  .pagination-large ul > li > a,
  .pagination-large ul > li > span {
  padding: 11px 19px;
  font-size: 17.5px;
  }
 
  .pagination-large ul > li:first-child > a,
  .pagination-large ul > li:first-child > span {
  -webkit-border-bottom-left-radius: 6px;
  border-bottom-left-radius: 6px;
  -webkit-border-top-left-radius: 6px;
  border-top-left-radius: 6px;
  -moz-border-radius-bottomleft: 6px;
  -moz-border-radius-topleft: 6px;
  }
 
  .pagination-large ul > li:last-child > a,
  .pagination-large ul > li:last-child > span {
  -webkit-border-top-right-radius: 6px;
  border-top-right-radius: 6px;
  -webkit-border-bottom-right-radius: 6px;
  border-bottom-right-radius: 6px;
  -moz-border-radius-topright: 6px;
  -moz-border-radius-bottomright: 6px;
  }
 
  .pagination-mini ul > li:first-child > a,
  .pagination-small ul > li:first-child > a,
  .pagination-mini ul > li:first-child > span,
  .pagination-small ul > li:first-child > span {
  -webkit-border-bottom-left-radius: 3px;
  border-bottom-left-radius: 3px;
  -webkit-border-top-left-radius: 3px;
  border-top-left-radius: 3px;
  -moz-border-radius-bottomleft: 3px;
  -moz-border-radius-topleft: 3px;
  }
 
  .pagination-mini ul > li:last-child > a,
  .pagination-small ul > li:last-child > a,
  .pagination-mini ul > li:last-child > span,
  .pagination-small ul > li:last-child > span {
  -webkit-border-top-right-radius: 3px;
  border-top-right-radius: 3px;
  -webkit-border-bottom-right-radius: 3px;
  border-bottom-right-radius: 3px;
  -moz-border-radius-topright: 3px;
  -moz-border-radius-bottomright: 3px;
  }
 
  .pagination-small ul > li > a,
  .pagination-small ul > li > span {
  padding: 2px 10px;
  font-size: 11.9px;
  }
 
  .pagination-mini ul > li > a,
  .pagination-mini ul > li > span {
  padding: 1px 6px;
  font-size: 10.5px;
  }
 
  .pager {
  margin: 20px 0;
  text-align: center;
  list-style: none;
  *zoom: 1;
  }
 
  .pager:before,
  .pager:after {
  display: table;
  line-height: 0;
  content: "";
  }
 
  .pager:after {
  clear: both;
  }
 
  .pager li {
  display: inline;
  }
 
  .pager li > a,
  .pager li > span {
  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 li > a:hover {
  text-decoration: none;
  background-color: #f5f5f5;
  }
 
  .pager .next > a,
  .pager .next > span {
  float: right;
  }
 
  .pager .previous > a,
  .pager .previous > span {
  float: left;
  }
 
  .pager .disabled > a,
  .pager .disabled > a:hover,
  .pager .disabled > span {
  color: #999999;
  cursor: default;
  background-color: #fff;
  }
 
  .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;
  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;
  -webkit-border-radius: 6px;
  -moz-border-radius: 6px;
  border-radius: 6px;
  outline: none;
  -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 {
  top: -25%;
  -webkit-transition: opacity 0.3s linear, top 0.3s ease-out;
  -moz-transition: opacity 0.3s linear, top 0.3s ease-out;
  -o-transition: opacity 0.3s linear, top 0.3s ease-out;
  transition: opacity 0.3s linear, top 0.3s ease-out;
  }
 
  .modal.fade.in {
  top: 50%;
  }
 
  .modal-header {
  padding: 9px 15px;
  border-bottom: 1px solid #eee;
  }
 
  .modal-header .close {
  margin-top: 2px;
  }
 
  .modal-header h3 {
  margin: 0;
  line-height: 30px;
  }
 
  .modal-body {
  max-height: 400px;
  padding: 15px;
  overflow-y: auto;
  }
 
  .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;
  *zoom: 1;
  -webkit-box-shadow: inset 0 1px 0 #ffffff;
  -moz-box-shadow: inset 0 1px 0 #ffffff;
  box-shadow: inset 0 1px 0 #ffffff;
  }
 
  .modal-footer:before,
  .modal-footer:after {
  display: table;
  line-height: 0;
  content: "";
  }
 
  .modal-footer:after {
  clear: both;
  }
 
  .modal-footer .btn + .btn {
  margin-bottom: 0;
  margin-left: 5px;
  }
 
  .modal-footer .btn-group .btn + .btn {
  margin-left: -1px;
  }
 
  .modal-footer .btn-block + .btn-block {
  margin-left: 0;
  }
 
  .tooltip {
  position: absolute;
  z-index: 1030;
  display: block;
  padding: 5px;
  font-size: 11px;
  opacity: 0;
  filter: alpha(opacity=0);
  visibility: visible;
  }
 
  .tooltip.in {
  opacity: 0.8;
  filter: alpha(opacity=80);
  }
 
  .tooltip.top {
  margin-top: -3px;
  }
 
  .tooltip.right {
  margin-left: 3px;
  }
 
  .tooltip.bottom {
  margin-top: 3px;
  }
 
  .tooltip.left {
  margin-left: -3px;
  }
 
  .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;
  border-color: transparent;
  border-style: solid;
  }
 
  .tooltip.top .tooltip-arrow {
  bottom: 0;
  left: 50%;
  margin-left: -5px;
  border-top-color: #000000;
  border-width: 5px 5px 0;
  }
 
  .tooltip.right .tooltip-arrow {
  top: 50%;
  left: 0;
  margin-top: -5px;
  border-right-color: #000000;
  border-width: 5px 5px 5px 0;
  }
 
  .tooltip.left .tooltip-arrow {
  top: 50%;
  right: 0;
  margin-top: -5px;
  border-left-color: #000000;
  border-width: 5px 0 5px 5px;
  }
 
  .tooltip.bottom .tooltip-arrow {
  top: 0;
  left: 50%;
  margin-left: -5px;
  border-bottom-color: #000000;
  border-width: 0 5px 5px;
  }
 
  .popover {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1010;
  display: none;
  width: 236px;
  padding: 1px;
  background-color: #ffffff;
  border: 1px solid #ccc;
  border: 1px solid rgba(0, 0, 0, 0.2);
  -webkit-border-radius: 6px;
  -moz-border-radius: 6px;
  border-radius: 6px;
  -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;
  }
 
  .popover.top {
  margin-top: -10px;
  }
 
  .popover.right {
  margin-left: 10px;
  }
 
  .popover.bottom {
  margin-top: 10px;
  }
 
  .popover.left {
  margin-left: -10px;
  }
 
  .popover-title {
  padding: 8px 14px;
  margin: 0;
  font-size: 14px;
  font-weight: normal;
  line-height: 18px;
  background-color: #f7f7f7;
  border-bottom: 1px solid #ebebeb;
  -webkit-border-radius: 5px 5px 0 0;
  -moz-border-radius: 5px 5px 0 0;
  border-radius: 5px 5px 0 0;
  }
 
  .popover-content {
  padding: 9px 14px;
  }
 
  .popover-content p,
  .popover-content ul,
  .popover-content ol {
  margin-bottom: 0;
  }
 
  .popover .arrow,
  .popover .arrow:after {
  position: absolute;
  display: inline-block;
  width: 0;
  height: 0;
  border-color: transparent;
  border-style: solid;
  }
 
  .popover .arrow:after {
  z-index: -1;
  content: "";
  }
 
  .popover.top .arrow {
  bottom: -10px;
  left: 50%;
  margin-left: -10px;
  border-top-color: #ffffff;
  border-width: 10px 10px 0;
  }
 
  .popover.top .arrow:after {
  bottom: -1px;
  left: -11px;
  border-top-color: rgba(0, 0, 0, 0.25);
  border-width: 11px 11px 0;
  }
 
  .popover.right .arrow {
  top: 50%;
  left: -10px;
  margin-top: -10px;
  border-right-color: #ffffff;
  border-width: 10px 10px 10px 0;
  }
 
  .popover.right .arrow:after {
  bottom: -11px;
  left: -1px;
  border-right-color: rgba(0, 0, 0, 0.25);
  border-width: 11px 11px 11px 0;
  }
 
  .popover.bottom .arrow {
  top: -10px;
  left: 50%;
  margin-left: -10px;
  border-bottom-color: #ffffff;
  border-width: 0 10px 10px;
  }
 
  .popover.bottom .arrow:after {
  top: -1px;
  left: -11px;
  border-bottom-color: rgba(0, 0, 0, 0.25);
  border-width: 0 11px 11px;
  }
 
  .popover.left .arrow {
  top: 50%;
  right: -10px;
  margin-top: -10px;
  border-left-color: #ffffff;
  border-width: 10px 0 10px 10px;
  }
 
  .popover.left .arrow:after {
  right: -1px;
  bottom: -11px;
  border-left-color: rgba(0, 0, 0, 0.25);
  border-width: 11px 0 11px 11px;
  }
 
  .thumbnails {
  margin-left: -20px;
  list-style: none;
  *zoom: 1;
  }
 
  .thumbnails:before,
  .thumbnails:after {
  display: table;
  line-height: 0;
  content: "";
  }
 
  .thumbnails:after {
  clear: both;
  }
 
  .row-fluid .thumbnails {
  margin-left: 0;
  }
 
  .thumbnails > li {
  float: left;
  margin-bottom: 20px;
  margin-left: 20px;
  }
 
  .thumbnail {
  display: block;
  padding: 4px;
  line-height: 20px;
  border: 1px solid #ddd;
  -webkit-border-radius: 4px;
  -moz-border-radius: 4px;
  border-radius: 4px;
  -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.055);
  -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.055);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.055);
  -webkit-transition: all 0.2s ease-in-out;
  -moz-transition: all 0.2s ease-in-out;
  -o-transition: all 0.2s ease-in-out;
  transition: all 0.2s ease-in-out;
  }
 
  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-right: auto;
  margin-left: auto;
  }
 
  .thumbnail .caption {
  padding: 9px;
  color: #555555;
  }
 
  .media,
  .media-body {
  overflow: hidden;
  *overflow: visible;
  zoom: 1;
  }
 
  .media,
  .media .media {
  margin-top: 15px;
  }
 
  .media:first-child {
  margin-top: 0;
  }
 
  .media-object {
  display: block;
  }
 
  .media-heading {
  margin: 0 0 5px;
  }
 
  .media .pull-left {
  margin-right: 10px;
  }
 
  .media .pull-right {
  margin-left: 10px;
  }
 
  .media-list {
  margin-left: 0;
  list-style: none;
  }
 
  .label,
  .badge {
  display: inline-block;
  padding: 2px 4px;
  font-size: 11.844px;
  font-weight: bold;
  line-height: 14px;
  color: #ffffff;
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
  white-space: nowrap;
  vertical-align: baseline;
  background-color: #999999;
  }
 
  .label {
  -webkit-border-radius: 3px;
  -moz-border-radius: 3px;
  border-radius: 3px;
  }
 
  .badge {
  padding-right: 9px;
  padding-left: 9px;
  -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;
  }
 
  .btn .label,
  .btn .badge {
  position: relative;
  top: -1px;
  }
 
  .btn-mini .label,
  .btn-mini .badge {
  top: 0;
  }
 
  @-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 {
  height: 20px;
  margin-bottom: 20px;
  overflow: hidden;
  background-color: #f7f7f7;
  background-image: -moz-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(to bottom, #f5f5f5, #f9f9f9);
  background-repeat: repeat-x;
  -webkit-border-radius: 4px;
  -moz-border-radius: 4px;
  border-radius: 4px;
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#fff9f9f9', 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);
  }
 
  .progress .bar {
  float: left;
  width: 0;
  height: 100%;
  font-size: 12px;
  color: #ffffff;
  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: -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(to bottom, #149bdf, #0480be);
  background-repeat: repeat-x;
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff149bdf', endColorstr='#ff0480be', 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;
  box-sizing: border-box;
  -webkit-transition: width 0.6s ease;
  -moz-transition: width 0.6s ease;
  -o-transition: width 0.6s ease;
  transition: width 0.6s ease;
  }
 
  .progress .bar + .bar {
  -webkit-box-shadow: inset 1px 0 0 rgba(0, 0, 0, 0.15), inset 0 -1px 0 rgba(0, 0, 0, 0.15);
  -moz-box-shadow: inset 1px 0 0 rgba(0, 0, 0, 0.15), inset 0 -1px 0 rgba(0, 0, 0, 0.15);
  box-shadow: inset 1px 0 0 rgba(0, 0, 0, 0.15), inset 0 -1px 0 rgba(0, 0, 0, 0.15);
  }
 
  .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: -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,
  .progress .bar-danger {
  background-color: #dd514c;
  background-image: -moz-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(to bottom, #ee5f5b, #c43c35);
  background-repeat: repeat-x;
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffee5f5b', endColorstr='#ffc43c35', GradientType=0);
  }
 
  .progress-danger.progress-striped .bar,
  .progress-striped .bar-danger {
  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: -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,
  .progress .bar-success {
  background-color: #5eb95e;
  background-image: -moz-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(to bottom, #62c462, #57a957);
  background-repeat: repeat-x;
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff62c462', endColorstr='#ff57a957', GradientType=0);
  }
 
  .progress-success.progress-striped .bar,
  .progress-striped .bar-success {
  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: -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,
  .progress .bar-info {
  background-color: #4bb1cf;
  background-image: -moz-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(to bottom, #5bc0de, #339bb9);
  background-repeat: repeat-x;
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff339bb9', GradientType=0);
  }
 
  .progress-info.progress-striped .bar,
  .progress-striped .bar-info {
  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: -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,
  .progress .bar-warning {
  background-color: #faa732;
  background-image: -moz-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(to bottom, #fbb450, #f89406);
  background-repeat: repeat-x;
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffbb450', endColorstr='#fff89406', GradientType=0);
  }
 
  .progress-warning.progress-striped .bar,
  .progress-striped .bar-warning {
  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: -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);
  }
 
  .accordion {
  margin-bottom: 20px;
  }
 
  .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: 20px;
  line-height: 1;
  }
 
  .carousel-inner {
  position: relative;
  width: 100%;
  overflow: hidden;
  }
 
  .carousel .item {
  position: relative;
  display: none;
  -webkit-transition: 0.6s ease-in-out left;
  -moz-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 {
  right: 15px;
  left: auto;
  }
 
  .carousel-control:hover {
  color: #ffffff;
  text-decoration: none;
  opacity: 0.9;
  filter: alpha(opacity=90);
  }
 
  .carousel-caption {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 15px;
  background: #333333;
  background: rgba(0, 0, 0, 0.75);
  }
 
  .carousel-caption h4,
  .carousel-caption p {
  line-height: 20px;
  color: #ffffff;
  }
 
  .carousel-caption h4 {
  margin: 0 0 5px;
  }
 
  .carousel-caption p {
  margin-bottom: 0;
  }
 
  .hero-unit {
  padding: 60px;
  margin-bottom: 30px;
  font-size: 18px;
  font-weight: 200;
  line-height: 30px;
  color: inherit;
  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;
  letter-spacing: -1px;
  color: inherit;
  }
 
  .hero-unit li {
  line-height: 30px;
  }
 
  .pull-right {
  float: right;
  }
 
  .pull-left {
  float: left;
  }
 
  .hide {
  display: none;
  }
 
  .show {
  display: block;
  }
 
  .invisible {
  visibility: hidden;
  }
 
  .affix {
  position: fixed;
  }
 
  /*!
  * Bootstrap v2.2.1
  *
  * 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.
  */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{width:auto\9;height:auto;max-width:100%;vertical-align:middle;border:0;-ms-interpolation-mode:bicubic}#map_canvas img,.google-maps 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,html 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}.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;line-height:0;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:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}body{margin:0;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:20px;color:#333;background-color:#fff}a{color:#08c;text-decoration:none}a:hover{color:#005580;text-decoration:underline}.img-rounded{-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.img-polaroid{padding:4px;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);-webkit-box-shadow:0 1px 3px rgba(0,0,0,0.1);-moz-box-shadow:0 1px 3px rgba(0,0,0,0.1);box-shadow:0 1px 3px rgba(0,0,0,0.1)}.img-circle{-webkit-border-radius:500px;-moz-border-radius:500px;border-radius:500px}.row{margin-left:-20px;*zoom:1}.row:before,.row:after{display:table;line-height:0;content:""}.row:after{clear:both}[class*="span"]{float:left;min-height:1px;margin-left:20px}.container,.navbar-static-top .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;line-height:0;content:""}.row-fluid:after{clear:both}.row-fluid [class*="span"]{display:block;float:left;width:100%;min-height:30px;margin-left:2.127659574468085%;*margin-left:2.074468085106383%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="span"]:first-child{margin-left:0}.row-fluid .controls-row [class*="span"]+[class*="span"]{margin-left:2.127659574468085%}.row-fluid .span12{width:100%;*width:99.94680851063829%}.row-fluid .span11{width:91.48936170212765%;*width:91.43617021276594%}.row-fluid .span10{width:82.97872340425532%;*width:82.92553191489361%}.row-fluid .span9{width:74.46808510638297%;*width:74.41489361702126%}.row-fluid .span8{width:65.95744680851064%;*width:65.90425531914893%}.row-fluid .span7{width:57.44680851063829%;*width:57.39361702127659%}.row-fluid .span6{width:48.93617021276595%;*width:48.88297872340425%}.row-fluid .span5{width:40.42553191489362%;*width:40.37234042553192%}.row-fluid .span4{width:31.914893617021278%;*width:31.861702127659576%}.row-fluid .span3{width:23.404255319148934%;*width:23.351063829787233%}.row-fluid .span2{width:14.893617021276595%;*width:14.840425531914894%}.row-fluid .span1{width:6.382978723404255%;*width:6.329787234042553%}.row-fluid .offset12{margin-left:104.25531914893617%;*margin-left:104.14893617021275%}.row-fluid .offset12:first-child{margin-left:102.12765957446808%;*margin-left:102.02127659574467%}.row-fluid .offset11{margin-left:95.74468085106382%;*margin-left:95.6382978723404%}.row-fluid .offset11:first-child{margin-left:93.61702127659574%;*margin-left:93.51063829787232%}.row-fluid .offset10{margin-left:87.23404255319149%;*margin-left:87.12765957446807%}.row-fluid .offset10:first-child{margin-left:85.1063829787234%;*margin-left:84.99999999999999%}.row-fluid .offset9{margin-left:78.72340425531914%;*margin-left:78.61702127659572%}.row-fluid .offset9:first-child{margin-left:76.59574468085106%;*margin-left:76.48936170212764%}.row-fluid .offset8{margin-left:70.2127659574468%;*margin-left:70.10638297872339%}.row-fluid .offset8:first-child{margin-left:68.08510638297872%;*margin-left:67.9787234042553%}.row-fluid .offset7{margin-left:61.70212765957446%;*margin-left:61.59574468085106%}.row-fluid .offset7:first-child{margin-left:59.574468085106375%;*margin-left:59.46808510638297%}.row-fluid .offset6{margin-left:53.191489361702125%;*margin-left:53.085106382978715%}.row-fluid .offset6:first-child{margin-left:51.063829787234035%;*margin-left:50.95744680851063%}.row-fluid .offset5{margin-left:44.68085106382979%;*margin-left:44.57446808510638%}.row-fluid .offset5:first-child{margin-left:42.5531914893617%;*margin-left:42.4468085106383%}.row-fluid .offset4{margin-left:36.170212765957444%;*margin-left:36.06382978723405%}.row-fluid .offset4:first-child{margin-left:34.04255319148936%;*margin-left:33.93617021276596%}.row-fluid .offset3{margin-left:27.659574468085104%;*margin-left:27.5531914893617%}.row-fluid .offset3:first-child{margin-left:25.53191489361702%;*margin-left:25.425531914893618%}.row-fluid .offset2{margin-left:19.148936170212764%;*margin-left:19.04255319148936%}.row-fluid .offset2:first-child{margin-left:17.02127659574468%;*margin-left:16.914893617021278%}.row-fluid .offset1{margin-left:10.638297872340425%;*margin-left:10.53191489361702%}.row-fluid .offset1:first-child{margin-left:8.51063829787234%;*margin-left:8.404255319148938%}[class*="span"].hide,.row-fluid [class*="span"].hide{display:none}[class*="span"].pull-right,.row-fluid [class*="span"].pull-right{float:right}.container{margin-right:auto;margin-left:auto;*zoom:1}.container:before,.container:after{display:table;line-height:0;content:""}.container:after{clear:both}.container-fluid{padding-right:20px;padding-left:20px;*zoom:1}.container-fluid:before,.container-fluid:after{display:table;line-height:0;content:""}.container-fluid:after{clear:both}p{margin:0 0 10px}.lead{margin-bottom:20px;font-size:21px;font-weight:200;line-height:30px}small{font-size:85%}strong{font-weight:bold}em{font-style:italic}cite{font-style:normal}.muted{color:#999}.text-warning{color:#c09853}a.text-warning:hover{color:#a47e3c}.text-error{color:#b94a48}a.text-error:hover{color:#953b39}.text-info{color:#3a87ad}a.text-info:hover{color:#2d6987}.text-success{color:#468847}a.text-success:hover{color:#356635}h1,h2,h3,h4,h5,h6{margin:10px 0;font-family:inherit;font-weight:bold;line-height:20px;color:inherit;text-rendering:optimizelegibility}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small{font-weight:normal;line-height:1;color:#999}h1,h2,h3{line-height:40px}h1{font-size:38.5px}h2{font-size:31.5px}h3{font-size:24.5px}h4{font-size:17.5px}h5{font-size:14px}h6{font-size:11.9px}h1 small{font-size:24.5px}h2 small{font-size:17.5px}h3 small{font-size:14px}h4 small{font-size:14px}.page-header{padding-bottom:9px;margin:20px 0 30px;border-bottom:1px solid #eee}ul,ol{padding:0;margin:0 0 10px 25px}ul ul,ul ol,ol ol,ol ul{margin-bottom:0}li{line-height:20px}ul.unstyled,ol.unstyled{margin-left:0;list-style:none}dl{margin-bottom:20px}dt,dd{line-height:20px}dt{font-weight:bold}dd{margin-left:10px}.dl-horizontal{*zoom:1}.dl-horizontal:before,.dl-horizontal:after{display:table;line-height:0;content:""}.dl-horizontal:after{clear:both}.dl-horizontal dt{float:left;width:160px;overflow:hidden;clear:left;text-align:right;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}hr{margin:20px 0;border:0;border-top:1px solid #eee;border-bottom:1px solid #fff}abbr[title],abbr[data-original-title]{cursor:help;border-bottom:1px dotted #999}abbr.initialism{font-size:90%;text-transform:uppercase}blockquote{padding:0 0 0 15px;margin:0 0 20px;border-left:5px solid #eee}blockquote p{margin-bottom:0;font-size:16px;font-weight:300;line-height:25px}blockquote small{display:block;line-height:20px;color:#999}blockquote small:before{content:'\2014 \00A0'}blockquote.pull-right{float:right;padding-right:15px;padding-left:0;border-right:5px solid #eee;border-left:0}blockquote.pull-right p,blockquote.pull-right small{text-align:right}blockquote.pull-right small:before{content:''}blockquote.pull-right small:after{content:'\00A0 \2014'}q:before,q:after,blockquote:before,blockquote:after{content:""}address{display:block;margin-bottom:20px;font-style:normal;line-height:20px}code,pre{padding:0 3px 2px;font-family:Monaco,Menlo,Consolas,"Courier New",monospace;font-size:12px;color:#333;-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:9.5px;margin:0 0 10px;font-size:13px;line-height:20px;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:20px}pre code{padding:0;color:inherit;background-color:transparent;border:0}.pre-scrollable{max-height:340px;overflow-y:scroll}form{margin:0 0 20px}fieldset{padding:0;margin:0;border:0}legend{display:block;width:100%;padding:0;margin-bottom:20px;font-size:21px;line-height:40px;color:#333;border:0;border-bottom:1px solid #e5e5e5}legend small{font-size:15px;color:#999}label,input,button,select,textarea{font-size:14px;font-weight:normal;line-height:20px}input,button,select,textarea{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif}label{display:block;margin-bottom:5px}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:20px;padding:4px 6px;margin-bottom:10px;font-size:14px;line-height:20px;color:#555;vertical-align:middle;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}input,textarea,.uneditable-input{width:206px}textarea{height:auto}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:#fff;border:1px solid #ccc;-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 .2s,box-shadow linear .2s;-moz-transition:border linear .2s,box-shadow linear .2s;-o-transition:border linear .2s,box-shadow linear .2s;transition:border linear .2s,box-shadow linear .2s}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;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6)}input[type="radio"],input[type="checkbox"]{margin:4px 0 0;margin-top:1px \9;*margin-top:0;line-height:normal;cursor:pointer}input[type="file"],input[type="image"],input[type="submit"],input[type="reset"],input[type="button"],input[type="radio"],input[type="checkbox"]{width:auto}select,input[type="file"]{height:30px;*margin-top:4px;line-height:30px}select{width:220px;background-color:#fff;border:1px solid #ccc}select[multiple],select[size]{height:auto}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}.uneditable-input,.uneditable-textarea{color:#999;cursor:not-allowed;background-color:#fcfcfc;border-color:#ccc;-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)}.uneditable-input{overflow:hidden;white-space:nowrap}.uneditable-textarea{width:auto;height:auto}input:-moz-placeholder,textarea:-moz-placeholder{color:#999}input:-ms-input-placeholder,textarea:-ms-input-placeholder{color:#999}input::-webkit-input-placeholder,textarea::-webkit-input-placeholder{color:#999}.radio,.checkbox{min-height:20px;padding-left:20px}.radio input[type="radio"],.checkbox input[type="checkbox"]{float:left;margin-left:-20px}.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}.input-mini{width:60px}.input-small{width:90px}.input-medium{width:150px}.input-large{width:210px}.input-xlarge{width:270px}.input-xxlarge{width:530px}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[class*="span"],.row-fluid select[class*="span"],.row-fluid textarea[class*="span"],.row-fluid .uneditable-input[class*="span"],.row-fluid .input-prepend [class*="span"],.row-fluid .input-append [class*="span"]{display:inline-block}input,textarea,.uneditable-input{margin-left:0}.controls-row [class*="span"]+[class*="span"]{margin-left:20px}input.span12,textarea.span12,.uneditable-input.span12{width:926px}input.span11,textarea.span11,.uneditable-input.span11{width:846px}input.span10,textarea.span10,.uneditable-input.span10{width:766px}input.span9,textarea.span9,.uneditable-input.span9{width:686px}input.span8,textarea.span8,.uneditable-input.span8{width:606px}input.span7,textarea.span7,.uneditable-input.span7{width:526px}input.span6,textarea.span6,.uneditable-input.span6{width:446px}input.span5,textarea.span5,.uneditable-input.span5{width:366px}input.span4,textarea.span4,.uneditable-input.span4{width:286px}input.span3,textarea.span3,.uneditable-input.span3{width:206px}input.span2,textarea.span2,.uneditable-input.span2{width:126px}input.span1,textarea.span1,.uneditable-input.span1{width:46px}.controls-row{*zoom:1}.controls-row:before,.controls-row:after{display:table;line-height:0;content:""}.controls-row:after{clear:both}.controls-row [class*="span"],.row-fluid .controls-row [class*="span"]{float:left}.controls-row .checkbox[class*="span"],.controls-row .radio[class*="span"]{padding-top:5px}input[disabled],select[disabled],textarea[disabled],input[readonly],select[readonly],textarea[readonly]{cursor:not-allowed;background-color:#eee}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}.control-group.warning input,.control-group.warning select,.control-group.warning textarea{border-color:#c09853;-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)}.control-group.warning input:focus,.control-group.warning select:focus,.control-group.warning textarea:focus{border-color:#a47e3c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #dbc59e;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #dbc59e;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),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}.control-group.error input,.control-group.error select,.control-group.error textarea{border-color:#b94a48;-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)}.control-group.error input:focus,.control-group.error select:focus,.control-group.error textarea:focus{border-color:#953b39;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #d59392;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #d59392;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),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}.control-group.success input,.control-group.success select,.control-group.success textarea{border-color:#468847;-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)}.control-group.success input:focus,.control-group.success select:focus,.control-group.success textarea:focus{border-color:#356635;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7aba7b;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7aba7b;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),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}.control-group.info>label,.control-group.info .help-block,.control-group.info .help-inline{color:#3a87ad}.control-group.info .checkbox,.control-group.info .radio,.control-group.info input,.control-group.info select,.control-group.info textarea{color:#3a87ad}.control-group.info input,.control-group.info select,.control-group.info textarea{border-color:#3a87ad;-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)}.control-group.info input:focus,.control-group.info select:focus,.control-group.info textarea:focus{border-color:#2d6987;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7ab5d3;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7ab5d3;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7ab5d3}.control-group.info .input-prepend .add-on,.control-group.info .input-append .add-on{color:#3a87ad;background-color:#d9edf7;border-color:#3a87ad}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:19px 20px 20px;margin-top:20px;margin-bottom:20px;background-color:#f5f5f5;border-top:1px solid #e5e5e5;*zoom:1}.form-actions:before,.form-actions:after{display:table;line-height:0;content:""}.form-actions:after{clear:both}.help-block,.help-inline{color:#595959}.help-block{display:block;margin-bottom:10px}.help-inline{display:inline-block;*display:inline;padding-left:5px;vertical-align:middle;*zoom:1}.input-append,.input-prepend{margin-bottom:5px;font-size:0;white-space:nowrap}.input-append input,.input-prepend input,.input-append select,.input-prepend select,.input-append .uneditable-input,.input-prepend .uneditable-input,.input-append .dropdown-menu,.input-prepend .dropdown-menu{font-size:14px}.input-append input,.input-prepend input,.input-append select,.input-prepend select,.input-append .uneditable-input,.input-prepend .uneditable-input{position:relative;margin-bottom:0;*margin-left:0;vertical-align:top;-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.input-append input:focus,.input-prepend input:focus,.input-append select:focus,.input-prepend select:focus,.input-append .uneditable-input:focus,.input-prepend .uneditable-input:focus{z-index:2}.input-append .add-on,.input-prepend .add-on{display:inline-block;width:auto;height:20px;min-width:16px;padding:4px 5px;font-size:14px;font-weight:normal;line-height:20px;text-align:center;text-shadow:0 1px 0 #fff;background-color:#eee;border:1px solid #ccc}.input-append .add-on,.input-prepend .add-on,.input-append .btn,.input-prepend .btn{vertical-align:top;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.input-append .active,.input-prepend .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:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.input-append input,.input-append select,.input-append .uneditable-input{-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.input-append input+.btn-group .btn,.input-append select+.btn-group .btn,.input-append .uneditable-input+.btn-group .btn{-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.input-append .add-on,.input-append .btn,.input-append .btn-group{margin-left:-1px}.input-append .add-on:last-child,.input-append .btn:last-child{-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 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 input+.btn-group .btn,.input-prepend.input-append select+.btn-group .btn,.input-prepend.input-append .uneditable-input+.btn-group .btn{-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.input-prepend.input-append .add-on:first-child,.input-prepend.input-append .btn:first-child{margin-right:-1px;-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.input-prepend.input-append .add-on:last-child,.input-prepend.input-append .btn:last-child{margin-left:-1px;-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.input-prepend.input-append .btn-group:first-child{margin-left:0}input.search-query{padding-right:14px;padding-right:4px \9;padding-left:14px;padding-left:4px \9;margin-bottom:0;-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px}.form-search .input-append .search-query,.form-search .input-prepend .search-query{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.form-search .input-append .search-query{-webkit-border-radius:14px 0 0 14px;-moz-border-radius:14px 0 0 14px;border-radius:14px 0 0 14px}.form-search .input-append .btn{-webkit-border-radius:0 14px 14px 0;-moz-border-radius:0 14px 14px 0;border-radius:0 14px 14px 0}.form-search .input-prepend .search-query{-webkit-border-radius:0 14px 14px 0;-moz-border-radius:0 14px 14px 0;border-radius:0 14px 14px 0}.form-search .input-prepend .btn{-webkit-border-radius:14px 0 0 14px;-moz-border-radius:14px 0 0 14px;border-radius:14px 0 0 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;margin-bottom:0;vertical-align:middle;*zoom:1}.form-search .hide,.form-inline .hide,.form-horizontal .hide{display:none}.form-search label,.form-inline label,.form-search .btn-group,.form-inline .btn-group{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:10px}legend+.control-group{margin-top:20px;-webkit-margin-top-collapse:separate}.form-horizontal .control-group{margin-bottom:20px;*zoom:1}.form-horizontal .control-group:before,.form-horizontal .control-group:after{display:table;line-height:0;content:""}.form-horizontal .control-group:after{clear:both}.form-horizontal .control-label{float:left;width:160px;padding-top:5px;text-align:right}.form-horizontal .controls{*display:inline-block;*padding-left:20px;margin-left:180px;*margin-left:0}.form-horizontal .controls:first-child{*padding-left:180px}.form-horizontal .help-block{margin-bottom:0}.form-horizontal input+.help-block,.form-horizontal select+.help-block,.form-horizontal textarea+.help-block{margin-top:10px}.form-horizontal .form-actions{padding-left:180px}table{max-width:100%;background-color:transparent;border-collapse:collapse;border-spacing:0}.table{width:100%;margin-bottom:20px}.table th,.table td{padding:8px;line-height:20px;text-align:left;vertical-align:top;border-top:1px solid #ddd}.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 #ddd}.table-condensed th,.table-condensed td{padding:4px 5px}.table-bordered{border:1px solid #ddd;border-collapse:separate;*border-collapse:collapse;border-left:0;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.table-bordered th,.table-bordered td{border-left:1px solid #ddd}.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,.table-bordered tfoot: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,.table-bordered tfoot: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-bordered caption+thead tr:first-child th:first-child,.table-bordered caption+tbody tr:first-child td:first-child,.table-bordered colgroup+thead tr:first-child th:first-child,.table-bordered colgroup+tbody tr:first-child td:first-child{-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-topleft:4px}.table-bordered caption+thead tr:first-child th:last-child,.table-bordered caption+tbody tr:first-child td:last-child,.table-bordered colgroup+thead tr:first-child th:last-child,.table-bordered colgroup+tbody tr:first-child td:last-child{-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-moz-border-radius-topright:4px}.table-striped tbody tr:nth-child(odd) td,.table-striped tbody tr:nth-child(odd) th{background-color:#f9f9f9}.table-hover tbody tr:hover td,.table-hover tbody tr:hover th{background-color:#f5f5f5}table td[class*="span"],table th[class*="span"],.row-fluid table td[class*="span"],.row-fluid table th[class*="span"]{display:table-cell;float:none;margin-left:0}.table td.span1,.table th.span1{float:none;width:44px;margin-left:0}.table td.span2,.table th.span2{float:none;width:124px;margin-left:0}.table td.span3,.table th.span3{float:none;width:204px;margin-left:0}.table td.span4,.table th.span4{float:none;width:284px;margin-left:0}.table td.span5,.table th.span5{float:none;width:364px;margin-left:0}.table td.span6,.table th.span6{float:none;width:444px;margin-left:0}.table td.span7,.table th.span7{float:none;width:524px;margin-left:0}.table td.span8,.table th.span8{float:none;width:604px;margin-left:0}.table td.span9,.table th.span9{float:none;width:684px;margin-left:0}.table td.span10,.table th.span10{float:none;width:764px;margin-left:0}.table td.span11,.table th.span11{float:none;width:844px;margin-left:0}.table td.span12,.table th.span12{float:none;width:924px;margin-left:0}.table tbody tr.success td{background-color:#dff0d8}.table tbody tr.error td{background-color:#f2dede}.table tbody tr.warning td{background-color:#fcf8e3}.table tbody tr.info td{background-color:#d9edf7}.table-hover tbody tr.success:hover td{background-color:#d0e9c6}.table-hover tbody tr.error:hover td{background-color:#ebcccc}.table-hover tbody tr.warning:hover td{background-color:#faf2cc}.table-hover tbody tr.info:hover td{background-color:#c4e3f3}[class^="icon-"],[class*=" icon-"]{display:inline-block;width:14px;height:14px;margin-top:1px;*margin-right:.3em;line-height:14px;vertical-align:text-top;background-image:url("../img/glyphicons-halflings.png");background-position:14px 14px;background-repeat:no-repeat}.icon-white,.nav-pills>.active>a>[class^="icon-"],.nav-pills>.active>a>[class*=" icon-"],.nav-list>.active>a>[class^="icon-"],.nav-list>.active>a>[class*=" icon-"],.navbar-inverse .nav>.active>a>[class^="icon-"],.navbar-inverse .nav>.active>a>[class*=" icon-"],.dropdown-menu>li>a:hover>[class^="icon-"],.dropdown-menu>li>a:hover>[class*=" icon-"],.dropdown-menu>.active>a>[class^="icon-"],.dropdown-menu>.active>a>[class*=" icon-"],.dropdown-submenu:hover>a>[class^="icon-"],.dropdown-submenu:hover>a>[class*=" icon-"]{background-image:url("../img/glyphicons-halflings-white.png")}.icon-glass{background-position:0 0}.icon-music{background-position:-24px 0}.icon-search{background-position:-48px 0}.icon-envelope{background-position:-72px 0}.icon-heart{background-position:-96px 0}.icon-star{background-position:-120px 0}.icon-star-empty{background-position:-144px 0}.icon-user{background-position:-168px 0}.icon-film{background-position:-192px 0}.icon-th-large{background-position:-216px 0}.icon-th{background-position:-240px 0}.icon-th-list{background-position:-264px 0}.icon-ok{background-position:-288px 0}.icon-remove{background-position:-312px 0}.icon-zoom-in{background-position:-336px 0}.icon-zoom-out{background-position:-360px 0}.icon-off{background-position:-384px 0}.icon-signal{background-position:-408px 0}.icon-cog{background-position:-432px 0}.icon-trash{background-position:-456px 0}.icon-home{background-position:0 -24px}.icon-file{background-position:-24px -24px}.icon-time{background-position:-48px -24px}.icon-road{background-position:-72px -24px}.icon-download-alt{background-position:-96px -24px}.icon-download{background-position:-120px -24px}.icon-upload{background-position:-144px -24px}.icon-inbox{background-position:-168px -24px}.icon-play-circle{background-position:-192px -24px}.icon-repeat{background-position:-216px -24px}.icon-refresh{background-position:-240px -24px}.icon-list-alt{background-position:-264px -24px}.icon-lock{background-position:-287px -24px}.icon-flag{background-position:-312px -24px}.icon-headphones{background-position:-336px -24px}.icon-volume-off{background-position:-360px -24px}.icon-volume-down{background-position:-384px -24px}.icon-volume-up{background-position:-408px -24px}.icon-qrcode{background-position:-432px -24px}.icon-barcode{background-position:-456px -24px}.icon-tag{background-position:0 -48px}.icon-tags{background-position:-25px -48px}.icon-book{background-position:-48px -48px}.icon-bookmark{background-position:-72px -48px}.icon-print{background-position:-96px -48px}.icon-camera{background-position:-120px -48px}.icon-font{background-position:-144px -48px}.icon-bold{background-position:-167px -48px}.icon-italic{background-position:-192px -48px}.icon-text-height{background-position:-216px -48px}.icon-text-width{background-position:-240px -48px}.icon-align-left{background-position:-264px -48px}.icon-align-center{background-position:-288px -48px}.icon-align-right{background-position:-312px -48px}.icon-align-justify{background-position:-336px -48px}.icon-list{background-position:-360px -48px}.icon-indent-left{background-position:-384px -48px}.icon-indent-right{background-position:-408px -48px}.icon-facetime-video{background-position:-432px -48px}.icon-picture{background-position:-456px -48px}.icon-pencil{background-position:0 -72px}.icon-map-marker{background-position:-24px -72px}.icon-adjust{background-position:-48px -72px}.icon-tint{background-position:-72px -72px}.icon-edit{background-position:-96px -72px}.icon-share{background-position:-120px -72px}.icon-check{background-position:-144px -72px}.icon-move{background-position:-168px -72px}.icon-step-backward{background-position:-192px -72px}.icon-fast-backward{background-position:-216px -72px}.icon-backward{background-position:-240px -72px}.icon-play{background-position:-264px -72px}.icon-pause{background-position:-288px -72px}.icon-stop{background-position:-312px -72px}.icon-forward{background-position:-336px -72px}.icon-fast-forward{background-position:-360px -72px}.icon-step-forward{background-position:-384px -72px}.icon-eject{background-position:-408px -72px}.icon-chevron-left{background-position:-432px -72px}.icon-chevron-right{background-position:-456px -72px}.icon-plus-sign{background-position:0 -96px}.icon-minus-sign{background-position:-24px -96px}.icon-remove-sign{background-position:-48px -96px}.icon-ok-sign{background-position:-72px -96px}.icon-question-sign{background-position:-96px -96px}.icon-info-sign{background-position:-120px -96px}.icon-screenshot{background-position:-144px -96px}.icon-remove-circle{background-position:-168px -96px}.icon-ok-circle{background-position:-192px -96px}.icon-ban-circle{background-position:-216px -96px}.icon-arrow-left{background-position:-240px -96px}.icon-arrow-right{background-position:-264px -96px}.icon-arrow-up{background-position:-289px -96px}.icon-arrow-down{background-position:-312px -96px}.icon-share-alt{background-position:-336px -96px}.icon-resize-full{background-position:-360px -96px}.icon-resize-small{background-position:-384px -96px}.icon-plus{background-position:-408px -96px}.icon-minus{background-position:-433px -96px}.icon-asterisk{background-position:-456px -96px}.icon-exclamation-sign{background-position:0 -120px}.icon-gift{background-position:-24px -120px}.icon-leaf{background-position:-48px -120px}.icon-fire{background-position:-72px -120px}.icon-eye-open{background-position:-96px -120px}.icon-eye-close{background-position:-120px -120px}.icon-warning-sign{background-position:-144px -120px}.icon-plane{background-position:-168px -120px}.icon-calendar{background-position:-192px -120px}.icon-random{width:16px;background-position:-216px -120px}.icon-comment{background-position:-240px -120px}.icon-magnet{background-position:-264px -120px}.icon-chevron-up{background-position:-288px -120px}.icon-chevron-down{background-position:-313px -119px}.icon-retweet{background-position:-336px -120px}.icon-shopping-cart{background-position:-360px -120px}.icon-folder-close{background-position:-384px -120px}.icon-folder-open{width:16px;background-position:-408px -120px}.icon-resize-vertical{background-position:-432px -119px}.icon-resize-horizontal{background-position:-456px -118px}.icon-hdd{background-position:0 -144px}.icon-bullhorn{background-position:-24px -144px}.icon-bell{background-position:-48px -144px}.icon-certificate{background-position:-72px -144px}.icon-thumbs-up{background-position:-96px -144px}.icon-thumbs-down{background-position:-120px -144px}.icon-hand-right{background-position:-144px -144px}.icon-hand-left{background-position:-168px -144px}.icon-hand-up{background-position:-192px -144px}.icon-hand-down{background-position:-216px -144px}.icon-circle-arrow-right{background-position:-240px -144px}.icon-circle-arrow-left{background-position:-264px -144px}.icon-circle-arrow-up{background-position:-288px -144px}.icon-circle-arrow-down{background-position:-312px -144px}.icon-globe{background-position:-336px -144px}.icon-wrench{background-position:-360px -144px}.icon-tasks{background-position:-384px -144px}.icon-filter{background-position:-408px -144px}.icon-briefcase{background-position:-432px -144px}.icon-fullscreen{background-position:-456px -144px}.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 #000;border-right:4px solid transparent;border-left:4px solid transparent;content:""}.dropdown .caret{margin-top:8px;margin-left:2px}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;list-style:none;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);*border-right-width:2px;*border-bottom-width:2px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-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:9px 1px;*margin:-5px 0 5px;overflow:hidden;background-color:#e5e5e5;border-bottom:1px solid #fff}.dropdown-menu li>a{display:block;padding:3px 20px;clear:both;font-weight:normal;line-height:20px;color:#333;white-space:nowrap}.dropdown-menu li>a:hover,.dropdown-menu li>a:focus,.dropdown-submenu:hover>a{color:#fff;text-decoration:none;background-color:#0081c2;background-image:-moz-linear-gradient(top,#08c,#0077b3);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#0077b3));background-image:-webkit-linear-gradient(top,#08c,#0077b3);background-image:-o-linear-gradient(top,#08c,#0077b3);background-image:linear-gradient(to bottom,#08c,#0077b3);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc',endColorstr='#ff0077b3',GradientType=0)}.dropdown-menu .active>a,.dropdown-menu .active>a:hover{color:#333;text-decoration:none;background-color:#0081c2;background-image:-moz-linear-gradient(top,#08c,#0077b3);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#0077b3));background-image:-webkit-linear-gradient(top,#08c,#0077b3);background-image:-o-linear-gradient(top,#08c,#0077b3);background-image:linear-gradient(to bottom,#08c,#0077b3);background-repeat:repeat-x;outline:0;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc',endColorstr='#ff0077b3',GradientType=0)}.dropdown-menu .disabled>a,.dropdown-menu .disabled>a:hover{color:#999}.dropdown-menu .disabled>a:hover{text-decoration:none;cursor:default;background-color:transparent;background-image:none}.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 #000;content:""}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:1px}.dropdown-submenu{position:relative}.dropdown-submenu>.dropdown-menu{top:0;left:100%;margin-top:-6px;margin-left:-1px;-webkit-border-radius:0 6px 6px 6px;-moz-border-radius:0 6px 6px 6px;border-radius:0 6px 6px 6px}.dropdown-submenu:hover>.dropdown-menu{display:block}.dropup .dropdown-submenu>.dropdown-menu{top:auto;bottom:0;margin-top:0;margin-bottom:-2px;-webkit-border-radius:5px 5px 5px 0;-moz-border-radius:5px 5px 5px 0;border-radius:5px 5px 5px 0}.dropdown-submenu>a:after{display:block;float:right;width:0;height:0;margin-top:5px;margin-right:-10px;border-color:transparent;border-left-color:#ccc;border-style:solid;border-width:5px 0 5px 5px;content:" "}.dropdown-submenu:hover>a:after{border-left-color:#fff}.dropdown-submenu.pull-left{float:none}.dropdown-submenu.pull-left>.dropdown-menu{left:-100%;margin-left:10px;-webkit-border-radius:6px 0 6px 6px;-moz-border-radius:6px 0 6px 6px;border-radius:6px 0 6px 6px}.dropdown .dropdown-menu .nav-header{padding-right:20px;padding-left:20px}.typeahead{margin-top:2px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #e3e3e3;-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}.fade{opacity:0;-webkit-transition:opacity .15s linear;-moz-transition:opacity .15s linear;-o-transition:opacity .15s linear;transition:opacity .15s linear}.fade.in{opacity:1}.collapse{position:relative;height:0;overflow:hidden;-webkit-transition:height .35s ease;-moz-transition:height .35s ease;-o-transition:height .35s ease;transition:height .35s ease}.collapse.in{height:auto}.close{float:right;font-size:20px;font-weight:bold;line-height:20px;color:#000;text-shadow:0 1px 0 #fff;opacity:.2;filter:alpha(opacity=20)}.close:hover{color:#000;text-decoration:none;cursor:pointer;opacity:.4;filter:alpha(opacity=40)}button.close{padding:0;cursor:pointer;background:transparent;border:0;-webkit-appearance:none}.btn{display:inline-block;*display:inline;padding:4px 12px;margin-bottom:0;*margin-left:.3em;font-size:14px;line-height:20px;*line-height:20px;color:#333;text-align:center;text-shadow:0 1px 1px rgba(255,255,255,0.75);vertical-align:middle;cursor:pointer;background-color:#f5f5f5;*background-color:#e6e6e6;background-image:-moz-linear-gradient(top,#fff,#e6e6e6);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fff),to(#e6e6e6));background-image:-webkit-linear-gradient(top,#fff,#e6e6e6);background-image:-o-linear-gradient(top,#fff,#e6e6e6);background-image:linear-gradient(to bottom,#fff,#e6e6e6);background-repeat:repeat-x;border:1px solid #bbb;*border: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);border-bottom-color:#a2a2a2;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#ffe6e6e6',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);*zoom:1;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05)}.btn:hover,.btn:active,.btn.active,.btn.disabled,.btn[disabled]{color:#333;background-color:#e6e6e6;*background-color:#d9d9d9}.btn:active,.btn.active{background-color:#ccc \9}.btn:first-child{*margin-left:0}.btn:hover{color:#333;text-decoration:none;background-color:#e6e6e6;*background-color:#d9d9d9;background-position:0 -15px;-webkit-transition:background-position .1s linear;-moz-transition:background-position .1s linear;-o-transition:background-position .1s linear;transition:background-position .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,0.15),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05)}.btn.disabled,.btn[disabled]{cursor:default;background-color:#e6e6e6;background-image:none;opacity:.65;filter:alpha(opacity=65);-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.btn-large{padding:11px 19px;font-size:17.5px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.btn-large [class^="icon-"],.btn-large [class*=" icon-"]{margin-top:2px}.btn-small{padding:2px 10px;font-size:11.9px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.btn-small [class^="icon-"],.btn-small [class*=" icon-"]{margin-top:0}.btn-mini{padding:1px 6px;font-size:10.5px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.btn-block{display:block;width:100%;padding-right:0;padding-left:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.btn-block+.btn-block{margin-top:5px}input[type="submit"].btn-block,input[type="reset"].btn-block,input[type="button"].btn-block{width:100%}.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:#c5c5c5;border-color:rgba(0,0,0,0.15) rgba(0,0,0,0.15) rgba(0,0,0,0.25)}.btn-primary{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#006dcc;*background-color:#04c;background-image:-moz-linear-gradient(top,#08c,#04c);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#04c));background-image:-webkit-linear-gradient(top,#08c,#04c);background-image:-o-linear-gradient(top,#08c,#04c);background-image:linear-gradient(to bottom,#08c,#04c);background-repeat:repeat-x;border-color:#04c #04c #002a80;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc',endColorstr='#ff0044cc',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-primary:hover,.btn-primary:active,.btn-primary.active,.btn-primary.disabled,.btn-primary[disabled]{color:#fff;background-color:#04c;*background-color:#003bb3}.btn-primary:active,.btn-primary.active{background-color:#039 \9}.btn-warning{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#faa732;*background-color:#f89406;background-image:-moz-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(to bottom,#fbb450,#f89406);background-repeat:repeat-x;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);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffbb450',endColorstr='#fff89406',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-warning:hover,.btn-warning:active,.btn-warning.active,.btn-warning.disabled,.btn-warning[disabled]{color:#fff;background-color:#f89406;*background-color:#df8505}.btn-warning:active,.btn-warning.active{background-color:#c67605 \9}.btn-danger{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#da4f49;*background-color:#bd362f;background-image:-moz-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(to bottom,#ee5f5b,#bd362f);background-repeat:repeat-x;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);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffee5f5b',endColorstr='#ffbd362f',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-danger:hover,.btn-danger:active,.btn-danger.active,.btn-danger.disabled,.btn-danger[disabled]{color:#fff;background-color:#bd362f;*background-color:#a9302a}.btn-danger:active,.btn-danger.active{background-color:#942a25 \9}.btn-success{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#5bb75b;*background-color:#51a351;background-image:-moz-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(to bottom,#62c462,#51a351);background-repeat:repeat-x;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);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff62c462',endColorstr='#ff51a351',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-success:hover,.btn-success:active,.btn-success.active,.btn-success.disabled,.btn-success[disabled]{color:#fff;background-color:#51a351;*background-color:#499249}.btn-success:active,.btn-success.active{background-color:#408140 \9}.btn-info{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#49afcd;*background-color:#2f96b4;background-image:-moz-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(to bottom,#5bc0de,#2f96b4);background-repeat:repeat-x;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);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de',endColorstr='#ff2f96b4',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-info:hover,.btn-info:active,.btn-info.active,.btn-info.disabled,.btn-info[disabled]{color:#fff;background-color:#2f96b4;*background-color:#2a85a0}.btn-info:active,.btn-info.active{background-color:#24748c \9}.btn-inverse{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#363636;*background-color:#222;background-image:-moz-linear-gradient(top,#444,#222);background-image:-webkit-gradient(linear,0 0,0 100%,from(#444),to(#222));background-image:-webkit-linear-gradient(top,#444,#222);background-image:-o-linear-gradient(top,#444,#222);background-image:linear-gradient(to bottom,#444,#222);background-repeat:repeat-x;border-color:#222 #222 #000;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff444444',endColorstr='#ff222222',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-inverse:hover,.btn-inverse:active,.btn-inverse.active,.btn-inverse.disabled,.btn-inverse[disabled]{color:#fff;background-color:#222;*background-color:#151515}.btn-inverse:active,.btn-inverse.active{background-color:#080808 \9}button.btn,input[type="submit"].btn{*padding-top:3px;*padding-bottom:3px}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-link,.btn-link:active,.btn-link[disabled]{background-color:transparent;background-image:none;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.btn-link{color:#08c;cursor:pointer;border-color:transparent;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.btn-link:hover{color:#005580;text-decoration:underline;background-color:transparent}.btn-link[disabled]:hover{color:#333;text-decoration:none}.btn-group{position:relative;display:inline-block;*display:inline;*margin-left:.3em;font-size:0;white-space:nowrap;vertical-align:middle;*zoom:1}.btn-group:first-child{*margin-left:0}.btn-group+.btn-group{margin-left:5px}.btn-toolbar{margin-top:10px;margin-bottom:10px;font-size:0}.btn-toolbar .btn+.btn,.btn-toolbar .btn-group+.btn,.btn-toolbar .btn+.btn-group{margin-left:5px}.btn-group>.btn{position:relative;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.btn-group>.btn+.btn{margin-left:-1px}.btn-group>.btn,.btn-group>.dropdown-menu{font-size:14px}.btn-group>.btn-mini{font-size:11px}.btn-group>.btn-small{font-size:12px}.btn-group>.btn-large{font-size:16px}.btn-group>.btn:first-child{margin-left:0;-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-bottomleft:4px;-moz-border-radius-topleft:4px}.btn-group>.btn:last-child,.btn-group>.dropdown-toggle{-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px;-moz-border-radius-topright:4px;-moz-border-radius-bottomright:4px}.btn-group>.btn.large:first-child{margin-left:0;-webkit-border-bottom-left-radius:6px;border-bottom-left-radius:6px;-webkit-border-top-left-radius:6px;border-top-left-radius:6px;-moz-border-radius-bottomleft:6px;-moz-border-radius-topleft:6px}.btn-group>.btn.large:last-child,.btn-group>.large.dropdown-toggle{-webkit-border-top-right-radius:6px;border-top-right-radius:6px;-webkit-border-bottom-right-radius:6px;border-bottom-right-radius:6px;-moz-border-radius-topright:6px;-moz-border-radius-bottomright: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>.btn+.dropdown-toggle{*padding-top:5px;padding-right:8px;*padding-bottom:5px;padding-left:8px;-webkit-box-shadow:inset 1px 0 0 rgba(255,255,255,0.125),inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 1px 0 0 rgba(255,255,255,0.125),inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 1px 0 0 rgba(255,255,255,0.125),inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05)}.btn-group>.btn-mini+.dropdown-toggle{*padding-top:2px;padding-right:5px;*padding-bottom:2px;padding-left:5px}.btn-group>.btn-small+.dropdown-toggle{*padding-top:5px;*padding-bottom:4px}.btn-group>.btn-large+.dropdown-toggle{*padding-top:7px;padding-right:12px;*padding-bottom:7px;padding-left:12px}.btn-group.open .dropdown-toggle{background-image:none;-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05)}.btn-group.open .btn.dropdown-toggle{background-color:#e6e6e6}.btn-group.open .btn-primary.dropdown-toggle{background-color:#04c}.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:#222}.btn .caret{margin-top:8px;margin-left:0}.btn-mini .caret,.btn-small .caret,.btn-large .caret{margin-top:6px}.btn-large .caret{border-top-width:5px;border-right-width:5px;border-left-width:5px}.dropup .btn-large .caret{border-bottom-width:5px}.btn-primary .caret,.btn-warning .caret,.btn-danger .caret,.btn-info .caret,.btn-success .caret,.btn-inverse .caret{border-top-color:#fff;border-bottom-color:#fff}.btn-group-vertical{display:inline-block;*display:inline;*zoom:1}.btn-group-vertical .btn{display:block;float:none;width:100%;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.btn-group-vertical .btn+.btn{margin-top:-1px;margin-left:0}.btn-group-vertical .btn:first-child{-webkit-border-radius:4px 4px 0 0;-moz-border-radius:4px 4px 0 0;border-radius:4px 4px 0 0}.btn-group-vertical .btn:last-child{-webkit-border-radius:0 0 4px 4px;-moz-border-radius:0 0 4px 4px;border-radius:0 0 4px 4px}.btn-group-vertical .btn-large:first-child{-webkit-border-radius:6px 6px 0 0;-moz-border-radius:6px 6px 0 0;border-radius:6px 6px 0 0}.btn-group-vertical .btn-large:last-child{-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px}.alert{padding:8px 35px 8px 14px;margin-bottom:20px;color:#c09853;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}.alert h4{margin:0}.alert .close{position:relative;top:-2px;right:-21px;line-height:20px}.alert-success{color:#468847;background-color:#dff0d8;border-color:#d6e9c6}.alert-danger,.alert-error{color:#b94a48;background-color:#f2dede;border-color:#eed3d7}.alert-info{color:#3a87ad;background-color:#d9edf7;border-color:#bce8f1}.alert-block{padding-top:14px;padding-bottom:14px}.alert-block>p,.alert-block>ul{margin-bottom:0}.alert-block p+p{margin-top:5px}.nav{margin-bottom:20px;margin-left:0;list-style:none}.nav>li>a{display:block}.nav>li>a:hover{text-decoration:none;background-color:#eee}.nav>.pull-right{float:right}.nav-header{display:block;padding:3px 15px;font-size:11px;font-weight:bold;line-height:20px;color:#999;text-shadow:0 1px 0 rgba(255,255,255,0.5);text-transform:uppercase}.nav li+.nav-header{margin-top:9px}.nav-list{padding-right:15px;padding-left:15px;margin-bottom:0}.nav-list>li>a,.nav-list .nav-header{margin-right:-15px;margin-left:-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:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.2);background-color:#08c}.nav-list [class^="icon-"],.nav-list [class*=" icon-"]{margin-right:2px}.nav-list .divider{*width:100%;height:1px;margin:9px 1px;*margin:-5px 0 5px;overflow:hidden;background-color:#e5e5e5;border-bottom:1px solid #fff}.nav-tabs,.nav-pills{*zoom:1}.nav-tabs:before,.nav-pills:before,.nav-tabs:after,.nav-pills:after{display:table;line-height:0;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:20px;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:#eee #eee #ddd}.nav-tabs>.active>a,.nav-tabs>.active>a:hover{color:#555;cursor:default;background-color:#fff;border:1px solid #ddd;border-bottom-color:transparent}.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:#fff;background-color:#08c}.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-top-right-radius:4px;border-top-right-radius:4px;-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-topright:4px;-moz-border-radius-topleft:4px}.nav-tabs.nav-stacked>li:last-child>a{-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px;-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-moz-border-radius-bottomright:4px;-moz-border-radius-bottomleft:4px}.nav-tabs.nav-stacked>li>a:hover{z-index:2;border-color:#ddd}.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 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px}.nav-pills .dropdown-menu{-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.nav .dropdown-toggle .caret{margin-top:6px;border-top-color:#08c;border-bottom-color:#08c}.nav .dropdown-toggle:hover .caret{border-top-color:#005580;border-bottom-color:#005580}.nav-tabs .dropdown-toggle .caret{margin-top:8px}.nav .active .dropdown-toggle .caret{border-top-color:#fff;border-bottom-color:#fff}.nav-tabs .active .dropdown-toggle .caret{border-top-color:#555;border-bottom-color:#555}.nav>.dropdown.active>a:hover{cursor:pointer}.nav-tabs .open .dropdown-toggle,.nav-pills .open .dropdown-toggle,.nav>li.dropdown.open.active>a:hover{color:#fff;background-color:#999;border-color:#999}.nav li.dropdown.open .caret,.nav li.dropdown.open.active .caret,.nav li.dropdown.open a:hover .caret{border-top-color:#fff;border-bottom-color:#fff;opacity:1;filter:alpha(opacity=100)}.tabs-stacked .open>a:hover{border-color:#999}.tabbable{*zoom:1}.tabbable:before,.tabbable:after{display:table;line-height:0;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-top-color:#ddd;border-bottom-color:transparent}.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:#eee #ddd #eee #eee}.tabs-left>.nav-tabs .active>a,.tabs-left>.nav-tabs .active>a:hover{border-color:#ddd transparent #ddd #ddd;*border-right-color:#fff}.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:#eee #eee #eee #ddd}.tabs-right>.nav-tabs .active>a,.tabs-right>.nav-tabs .active>a:hover{border-color:#ddd #ddd #ddd transparent;*border-left-color:#fff}.nav>.disabled>a{color:#999}.nav>.disabled>a:hover{text-decoration:none;cursor:default;background-color:transparent}.navbar{*position:relative;*z-index:2;margin-bottom:20px;overflow:visible;color:#777}.navbar-inner{min-height:40px;padding-right:20px;padding-left:20px;background-color:#fafafa;background-image:-moz-linear-gradient(top,#fff,#f2f2f2);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fff),to(#f2f2f2));background-image:-webkit-linear-gradient(top,#fff,#f2f2f2);background-image:-o-linear-gradient(top,#fff,#f2f2f2);background-image:linear-gradient(to bottom,#fff,#f2f2f2);background-repeat:repeat-x;border:1px solid #d4d4d4;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#fff2f2f2',GradientType=0);*zoom:1;-webkit-box-shadow:0 1px 4px rgba(0,0,0,0.065);-moz-box-shadow:0 1px 4px rgba(0,0,0,0.065);box-shadow:0 1px 4px rgba(0,0,0,0.065)}.navbar-inner:before,.navbar-inner:after{display:table;line-height:0;content:""}.navbar-inner:after{clear:both}.navbar .container{width:auto}.nav-collapse.collapse{height:auto;overflow:visible}.navbar .brand{display:block;float:left;padding:10px 20px 10px;margin-left:-20px;font-size:20px;font-weight:200;color:#777;text-shadow:0 1px 0 #fff}.navbar .brand:hover{text-decoration:none}.navbar-text{margin-bottom:0;line-height:40px}.navbar-link{color:#777}.navbar-link:hover{color:#333}.navbar .divider-vertical{height:40px;margin:0 9px;border-right:1px solid #fff;border-left:1px solid #f2f2f2}.navbar .btn,.navbar .btn-group{margin-top:5px}.navbar .btn-group .btn,.navbar .input-prepend .btn,.navbar .input-append .btn{margin-top:0}.navbar-form{margin-bottom:0;*zoom:1}.navbar-form:before,.navbar-form:after{display:table;line-height:0;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,.navbar-form .btn{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:5px;margin-bottom:0}.navbar-search .search-query{padding:4px 14px;margin-bottom:0;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px;font-weight:normal;line-height:1;-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px}.navbar-static-top{position:static;margin-bottom:0}.navbar-static-top .navbar-inner{-webkit-border-radius:0;-moz-border-radius:0;border-radius: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-static-top .navbar-inner{border-width:0 0 1px}.navbar-fixed-bottom .navbar-inner{border-width:1px 0 0}.navbar-fixed-top .navbar-inner,.navbar-fixed-bottom .navbar-inner{padding-right:0;padding-left:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:940px}.navbar-fixed-top{top:0}.navbar-fixed-top .navbar-inner,.navbar-static-top .navbar-inner{-webkit-box-shadow:0 1px 10px rgba(0,0,0,0.1);-moz-box-shadow:0 1px 10px rgba(0,0,0,0.1);box-shadow:0 1px 10px rgba(0,0,0,0.1)}.navbar-fixed-bottom{bottom:0}.navbar-fixed-bottom .navbar-inner{-webkit-box-shadow:0 -1px 10px rgba(0,0,0,0.1);-moz-box-shadow:0 -1px 10px rgba(0,0,0,0.1);box-shadow:0 -1px 10px rgba(0,0,0,0.1)}.navbar .nav{position:relative;left:0;display:block;float:left;margin:0 10px 0 0}.navbar .nav.pull-right{float:right;margin-right:0}.navbar .nav>li{float:left}.navbar .nav>li>a{float:none;padding:10px 15px 10px;color:#777;text-decoration:none;text-shadow:0 1px 0 #fff}.navbar .nav .dropdown-toggle .caret{margin-top:8px}.navbar .nav>li>a:focus,.navbar .nav>li>a:hover{color:#333;text-decoration:none;background-color:transparent}.navbar .nav>.active>a,.navbar .nav>.active>a:hover,.navbar .nav>.active>a:focus{color:#555;text-decoration:none;background-color:#e5e5e5;-webkit-box-shadow:inset 0 3px 8px rgba(0,0,0,0.125);-moz-box-shadow:inset 0 3px 8px rgba(0,0,0,0.125);box-shadow:inset 0 3px 8px rgba(0,0,0,0.125)}.navbar .btn-navbar{display:none;float:right;padding:7px 10px;margin-right:5px;margin-left:5px;color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#ededed;*background-color:#e5e5e5;background-image:-moz-linear-gradient(top,#f2f2f2,#e5e5e5);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f2f2f2),to(#e5e5e5));background-image:-webkit-linear-gradient(top,#f2f2f2,#e5e5e5);background-image:-o-linear-gradient(top,#f2f2f2,#e5e5e5);background-image:linear-gradient(to bottom,#f2f2f2,#e5e5e5);background-repeat:repeat-x;border-color:#e5e5e5 #e5e5e5 #bfbfbf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2f2f2',endColorstr='#ffe5e5e5',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.075);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.075);box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.075)}.navbar .btn-navbar:hover,.navbar .btn-navbar:active,.navbar .btn-navbar.active,.navbar .btn-navbar.disabled,.navbar .btn-navbar[disabled]{color:#fff;background-color:#e5e5e5;*background-color:#d9d9d9}.navbar .btn-navbar:active,.navbar .btn-navbar.active{background-color:#ccc \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 .nav>li>.dropdown-menu:before{position:absolute;top:-7px;left:9px;display:inline-block;border-right:7px solid transparent;border-bottom:7px solid #ccc;border-left:7px solid transparent;border-bottom-color:rgba(0,0,0,0.2);content:''}.navbar .nav>li>.dropdown-menu:after{position:absolute;top:-6px;left:10px;display:inline-block;border-right:6px solid transparent;border-bottom:6px solid #fff;border-left:6px solid transparent;content:''}.navbar-fixed-bottom .nav>li>.dropdown-menu:before{top:auto;bottom:-7px;border-top:7px solid #ccc;border-bottom:0;border-top-color:rgba(0,0,0,0.2)}.navbar-fixed-bottom .nav>li>.dropdown-menu:after{top:auto;bottom:-6px;border-top:6px solid #fff;border-bottom:0}.navbar .nav li.dropdown.open>.dropdown-toggle,.navbar .nav li.dropdown.active>.dropdown-toggle,.navbar .nav li.dropdown.open.active>.dropdown-toggle{color:#555;background-color:#e5e5e5}.navbar .nav li.dropdown>.dropdown-toggle .caret{border-top-color:#777;border-bottom-color:#777}.navbar .nav li.dropdown.open>.dropdown-toggle .caret,.navbar .nav li.dropdown.active>.dropdown-toggle .caret,.navbar .nav li.dropdown.open.active>.dropdown-toggle .caret{border-top-color:#555;border-bottom-color:#555}.navbar .pull-right>li>.dropdown-menu,.navbar .nav>li>.dropdown-menu.pull-right{right:0;left:auto}.navbar .pull-right>li>.dropdown-menu:before,.navbar .nav>li>.dropdown-menu.pull-right:before{right:12px;left:auto}.navbar .pull-right>li>.dropdown-menu:after,.navbar .nav>li>.dropdown-menu.pull-right:after{right:13px;left:auto}.navbar .pull-right>li>.dropdown-menu .dropdown-menu,.navbar .nav>li>.dropdown-menu.pull-right .dropdown-menu{right:100%;left:auto;margin-right:-1px;margin-left:0;-webkit-border-radius:6px 0 6px 6px;-moz-border-radius:6px 0 6px 6px;border-radius:6px 0 6px 6px}.navbar-inverse{color:#999}.navbar-inverse .navbar-inner{background-color:#1b1b1b;background-image:-moz-linear-gradient(top,#222,#111);background-image:-webkit-gradient(linear,0 0,0 100%,from(#222),to(#111));background-image:-webkit-linear-gradient(top,#222,#111);background-image:-o-linear-gradient(top,#222,#111);background-image:linear-gradient(to bottom,#222,#111);background-repeat:repeat-x;border-color:#252525;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff222222',endColorstr='#ff111111',GradientType=0)}.navbar-inverse .brand,.navbar-inverse .nav>li>a{color:#999;text-shadow:0 -1px 0 rgba(0,0,0,0.25)}.navbar-inverse .brand:hover,.navbar-inverse .nav>li>a:hover{color:#fff}.navbar-inverse .nav>li>a:focus,.navbar-inverse .nav>li>a:hover{color:#fff;background-color:transparent}.navbar-inverse .nav .active>a,.navbar-inverse .nav .active>a:hover,.navbar-inverse .nav .active>a:focus{color:#fff;background-color:#111}.navbar-inverse .navbar-link{color:#999}.navbar-inverse .navbar-link:hover{color:#fff}.navbar-inverse .divider-vertical{border-right-color:#222;border-left-color:#111}.navbar-inverse .nav li.dropdown.open>.dropdown-toggle,.navbar-inverse .nav li.dropdown.active>.dropdown-toggle,.navbar-inverse .nav li.dropdown.open.active>.dropdown-toggle{color:#fff;background-color:#111}.navbar-inverse .nav li.dropdown>.dropdown-toggle .caret{border-top-color:#999;border-bottom-color:#999}.navbar-inverse .nav li.dropdown.open>.dropdown-toggle .caret,.navbar-inverse .nav li.dropdown.active>.dropdown-toggle .caret,.navbar-inverse .nav li.dropdown.open.active>.dropdown-toggle .caret{border-top-color:#fff;border-bottom-color:#fff}.navbar-inverse .navbar-search .search-query{color:#fff;background-color:#515151;border-color:#111;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1),0 1px 0 rgba(255,255,255,0.15);-moz-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1),0 1px 0 rgba(255,255,255,0.15);box-shadow:inset 0 1px 2px rgba(0,0,0,0.1),0 1px 0 rgba(255,255,255,0.15);-webkit-transition:none;-moz-transition:none;-o-transition:none;transition:none}.navbar-inverse .navbar-search .search-query:-moz-placeholder{color:#ccc}.navbar-inverse .navbar-search .search-query:-ms-input-placeholder{color:#ccc}.navbar-inverse .navbar-search .search-query::-webkit-input-placeholder{color:#ccc}.navbar-inverse .navbar-search .search-query:focus,.navbar-inverse .navbar-search .search-query.focused{padding:5px 15px;color:#333;text-shadow:0 1px 0 #fff;background-color:#fff;border:0;outline: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)}.navbar-inverse .btn-navbar{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#0e0e0e;*background-color:#040404;background-image:-moz-linear-gradient(top,#151515,#040404);background-image:-webkit-gradient(linear,0 0,0 100%,from(#151515),to(#040404));background-image:-webkit-linear-gradient(top,#151515,#040404);background-image:-o-linear-gradient(top,#151515,#040404);background-image:linear-gradient(to bottom,#151515,#040404);background-repeat:repeat-x;border-color:#040404 #040404 #000;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff151515',endColorstr='#ff040404',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.navbar-inverse .btn-navbar:hover,.navbar-inverse .btn-navbar:active,.navbar-inverse .btn-navbar.active,.navbar-inverse .btn-navbar.disabled,.navbar-inverse .btn-navbar[disabled]{color:#fff;background-color:#040404;*background-color:#000}.navbar-inverse .btn-navbar:active,.navbar-inverse .btn-navbar.active{background-color:#000 \9}.breadcrumb{padding:8px 15px;margin:0 0 20px;list-style:none;background-color:#f5f5f5;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.breadcrumb li{display:inline-block;*display:inline;text-shadow:0 1px 0 #fff;*zoom:1}.breadcrumb .divider{padding:0 5px;color:#ccc}.breadcrumb .active{color:#999}.pagination{margin:20px 0}.pagination ul{display:inline-block;*display:inline;margin-bottom:0;margin-left:0;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;*zoom:1;-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 ul>li{display:inline}.pagination ul>li>a,.pagination ul>li>span{float:left;padding:4px 12px;line-height:20px;text-decoration:none;background-color:#fff;border:1px solid #ddd;border-left-width:0}.pagination ul>li>a:hover,.pagination ul>.active>a,.pagination ul>.active>span{background-color:#f5f5f5}.pagination ul>.active>a,.pagination ul>.active>span{color:#999;cursor:default}.pagination ul>.disabled>span,.pagination ul>.disabled>a,.pagination ul>.disabled>a:hover{color:#999;cursor:default;background-color:transparent}.pagination ul>li:first-child>a,.pagination ul>li:first-child>span{border-left-width:1px;-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-bottomleft:4px;-moz-border-radius-topleft:4px}.pagination ul>li:last-child>a,.pagination ul>li:last-child>span{-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px;-moz-border-radius-topright:4px;-moz-border-radius-bottomright:4px}.pagination-centered{text-align:center}.pagination-right{text-align:right}.pagination-large ul>li>a,.pagination-large ul>li>span{padding:11px 19px;font-size:17.5px}.pagination-large ul>li:first-child>a,.pagination-large ul>li:first-child>span{-webkit-border-bottom-left-radius:6px;border-bottom-left-radius:6px;-webkit-border-top-left-radius:6px;border-top-left-radius:6px;-moz-border-radius-bottomleft:6px;-moz-border-radius-topleft:6px}.pagination-large ul>li:last-child>a,.pagination-large ul>li:last-child>span{-webkit-border-top-right-radius:6px;border-top-right-radius:6px;-webkit-border-bottom-right-radius:6px;border-bottom-right-radius:6px;-moz-border-radius-topright:6px;-moz-border-radius-bottomright:6px}.pagination-mini ul>li:first-child>a,.pagination-small ul>li:first-child>a,.pagination-mini ul>li:first-child>span,.pagination-small ul>li:first-child>span{-webkit-border-bottom-left-radius:3px;border-bottom-left-radius:3px;-webkit-border-top-left-radius:3px;border-top-left-radius:3px;-moz-border-radius-bottomleft:3px;-moz-border-radius-topleft:3px}.pagination-mini ul>li:last-child>a,.pagination-small ul>li:last-child>a,.pagination-mini ul>li:last-child>span,.pagination-small ul>li:last-child>span{-webkit-border-top-right-radius:3px;border-top-right-radius:3px;-webkit-border-bottom-right-radius:3px;border-bottom-right-radius:3px;-moz-border-radius-topright:3px;-moz-border-radius-bottomright:3px}.pagination-small ul>li>a,.pagination-small ul>li>span{padding:2px 10px;font-size:11.9px}.pagination-mini ul>li>a,.pagination-mini ul>li>span{padding:1px 6px;font-size:10.5px}.pager{margin:20px 0;text-align:center;list-style:none;*zoom:1}.pager:before,.pager:after{display:table;line-height:0;content:""}.pager:after{clear:both}.pager li{display:inline}.pager li>a,.pager li>span{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 li>a:hover{text-decoration:none;background-color:#f5f5f5}.pager .next>a,.pager .next>span{float:right}.pager .previous>a,.pager .previous>span{float:left}.pager .disabled>a,.pager .disabled>a:hover,.pager .disabled>span{color:#999;cursor:default;background-color:#fff}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000}.modal-backdrop.fade{opacity:0}.modal-backdrop,.modal-backdrop.fade.in{opacity:.8;filter:alpha(opacity=80)}.modal{position:fixed;top:50%;left:50%;z-index:1050;width:560px;margin:-250px 0 0 -280px;background-color:#fff;border:1px solid #999;border:1px solid rgba(0,0,0,0.3);*border:1px solid #999;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;outline:0;-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{top:-25%;-webkit-transition:opacity .3s linear,top .3s ease-out;-moz-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}.modal.fade.in{top:50%}.modal-header{padding:9px 15px;border-bottom:1px solid #eee}.modal-header .close{margin-top:2px}.modal-header h3{margin:0;line-height:30px}.modal-body{max-height:400px;padding:15px;overflow-y:auto}.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;*zoom:1;-webkit-box-shadow:inset 0 1px 0 #fff;-moz-box-shadow:inset 0 1px 0 #fff;box-shadow:inset 0 1px 0 #fff}.modal-footer:before,.modal-footer:after{display:table;line-height:0;content:""}.modal-footer:after{clear:both}.modal-footer .btn+.btn{margin-bottom:0;margin-left:5px}.modal-footer .btn-group .btn+.btn{margin-left:-1px}.modal-footer .btn-block+.btn-block{margin-left:0}.tooltip{position:absolute;z-index:1030;display:block;padding:5px;font-size:11px;opacity:0;filter:alpha(opacity=0);visibility:visible}.tooltip.in{opacity:.8;filter:alpha(opacity=80)}.tooltip.top{margin-top:-3px}.tooltip.right{margin-left:3px}.tooltip.bottom{margin-top:3px}.tooltip.left{margin-left:-3px}.tooltip-inner{max-width:200px;padding:3px 8px;color:#fff;text-align:center;text-decoration:none;background-color:#000;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-top-color:#000;border-width:5px 5px 0}.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-right-color:#000;border-width:5px 5px 5px 0}.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-left-color:#000;border-width:5px 0 5px 5px}.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-bottom-color:#000;border-width:0 5px 5px}.popover{position:absolute;top:0;left:0;z-index:1010;display:none;width:236px;padding:1px;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-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}.popover.top{margin-top:-10px}.popover.right{margin-left:10px}.popover.bottom{margin-top:10px}.popover.left{margin-left:-10px}.popover-title{padding:8px 14px;margin:0;font-size:14px;font-weight:normal;line-height:18px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;-webkit-border-radius:5px 5px 0 0;-moz-border-radius:5px 5px 0 0;border-radius:5px 5px 0 0}.popover-content{padding:9px 14px}.popover-content p,.popover-content ul,.popover-content ol{margin-bottom:0}.popover .arrow,.popover .arrow:after{position:absolute;display:inline-block;width:0;height:0;border-color:transparent;border-style:solid}.popover .arrow:after{z-index:-1;content:""}.popover.top .arrow{bottom:-10px;left:50%;margin-left:-10px;border-top-color:#fff;border-width:10px 10px 0}.popover.top .arrow:after{bottom:-1px;left:-11px;border-top-color:rgba(0,0,0,0.25);border-width:11px 11px 0}.popover.right .arrow{top:50%;left:-10px;margin-top:-10px;border-right-color:#fff;border-width:10px 10px 10px 0}.popover.right .arrow:after{bottom:-11px;left:-1px;border-right-color:rgba(0,0,0,0.25);border-width:11px 11px 11px 0}.popover.bottom .arrow{top:-10px;left:50%;margin-left:-10px;border-bottom-color:#fff;border-width:0 10px 10px}.popover.bottom .arrow:after{top:-1px;left:-11px;border-bottom-color:rgba(0,0,0,0.25);border-width:0 11px 11px}.popover.left .arrow{top:50%;right:-10px;margin-top:-10px;border-left-color:#fff;border-width:10px 0 10px 10px}.popover.left .arrow:after{right:-1px;bottom:-11px;border-left-color:rgba(0,0,0,0.25);border-width:11px 0 11px 11px}.thumbnails{margin-left:-20px;list-style:none;*zoom:1}.thumbnails:before,.thumbnails:after{display:table;line-height:0;content:""}.thumbnails:after{clear:both}.row-fluid .thumbnails{margin-left:0}.thumbnails>li{float:left;margin-bottom:20px;margin-left:20px}.thumbnail{display:block;padding:4px;line-height:20px;border:1px solid #ddd;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:0 1px 3px rgba(0,0,0,0.055);-moz-box-shadow:0 1px 3px rgba(0,0,0,0.055);box-shadow:0 1px 3px rgba(0,0,0,0.055);-webkit-transition:all .2s ease-in-out;-moz-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out}a.thumbnail:hover{border-color:#08c;-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-right:auto;margin-left:auto}.thumbnail .caption{padding:9px;color:#555}.media,.media-body{overflow:hidden;*overflow:visible;zoom:1}.media,.media .media{margin-top:15px}.media:first-child{margin-top:0}.media-object{display:block}.media-heading{margin:0 0 5px}.media .pull-left{margin-right:10px}.media .pull-right{margin-left:10px}.media-list{margin-left:0;list-style:none}.label,.badge{display:inline-block;padding:2px 4px;font-size:11.844px;font-weight:bold;line-height:14px;color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);white-space:nowrap;vertical-align:baseline;background-color:#999}.label{-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.badge{padding-right:9px;padding-left:9px;-webkit-border-radius:9px;-moz-border-radius:9px;border-radius:9px}a.label:hover,a.badge:hover{color:#fff;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:#333}.label-inverse[href],.badge-inverse[href]{background-color:#1a1a1a}.btn .label,.btn .badge{position:relative;top:-1px}.btn-mini .label,.btn-mini .badge{top:0}@-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{height:20px;margin-bottom:20px;overflow:hidden;background-color:#f7f7f7;background-image:-moz-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(to bottom,#f5f5f5,#f9f9f9);background-repeat:repeat-x;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5',endColorstr='#fff9f9f9',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)}.progress .bar{float:left;width:0;height:100%;font-size:12px;color:#fff;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:-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(to bottom,#149bdf,#0480be);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff149bdf',endColorstr='#ff0480be',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;box-sizing:border-box;-webkit-transition:width .6s ease;-moz-transition:width .6s ease;-o-transition:width .6s ease;transition:width .6s ease}.progress .bar+.bar{-webkit-box-shadow:inset 1px 0 0 rgba(0,0,0,0.15),inset 0 -1px 0 rgba(0,0,0,0.15);-moz-box-shadow:inset 1px 0 0 rgba(0,0,0,0.15),inset 0 -1px 0 rgba(0,0,0,0.15);box-shadow:inset 1px 0 0 rgba(0,0,0,0.15),inset 0 -1px 0 rgba(0,0,0,0.15)}.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:-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,.progress .bar-danger{background-color:#dd514c;background-image:-moz-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(to bottom,#ee5f5b,#c43c35);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffee5f5b',endColorstr='#ffc43c35',GradientType=0)}.progress-danger.progress-striped .bar,.progress-striped .bar-danger{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:-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,.progress .bar-success{background-color:#5eb95e;background-image:-moz-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(to bottom,#62c462,#57a957);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff62c462',endColorstr='#ff57a957',GradientType=0)}.progress-success.progress-striped .bar,.progress-striped .bar-success{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:-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,.progress .bar-info{background-color:#4bb1cf;background-image:-moz-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(to bottom,#5bc0de,#339bb9);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de',endColorstr='#ff339bb9',GradientType=0)}.progress-info.progress-striped .bar,.progress-striped .bar-info{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:-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,.progress .bar-warning{background-color:#faa732;background-image:-moz-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(to bottom,#fbb450,#f89406);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffbb450',endColorstr='#fff89406',GradientType=0)}.progress-warning.progress-striped .bar,.progress-striped .bar-warning{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:-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)}.accordion{margin-bottom:20px}.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:20px;line-height:1}.carousel-inner{position:relative;width:100%;overflow:hidden}.carousel .item{position:relative;display:none;-webkit-transition:.6s ease-in-out left;-moz-transition:.6s ease-in-out left;-o-transition:.6s ease-in-out left;transition:.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:#fff;text-align:center;background:#222;border:3px solid #fff;-webkit-border-radius:23px;-moz-border-radius:23px;border-radius:23px;opacity:.5;filter:alpha(opacity=50)}.carousel-control.right{right:15px;left:auto}.carousel-control:hover{color:#fff;text-decoration:none;opacity:.9;filter:alpha(opacity=90)}.carousel-caption{position:absolute;right:0;bottom:0;left:0;padding:15px;background:#333;background:rgba(0,0,0,0.75)}.carousel-caption h4,.carousel-caption p{line-height:20px;color:#fff}.carousel-caption h4{margin:0 0 5px}.carousel-caption p{margin-bottom:0}.hero-unit{padding:60px;margin-bottom:30px;font-size:18px;font-weight:200;line-height:30px;color:inherit;background-color:#eee;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.hero-unit h1{margin-bottom:0;font-size:60px;line-height:1;letter-spacing:-1px;color:inherit}.hero-unit li{line-height:30px}.pull-right{float:right}.pull-left{float:left}.hide{display:none}.show{display:block}.invisible{visibility:hidden}.affix{position:fixed}
 
 
  *.pyc
  <?php
 
  include('template.inc.php');
  include_header_documents("About");
  include_once('../include/common.inc.php');
  ?>
  <h1>About</h1>
  <?php
  include_footer_documents();
  ?>
 
  <?php
  include('template.inc.php');
  include_once('../include/common.inc.php');
  $agenciesdb = $server->get_db('disclosr-agencies');
 
  $idtoname = Array();
  foreach ($agenciesdb->get_view("app", "byCanonicalName")->rows as $row) {
  $idtoname[$row->id] = trim($row->value->name);
  }
  $foidocsdb = $server->get_db('disclosr-foidocuments');
 
  include_header_documents((isset($_REQUEST['id']) ? $idtoname[$_REQUEST['id']] : 'Entries by Agency'));
  $endkey = (isset($_REQUEST['end_key']) ? $_REQUEST['end_key'] : '9999-99-99');
  ?>
  <div class="headline">Read all the information released by Australian Federal Government agencies under the FOI Act in one place!</div>
  <a style='float:right' href="rss.xml.php"><img src="img/feed-icon-14x14.png" alt="RSS Icon"/> All Agencies RSS Feed</a><br>
  <?php
  try {
  if ($_REQUEST['id']) {
  $rows = $foidocsdb->get_view("app", "byAgencyID", $_REQUEST['id'], false, false, false)->rows;
  foreach ($rows as $row) {
  //print_r($rows);
  echo displayLogEntry($row, $idtoname);
  if (!isset($startkey))
  $startkey = $row->key;
  $endkey = $row->key;
  }
  } else {
  $rows = $foidocsdb->get_view("app", "byAgencyID?group=true", null, false, false, true)->rows;
  if ($rows) {
  foreach ($rows as $row) {
  echo '<a href="agency.php?id=' . $row->key . '">' . $idtoname[$row->key] . " (" . $row->value . " records)</a> <br>\n";
  }
  }
  }
  } catch (SetteeRestClientException $e) {
  setteErrorHandler($e);
  }
  echo "<a class='btn btn-large btn-primary' href='?end_key=$endkey' style='float:right;'>next page <i class='icon-circle-arrow-right icon-white'></i></a>";
  include_footer_documents();
  ?>
<?php <?php
include('template.inc.php'); include('template.inc.php');
include_header_documents(""); include_header_documents("Charts");
include_once('../include/common.inc.php'); include_once('../include/common.inc.php');
$agenciesdb = $server->get_db('disclosr-agencies'); $agenciesdb = $server->get_db('disclosr-agencies');
   
$idtoname = Array(); $idtoname = Array();
foreach ($agenciesdb->get_view("app", "byCanonicalName")->rows as $row) { foreach ($agenciesdb->get_view("app", "byCanonicalName")->rows as $row) {
$idtoname[$row->id] = trim($row->value->name); $idtoname[$row->id] = trim($row->value->name);
} }
$foidocsdb = $server->get_db('disclosr-foidocuments'); $foidocsdb = $server->get_db('disclosr-foidocuments');
   
?> ?>
<div class="foundation-header"> <div class="foundation-header">
<h1><a href="about.php">Charts</a></h1> <h1><a href="about.php">Charts</a></h1>
<h4 class="subheader">Lorem ipsum.</h4> <h4 class="subheader">Lorem ipsum.</h4>
</div> </div>
<div id="employees" style="width:1000px;height:900px;"></div> <div id="bydate" style="width:1000px;height:300px;"></div>
  <div id="byagency" style="width:1200px;height:300px;"></div>
<script id="source"> <script id="source">
window.onload = function() { window.onload = function() {
$(document).ready(function() { $(document).ready(function() {
var var
d1 = [], d1 = [],
start = new Date("2009/01/01 01:00").getTime(), options1,
options, o1;
graph,  
i, x, o;  
   
<?php <?php
try { try {
$rows = $foidocsdb->get_view("app", "byDate?group=true", null, true)->rows; $rows = $foidocsdb->get_view("app", "byDateMonthYear?group=true",null, false,false,true)->rows;
   
   
$dataValues = Array(); $dataValues = Array();
foreach ($rows as $row) { foreach ($rows as $row) {
$dataValues[$row->value] = $row->key; $dataValues[$row->key] = $row->value;
} }
$i = 0; $i = 0;
ksort($dataValues); ksort($dataValues);
foreach ($dataValues as $value => $key) { foreach ($dataValues as $key => $value) {
$date = date_create_from_format('Y-m-d', $key); $date = date_create_from_format('Y-m-d', $key);
if (date_format($date, 'U') != "") { if (date_format($date, 'U') != "") {
echo " d1.push([".date_format($date, 'U')."000, $value]);" . PHP_EOL; echo " d1.push([".date_format($date, 'U')."000, $value]);" . PHP_EOL;
// echo " emplabels.push('$key');" . PHP_EOL; // echo " emplabels.push('$key');" . PHP_EOL;
$i++; $i++;
} }
} }
} catch (SetteeRestClientException $e) { } catch (SetteeRestClientException $e) {
setteErrorHandler($e); setteErrorHandler($e);
} }
?> ?>
   
   
options = { options1 = {
xaxis : { xaxis : {
mode : 'time', mode : 'time',
labelsAngle : 45 labelsAngle : 45
}, },
selection : { selection : {
mode : 'x' mode : 'x'
}, },
HtmlText : false, HtmlText : false,
title : 'Time' title : 'Time'
}; };
// Draw graph with default options, overwriting with passed options // Draw graph with default options, overwriting with passed options
function drawGraph (opts) { function drawGraph (opts) {
   
// Clone the options, so the 'options' variable always keeps intact. // Clone the options, so the 'options' variable always keeps intact.
o = Flotr._.extend(Flotr._.clone(options), opts || {}); o1 = Flotr._.extend(Flotr._.clone(options1), opts || {});
   
// Return a new graph. // Return a new graph.
return Flotr.draw( return Flotr.draw(
document.getElementById("employees"), document.getElementById("bydate"),
[ d1 ], [ d1 ],
o o1
); );
} }
   
graph = drawGraph(); graph = drawGraph();
Flotr.EventAdapter.observe(container, 'flotr:select', function(area){ Flotr.EventAdapter.observe(document.getElementById("bydate"), 'flotr:select', function(area){
// Draw selected area // Draw selected area
graph = drawGraph({ graph = drawGraph({
xaxis : { min : area.x1, max : area.x2, mode : 'time', labelsAngle : 45 }, xaxis : { min : area.x1, max : area.x2, mode : 'time', labelsAngle : 45 },
yaxis : { min : area.y1, max : area.y2 } yaxis : { min : area.y1, max : area.y2 }
}); });
}); });
// When graph is clicked, draw the graph with default area. // When graph is clicked, draw the graph with default area.
Flotr.EventAdapter.observe(container, 'flotr:click', function () { graph = drawGraph(); }); Flotr.EventAdapter.observe(document.getElementById("bydate"), 'flotr:click', function () { graph = drawGraph(); });
   
}); });
}; };
   
  var d2 = [];
  var agencylabels = [];
  function agencytrackformatter(obj) {
   
  return agencylabels[Math.floor(obj.x)] +" = "+obj.y;
   
  }
  function agencytickformatter(val, axis) {
  if (agencylabels[Math.floor(val)]) {
  return '<p style="margin-top:8em;-webkit-transform:rotate(-90deg);">'+(agencylabels[Math.floor(val)])+"</b>";
   
  } else {
  return "";
  }
  }
  <?php
  try {
  $rows = $foidocsdb->get_view("app", "byAgencyID?group=true",null, false,false,true)->rows;
   
   
  $dataValues = Array();
  $i = 0;
  foreach ($rows as $row) {
  echo " d2.push([".$i.", $row->value]);" . PHP_EOL;
  echo " agencylabels.push(['".str_replace("'","",$idtoname[$row->key])."']);" . PHP_EOL;
   
  $i++;
  }
  } catch (SetteeRestClientException $e) {
  setteErrorHandler($e);
  }
  ?>
  // Draw the graph
  Flotr.draw(
  document.getElementById("byagency"),
  [d2],
  {
  bars : {
  show : true,
  horizontal : false,
  shadowSize : 0,
  barWidth : 0.5
  },
  mouse : {
  track : true,
  relative : true,
  trackFormatter: agencytrackformatter
  },
  yaxis : {
  min : 0,
  autoscaleMargin : 1
  },
  xaxis: {
  minorTickFreq: 1,
  noTicks: agencylabels.length,
  showMinorLabels: true,
  tickFormatter: agencytickformatter
  },
  legend: {
  show: false
  }
  }
  );
</script> </script>
   
<?php <?php
include_footer_documents(); include_footer_documents();
?> ?>
   
   
  <?php
 
  include('template.inc.php');
  include_header_documents("Entries by Date");
  include_once('../include/common.inc.php');
  $endkey = (isset($_REQUEST['end_key']) ? $_REQUEST['end_key'] : '9999-99-99');
  ?>
  <div class="headline">Read all the information released by Australian Federal Government agencies under the FOI Act in one place!</div>
  <a style='float:right' href="rss.xml.php"><img src="img/feed-icon-14x14.png" alt="RSS Icon"/> All Agencies RSS Feed</a><br>
  <?php
  /*$agenciesdb = $server->get_db('disclosr-agencies');
 
  $idtoname = Array();
  foreach ($agenciesdb->get_view("app", "byCanonicalName")->rows as $row) {
  $idtoname[$row->id] = trim($row->value->name);
  }
  $foidocsdb = $server->get_db('disclosr-foidocuments');
  try {
  $rows = $foidocsdb->get_view("app", "byDate", Array($endkey, '0000-00-00'), true, 20)->rows;
  if ($rows) {
  foreach ($rows as $key => $row) {
  echo displayLogEntry($row, $idtoname);
  if (!isset($startkey)) $startkey = $row->key;
  $endkey = $row->key;
  }
  }
  } catch (SetteeRestClientException $e) {
  setteErrorHandler($e);
  }
  echo "<a class='btn btn-large btn-primary' href='?end_key=$endkey' style='float:right;'>next page <i class='icon-circle-arrow-right icon-white'></i></a>";
  */
  include_footer_documents();
  ?>
 
<?php <?php
   
include('template.inc.php'); include('template.inc.php');
include_header_documents(""); include_header_documents("List of Disclosure Logs");
include_once('../include/common.inc.php'); include_once('../include/common.inc.php');
   
echo "<table> echo "<table>
<tr><th>Agency Name</th><th>Disclosure Log URL recorded?</th><th>Do we monitor this URL?</th></tr>"; <tr><th>Agency Name</th><th>Disclosure Log URL recorded?</th><th>Do we monitor this URL?</th></tr>";
$agenciesdb = $server->get_db('disclosr-agencies'); $agenciesdb = $server->get_db('disclosr-agencies');
$docsdb = $server->get_db('disclosr-documents'); $docsdb = $server->get_db('disclosr-documents');
  $agencies = 0;
  $disclogs = 0;
  $red = 0;
  $green = 0;
  $yellow = 0;
  $orange = 0;
try { try {
$rows = $agenciesdb->get_view("app", "byCanonicalName", null, true)->rows; $rows = $agenciesdb->get_view("app", "byCanonicalName", null, true)->rows;
   
   
if ($rows) { if ($rows) {
foreach ($rows as $row) { foreach ($rows as $row) {
  if ((!isset($row->value->status) || $row->value->status != "suspended") && isset($row->value->foiEmail)) {
  echo "<tr><td>";
  if (isset($row->value->website)) echo "<a href='" . $row->value->website . "'>";
  echo "<b>" . $row->value->name . "</b>";
  if (isset($row->value->website)) echo "</a>";
  if ($ENV == "DEV")
  echo "<br>(" . $row->id . ")";
  echo "</td>\n";
  $agencies++;
   
echo "<tr><td><b>" . $row->value->name . "</b>"; echo "<td>";
if ($ENV == "DEV") if (isset($row->value->FOIDocumentsURL)) {
echo "<br>(" . $row->id . ")"; $disclogs++;
echo "</td>\n"; echo '<a href="' . $row->value->FOIDocumentsURL . '">'
  . $row->value->FOIDocumentsURL . '</a>';
  if ($ENV == "DEV")
echo "<td>"; echo '<br><small>(<a href="viewDocument.php?hash=' . md5($row->value->FOIDocumentsURL) . '">'
if (isset($row->value->FOIDocumentsURL)) { . 'view local copy</a>)</small>';
echo '<a href="' . $row->value->FOIDocumentsURL . '">' } else {
. $row->value->FOIDocumentsURL . '</a>'; echo "<font color='red'><abbr title='No'>✘</abbr></font>";
if ($ENV == "DEV") }
echo '<br><small>(<a href="viewDocument.php?hash=' . md5($row->value->FOIDocumentsURL) . '">' echo "</td>\n<td>";
. 'view local copy</a>)</small>'; if (isset($row->value->FOIDocumentsURL)) {
} else { if (file_exists("./scrapers/" . $row->id . '.py')) {
echo "<font color='red'>✘</font>"; echo "<font color='green'><abbr title='Yes'>✔</abbr></font>";
  $green++;
  } else if (file_exists("./scrapers/" . $row->id . '.txt')) {
  if (trim(file_get_contents("./scrapers/" . $row->id . '.txt')) == "no disclog") {
  echo "<font color='yellow'><abbr title='No log table exists at URL to scrape'><b>◎</b></abbr></font>";
  $yellow++;
  } else {
  echo file_get_contents("./scrapers/" . $row->id . '.txt');
  echo "<font color='orange'><abbr title='Work in progress'><b>▬</b></abbr></font>";
  $orange++;
  }
  } else {
  echo "<font color='red'><abbr title='No'>✘</abbr></font>";
  $red++;
  }
  }
  echo "</td></tr>\n";
} }
echo "</td>\n<td>";  
if (isset($row->value->FOIDocumentsURL)) {  
if (file_exists("./scrapers/" . $row->id . '.py')) {  
echo "<font color='green'>✔</font>";  
} else if (file_exists("./scrapers/" . $row->id . '.txt')) {  
echo "<font color='orange'><b>▬</b></font>";  
} else {  
echo "<font color='red'>✘</font>";  
}  
}  
echo "</td></tr>\n";  
} }
} }
} catch (SetteeRestClientException $e) { } catch (SetteeRestClientException $e) {
setteErrorHandler($e); setteErrorHandler($e);
} }
echo "</table>"; echo "</table>";
  echo $agencies . " agencies, " . round(($disclogs / $agencies) * 100) . "% with disclosure logs; "
  . round(($green / $disclogs) * 100) . "% logs with scrapers " . round(($red / $disclogs) * 100) . "% logs without scrapers " . round(($orange / $disclogs) * 100) . "% logs Work-In-Progress scrapers ";
   
include_footer_documents(); include_footer_documents();
?> ?>
   
  {
  "venv": "",
  "project-type": "Import from sources",
  "name": "disclosr-documents",
  "license": "GNU General Public License v3",
  "description": ""
  }
import sys,os import sys
  import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../')) sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
import scrape import scrape
from bs4 import BeautifulSoup from bs4 import BeautifulSoup
from time import mktime from time import mktime
import feedparser import feedparser
import abc import abc
import unicodedata, re import unicodedata
  import re
import dateutil import dateutil
from dateutil.parser import * from dateutil.parser import *
from datetime import * from datetime import *
  import codecs
   
  import difflib
   
  from StringIO import StringIO
   
  from pdfminer.pdfparser import PDFDocument, PDFParser
  from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter, process_pdf
  from pdfminer.pdfdevice import PDFDevice, TagExtractor
  from pdfminer.converter import TextConverter
  from pdfminer.cmapdb import CMapDB
  from pdfminer.layout import LAParams
   
   
class GenericDisclogScraper(object): class GenericDisclogScraper(object):
__metaclass__ = abc.ABCMeta __metaclass__ = abc.ABCMeta
agencyID = None agencyID = None
disclogURL = None disclogURL = None
def remove_control_chars(self, input):  
return "".join([i for i in input if ord(i) in range(32, 127)]) def remove_control_chars(self, input):
def getAgencyID(self): return "".join([i for i in input if ord(i) in range(32, 127)])
""" disclosr agency id """  
if self.agencyID == None: def getAgencyID(self):
self.agencyID = os.path.basename(sys.argv[0]).replace(".py","") """ disclosr agency id """
return self.agencyID if self.agencyID is None:
  self.agencyID = os.path.basename(sys.argv[0]).replace(".py", "")
def getURL(self): return self.agencyID
""" disclog URL"""  
if self.disclogURL == None: def getURL(self):
agency = scrape.agencydb.get(self.getAgencyID()) """ disclog URL"""
self.disclogURL = agency['FOIDocumentsURL'] if self.disclogURL is None:
return self.disclogURL agency = scrape.agencydb.get(self.getAgencyID())
  self.disclogURL = agency['FOIDocumentsURL']
@abc.abstractmethod return self.disclogURL
def doScrape(self):  
""" do the scraping """ @abc.abstractmethod
return def doScrape(self):
  """ do the scraping """
@abc.abstractmethod return
def getDescription(self, content, entry, doc):  
""" get description""" class GenericHTMLDisclogScraper(GenericDisclogScraper):
return  
  def doScrape(self):
  foidocsdb = scrape.couch['disclosr-foidocuments']
  (url, mime_type, rcontent) = scrape.fetchURL(scrape.docsdb,
  self.getURL(), "foidocuments", self.getAgencyID())
  content = rcontent
  dochash = scrape.mkhash(content)
  doc = foidocsdb.get(dochash)
  if doc is None:
  print "saving " + dochash
  description = "This log may have updated but as it was not in a table last time we viewed it, we cannot extract what has changed. Please refer to the agency's website Disclosure Log to see the most recent entries"
  last_attach = scrape.getLastAttachment(scrape.docsdb, self.getURL())
  if last_attach != None:
  html_diff = difflib.HtmlDiff()
  description = description + "\nChanges: "
  description = description + html_diff.make_table(last_attach.read().split('\n'),
  content.split('\n'))
  edate = date.today().strftime("%Y-%m-%d")
  doc = {'_id': dochash, 'agencyID': self.getAgencyID()
  , 'url': self.getURL(), 'docID': dochash,
  "date": edate, "title": "Disclosure Log Updated", "description": description}
  foidocsdb.save(doc)
  else:
  print "already saved"
   
  class GenericPDFDisclogScraper(GenericDisclogScraper):
   
  def doScrape(self):
  foidocsdb = scrape.couch['disclosr-foidocuments']
  (url, mime_type, content) = scrape.fetchURL(scrape.docsdb,
  self.getURL(), "foidocuments", self.getAgencyID())
  laparams = LAParams()
  rsrcmgr = PDFResourceManager(caching=True)
  outfp = StringIO()
  device = TextConverter(rsrcmgr, outfp, codec='utf-8',
  laparams=laparams)
  fp = StringIO()
  fp.write(content)
   
  process_pdf(rsrcmgr, device, fp, set(), caching=True,
  check_extractable=True)
  description = outfp.getvalue()
  fp.close()
  device.close()
  outfp.close()
  dochash = scrape.mkhash(description)
  doc = foidocsdb.get(dochash)
  if doc is None:
  print "saving " + dochash
  edate = date.today().strftime("%Y-%m-%d")
  doc = {'_id': dochash, 'agencyID': self.getAgencyID()
  , 'url': self.getURL(), 'docID': dochash,
  "date": edate, "title": "Disclosure Log Updated", "description": description}
  foidocsdb.save(doc)
  else:
  print "already saved"
   
   
  class GenericDOCXDisclogScraper(GenericDisclogScraper):
   
  def doScrape(self):
  foidocsdb = scrape.couch['disclosr-foidocuments']
  (url, mime_type, content) = scrape.fetchURL(scrape.docsdb
  , self.getURL(), "foidocuments", self.getAgencyID())
  mydoc = zipfile.ZipFile(file)
  xmlcontent = mydoc.read('word/document.xml')
  document = etree.fromstring(xmlcontent)
  ## Fetch all the text out of the document we just created
  paratextlist = getdocumenttext(document)
  # Make explicit unicode version
  newparatextlist = []
  for paratext in paratextlist:
  newparatextlist.append(paratext.encode("utf-8"))
  ## Print our documnts test with two newlines under each paragraph
  description = '\n\n'.join(newparatextlist).strip(' \t\n\r')
  dochash = scrape.mkhash(description)
  doc = foidocsdb.get(dochash)
   
  if doc is None:
  print "saving " + dochash
  edate = time().strftime("%Y-%m-%d")
  doc = {'_id': dochash, 'agencyID': self.getAgencyID()
  , 'url': self.getURL(), 'docID': dochash,
  "date": edate, "title": "Disclosure Log Updated", "description": description}
  foidocsdb.save(doc)
  else:
  print "already saved"
   
   
class GenericRSSDisclogScraper(GenericDisclogScraper): class GenericRSSDisclogScraper(GenericDisclogScraper):
   
def doScrape(self): def doScrape(self):
foidocsdb = scrape.couch['disclosr-foidocuments'] foidocsdb = scrape.couch['disclosr-foidocuments']
(url,mime_type,content) = scrape.fetchURL(scrape.docsdb, self.getURL(), "foidocuments", self.getAgencyID()) (url, mime_type, content) = scrape.fetchURL(scrape.docsdb,
feed = feedparser.parse(content) self.getURL(), "foidocuments", self.getAgencyID())
for entry in feed.entries: feed = feedparser.parse(content)
#print entry for entry in feed.entries:
print entry.id #print entry
hash = scrape.mkhash(entry.id) print entry.id
#print hash dochash = scrape.mkhash(entry.id)
doc = foidocsdb.get(hash) doc = foidocsdb.get(dochash)
#print doc #print doc
if doc == None: if doc is None:
print "saving "+ hash print "saving " + dochash
edate = datetime.fromtimestamp(mktime( entry.published_parsed)).strftime("%Y-%m-%d") edate = datetime.fromtimestamp(
doc = {'_id': hash, 'agencyID': self.getAgencyID(), 'url': entry.link, 'docID': entry.id, mktime(entry.published_parsed)).strftime("%Y-%m-%d")
"date": edate,"title": entry.title} doc = {'_id': dochash, 'agencyID': self.getAgencyID(),
self.getDescription(entry,entry, doc) 'url': entry.link, 'docID': entry.id,
foidocsdb.save(doc) "date": edate, "title": entry.title}
  self.getDescription(entry, entry, doc)
  foidocsdb.save(doc)
  else:
  print "already saved"
   
  def getDescription(self, content, entry, doc):
  """ get description from rss entry"""
  doc.update({'description': content.summary})
  return
   
   
  class GenericOAICDisclogScraper(GenericDisclogScraper):
  __metaclass__ = abc.ABCMeta
   
  @abc.abstractmethod
  def getColumns(self, columns):
  """ rearranges columns if required """
  return
   
  def getColumnCount(self):
  return 5
   
  def getDescription(self, content, entry, doc):
  """ get description from rss entry"""
  descriptiontxt = ""
  for string in content.stripped_strings:
  descriptiontxt = descriptiontxt + " \n" + string
  doc.update({'description': descriptiontxt})
   
  def getTitle(self, content, entry, doc):
  doc.update({'title': (''.join(content.stripped_strings))})
   
  def getTable(self, soup):
  return soup.table
   
  def getRows(self, table):
  return table.find_all('tr')
   
  def getDate(self, content, entry, doc):
  date = ''.join(content.stripped_strings).strip()
  (a, b, c) = date.partition("(")
  date = self.remove_control_chars(a.replace("Octber", "October"))
  print date
  edate = parse(date, dayfirst=True, fuzzy=True).strftime("%Y-%m-%d")
  print edate
  doc.update({'date': edate})
  return
   
  def getLinks(self, content, entry, doc):
  links = []
  for atag in entry.find_all("a"):
  if atag.has_key('href'):
  links.append(scrape.fullurl(content, atag['href']))
  if links != []:
  doc.update({'links': links})
  return
   
  def doScrape(self):
  foidocsdb = scrape.couch['disclosr-foidocuments']
  (url, mime_type, content) = scrape.fetchURL(scrape.docsdb,
  self.getURL(), "foidocuments", self.getAgencyID())
  if content is not None:
  if mime_type == "text/html" or mime_type == "application/xhtml+xml" or mime_type == "application/xml":
  # http://www.crummy.com/software/BeautifulSoup/documentation.html
  print "parsing"
  soup = BeautifulSoup(content)
  table = self.getTable(soup)
  for row in self.getRows(table):
  columns = row.find_all('td')
  if len(columns) is self.getColumnCount():
  (id, date, title,
  description, notes) = self.getColumns(columns)
  print self.remove_control_chars(
  ''.join(id.stripped_strings))
  if id.string is None:
  dochash = scrape.mkhash(
  self.remove_control_chars(
  url + (''.join(date.stripped_strings))))
else: else:
print "already saved" dochash = scrape.mkhash(
def getDescription(self, content, entry, doc): self.remove_control_chars(
""" get description from rss entry""" url + (''.join(id.stripped_strings))))
doc.update({'description': content.summary}) doc = foidocsdb.get(dochash)
return  
  if doc is None:
class GenericOAICDisclogScraper(GenericDisclogScraper): print "saving " + dochash
__metaclass__ = abc.ABCMeta doc = {'_id': dochash,
@abc.abstractmethod 'agencyID': self.getAgencyID(),
def getColumns(self,columns): 'url': self.getURL(),
""" rearranges columns if required """ 'docID': (''.join(id.stripped_strings))}
return self.getLinks(self.getURL(), row, doc)
def getColumnCount(self): self.getTitle(title, row, doc)
return 5 self.getDate(date, row, doc)
def getDescription(self, content, entry, doc): self.getDescription(description, row, doc)
""" get description from rss entry""" if notes is not None:
descriptiontxt = "" doc.update({ 'notes': (
for string in content.stripped_strings: ''.join(notes.stripped_strings))})
descriptiontxt = descriptiontxt + " \n" + string badtitles = ['-','Summary of FOI Request'
doc.update({'description': descriptiontxt}) , 'FOI request(in summary form)'
return , 'Summary of FOI request received by the ASC',
def getTitle(self, content, entry, doc): 'Summary of FOI request received by agency/minister',
doc.update({'title': content.string}) 'Description of Documents Requested','FOI request',
return 'Description of FOI Request','Summary of request','Description','Summary',
def getTable(self, soup): 'Summary of FOIrequest received by agency/minister','Summary of FOI request received','Description of FOI Request',"FOI request",'Results 1 to 67 of 67']
return soup.table if doc['title'] not in badtitles\
def getDate(self, content, entry, doc): and doc['description'] != '':
edate = parse(''.join(content.stripped_strings).strip(), dayfirst=True, fuzzy=True).strftime("%Y-%m-%d") print "saving"
print edate foidocsdb.save(doc)
doc.update({'date': edate}) else:
return print "already saved " + dochash
def getLinks(self, content, entry, doc):  
links = [] elif len(row.find_all('th')) is self.getColumnCount():
for atag in entry.find_all("a"): print "header row"
if atag.has_key('href'):  
links.append(scrape.fullurl(content,atag['href'])) else:
if links != []: print "ERROR number of columns incorrect"
doc.update({'links': links}) print row
return  
   
def doScrape(self):  
foidocsdb = scrape.couch['disclosr-foidocuments']  
(url,mime_type,content) = scrape.fetchURL(scrape.docsdb, self.getURL(), "foidocuments", self.getAgencyID())  
if content != None:  
if mime_type == "text/html" or mime_type == "application/xhtml+xml" or mime_type =="application/xml":  
# http://www.crummy.com/software/BeautifulSoup/documentation.html  
soup = BeautifulSoup(content)  
table = self.getTable(soup)  
for row in table.find_all('tr'):  
columns = row.find_all('td')  
if len(columns) == self.getColumnCount():  
(id, date, description, title, notes) = self.getColumns(columns)  
print ''.join(id.stripped_strings)  
if id.string == None:  
hash = scrape.mkhash(self.remove_control_chars(url+(''.join(date.stripped_strings))))  
else:  
hash = scrape.mkhash(self.remove_control_chars(url+(''.join(id.stripped_strings))))  
doc = foidocsdb.get(hash)  
   
if doc == None:  
print "saving " +hash  
doc = {'_id': hash, 'agencyID': self.getAgencyID(), 'url': self.getURL(), 'docID': id.string}  
self.getLinks(self.getURL(),row,doc)  
self.getTitle(title,row, doc)  
self.getDate(date,row, doc)  
self.getDescription(description,row, doc)  
if notes != None:  
doc.update({ 'notes': notes.string})  
foidocsdb.save(doc)  
else:  
print "already saved "+hash  
   
elif len(row.find_all('th')) == self.getColumnCount():  
print "header row"  
   
else:  
print "ERROR number of columns incorrect"  
print row  
   
 Binary files /dev/null and b/documents/img/feed-icon-14x14.png differ
<?php <?php
include('template.inc.php'); include('template.inc.php');
include_header_documents(""); include_header_documents("");
include_once('../include/common.inc.php'); include_once('../include/common.inc.php');
  $endkey = (isset($_REQUEST['end_key']) ? $_REQUEST['end_key'] : '9999-99-99');
  $enddocid = (isset($_REQUEST['end_docid']) ? $_REQUEST['end_docid'] : null);
?> ?>
  <div class="headline">Read all the information released by Australian Federal Government agencies under the FOI Act in one place!</div>
  <a style='float:right' href="rss.xml.php"><img src="img/feed-icon-14x14.png" alt="RSS Icon"/> All Agencies RSS Feed</a><br>
<?php <?php
   
   
   
$agenciesdb = $server->get_db('disclosr-agencies'); $agenciesdb = $server->get_db('disclosr-agencies');
   
$idtoname = Array(); $idtoname = Array();
foreach ($agenciesdb->get_view("app", "byCanonicalName")->rows as $row) { foreach ($agenciesdb->get_view("app", "byCanonicalName")->rows as $row) {
$idtoname[$row->id] = trim($row->value->name); $idtoname[$row->id] = trim($row->value->name);
} }
$foidocsdb = $server->get_db('disclosr-foidocuments'); $foidocsdb = $server->get_db('disclosr-foidocuments');
try { try {
$rows = $foidocsdb->get_view("app", "byDate", Array('9999-99-99','0000-00-00'), true)->rows; $rows = $foidocsdb->get_view("app", "byDate", Array($endkey, '0000-00-00'), true, 20,null, $enddocid)->rows;
   
   
if ($rows) { if ($rows) {
foreach ($rows as $row) { foreach ($rows as $key => $row) {
displayLogEntry($row,$idtoname); echo displayLogEntry($row, $idtoname);
  if (!isset($startkey))
  $startkey = $row->key;
  $endkey = $row->key;
  $enddocid = $row->value->_id;
} }
} }
} catch (SetteeRestClientException $e) { } catch (SetteeRestClientException $e) {
setteErrorHandler($e); setteErrorHandler($e);
} }
  echo "<a class='btn btn-large btn-primary' href='?end_key=$endkey&amp;end_docid=$enddocid' style='float:right;'>next page <i class='icon-circle-arrow-right icon-white'></i></a>";
include_footer_documents(); include_footer_documents();
?> ?>
   
# www.robotstxt.org/ # www.robotstxt.org/
# http://code.google.com/web/controlcrawlindex/ # http://code.google.com/web/controlcrawlindex/
   
User-agent: * User-agent: *
  Disallow: /admin/
  Sitemap: http://disclosurelo.gs/sitemap.xml.php
<?php <?php
   
// Agency X updated Y, new files, diff of plain text/link text, // Agency X updated Y, new files, diff of plain text/link text,
// feed for just one agency or all // feed for just one agency or all
// This is a minimum example of using the Universal Feed Generator Class // This is a minimum example of using the Universal Feed Generator Class
include("lib/FeedWriter.php"); include("../lib/FeedWriter/FeedTypes.php");
  include_once('../include/common.inc.php');
//Creating an instance of FeedWriter class. //Creating an instance of FeedWriter class.
$TestFeed = new FeedWriter(RSS2); $TestFeed = new RSS2FeedWriter();
//Setting the channel elements //Setting the channel elements
  ////Retriving informations from database
  $idtoname = Array();
  $agenciesdb = $server->get_db('disclosr-agencies');
  foreach ($agenciesdb->get_view("app", "byCanonicalName")->rows as $row) {
  $idtoname[$row->id] = trim($row->value->name);
  }
  $foidocsdb = $server->get_db('disclosr-foidocuments');
  if (isset($_REQUEST['id'])) {
  $rows = $foidocsdb->get_view("app", "byAgencyID", $_REQUEST['id'], false, false, false)->rows;
  $title = $idtoname[$_REQUEST['id']];
  } else {
  $rows = $foidocsdb->get_view("app", "byDate", Array('9999-99-99', '0000-00-00', 50), true)->rows;
  $title = 'All Agencies';
  }
//Use wrapper functions for common channelelements //Use wrapper functions for common channelelements
$TestFeed->setTitle('Last Modified - All'); $TestFeed->setTitle('disclosurelo.gs Newest Entries - '.$title);
$TestFeed->setLink('http://disclosr.lambdacomplex.org/rss.xml.php'); $TestFeed->setLink('http://disclosurelo.gs/rss.xml.php'.(isset($_REQUEST['id'])? '?id='.$_REQUEST['id'] : ''));
$TestFeed->setDescription('This is test of creating a RSS 2.0 feed Universal Feed Writer'); $TestFeed->setDescription('disclosurelo.gs Newest Entries - '.$title);
//Retriving informations from database $TestFeed->setChannelElement('language', 'en-us');
$rows = $db->get_view("app", "byLastModified")->rows; $TestFeed->setChannelElement('pubDate', date(DATE_RSS, time()));
   
   
//print_r($rows); //print_r($rows);
foreach ($rows as $row) { foreach ($rows as $row) {
//Create an empty FeedItem //Create an empty FeedItem
$newItem = $TestFeed->createNewItem(); $newItem = $TestFeed->createNewItem();
//Add elements to the feed item //Add elements to the feed item
$newItem->setTitle($row['name']); $newItem->setTitle($row->value->title);
$newItem->setLink($row['id']); $newItem->setLink("http://disclosurelo.gs/view.php?id=" . $row->value->_id);
$newItem->setDate(date("c", $row['metadata']['lastModified'])); $newItem->setDate(strtotime($row->value->date));
$newItem->setDescription($row['name']); $newItem->setDescription(displayLogEntry($row, $idtoname));
  $newItem->setAuthor($idtoname[$row->value->agencyID]);
  $newItem->addElement('guid', "http://disclosurelo.gs/view.php?id=" . $row->value->_id, array('isPermaLink' => 'true'));
//Now add the feed item //Now add the feed item
$TestFeed->addItem($newItem); $TestFeed->addItem($newItem);
} }
//OK. Everything is done. Now genarate the feed. //OK. Everything is done. Now genarate the feed.
$TestFeed->genarateFeed(); $TestFeed->generateFeed();
?> ?>
   
  for f in scrapers/*.py;
  do echo "Processing $f file..";
  python $f;
  if [ "$?" -ne "0" ]; then
  echo "error";
  sleep 2;
  fi
  done
 
 
#http://packages.python.org/CouchDB/client.html #http://packages.python.org/CouchDB/client.html
import couchdb import couchdb
import urllib2 import urllib2
from BeautifulSoup import BeautifulSoup from BeautifulSoup import BeautifulSoup
import re import re
import hashlib import hashlib
from urlparse import urljoin from urlparse import urljoin
import time import time
import os import os
import mimetypes import mimetypes
import re  
import urllib import urllib
import urlparse import urlparse
   
def mkhash(input): def mkhash(input):
return hashlib.md5(input).hexdigest().encode("utf-8") return hashlib.md5(input).hexdigest().encode("utf-8")
   
def canonurl(url): def canonurl(url):
r"""Return the canonical, ASCII-encoded form of a UTF-8 encoded URL, or '' r"""Return the canonical, ASCII-encoded form of a UTF-8 encoded URL, or ''
if the URL looks invalid. if the URL looks invalid.
>>> canonurl('\xe2\x9e\xa1.ws') # tinyarro.ws >>> canonurl('\xe2\x9e\xa1.ws') # tinyarro.ws
'http://xn--hgi.ws/' 'http://xn--hgi.ws/'
""" """
# strip spaces at the ends and ensure it's prefixed with 'scheme://' # strip spaces at the ends and ensure it's prefixed with 'scheme://'
url = url.strip() url = url.strip()
if not url: if not url:
return '' return ''
if not urlparse.urlsplit(url).scheme: if not urlparse.urlsplit(url).scheme:
url = 'http://' + url url = 'http://' + url
   
# turn it into Unicode # turn it into Unicode
#try: #try:
# url = unicode(url, 'utf-8') # url = unicode(url, 'utf-8')
#except UnicodeDecodeError: #except UnicodeDecodeError:
# return '' # bad UTF-8 chars in URL # return '' # bad UTF-8 chars in URL
   
# parse the URL into its components # parse the URL into its components
parsed = urlparse.urlsplit(url) parsed = urlparse.urlsplit(url)
scheme, netloc, path, query, fragment = parsed scheme, netloc, path, query, fragment = parsed
   
# ensure scheme is a letter followed by letters, digits, and '+-.' chars # ensure scheme is a letter followed by letters, digits, and '+-.' chars
if not re.match(r'[a-z][-+.a-z0-9]*$', scheme, flags=re.I): if not re.match(r'[a-z][-+.a-z0-9]*$', scheme, flags=re.I):
return '' return ''
scheme = str(scheme) scheme = str(scheme)
   
# ensure domain and port are valid, eg: sub.domain.<1-to-6-TLD-chars>[:port] # ensure domain and port are valid, eg: sub.domain.<1-to-6-TLD-chars>[:port]
match = re.match(r'(.+\.[a-z0-9]{1,6})(:\d{1,5})?$', netloc, flags=re.I) match = re.match(r'(.+\.[a-z0-9]{1,6})(:\d{1,5})?$', netloc, flags=re.I)
if not match: if not match:
return '' return ''
domain, port = match.groups() domain, port = match.groups()
netloc = domain + (port if port else '') netloc = domain + (port if port else '')
netloc = netloc.encode('idna') netloc = netloc.encode('idna')
   
# ensure path is valid and convert Unicode chars to %-encoded # ensure path is valid and convert Unicode chars to %-encoded
if not path: if not path:
path = '/' # eg: 'http://google.com' -> 'http://google.com/' path = '/' # eg: 'http://google.com' -> 'http://google.com/'
path = urllib.quote(urllib.unquote(path.encode('utf-8')), safe='/;') path = urllib.quote(urllib.unquote(path.encode('utf-8')), safe='/;')
   
# ensure query is valid # ensure query is valid
query = urllib.quote(urllib.unquote(query.encode('utf-8')), safe='=&?/') query = urllib.quote(urllib.unquote(query.encode('utf-8')), safe='=&?/')
   
# ensure fragment is valid # ensure fragment is valid
fragment = urllib.quote(urllib.unquote(fragment.encode('utf-8'))) fragment = urllib.quote(urllib.unquote(fragment.encode('utf-8')))
   
# piece it all back together, truncating it to a maximum of 4KB # piece it all back together, truncating it to a maximum of 4KB
url = urlparse.urlunsplit((scheme, netloc, path, query, fragment)) url = urlparse.urlunsplit((scheme, netloc, path, query, fragment))
return url[:4096] return url[:4096]
   
def fullurl(url,href): def fullurl(url,href):
href = href.replace(" ","%20") href = href.replace(" ","%20")
href = re.sub('#.*$','',href) href = re.sub('#.*$','',href)
return urljoin(url,href) return urljoin(url,href)
   
#http://diveintopython.org/http_web_services/etags.html #http://diveintopython.org/http_web_services/etags.html
class NotModifiedHandler(urllib2.BaseHandler): class NotModifiedHandler(urllib2.BaseHandler):
def http_error_304(self, req, fp, code, message, headers): def http_error_304(self, req, fp, code, message, headers):
addinfourl = urllib2.addinfourl(fp, headers, req.get_full_url()) addinfourl = urllib2.addinfourl(fp, headers, req.get_full_url())
addinfourl.code = code addinfourl.code = code
return addinfourl return addinfourl
   
  def getLastAttachment(docsdb,url):
  hash = mkhash(url)
  doc = docsdb.get(hash)
  if doc != None:
  last_attachment_fname = doc["_attachments"].keys()[-1]
  last_attachment = docsdb.get_attachment(doc,last_attachment_fname)
  return last_attachment
  else:
  return None
   
def fetchURL(docsdb, url, fieldName, agencyID, scrape_again=True): def fetchURL(docsdb, url, fieldName, agencyID, scrape_again=True):
url = canonurl(url) url = canonurl(url)
hash = mkhash(url) hash = mkhash(url)
req = urllib2.Request(url) req = urllib2.Request(url)
print "Fetching %s (%s)" % (url,hash) print "Fetching %s (%s)" % (url,hash)
if url.startswith("mailto") or url.startswith("javascript") or url.startswith("#") or url == None or url == "": if url.startswith("mailto") or url.startswith("javascript") or url.startswith("#") or url == None or url == "":
print "Not a valid HTTP url" print "Not a valid HTTP url"
return (None,None,None) return (None,None,None)
doc = docsdb.get(hash) doc = docsdb.get(hash)
if doc == None: if doc == None:
doc = {'_id': hash, 'agencyID': agencyID, 'url': url, 'fieldName':fieldName} doc = {'_id': hash, 'agencyID': agencyID, 'url': url, 'fieldName':fieldName}
else: else:
if (('page_scraped' in doc) and (time.time() - doc['page_scraped']) < 60*24*14*1000): if (('page_scraped' in doc) and (time.time() - doc['page_scraped']) < 60*24*14*1000):
print "Uh oh, trying to scrape URL again too soon!" print "Uh oh, trying to scrape URL again too soon!"+hash
last_attachment_fname = doc["_attachments"].keys()[-1] last_attachment_fname = doc["_attachments"].keys()[-1]
last_attachment = docsdb.get_attachment(doc,last_attachment_fname) last_attachment = docsdb.get_attachment(doc,last_attachment_fname)
content = last_attachment content = last_attachment
return (doc['url'],doc['mime_type'],content) return (doc['url'],doc['mime_type'],content.read())
if scrape_again == False: if scrape_again == False:
print "Not scraping this URL again as requested" print "Not scraping this URL again as requested"
return (None,None,None) return (doc['url'],doc['mime_type'],content.read())
   
time.sleep(3) # wait 3 seconds to give webserver time to recover req.add_header("User-Agent", "Mozilla/4.0 (compatible; Prometheus webspider; owner maxious@lambdacomplex.org)")
  #if there is a previous version stored in couchdb, load caching helper tags
req.add_header("User-Agent", "Mozilla/4.0 (compatible; Prometheus webspider; owner maxious@lambdacomplex.org)") if doc.has_key('etag'):
#if there is a previous version stored in couchdb, load caching helper tags req.add_header("If-None-Match", doc['etag'])
if doc.has_key('etag'): if doc.has_key('last_modified'):
req.add_header("If-None-Match", doc['etag']) req.add_header("If-Modified-Since", doc['last_modified'])
if doc.has_key('last_modified'):  
req.add_header("If-Modified-Since", doc['last_modified']) opener = urllib2.build_opener(NotModifiedHandler())
  try:
opener = urllib2.build_opener(NotModifiedHandler()) url_handle = opener.open(req)
try: doc['url'] = url_handle.geturl() # may have followed a redirect to a new url
url_handle = opener.open(req) headers = url_handle.info() # the addinfourls have the .info() too
doc['url'] = url_handle.geturl() # may have followed a redirect to a new url doc['etag'] = headers.getheader("ETag")
headers = url_handle.info() # the addinfourls have the .info() too doc['last_modified'] = headers.getheader("Last-Modified")
doc['etag'] = headers.getheader("ETag") doc['date'] = headers.getheader("Date")
doc['last_modified'] = headers.getheader("Last-Modified") doc['page_scraped'] = time.time()
doc['date'] = headers.getheader("Date") doc['web_server'] = headers.getheader("Server")
doc['page_scraped'] = time.time() doc['via'] = headers.getheader("Via")
doc['web_server'] = headers.getheader("Server") doc['powered_by'] = headers.getheader("X-Powered-By")
doc['via'] = headers.getheader("Via") doc['file_size'] = headers.getheader("Content-Length")
doc['powered_by'] = headers.getheader("X-Powered-By") content_type = headers.getheader("Content-Type")
doc['file_size'] = headers.getheader("Content-Length") if content_type != None:
content_type = headers.getheader("Content-Type") doc['mime_type'] = content_type.split(";")[0]
if content_type != None: else:
doc['mime_type'] = content_type.split(";")[0] (type,encoding) = mimetypes.guess_type(url)
else: doc['mime_type'] = type
(type,encoding) = mimetypes.guess_type(url) if hasattr(url_handle, 'code'):
doc['mime_type'] = type if url_handle.code == 304:
if hasattr(url_handle, 'code'): print "the web page has not been modified"+hash
if url_handle.code == 304: last_attachment_fname = doc["_attachments"].keys()[-1]
print "the web page has not been modified" last_attachment = docsdb.get_attachment(doc,last_attachment_fname)
return (None,None,None) content = last_attachment
else: return (doc['url'],doc['mime_type'],content.read())
content = url_handle.read() else:
docsdb.save(doc) print "new webpage loaded"
doc = docsdb.get(hash) # need to get a _rev content = url_handle.read()
docsdb.put_attachment(doc, content, str(time.time())+"-"+os.path.basename(url), doc['mime_type']) docsdb.save(doc)
return (doc['url'], doc['mime_type'], content) doc = docsdb.get(hash) # need to get a _rev
#store as attachment epoch-filename docsdb.put_attachment(doc, content, str(time.time())+"-"+os.path.basename(url), doc['mime_type'])
  return (doc['url'], doc['mime_type'], content)
except urllib2.URLError as e: #store as attachment epoch-filename
error = ""  
if hasattr(e, 'reason'): except urllib2.URLError as e:
error = "error %s in downloading %s" % (str(e.reason), url) print "error!"
elif hasattr(e, 'code'): error = ""
error = "error %s in downloading %s" % (e.code, url) if hasattr(e, 'reason'):
print error error = "error %s in downloading %s" % (str(e.reason), url)
doc['error'] = error elif hasattr(e, 'code'):
docsdb.save(doc) error = "error %s in downloading %s" % (e.code, url)
return (None,None,None) print error
  doc['error'] = error
  docsdb.save(doc)
  return (None,None,None)
   
   
   
def scrapeAndStore(docsdb, url, depth, fieldName, agencyID): def scrapeAndStore(docsdb, url, depth, fieldName, agencyID):
(url,mime_type,content) = fetchURL(docsdb, url, fieldName, agencyID) (url,mime_type,content) = fetchURL(docsdb, url, fieldName, agencyID)
badURLs = ["http://www.ausport.gov.au/supporting/funding/grants_and_scholarships/grant_funding_report"] badURLs = ["http://www.ausport.gov.au/supporting/funding/grants_and_scholarships/grant_funding_report"]
if content != None and depth > 0 and url != "http://www.ausport.gov.au/supporting/funding/grants_and_scholarships/grant_funding_report": if content != None and depth > 0 and url != "http://www.ausport.gov.au/supporting/funding/grants_and_scholarships/grant_funding_report":
if mime_type == "text/html" or mime_type == "application/xhtml+xml" or mime_type =="application/xml": if mime_type == "text/html" or mime_type == "application/xhtml+xml" or mime_type =="application/xml":
# http://www.crummy.com/software/BeautifulSoup/documentation.html # http://www.crummy.com/software/BeautifulSoup/documentation.html
soup = BeautifulSoup(content) soup = BeautifulSoup(content)
navIDs = soup.findAll(id=re.compile('nav|Nav|menu|bar|left|right|sidebar|more-links|breadcrumb|footer|header')) navIDs = soup.findAll(id=re.compile('nav|Nav|menu|bar|left|right|sidebar|more-links|breadcrumb|footer|header'))
for nav in navIDs: for nav in navIDs:
print "Removing element", nav['id'] print "Removing element", nav['id']
nav.extract() nav.extract()
navClasses = soup.findAll(attrs={'class' : re.compile('nav|menu|bar|left|right|sidebar|more-links|breadcrumb|footer|header')}) navClasses = soup.findAll(attrs={'class' : re.compile('nav|menu|bar|left|right|sidebar|more-links|breadcrumb|footer|header')})
for nav in navClasses: for nav in navClasses:
print "Removing element", nav['class'] print "Removing element", nav['class']
nav.extract() nav.extract()
links = soup.findAll('a') # soup.findAll('a', id=re.compile("^p-")) links = soup.findAll('a') # soup.findAll('a', id=re.compile("^p-"))
linkurls = set([]) linkurls = set([])
for link in links: for link in links:
if link.has_key("href"): if link.has_key("href"):
if link['href'].startswith("http"): if link['href'].startswith("http"):
# lets not do external links for now # lets not do external links for now
# linkurls.add(link['href']) # linkurls.add(link['href'])
None None
if link['href'].startswith("mailto"): if link['href'].startswith("mailto"):
# not http # not http
None None
if link['href'].startswith("javascript"): if link['href'].startswith("javascript"):
# not http # not http
None None
else: else:
# remove anchors and spaces in urls # remove anchors and spaces in urls
linkurls.add(fullurl(url,link['href'])) linkurls.add(fullurl(url,link['href']))
for linkurl in linkurls: for linkurl in linkurls:
#print linkurl #print linkurl
scrapeAndStore(docsdb, linkurl, depth-1, fieldName, agencyID) scrapeAndStore(docsdb, linkurl, depth-1, fieldName, agencyID)
   
#couch = couchdb.Server('http://192.168.1.148:5984/') #couch = couchdb.Server('http://192.168.1.148:5984/')
couch = couchdb.Server('http://127.0.0.1:5984/') couch = couchdb.Server('http://127.0.0.1:5984/')
# select database # select database
agencydb = couch['disclosr-agencies'] agencydb = couch['disclosr-agencies']
docsdb = couch['disclosr-documents'] docsdb = couch['disclosr-documents']
   
if __name__ == "__main__": if __name__ == "__main__":
for row in agencydb.view('app/getScrapeRequired'): #not recently scraped agencies view? for row in agencydb.view('app/getScrapeRequired'): #not recently scraped agencies view?
agency = agencydb.get(row.id) agency = agencydb.get(row.id)
print agency['name'] print agency['name']
for key in agency.keys(): for key in agency.keys():
if key == "FOIDocumentsURL" and "status" not in agency.keys: if key == "FOIDocumentsURL" and "status" not in agency.keys:
scrapeAndStore(docsdb, agency[key],0,key,agency['_id']) scrapeAndStore(docsdb, agency[key],0,key,agency['_id'])
if key == 'website' and False: if key == 'website' and False:
scrapeAndStore(docsdb, agency[key],0,key,agency['_id']) scrapeAndStore(docsdb, agency[key],0,key,agency['_id'])
if key.endswith('URL') and False: agency['metadata']['lastScraped'] = time.time()
print key if key.endswith('URL') and False:
depth = 1 print key
if 'scrapeDepth' in agency.keys(): depth = 1
depth = agency['scrapeDepth'] if 'scrapeDepth' in agency.keys():
scrapeAndStore(docsdb, agency[key],depth,key,agency['_id']) depth = agency['scrapeDepth']
agency['metadata']['lastScraped'] = time.time() scrapeAndStore(docsdb, agency[key],depth,key,agency['_id'])
agencydb.save(agency) agencydb.save(agency)
   
  import sys
  import os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
  import traceback
  try:
  import amonpy
  amonpy.config.address = 'http://amon_instance:port'
  amonpy.config.secret_key = 'the secret key from /etc/amon.conf'
  amon_available = True
  except ImportError:
  amon_available = False
 
  class ScraperImplementation(genericScrapers.GenericPDFDisclogScraper):
 
  def __init__(self):
  super(ScraperImplementation, self).__init__()
 
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(ScraperImplementation,
  genericScrapers.GenericPDFDisclogScraper)
  print 'Instance:', isinstance(ScraperImplementation(),
  genericScrapers.GenericPDFDisclogScraper)
  try:
  ScraperImplementation().doScrape()
  except Exception, err:
  sys.stderr.write('ERROR: %s\n' % str(err))
  print ‘Error Reason: ‘, err.__doc__
  print ‘Exception: ‘, err.__class__
  print traceback.format_exc()
  if amon_available:
  data = {
  'exception_class': '',
  'url': '',
  'backtrace': ['exception line ', 'another exception line'],
  'enviroment': '',
 
  # In 'data' you can add request information, session variables - it's a recursive
  # dictionary, so you can literally add everything important for your specific case
  # The dictionary doesn't have a specified structure, the keys below are only example
  'data': {'request': '', 'session': '', 'more': ''}
 
  }
 
  amonpy.exception(data)
  pass
 
  import sys,os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
  import dateutil
  from dateutil.parser import *
  from datetime import *
 
 
  class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper):
 
  def __init__(self):
  super(ScraperImplementation, self).__init__()
  def getDate(self, content, entry, doc):
  date = ''.join(entry.find('th').stripped_strings).strip()
  (a, b, c) = date.partition("(")
  date = self.remove_control_chars(a.replace("Octber", "October"))
  print date
  edate = parse(date, dayfirst=True, fuzzy=True).strftime("%Y-%m-%d")
  print edate
  doc.update({'date': edate})
  return
  def getColumnCount(self):
  return 4
 
  def getTable(self, soup):
  return soup.find(summary="List of Defence documents released under Freedom of Information requets")
 
  def getColumns(self, columns):
  (id, description, access, notes) = columns
  return (id, None, description, description, notes)
 
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper)
  print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper)
 
  nsi = ScraperImplementation()
  nsi.disclogURL = "http://www.defence.gov.au/foi/disclosure_log_201213.cfm"
  nsi.doScrape()
 
  nsi.disclogURL = "http://www.defence.gov.au/foi/disclosure_log_201112.cfm"
  nsi.doScrape()
 
  nsi.disclogURL = "http://www.defence.gov.au/foi/disclosure_log_201011.cfm"
  nsi.doScrape()
 
 
  import sys,os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
  import scrape
  from bs4 import BeautifulSoup
 
  #http://www.doughellmann.com/PyMOTW/abc/
  class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper):
  def getColumnCount(self):
  return 6
  def getColumns(self,columns):
  (id, date, title, description, notes,link) = columns
  return (id, date, title, description, notes)
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper)
  print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper)
  ScraperImplementation().doScrape()
 
  import sys
  import os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
 
 
  class ScraperImplementation(genericScrapers.GenericHTMLDisclogScraper):
 
  def __init__(self):
  super(ScraperImplementation, self).__init__()
 
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(ScraperImplementation,
  genericScrapers.GenericHTMLDisclogScraper)
  print 'Instance:', isinstance(ScraperImplementation(),
  genericScrapers.GenericHTMLDisclogScraper)
  ScraperImplementation().doScrape()
 
  import sys,os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
  import scrape
  from bs4 import BeautifulSoup
 
  #http://www.doughellmann.com/PyMOTW/abc/
  class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper):
  #def getTable(self,soup):
  # return soup.find(id = "ctl00_PlaceHolderMain_intro2__ControlWrapper_CerRichHtmlField").table
  def getColumnCount(self):
  return 5
  def getColumns(self,columns):
  (id, date, title, description,notes) = columns
  return (id, date, title, description, notes)
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper)
  print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper)
  ScraperImplementation().doScrape()
 
import sys,os import sys,os
sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../')) sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
import genericScrapers import genericScrapers
import scrape import scrape
from bs4 import BeautifulSoup from bs4 import BeautifulSoup
   
#http://www.doughellmann.com/PyMOTW/abc/ #http://www.doughellmann.com/PyMOTW/abc/
class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper): class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper):
def getColumns(self,columns): def getColumns(self,columns):
(id, date, title, description, notes) = columns (id, date, title, description, notes) = columns
return (id, date, description, title, notes) return (id, date, title, description, notes)
   
if __name__ == '__main__': if __name__ == '__main__':
print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper) print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper)
print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper) print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper)
ScraperImplementation().doScrape() ScraperImplementation().doScrape()
   
import sys,os import sys,os
sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../')) sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
import genericScrapers import genericScrapers
import scrape import scrape
from bs4 import BeautifulSoup from bs4 import BeautifulSoup
   
#http://www.doughellmann.com/PyMOTW/abc/ #http://www.doughellmann.com/PyMOTW/abc/
class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper): class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper):
def getColumnCount(self): def getColumnCount(self):
return 5 return 5
def getColumns(self,columns): def getColumns(self,columns):
(id, date, title, description, notes) = columns (id, date, title, description, notes) = columns
return (id, date, description, title, notes) return (id, date, title, description, notes)
def getTable(self,soup): def getTable(self,soup):
return soup.find_all('table')[4] return soup.find_all('table')[4]
   
if __name__ == '__main__': if __name__ == '__main__':
print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper) print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper)
print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper) print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper)
ScraperImplementation().doScrape() ScraperImplementation().doScrape()
   
  import sys,os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
  import dateutil
  from dateutil.parser import *
  from datetime import *
  import scrape
  from bs4 import BeautifulSoup
  class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper):
 
  def __init__(self):
  super(ScraperImplementation, self).__init__()
 
  def getDescription(self,content, entry,doc):
  link = None
  links = []
  description = ""
  for atag in entry.find_all('a'):
  if atag.has_key('href'):
  link = scrape.fullurl(self.getURL(), atag['href'])
  (url, mime_type, htcontent) = scrape.fetchURL(scrape.docsdb, link, "foidocuments", self.getAgencyID(), False)
  if htcontent != None:
  if mime_type == "text/html" or mime_type == "application/xhtml+xml" or mime_type =="application/xml":
  soup = BeautifulSoup(htcontent)
  row = soup.find(id="content_div_148050")
  description = ''.join(row.stripped_strings)
  for atag in row.find_all("a"):
  if atag.has_key('href'):
  links.append(scrape.fullurl(link, atag['href']))
 
  if links != []:
  doc.update({'links': links})
  if description != "":
  doc.update({ 'description': description})
  def getColumnCount(self):
  return 4
 
  def getColumns(self, columns):
  (id, date, datepub, title) = columns
  return (id, date, title, title, None)
 
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper)
  print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper)
 
  nsi = ScraperImplementation()
  nsi.disclogURL = "http://www.dbcde.gov.au/about_us/freedom_of_information_disclosure_log/foi_list?result_146858_result_page=1"
  nsi.doScrape()
  nsi.disclogURL = "http://www.dbcde.gov.au/about_us/freedom_of_information_disclosure_log/foi_list?result_146858_result_page=2"
  nsi.doScrape()
  nsi.disclogURL = "http://www.dbcde.gov.au/about_us/freedom_of_information_disclosure_log/foi_list?result_146858_result_page=3"
  nsi.doScrape()
  nsi.disclogURL = "http://www.dbcde.gov.au/about_us/freedom_of_information_disclosure_log/foi_list?result_146858_result_page=4"
  nsi.doScrape()
  nsi.disclogURL = "http://www.dbcde.gov.au/about_us/freedom_of_information_disclosure_log/foi_list?result_146858_result_page=5"
  nsi.doScrape()
 
  import sys,os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
  import scrape
  from bs4 import BeautifulSoup
 
  #http://www.doughellmann.com/PyMOTW/abc/
  class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper):
  #def getTable(self,soup):
  # return soup.find(id = "cphMain_C001_Col01").table
  def getColumnCount(self):
  return 5
  def getColumns(self,columns):
  (id, date, title, description,notes) = columns
  return (id, date, title, description, notes)
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper)
  print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper)
  ScraperImplementation().doScrape()
 
import sys,os import sys,os
sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../')) sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
import genericScrapers import genericScrapers
import scrape import scrape
from bs4 import BeautifulSoup from bs4 import BeautifulSoup
   
#http://www.doughellmann.com/PyMOTW/abc/ #http://www.doughellmann.com/PyMOTW/abc/
class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper): class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper):
def getDescription(self,content, entry,doc): def getDescription(self,content, entry,doc):
link = None link = None
links = [] links = []
description = "" description = ""
for atag in entry.find_all('a'): for atag in entry.find_all('a'):
if atag.has_key('href'): if atag.has_key('href'):
link = scrape.fullurl(self.getURL(),atag['href']) link = scrape.fullurl(self.getURL(),atag['href'])
(url,mime_type,htcontent) = scrape.fetchURL(scrape.docsdb, link, "foidocuments", self.getAgencyID(), False) (url,mime_type,htcontent) = scrape.fetchURL(scrape.docsdb, link, "foidocuments", self.getAgencyID(), False)
if htcontent != None: if htcontent != None:
if mime_type == "text/html" or mime_type == "application/xhtml+xml" or mime_type =="application/xml": if mime_type == "text/html" or mime_type == "application/xhtml+xml" or mime_type =="application/xml":
# http://www.crummy.com/software/BeautifulSoup/documentation.html # http://www.crummy.com/software/BeautifulSoup/documentation.html
soup = BeautifulSoup(htcontent) soup = BeautifulSoup(htcontent)
for row in soup.find(class_ = "ms-rteTable-GreyAlternating").find_all('tr'): for row in soup.find(class_ = "ms-rteTable-GreyAlternating").find_all('tr'):
if row != None: if row != None:
rowtitle = row.find('th').string rowtitle = row.find('th').string
description = description + "\n" + rowtitle + ": " if rowtitle != None:
  description = description + "\n" + rowtitle + ": "
for text in row.find('td').stripped_strings: for text in row.find('td').stripped_strings:
description = description + text description = description + text
for atag in row.find_all("a"): for atag in row.find_all("a"):
if atag.has_key('href'): if atag.has_key('href'):
links.append(scrape.fullurl(link,atag['href'])) links.append(scrape.fullurl(link,atag['href']))
   
if links != []: if links != []:
doc.update({'links': links}) doc.update({'links': links})
if description != "": if description != "":
doc.update({ 'description': description}) doc.update({ 'description': description})
   
def getColumnCount(self): def getColumnCount(self):
return 2 return 2
def getTable(self,soup): def getTable(self,soup):
return soup.find(class_ = "ms-rteTable-GreyAlternating") return soup.find(class_ = "ms-rteTable-GreyAlternating")
def getColumns(self,columns): def getColumns(self,columns):
(date, title) = columns (date, title) = columns
return (title, date, title, title, None) return (title, date, title, title, None)
   
if __name__ == '__main__': if __name__ == '__main__':
print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper) print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper)
print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper) print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper)
ScraperImplementation().doScrape() ScraperImplementation().doScrape()
   
  import sys,os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
  import scrape
  from bs4 import BeautifulSoup
 
  #http://www.doughellmann.com/PyMOTW/abc/
  class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper):
  def getTable(self,soup):
  return soup.find(id = "inner_content")
  def getColumnCount(self):
  return 2
  def getColumns(self,columns):
  (date, title) = columns
  return (date, date, title, title, None)
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper)
  print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper)
  ScraperImplementation().doScrape()
 
  import sys,os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
  import scrape
  from bs4 import BeautifulSoup
 
  #http://www.doughellmann.com/PyMOTW/abc/
  class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper):
  #def getTable(self,soup):
  # return soup.find(id = "ctl00_PlaceHolderMain_intro2__ControlWrapper_CerRichHtmlField").table
  def getColumnCount(self):
  return 3
  def getColumns(self,columns):
  (id, title, date) = columns
  return (id, date, title, title, None)
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper)
  print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper)
  ScraperImplementation().doScrape()
 
  import sys
  import os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
 
 
  class ScraperImplementation(genericScrapers.GenericPDFDisclogScraper):
 
  def __init__(self):
  super(ScraperImplementation, self).__init__()
 
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(ScraperImplementation,
  genericScrapers.GenericPDFDisclogScraper)
  print 'Instance:', isinstance(ScraperImplementation(),
  genericScrapers.GenericPDFDisclogScraper)
  ScraperImplementation().doScrape()
 
  import sys,os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
  import scrape
  from bs4 import BeautifulSoup
  import dateutil
  from dateutil.parser import *
  from datetime import *
 
  #http://www.doughellmann.com/PyMOTW/abc/
  class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper):
  def getColumnCount(self):
  return 3
  def getColumns(self,columns):
  (date, title, description) = columns
  return (date, date, title, description, None)
  def getTitle(self, content, entry, doc):
  i = 0
  title = ""
  for string in content.stripped_strings:
  if i < 2:
  title = title + string
  i = i+1
  doc.update({'title': title})
  print title
  return
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper)
  print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper)
  ScraperImplementation().doScrape()
 
  import sys,os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
  import scrape
  from bs4 import BeautifulSoup
 
  #http://www.doughellmann.com/PyMOTW/abc/
  class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper):
  def getColumnCount(self):
  return 7
  def getColumns(self,columns):
  (id, date, title, description, link, deldate,notes) = columns
  return (id, date, title, description, notes)
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper)
  print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper)
  ScraperImplementation().doScrape()
 
import sys,os import sys,os
sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../')) sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
import genericScrapers import genericScrapers
#RSS feed not detailed #RSS feed not detailed
   
#http://www.doughellmann.com/PyMOTW/abc/ #http://www.doughellmann.com/PyMOTW/abc/
class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper): class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper):
def getColumns(self,columns): def getColumns(self,columns):
(id, date, description, title, notes) = columns (id, date, description, title, notes) = columns
return (id, date, description, title, notes) return (id, date, title, description, notes)
   
if __name__ == '__main__': if __name__ == '__main__':
print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper) print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper)
print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper) print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper)
ScraperImplementation().doScrape() ScraperImplementation().doScrape()
   
  import sys,os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
  import scrape
  from bs4 import BeautifulSoup
  import dateutil
  from dateutil.parser import *
  from datetime import *
 
  #http://www.doughellmann.com/PyMOTW/abc/
  class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper):
  def getTable(self,soup):
  return soup.find(class_ = "inner-column").table
  def getRows(self,table):
  return table.tbody.find_all('tr',recursive=False)
  def getColumnCount(self):
  return 3
  def getColumns(self,columns):
  (date, title, description) = columns
  return (date, date, title, description, None)
  def getDate(self, content, entry, doc):
  i = 0
  date = ""
  for string in content.stripped_strings:
  if i ==1:
  date = string
  i = i+1
  edate = parse(date, dayfirst=True, fuzzy=True).strftime("%Y-%m-%d")
  print edate
  doc.update({'date': edate})
  return
  def getTitle(self, content, entry, doc):
  i = 0
  title = ""
  for string in content.stripped_strings:
  if i < 2:
  title = title + string
  i = i+1
  doc.update({'title': title})
  #print title
  return
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper)
  print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper)
  ScraperImplementation().doScrape()
 
  import sys
  import os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
 
 
  class ScraperImplementation(genericScrapers.GenericHTMLDisclogScraper):
 
  def __init__(self):
  super(ScraperImplementation, self).__init__()
 
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(ScraperImplementation,
  genericScrapers.GenericHTMLDisclogScraper)
  print 'Instance:', isinstance(ScraperImplementation(),
  genericScrapers.GenericHTMLDisclogScraper)
  ScraperImplementation().doScrape()
 
  import sys,os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
  import scrape
  from bs4 import BeautifulSoup
  from datetime import date
 
  #http://www.doughellmann.com/PyMOTW/abc/
  class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper):
  def getTable(self,soup):
  return soup.find(id= "ctl00_MSO_ContentDiv").table
 
  def getColumns(self,columns):
  (id, title, description, notes) = columns
  return (id, title, title, description, notes)
  def getDate(self, content, entry, doc):
  edate = date.today().strftime("%Y-%m-%d")
  doc.update({'date': edate})
  return
  def getColumnCount(self):
  return 4
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper)
  print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper)
  ScraperImplementation().doScrape()
 
  import sys,os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
  import scrape
  from bs4 import BeautifulSoup
  import dateutil
  from dateutil.parser import *
  from datetime import *
 
  #http://www.doughellmann.com/PyMOTW/abc/
  class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper):
  def getColumnCount(self):
  return 5
  def getColumns(self,columns):
  (id, date, title, description, notes) = columns
  return (id, date, title, description, notes)
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper)
  print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper)
  si = ScraperImplementation()
  si.doScrape()
 
  import sys
  import os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
 
 
  class ScraperImplementation(genericScrapers.GenericHTMLDisclogScraper):
 
  def __init__(self):
  super(ScraperImplementation, self).__init__()
 
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(ScraperImplementation,
  genericScrapers.GenericHTMLDisclogScraper)
  print 'Instance:', isinstance(ScraperImplementation(),
  genericScrapers.GenericHTMLDisclogScraper)
  ScraperImplementation().doScrape()
 
  import sys
  import os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
 
 
  class ScraperImplementation(genericScrapers.GenericHTMLDisclogScraper):
 
  def __init__(self):
  super(ScraperImplementation, self).__init__()
 
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(ScraperImplementation,
  genericScrapers.GenericHTMLDisclogScraper)
  print 'Instance:', isinstance(ScraperImplementation(),
  genericScrapers.GenericHTMLDisclogScraper)
  ScraperImplementation().doScrape()
 
  import sys,os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
  import scrape
  from bs4 import BeautifulSoup
 
  #http://www.doughellmann.com/PyMOTW/abc/
  class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper):
  #def getTable(self,soup):
  # return soup.find(id = "ctl00_PlaceHolderMain_intro2__ControlWrapper_CerRichHtmlField").table
  def getColumnCount(self):
  return 5
  def getColumns(self,columns):
  (id, date, title, description,notes) = columns
  return (id, date, title, description, notes)
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper)
  print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper)
  ScraperImplementation().doScrape()
 
import sys,os import sys,os
sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../')) sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
import genericScrapers import genericScrapers
import scrape import scrape
from bs4 import BeautifulSoup from bs4 import BeautifulSoup
   
#http://www.doughellmann.com/PyMOTW/abc/ #http://www.doughellmann.com/PyMOTW/abc/
class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper): class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper):
def getTable(self,soup): def getTable(self,soup):
return soup.find(class_ = "ms-rtestate-field").table return soup.find(class_ = "ms-rtestate-field").table
def getColumns(self,columns): def getColumns(self,columns):
(id, date, title, description, notes) = columns (id, date, title, description, notes) = columns
return (id, date, description, title, notes) return (id, date, title, description, notes)
   
def getLinks(self, content, entry, doc): def getLinks(self, content, entry, doc):
link = None link = None
links = [] links = []
for atag in entry.find_all('a'): for atag in entry.find_all('a'):
if atag.has_key('href'): if atag.has_key('href'):
link = scrape.fullurl(self.getURL(),atag['href']) link = scrape.fullurl(self.getURL(),atag['href'])
(url,mime_type,htcontent) = scrape.fetchURL(scrape.docsdb, link, "foidocuments", self.getAgencyID(), False) (url,mime_type,htcontent) = scrape.fetchURL(scrape.docsdb, link, "foidocuments", self.getAgencyID(), False)
if htcontent != None: if htcontent != None:
if mime_type == "text/html" or mime_type == "application/xhtml+xml" or mime_type =="application/xml": if mime_type == "text/html" or mime_type == "application/xhtml+xml" or mime_type =="application/xml":
# http://www.crummy.com/software/BeautifulSoup/documentation.html # http://www.crummy.com/software/BeautifulSoup/documentation.html
soup = BeautifulSoup(htcontent) soup = BeautifulSoup(htcontent)
for atag in soup.find(class_ = "article-content").find_all('a'): for atag in soup.find(class_ = "article-content").find_all('a'):
if atag.has_key('href'): if atag.has_key('href'):
links.append(scrape.fullurl(link,atag['href'])) links.append(scrape.fullurl(link,atag['href']))
   
if links != []: if links != []:
doc.update({'links': links}) doc.update({'links': links})
doc.update({'url': link}) doc.update({'url': link})
return return
   
if __name__ == '__main__': if __name__ == '__main__':
print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper) print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper)
print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper) print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper)
ScraperImplementation().doScrape() ScraperImplementation().doScrape()
   
  import sys,os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
  import scrape
  from bs4 import BeautifulSoup
 
  #http://www.doughellmann.com/PyMOTW/abc/
  class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper):
  #def getTable(self,soup):
  # return soup.find(id = "ctl00_PlaceHolderMain_intro2__ControlWrapper_CerRichHtmlField").table
  def getColumnCount(self):
  return 4
  def getColumns(self,columns):
  (id, date, title, description) = columns
  return (id, date, title, description, None)
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper)
  print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper)
  ScraperImplementation().doScrape()
 
  import sys,os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
  import scrape
  from bs4 import BeautifulSoup
 
  #http://www.doughellmann.com/PyMOTW/abc/
  class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper):
  #def getTable(self,soup):
  # return soup.find(id = "ctl00_PlaceHolderMain_intro2__ControlWrapper_CerRichHtmlField").table
  def getColumnCount(self):
  return 4
  def getColumns(self,columns):
  (id, date, title, description) = columns
  return (id, date, title, description, None)
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper)
  print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper)
  ScraperImplementation().doScrape()
 
  import sys,os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
  import scrape
  from bs4 import BeautifulSoup
 
  #http://www.doughellmann.com/PyMOTW/abc/
  class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper):
  def getColumnCount(self):
  return 4
  def getColumns(self,columns):
  (date, id, title, description) = columns
  return (id, date, title, description, None)
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper)
  print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper)
  ScraperImplementation().doScrape()
 
  import sys,os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
  import scrape
  from bs4 import BeautifulSoup
 
  #http://www.doughellmann.com/PyMOTW/abc/
  class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper):
  def getTable(self,soup):
  return soup.find(id = "ctl00_PlaceHolderMain_intro2__ControlWrapper_CerRichHtmlField").table
  def getColumnCount(self):
  return 5
  def getColumns(self,columns):
  (id, date, title, description,notes) = columns
  return (id, date, title, description, notes)
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper)
  print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper)
  ScraperImplementation().doScrape()
 
  import sys,os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
  import scrape
  from bs4 import BeautifulSoup
 
  #http://www.doughellmann.com/PyMOTW/abc/
  class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper):
  #def getTable(self,soup):
  # return soup.find(id = "ctl00_PlaceHolderMain_intro2__ControlWrapper_CerRichHtmlField").table
  def getColumnCount(self):
  return 4
  def getColumns(self,columns):
  (date, title, description,notes) = columns
  return (title, date, title, description, notes)
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper)
  print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper)
  ScraperImplementation().doScrape()
 
  import sys
  import os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
 
 
  class ScraperImplementation(genericScrapers.GenericHTMLDisclogScraper):
 
  def __init__(self):
  super(ScraperImplementation, self).__init__()
 
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(ScraperImplementation,
  genericScrapers.GenericHTMLDisclogScraper)
  print 'Instance:', isinstance(ScraperImplementation(),
  genericScrapers.GenericHTMLDisclogScraper)
  ScraperImplementation().doScrape()
 
  import sys,os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
  import scrape
  from bs4 import BeautifulSoup
  import dateutil
  from dateutil.parser import *
  from datetime import *
 
  #http://www.doughellmann.com/PyMOTW/abc/
  class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper):
  def getColumnCount(self):
  return 5
  def getColumns(self,columns):
  (id, date, title, description, notes) = columns
  return (id, date, title, description, notes)
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper)
  print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper)
  si = ScraperImplementation()
  si.doScrape()
  si.disclogURL = "http://www.fahcsia.gov.au/disclosure-log-2011-12-financial-year"
  si.doScrape()
  si.disclogURL = "http://www.fahcsia.gov.au/disclosure-log-2010-11-financial-year"
  si.doScrape()
 
 
  import sys,os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
  import scrape
  from bs4 import BeautifulSoup
 
  #http://www.doughellmann.com/PyMOTW/abc/
  class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper):
  def getTable(self,soup):
  return soup.find(id="node-30609")
  def getColumnCount(self):
  return 5
  def getColumns(self,columns):
  (id, date, title, description,notes) = columns
  return (id, date, title, description, notes)
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper)
  print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper)
  ScraperImplementation().doScrape()
 
  import sys,os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
  import scrape
  from bs4 import BeautifulSoup
 
  #http://www.doughellmann.com/PyMOTW/abc/
  class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper):
  #def getTable(self,soup):
  # return soup.find(id = "ctl00_PlaceHolderMain_intro2__ControlWrapper_CerRichHtmlField").table
  def getColumnCount(self):
  return 3
  def getColumns(self,columns):
  (id, date, description) = columns
  return (id, date, description, description, None)
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper)
  print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper)
  ScraperImplementation().doScrape()
 
  import sys,os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
  import scrape
  from bs4 import BeautifulSoup
 
  #http://www.doughellmann.com/PyMOTW/abc/
  class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper):
  def getTable(self,soup):
  return soup.find(id = "centercontent").table
  def getColumnCount(self):
  return 5
  def getColumns(self,columns):
  (id, date, title, description,notes) = columns
  return (id, date, title, description, notes)
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper)
  print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper)
  ScraperImplementation().doScrape()
 
  import sys,os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
  import scrape
  from bs4 import BeautifulSoup
 
  #http://www.doughellmann.com/PyMOTW/abc/
  class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper):
  #def getTable(self,soup):
  # return soup.find(id = "ctl00_PlaceHolderMain_intro2__ControlWrapper_CerRichHtmlField").table
  def getColumnCount(self):
  return 5
  def getColumns(self,columns):
  (id, date, title, description,notes) = columns
  return (id, date, title, description, notes)
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper)
  print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper)
  ScraperImplementation().doScrape()
 
  import sys
  import os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
 
 
  class ScraperImplementation(genericScrapers.GenericPDFDisclogScraper):
 
  def __init__(self):
  super(ScraperImplementation, self).__init__()
 
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(ScraperImplementation,
  genericScrapers.GenericOAICDisclogScraper)
  print 'Instance:', isinstance(ScraperImplementation(),
  genericScrapers.GenericOAICDisclogScraper)
  ScraperImplementation().doScrape()
 
  import sys,os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
  import scrape
  from bs4 import BeautifulSoup
  import dateutil
  from dateutil.parser import *
  from datetime import *
 
  #http://www.doughellmann.com/PyMOTW/abc/
  class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper):
  def getColumnCount(self):
  return 5
  def getColumns(self,columns):
  (id, date, title, description, notes) = columns
  return (id, date, title, description, notes)
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper)
  print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper)
  si = ScraperImplementation()
  si.doScrape()
 
  import sys,os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
  import scrape
  from bs4 import BeautifulSoup
 
  #http://www.doughellmann.com/PyMOTW/abc/
  class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper):
  def getTable(self,soup):
  return soup.find(id = "content_div_50269").table
  def getColumns(self,columns):
  (id, date, title, description, notes) = columns
  return (id, date, title, description, notes)
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper)
  print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper)
  ScraperImplementation().doScrape()
 
import sys,os  
sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))  
import genericScrapers  
import scrape  
from bs4 import BeautifulSoup  
 
#http://www.doughellmann.com/PyMOTW/abc/  
class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper):  
def getTable(self,soup):  
return soup.find(id = "content_div_50269").table  
def getColumns(self,columns):  
(id, date, title, description, notes) = columns  
return (id, date, title, description, notes)  
 
if __name__ == '__main__':  
print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper)  
print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper)  
ScraperImplementation().doScrape()  
 
import sys,os import sys,os
sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../')) sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
import genericScrapers import genericScrapers
import scrape import scrape
from bs4 import BeautifulSoup from bs4 import BeautifulSoup
   
#http://www.doughellmann.com/PyMOTW/abc/ #http://www.doughellmann.com/PyMOTW/abc/
class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper): class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper):
def getColumns(self,columns): def getColumns(self,columns):
(id, date, title, description, notes) = columns (id, date, title, description, notes) = columns
return (id, date, description, title, notes) return (id, date, title, description, notes)
   
if __name__ == '__main__': if __name__ == '__main__':
print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper) print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper)
print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper) print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper)
ScraperImplementation().doScrape() ScraperImplementation().doScrape()
   
  weird div based log with tables of links
 
  import sys,os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
  import scrape
  from bs4 import BeautifulSoup
 
  #http://www.doughellmann.com/PyMOTW/abc/
  class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper):
  def getTable(self,soup):
  return soup.find(id = "content-middle").table
  def getColumnCount(self):
  return 5
  def getColumns(self,columns):
  (id, date, title, description,notes) = columns
  return (id, date, title, description, notes)
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper)
  print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper)
  ScraperImplementation().doScrape()
 
  import sys,os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
  import scrape
  from bs4 import BeautifulSoup
 
  #http://www.doughellmann.com/PyMOTW/abc/
  class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper):
  #def getTable(self,soup):
  # return soup.find(id = "ctl00_PlaceHolderMain_intro2__ControlWrapper_CerRichHtmlField").table
  def getColumnCount(self):
  return 5
  def getColumns(self,columns):
  (id, date, title, description,notes) = columns
  return (id, date, title, description, notes)
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper)
  print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper)
  ScraperImplementation().doScrape()
 
  import sys,os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
  import scrape
  from bs4 import BeautifulSoup
 
  #http://www.doughellmann.com/PyMOTW/abc/
  class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper):
  def getTable(self,soup):
  return soup.find("table",width="571")
  #findAll("table")[3]
  def getColumnCount(self):
  return 7
  def getColumns(self,columns):
  (id, date, title, description,link,deldate,notes) = columns
  return (id, date, title, description, notes)
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper)
  print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper)
  ScraperImplementation().doScrape()
 
  import sys,os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
  import scrape
  from bs4 import BeautifulSoup
 
  #http://www.doughellmann.com/PyMOTW/abc/
  class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper):
  def getTable(self,soup):
  return soup.find(id = "cphMain_C001_Col01").table
  def getColumnCount(self):
  return 5
  def getColumns(self,columns):
  (id, date, title, description,notes) = columns
  return (id, date, title, description, notes)
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper)
  print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper)
  ScraperImplementation().doScrape()
 
import sys,os import sys,os
sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../')) sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
import genericScrapers import genericScrapers
import scrape import scrape
from bs4 import BeautifulSoup from bs4 import BeautifulSoup
   
#http://www.doughellmann.com/PyMOTW/abc/ #http://www.doughellmann.com/PyMOTW/abc/
class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper): class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper):
def getColumnCount(self): def getColumnCount(self):
return 7 return 7
def getColumns(self,columns): def getColumns(self,columns):
(id, date, title, description, notes, deletedate, otherinfo) = columns (id, date, title, description, notes, deletedate, otherinfo) = columns
return (id, date, description, title, notes) return (id, date, title, description, notes)
#def getTable(self,soup): #def getTable(self,soup):
# return soup.find(class_ = "box").table # return soup.find(class_ = "box").table
   
if __name__ == '__main__': if __name__ == '__main__':
print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper) print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper)
print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper) print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper)
ScraperImplementation().doScrape() ScraperImplementation().doScrape()
   
  import sys
  import os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
 
 
  class ScraperImplementation(genericScrapers.GenericHTMLDisclogScraper):
 
  def __init__(self):
  super(ScraperImplementation, self).__init__()
 
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(ScraperImplementation,
  genericScrapers.GenericHTMLDisclogScraper)
  print 'Instance:', isinstance(ScraperImplementation(),
  genericScrapers.GenericHTMLDisclogScraper)
  ScraperImplementation().doScrape()
 
  import sys
  import os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
 
 
  class ScraperImplementation(genericScrapers.GenericHTMLDisclogScraper):
 
  def __init__(self):
  super(ScraperImplementation, self).__init__()
 
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(ScraperImplementation,
  genericScrapers.GenericHTMLDisclogScraper)
  print 'Instance:', isinstance(ScraperImplementation(),
  genericScrapers.GenericHTMLDisclogScraper)
  ScraperImplementation().doScrape()
 
  import sys
  import os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
  import scrape
  from datetime import date
  from pyquery import PyQuery as pq
  from lxml import etree
  import urllib
  import dateutil
  from dateutil.parser import *
 
  class ACMADisclogScraper(genericScrapers.GenericDisclogScraper):
 
  def doScrape(self):
  foidocsdb = scrape.couch['disclosr-foidocuments']
  (url, mime_type, content) = scrape.fetchURL(scrape.docsdb,
  self.getURL(), "foidocuments", self.getAgencyID())
 
  d = pq(content)
  d.make_links_absolute(base_url = self.getURL())
  for table in d('table').items():
  title= table('thead').text()
  print title
  (idate,descA,descB,link,deldate,notes) = table('tbody tr').map(lambda i, e: pq(e).children().eq(1).text())
  links = table('a').map(lambda i, e: pq(e).attr('href'))
  description = descA+" "+descB
  edate = parse(idate[:12], dayfirst=True, fuzzy=True).strftime("%Y-%m-%d")
  print edate
  dochash = scrape.mkhash(self.remove_control_chars(title))
  doc = foidocsdb.get(dochash)
  if doc is None:
  print "saving " + dochash
  edate = date.today().strftime("%Y-%m-%d")
  doc = {'_id': dochash, 'agencyID': self.getAgencyID()
  , 'url': self.getURL(), 'docID': dochash,
  "links": links,
  "date": edate, "notes": notes, "title": title, "description": description}
  #print doc
  foidocsdb.save(doc)
  else:
  print "already saved"
 
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(ACMADisclogScraper,
  genericScrapers.GenericDisclogScraper)
  print 'Instance:', isinstance(ACMADisclogScraper(),
  genericScrapers.GenericDisclogScraper)
  ACMADisclogScraper().doScrape()
 
  import sys,os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
  import scrape
  from bs4 import BeautifulSoup
 
  #http://www.doughellmann.com/PyMOTW/abc/
  class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper):
  #def getTable(self,soup):
  # return soup.find(id = "ctl00_PlaceHolderMain_intro2__ControlWrapper_CerRichHtmlField").table
  def getColumnCount(self):
  return 3
  def getColumns(self,columns):
  (date, title, description) = columns
  return (date, date, title, description, None)
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper)
  print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper)
  ScraperImplementation().doScrape()
 
  import sys,os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
  import scrape
  from bs4 import BeautifulSoup
 
  #http://www.doughellmann.com/PyMOTW/abc/
  class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper):
  #def getTable(self,soup):
  # return soup.find(id = "ctl00_PlaceHolderMain_intro2__ControlWrapper_CerRichHtmlField").table
  def getTitle(self, content, entry, doc):
  doc.update({'title': content.stripped_strings.next()})
  return
  def getColumnCount(self):
  return 3
  def getColumns(self,columns):
  (date, id, description) = columns
  return (id, date, description, description, None)
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper)
  print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper)
  ScraperImplementation().doScrape()
 
  import sys
  import os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
 
 
  class ScraperImplementation(genericScrapers.GenericPDFDisclogScraper):
 
  def __init__(self):
  super(ScraperImplementation, self).__init__()
 
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(ScraperImplementation,
  genericScrapers.GenericOAICDisclogScraper)
  print 'Instance:', isinstance(ScraperImplementation(),
  genericScrapers.GenericOAICDisclogScraper)
  ScraperImplementation().doScrape()
 
  import sys,os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
  import dateutil
  from dateutil.parser import *
  from datetime import *
 
 
  class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper):
 
  def __init__(self):
  super(ScraperImplementation, self).__init__()
 
  def getColumnCount(self):
  return 6
 
  def getColumns(self, columns):
  (id, date, title, description, datepub, notes) = columns
  return (id, date, title, description, notes)
 
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper)
  print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper)
 
  nsi = ScraperImplementation()
  nsi.disclogURL = "http://www.dpmc.gov.au/foi/ips/disclosure_logs/pmo/2011-12.cfm"
  nsi.doScrape()
  nsi.disclogURL = "http://www.dpmc.gov.au/foi/ips/disclosure_logs/dpmc/2011-12.cfm"
  nsi.doScrape()
  nsi.disclogURL = "http://www.dpmc.gov.au/foi/ips/disclosure_logs/dpmc/2012-13.cfm"
  nsi.doScrape()
  nsi.disclogURL = "http://www.dpmc.gov.au/foi/ips/disclosure_logs/omsi/2011-12.cfm"
  nsi.doScrape()
  nsi.disclogURL = "http://www.dpmc.gov.au/foi/ips/disclosure_logs/omps/2012-13.cfm"
  nsi.doScrape()
 
  import sys,os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
  import scrape
  from bs4 import BeautifulSoup
 
  #http://www.doughellmann.com/PyMOTW/abc/
  class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper):
  #def getTable(self,soup):
  # return soup.find(id = "ctl00_PlaceHolderMain_intro2__ControlWrapper_CerRichHtmlField").table
  def getColumnCount(self):
  return 5
  def getColumns(self,columns):
  (id, date, title, description,notes) = columns
  return (id, date, title, description, notes)
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper)
  print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper)
  ScraperImplementation().doScrape()
 
import sys,os import sys,os
sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../')) sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
import genericScrapers import genericScrapers
#RSS feed not detailed #RSS feed not detailed
   
#http://www.doughellmann.com/PyMOTW/abc/ #http://www.doughellmann.com/PyMOTW/abc/
class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper): class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper):
def getColumns(self,columns): def getColumns(self,columns):
(id, date, title, description, notes) = columns (id, date, title, description, notes) = columns
return (id, date, description, title, notes) return (id, date, title, description, notes)
   
if __name__ == '__main__': if __name__ == '__main__':
print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper) print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper)
print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper) print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper)
ScraperImplementation().doScrape() ScraperImplementation().doScrape()
   
   
  import sys,os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
  import scrape
  from bs4 import BeautifulSoup
  import codecs
  #http://www.doughellmann.com/PyMOTW/abc/
  class NewScraperImplementation(genericScrapers.GenericOAICDisclogScraper):
  def getDescription(self,content, entry,doc):
  link = None
  links = []
  description = ""
  for atag in entry.find_all('a'):
  if atag.has_key('href'):
  link = scrape.fullurl(self.getURL(),atag['href'])
  (url,mime_type,htcontent) = scrape.fetchURL(scrape.docsdb, link, "foidocuments", self.getAgencyID(), False)
  if htcontent != None:
  if mime_type == "text/html" or mime_type == "application/xhtml+xml" or mime_type =="application/xml":
  # http://www.crummy.com/software/BeautifulSoup/documentation.html
  soup = BeautifulSoup(htcontent)
  for text in soup.find(id="divFullWidthColumn").stripped_strings:
  description = description + text.encode('ascii', 'ignore')
 
  for atag in soup.find(id="divFullWidthColumn").find_all("a"):
  if atag.has_key('href'):
  links.append(scrape.fullurl(link,atag['href']))
 
  if links != []:
  doc.update({'links': links})
  if description != "":
  doc.update({ 'description': description})
 
  def getColumnCount(self):
  return 2
  def getTable(self,soup):
  return soup.find(id = "TwoColumnSorting")
  def getColumns(self,columns):
  ( title, date) = columns
  return (title, date, title, title, None)
  class OldScraperImplementation(genericScrapers.GenericOAICDisclogScraper):
  def getDescription(self,content, entry,doc):
  link = None
  links = []
  description = ""
  for atag in entry.find_all('a'):
  if atag.has_key('href'):
  link = scrape.fullurl(self.getURL(),atag['href'])
  (url,mime_type,htcontent) = scrape.fetchURL(scrape.docsdb, link, "foidocuments", self.getAgencyID(), False)
  if htcontent != None:
  if mime_type == "text/html" or mime_type == "application/xhtml+xml" or mime_type =="application/xml":
  # http://www.crummy.com/software/BeautifulSoup/documentation.html
  soup = BeautifulSoup(htcontent)
  for text in soup.find(id="content-item").stripped_strings:
  description = description + text + " \n"
  for atag in soup.find(id="content-item").find_all("a"):
  if atag.has_key('href'):
  links.append(scrape.fullurl(link,atag['href']))
  if links != []:
  doc.update({'links': links})
  if description != "":
  doc.update({ 'description': description})
 
  if links != []:
  doc.update({'links': links})
  if description != "":
  doc.update({ 'description': description})
 
  def getColumnCount(self):
  return 2
  def getTable(self,soup):
  return soup.find(class_ = "doc-list")
  def getColumns(self,columns):
  (date, title) = columns
  return (title, date, title, title, None)
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(NewScraperImplementation, genericScrapers.GenericOAICDisclogScraper)
  print 'Instance:', isinstance(NewScraperImplementation(), genericScrapers.GenericOAICDisclogScraper)
  NewScraperImplementation().doScrape()
  print 'Subclass:', issubclass(OldScraperImplementation, genericScrapers.GenericOAICDisclogScraper)
  print 'Instance:', isinstance(OldScraperImplementation(), genericScrapers.GenericOAICDisclogScraper)
  osi = OldScraperImplementation()
  osi.disclogURL = "http://archive.treasury.gov.au/content/foi_publications.asp?year=-1&abstract=0&classification=&=&titl=Disclosure+Log+-+Documents+Released+Under+FOI"
  osi.doScrape()
 
import sys,os import sys,os
sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../')) sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
import genericScrapers import genericScrapers
import scrape import scrape
from bs4 import BeautifulSoup from bs4 import BeautifulSoup
   
#http://www.doughellmann.com/PyMOTW/abc/ #http://www.doughellmann.com/PyMOTW/abc/
class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper): class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper):
def getColumnCount(self): def getColumnCount(self):
return 4; return 4;
def getTable(self,soup): def getTable(self,soup):
return soup.find(class_ = "content").table return soup.find(class_ = "content").table
def getColumns(self,columns): def getColumns(self,columns):
(id, date, title, description) = columns (id, date, title, description) = columns
return (id, date, description, title, None) return (id, date, title, description, None)
   
if __name__ == '__main__': if __name__ == '__main__':
print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper) print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper)
print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper) print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper)
ScraperImplementation().doScrape() ScraperImplementation().doScrape()
   
  import sys,os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
  import scrape
  from bs4 import BeautifulSoup
  import dateutil
  from dateutil.parser import *
  from datetime import *
 
  #http://www.doughellmann.com/PyMOTW/abc/
  class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper):
  def getColumnCount(self):
  return 5
  def getColumns(self,columns):
  (id, date, title, description, notes) = columns
  return (id, date, title, description, notes)
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper)
  print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper)
  si = ScraperImplementation()
  si.doScrape()
 
  import sys,os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
  import scrape
  from bs4 import BeautifulSoup
 
  #http://www.doughellmann.com/PyMOTW/abc/
  class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper):
  #def getTable(self,soup):
  # return soup.find(id = "ctl00_PlaceHolderMain_intro2__ControlWrapper_CerRichHtmlField").table
  def getColumnCount(self):
  return 4
  def getColumns(self,columns):
  (id, date, title, description) = columns
  return (id, date, title, description, None)
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper)
  print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper)
  ScraperImplementation().doScrape()
 
  import sys,os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
  import scrape
  from bs4 import BeautifulSoup
 
  #http://www.doughellmann.com/PyMOTW/abc/
  class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper):
  #def getTable(self,soup):
  # return soup.find(id = "ctl00_PlaceHolderMain_intro2__ControlWrapper_CerRichHtmlField").table
  def getColumnCount(self):
  return 4
  def getColumns(self,columns):
  (id, date,logdate, description) = columns
  return (id, date, description, description, None)
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper)
  print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper)
  ScraperImplementation().doScrape()
 
  import sys,os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
  import scrape
  from bs4 import BeautifulSoup
 
  #http://www.doughellmann.com/PyMOTW/abc/
  class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper):
  #def getTable(self,soup):
  # return soup.find(id = "ctl00_PlaceHolderMain_intro2__ControlWrapper_CerRichHtmlField").table
  def getColumnCount(self):
  return 5
  def getColumns(self,columns):
  (id, date, title, description,notes) = columns
  return (id, date, title, description, notes)
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper)
  print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper)
  ScraperImplementation().doScrape()
 
  import sys
  import os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
 
 
  class ScraperImplementation(genericScrapers.GenericHTMLDisclogScraper):
 
  def __init__(self):
  super(ScraperImplementation, self).__init__()
 
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(ScraperImplementation,
  genericScrapers.GenericHTMLDisclogScraper)
  print 'Instance:', isinstance(ScraperImplementation(),
  genericScrapers.GenericHTMLDisclogScraper)
  ScraperImplementation().doScrape()
 
  import sys,os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
  import scrape
  from bs4 import BeautifulSoup
 
  #http://www.doughellmann.com/PyMOTW/abc/
  class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper):
  #def getTable(self,soup):
  # return soup.find(id = "ctl00_PlaceHolderMain_intro2__ControlWrapper_CerRichHtmlField").table
  def getColumnCount(self):
  return 5
  def getColumns(self,columns):
  (id, date, title, description,notes) = columns
  return (id, date, title, description, notes)
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper)
  print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper)
  ScraperImplementation().doScrape()
 
  import sys,os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
  import scrape
  from bs4 import BeautifulSoup
 
  #http://www.doughellmann.com/PyMOTW/abc/
  class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper):
  #def getTable(self,soup):
  # return soup.find(id = "ctl00_PlaceHolderMain_intro2__ControlWrapper_CerRichHtmlField").table
  def getColumnCount(self):
  return 3
  def getColumns(self,columns):
  (date, title, description) = columns
  return (date, date, title, description, None)
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper)
  print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper)
  ScraperImplementation().doScrape()
 
  import sys,os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
  import scrape
  from bs4 import BeautifulSoup
 
  #http://www.doughellmann.com/PyMOTW/abc/
  class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper):
  def getTable(self,soup):
  return soup.find(id="ctl00_ContentPlaceHolderMainNoAjax_EdtrTD1494_2").table
  def getColumnCount(self):
  return 4
  def getColumns(self,columns):
  (blank,id, title,date) = columns
  return (id, date, title, title, None)
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper)
  print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper)
  ScraperImplementation().doScrape()
 
  import sys,os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
  import scrape
  from bs4 import BeautifulSoup
 
  #http://www.doughellmann.com/PyMOTW/abc/
  class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper):
  def getTable(self,soup):
  return soup.find(id = "_ctl0__ctl0_MainContentPlaceHolder_MainContentPlaceHolder_ContentSpan").findAll("table")[3]
  def getColumnCount(self):
  return 5
  def getColumns(self,columns):
  (id, date, title, description,notes) = columns
  return (id, date, title, description, notes)
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper)
  print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper)
  ScraperImplementation().doScrape()
 
  import sys,os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
  import dateutil
  from dateutil.parser import *
  from datetime import *
 
 
  class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper):
 
  def __init__(self):
  super(ScraperImplementation, self).__init__()
 
  def getColumnCount(self):
  return 2
 
  def getColumns(self, columns):
  (date, title) = columns
  return (title, date, title, title, None)
 
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper)
  print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper)
 
  nsi = ScraperImplementation()
  nsi.disclogURL = "http://www.immi.gov.au/about/foi/foi-disclosures-2012.htm"
  nsi.doScrape()
  nsi.disclogURL = "http://www.immi.gov.au/about/foi/foi-disclosures-2011.htm"
  nsi.doScrape()
  nsi.disclogURL = "http://www.immi.gov.au/about/foi/foi-disclosures-2010.htm"
  nsi.doScrape()
  nsi.disclogURL = "http://www.immi.gov.au/about/foi/foi-disclosures-2009.htm"
  nsi.doScrape()
 
  import sys,os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
  import scrape
  from bs4 import BeautifulSoup
 
  #http://www.doughellmann.com/PyMOTW/abc/
  class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper):
  #def getTable(self,soup):
  # return soup.find(id = "ctl00_PlaceHolderMain_intro2__ControlWrapper_CerRichHtmlField").table
  def getColumnCount(self):
  return 5
  def getColumns(self,columns):
  (id, date, title, description,notes) = columns
  return (id, date, title, description, notes)
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper)
  print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper)
  ScraperImplementation().doScrape()
 
  import sys,os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
  import scrape
  from bs4 import BeautifulSoup
 
  #http://www.doughellmann.com/PyMOTW/abc/
  class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper):
  def getColumnCount(self):
  return 6
  def getColumns(self,columns):
  (id, date, title, description,link,notes) = columns
  return (id, date, title, description, notes)
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper)
  print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper)
  ScraperImplementation().doScrape()
 
  import sys,os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
  import scrape
  from bs4 import BeautifulSoup
 
  #http://www.doughellmann.com/PyMOTW/abc/
  class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper):
  def getTable(self,soup):
  return soup.find(id = "ctl00_PlaceHolderMain_Content__ControlWrapper_RichHtmlField").table
  def getColumnCount(self):
  return 5
  def getColumns(self,columns):
  (id, date, title, description,notes) = columns
  return (id, date, title, description, notes)
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper)
  print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper)
  ScraperImplementation().doScrape()
 
  import sys,os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
  import scrape
  from bs4 import BeautifulSoup
 
  #http://www.doughellmann.com/PyMOTW/abc/
  class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper):
  #def getTable(self,soup):
  # return soup.find(id = "ctl00_PlaceHolderMain_intro2__ControlWrapper_CerRichHtmlField").table
  def getColumnCount(self):
  return 5
  def getColumns(self,columns):
  (id, date, title, description,notes) = columns
  return (id, date, title, description, notes)
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper)
  print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper)
  ScraperImplementation().doScrape()
 
  import sys
  import os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
 
 
  class ScraperImplementation(genericScrapers.GenericHTMLDisclogScraper):
 
  def __init__(self):
  super(ScraperImplementation, self).__init__()
 
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(ScraperImplementation,
  genericScrapers.GenericHTMLDisclogScraper)
  print 'Instance:', isinstance(ScraperImplementation(),
  genericScrapers.GenericHTMLDisclogScraper)
  ScraperImplementation().doScrape()
 
# does not have any disclog entries or table  
 
  import sys,os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
  import scrape
  from bs4 import BeautifulSoup
 
  #http://www.doughellmann.com/PyMOTW/abc/
  class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper):
  #def getTable(self,soup):
  # return soup.find(id = "ctl00_PlaceHolderMain_intro2__ControlWrapper_CerRichHtmlField").table
  def getColumnCount(self):
  return 4
  def getColumns(self,columns):
  (id, date, title, description) = columns
  return (id, date, title, description, None)
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper)
  print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper)
  ScraperImplementation().doScrape()
 
  import sys,os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
  import scrape
  from bs4 import BeautifulSoup
 
  #http://www.doughellmann.com/PyMOTW/abc/
  class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper):
  def getTable(self,soup):
  return soup.find(summary="This table shows every FOI request to date.")
  def getColumnCount(self):
  return 5
  def getColumns(self,columns):
  (id, date, title, description,notes) = columns
  return (id, date, title, description, notes)
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper)
  print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper)
  ScraperImplementation().doScrape()
 
  import sys
  import os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
 
 
  class ScraperImplementation(genericScrapers.GenericHTMLDisclogScraper):
 
  def __init__(self):
  super(ScraperImplementation, self).__init__()
 
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(ScraperImplementation,
  genericScrapers.GenericHTMLDisclogScraper)
  print 'Instance:', isinstance(ScraperImplementation(),
  genericScrapers.GenericHTMLDisclogScraper)
  ScraperImplementation().doScrape()
 
  import sys,os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
  import scrape
  from bs4 import BeautifulSoup
 
  #http://www.doughellmann.com/PyMOTW/abc/
  class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper):
  def getTable(self,soup):
  return soup.find(class_ = "ms-rtestate-field").table
  def getColumnCount(self):
  return 4
  def getColumns(self,columns):
  (id, date, title, description) = columns
  return (id, date, title, description, None)
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper)
  print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper)
  ScraperImplementation().doScrape()
 
import sys,os  
sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))  
import genericScrapers  
import scrape  
from bs4 import BeautifulSoup  
 
#http://www.doughellmann.com/PyMOTW/abc/  
class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper):  
 
def getColumnCount(self):  
return 4  
def getColumns(self,columns):  
(id, date, title, description) = columns  
return (id, date, title, description, None)  
 
if __name__ == '__main__':  
print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper)  
print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper)  
ScraperImplementation().doScrape()  
 
import sys,os import sys,os
sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../')) sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
import genericScrapers import genericScrapers
#RSS feed not detailed #RSS feed not detailed
   
#http://www.doughellmann.com/PyMOTW/abc/ #http://www.doughellmann.com/PyMOTW/abc/
class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper): class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper):
def getColumns(self,columns): def getColumns(self,columns):
(id, date, title,description,notes) = columns (id, date, title,description,notes) = columns
return (id, date, description, title, notes) return (id, date, title, description, notes)
   
if __name__ == '__main__': if __name__ == '__main__':
print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper) print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper)
print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper) print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper)
ScraperImplementation().doScrape() ScraperImplementation().doScrape()
   
  import sys
  import os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
 
 
  class ScraperImplementation(genericScrapers.GenericPDFDisclogScraper):
 
  def __init__(self):
  super(ScraperImplementation, self).__init__()
 
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(ScraperImplementation,
  genericScrapers.GenericOAICDisclogScraper)
  print 'Instance:', isinstance(ScraperImplementation(),
  genericScrapers.GenericOAICDisclogScraper)
  ScraperImplementation().doScrape()
 
# pdf  
http://www.awm.gov.au/about/AWM_Disclosure_Log.pdf  
 
  import sys
  import os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
 
 
  class ScraperImplementation(genericScrapers.GenericHTMLDisclogScraper):
 
  def __init__(self):
  super(ScraperImplementation, self).__init__()
 
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(ScraperImplementation,
  genericScrapers.GenericHTMLDisclogScraper)
  print 'Instance:', isinstance(ScraperImplementation(),
  genericScrapers.GenericHTMLDisclogScraper)
  ScraperImplementation().doScrape()
 
  import sys,os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
  import scrape
  from bs4 import BeautifulSoup
 
  #http://www.doughellmann.com/PyMOTW/abc/
  class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper):
  def getTable(self,soup):
  return soup.find(id = "ctl00_PlaceHolderMain_ctl01__ControlWrapper_RichHtmlField").table
  def getColumnCount(self):
  return 5
  def getColumns(self,columns):
  (id, date, title, description,notes) = columns
  return (id, date, title, description, notes)
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper)
  print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper)
  ScraperImplementation().doScrape()
 
  import sys,os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
  import scrape
  from bs4 import BeautifulSoup
 
  #http://www.doughellmann.com/PyMOTW/abc/
  class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper):
  def getTable(self,soup):
  return soup.find(summary="This table lists the schedule of upcoming courses.")
  def getColumnCount(self):
  return 7
  def getColumns(self,columns):
  (id, date, title, description,link,deldate,notes) = columns
  return (id, date, title, description, notes)
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper)
  print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper)
  ScraperImplementation().doScrape()
 
  import sys,os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
  import scrape
  from bs4 import BeautifulSoup
 
  #http://www.doughellmann.com/PyMOTW/abc/
  class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper):
  #def getTable(self,soup):
  # return soup.find(id = "ctl00_PlaceHolderMain_intro2__ControlWrapper_CerRichHtmlField").table
  def getColumnCount(self):
  return 5
  def getColumns(self,columns):
  (id, date, title, description,notes) = columns
  return (id, date, title, description, notes)
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper)
  print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper)
  ScraperImplementation().doScrape()
 
  import sys,os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
  import scrape
  from bs4 import BeautifulSoup
 
  #http://www.doughellmann.com/PyMOTW/abc/
  class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper):
  def getTable(self,soup):
  return soup.find(id="main").table
  def getColumnCount(self):
  return 7
  def getColumns(self,columns):
  (id, date, title, description,link,deldate,notes) = columns
  return (id, date, title, description, notes)
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper)
  print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper)
  ScraperImplementation().doScrape()
 
  import sys
  import os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
  import scrape
  from datetime import date
  from pyquery import PyQuery as pq
  from lxml import etree
  import urllib
  import dateutil
  from dateutil.parser import *
 
  class ACMADisclogScraper(genericScrapers.GenericDisclogScraper):
 
  def doScrape(self):
  foidocsdb = scrape.couch['disclosr-foidocuments']
  (url, mime_type, content) = scrape.fetchURL(scrape.docsdb,
  self.getURL(), "foidocuments", self.getAgencyID())
 
  d = pq(content)
  d.make_links_absolute(base_url = self.getURL())
  for item in d('.item-list').items():
  title= item('h3').text()
  print title
  links = item('a').map(lambda i, e: pq(e).attr('href'))
  description = title= item('ul').text()
  edate = date.today().strftime("%Y-%m-%d")
  print edate
  dochash = scrape.mkhash(self.remove_control_chars(title))
  doc = foidocsdb.get(dochash)
  if doc is None:
  print "saving " + dochash
  doc = {'_id': dochash, 'agencyID': self.getAgencyID()
  , 'url': self.getURL(), 'docID': dochash,
  "links": links,
  "date": edate, "title": title, "description": description}
  #print doc
  foidocsdb.save(doc)
  else:
  print "already saved"
 
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(ACMADisclogScraper,
  genericScrapers.GenericDisclogScraper)
  print 'Instance:', isinstance(ACMADisclogScraper(),
  genericScrapers.GenericDisclogScraper)
  ACMADisclogScraper().doScrape()
 
  import sys,os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
  import scrape
  from bs4 import BeautifulSoup
 
  #http://www.doughellmann.com/PyMOTW/abc/
  class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper):
  #def getTable(self,soup):
  # return soup.find(id = "ctl00_PlaceHolderMain_intro2__ControlWrapper_CerRichHtmlField").table
  def getColumnCount(self):
  return 5
  def getColumns(self,columns):
  (id, date, title, description,notes) = columns
  return (id, date, title, description, notes)
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper)
  print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper)
  ScraperImplementation().doScrape()
 
import sys,os import sys,os
sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../')) sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
import genericScrapers import genericScrapers
import scrape import scrape
from bs4 import BeautifulSoup from bs4 import BeautifulSoup
   
#http://www.doughellmann.com/PyMOTW/abc/ #http://www.doughellmann.com/PyMOTW/abc/
class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper): class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper):
def getColumns(self,columns): def getColumns(self,columns):
(id, date, title, description, notes) = columns (id, date, title, description, notes) = columns
return (id, date, description, title, notes) return (id, date, title, description, notes)
def getTable(self,soup): def getTable(self,soup):
return soup.find(class_ = "content") return soup.find(class_ = "content")
   
if __name__ == '__main__': if __name__ == '__main__':
print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper) print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper)
print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper) print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper)
ScraperImplementation().doScrape() ScraperImplementation().doScrape()
   
  import sys,os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
  import scrape
  from bs4 import BeautifulSoup
 
  #http://www.doughellmann.com/PyMOTW/abc/
  class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper):
  #def getTable(self,soup):
  # return soup.find(id = "ctl00_PlaceHolderMain_intro2__ControlWrapper_CerRichHtmlField").table
  def getColumnCount(self):
  return 6
  def getColumns(self,columns):
  (id, date, title, description,deldate, notes) = columns
  return (id, date, title, description, notes)
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper)
  print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper)
  ScraperImplementation().doScrape()
 
import sys,os import sys,os
sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../')) sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
import genericScrapers import genericScrapers
#RSS feed not detailed #RSS feed not detailed
   
#http://www.doughellmann.com/PyMOTW/abc/ #http://www.doughellmann.com/PyMOTW/abc/
class ScraperImplementation(genericScrapers.GenericRSSDisclogScraper): class ScraperImplementation(genericScrapers.GenericRSSDisclogScraper):
def getColumns(self,columns): def getColumns(self,columns):
(id, date, title, description, notes) = columns (id, date, title, description, notes) = columns
return (id, date, description, title, notes) return (id, date, title, description, notes)
   
if __name__ == '__main__': if __name__ == '__main__':
print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericRSSDisclogScraper) print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericRSSDisclogScraper)
print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericRSSDisclogScraper) print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericRSSDisclogScraper)
ScraperImplementation().doScrape() ScraperImplementation().doScrape()
   
www.finance.gov.au/foi/disclosure-log/foi-rss.xml www.finance.gov.au/foi/disclosure-log/foi-rss.xml
   
  import sys,os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
  import scrape
  from bs4 import BeautifulSoup
 
  #http://www.doughellmann.com/PyMOTW/abc/
  class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper):
  #def getTable(self,soup):
  # return soup.find(id = "ctl00_PlaceHolderMain_intro2__ControlWrapper_CerRichHtmlField").table
  def getColumnCount(self):
  return 5
  def getColumns(self,columns):
  (id, date, title, description,notes) = columns
  return (id, date, title, description, notes)
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper)
  print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper)
  ScraperImplementation().doScrape()
 
  import sys
  import os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
 
 
  class ScraperImplementation(genericScrapers.GenericHTMLDisclogScraper):
 
  def __init__(self):
  super(ScraperImplementation, self).__init__()
 
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(ScraperImplementation,
  genericScrapers.GenericHTMLDisclogScraper)
  print 'Instance:', isinstance(ScraperImplementation(),
  genericScrapers.GenericHTMLDisclogScraper)
  ScraperImplementation().doScrape()
 
  import sys,os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
  import scrape
  from bs4 import BeautifulSoup
 
  #http://www.doughellmann.com/PyMOTW/abc/
  class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper):
  def getTable(self,soup):
  return soup.find(id = "inner_content")
  def getColumnCount(self):
  return 2
  def getColumns(self,columns):
  (date, title) = columns
  return (date, date, title, title, None)
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper)
  print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper)
  ScraperImplementation().doScrape()
 
  import sys,os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
  import scrape
  from bs4 import BeautifulSoup
 
  #http://www.doughellmann.com/PyMOTW/abc/
  class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper):
  #def getTable(self,soup):
  # return soup.find(id = "ctl00_PlaceHolderMain_intro2__ControlWrapper_CerRichHtmlField").table
  def getColumnCount(self):
  return 4
  def getColumns(self,columns):
  (id, title, date, description) = columns
  return (id, date, title, description, None)
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper)
  print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper)
  ScraperImplementation().doScrape()
 
  import sys,os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
  import scrape
  from bs4 import BeautifulSoup
 
  #http://www.doughellmann.com/PyMOTW/abc/
  class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper):
  def getTable(self,soup):
  return soup.find(id = "genericContent").table.tbody
  def getColumnCount(self):
  return 3
  def getColumns(self,columns):
  (id, date,title, description, notes) = columns
  return (id, date, title, description, notes)
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper)
  print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper)
  ScraperImplementation().doScrape()
 
import sys,os  
sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))  
import genericScrapers  
import scrape  
from bs4 import BeautifulSoup  
 
#http://www.doughellmann.com/PyMOTW/abc/  
class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper):  
def getTable(self,soup):  
return soup.find(id = "genericContent").table.tbody  
def getColumnCount(self):  
return 5  
def getColumns(self,columns):  
(id, date,title, description, notes) = columns  
return (id, date, title, description, notes)  
 
if __name__ == '__main__':  
print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper)  
print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper)  
ScraperImplementation().doScrape()  
 
  import sys
  import os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
 
 
  class ScraperImplementation(genericScrapers.GenericHTMLDisclogScraper):
 
  def __init__(self):
  super(ScraperImplementation, self).__init__()
 
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(ScraperImplementation,
  genericScrapers.GenericHTMLDisclogScraper)
  print 'Instance:', isinstance(ScraperImplementation(),
  genericScrapers.GenericHTMLDisclogScraper)
  ScraperImplementation().doScrape()
 
import sys,os import sys,os
sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../')) sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
import genericScrapers import genericScrapers
import scrape import scrape
from bs4 import BeautifulSoup from bs4 import BeautifulSoup
   
#http://www.doughellmann.com/PyMOTW/abc/ #http://www.doughellmann.com/PyMOTW/abc/
class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper): class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper):
def getColumns(self,columns): def getColumns(self,columns):
(id, date, title, description, notes) = columns (id, date, title, description, notes) = columns
return (id, date, description, title, notes) return (id, date, title, description, notes)
def getTable(self,soup): def getTable(self,soup):
return soup.find(id = "content").table return soup.find(id = "content").table
   
if __name__ == '__main__': if __name__ == '__main__':
print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper) print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper)
print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper) print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper)
ScraperImplementation().doScrape() ScraperImplementation().doScrape()
   
  import sys,os
  sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
  import genericScrapers
  import scrape
  from bs4 import BeautifulSoup
 
  #http://www.doughellmann.com/PyMOTW/abc/
  class ScraperImplementation(genericScrapers.GenericOAICDisclogScraper):
  def getTable(self,soup):
  return soup.find(id = "ctl00_PlaceHolderMain_PublishingPageContent__ControlWrapper_RichHtmlField").table
  def getColumnCount(self):
  return 7
  def getColumns(self,columns):
  (id, date, title, description,link,deldate, notes) = columns
  return (id, date, title, description, notes)
 
  if __name__ == '__main__':
  print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericOAICDisclogScraper)
  print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericOAICDisclogScraper)
  ScraperImplementation().doScrape()
 
import sys,os import sys,os
sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../')) sys.path.insert(0, os.path.join(os.path.dirname(__file__) or '.', '../'))
import genericScrapers import genericScrapers
#RSS feed not detailed #RSS feed not detailed
   
#http://www.doughellmann.com/PyMOTW/abc/ #http://www.doughellmann.com/PyMOTW/abc/
class ScraperImplementation(genericScrapers.GenericRSSDisclogScraper): class ScraperImplementation(genericScrapers.GenericRSSDisclogScraper):
def getColumns(self,columns): def getColumns(self,columns):
(id, date, title, description, notes) = columns (id, date, title, description, notes) = columns
return (id, date, description, title, notes) return (id, date, title, description, notes)
   
if __name__ == '__main__': if __name__ == '__main__':
print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericRSSDisclogScraper) print 'Subclass:', issubclass(ScraperImplementation, genericScrapers.GenericRSSDisclogScraper)
print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericRSSDisclogScraper) print 'Instance:', isinstance(ScraperImplementation(), genericScrapers.GenericRSSDisclogScraper)
ScraperImplementation().doScrape() ScraperImplementation().doScrape()
   
http://www.righttoknow.org.au/feed/search/%20(latest_status:successful%20OR%20latest_status:partially_successful) http://www.righttoknow.org.au/feed/search/%20(latest_status:successful%20OR%20latest_status:partially_successful)
   
  <?php
 
  include ('../include/common.inc.php');
  $last_updated = date('Y-m-d', @filemtime('cbrfeed.zip'));
  header("Content-Type: text/xml");
  echo "<?xml version='1.0' encoding='UTF-8'?>";
  echo '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">' . "\n";
  echo " <url><loc>" . local_url() . "index.php</loc><priority>1.0</priority></url>\n";
  foreach (scandir("./") as $file) {
  if (strpos($file, ".php") !== false && $file != "index.php" && $file != "sitemap.xml.php")
  echo " <url><loc>" . local_url() . "$file</loc><priority>0.6</priority></url>\n";
  }
  $agenciesdb = $server->get_db('disclosr-agencies');
  try {
  $rows = $agenciesdb->get_view("app", "byCanonicalName")->rows;
  foreach ($rows as $row) {
  echo '<url><loc>' . local_url() . 'agency.php?id=' . $row->value->_id . "</loc><priority>0.3</priority></url>\n";
  }
  } catch (SetteeRestClientException $e) {
  setteErrorHandler($e);
  }
  $foidocsdb = $server->get_db('disclosr-foidocuments');
  try {
  $rows = $foidocsdb->get_view("app", "all")->rows;
  foreach ($rows as $row) {
  echo '<url><loc>' . local_url() . 'view.php?id=' . $row->value->_id . "</loc><priority>0.3</priority></url>\n";
  }
  } catch (SetteeRestClientException $e) {
  setteErrorHandler($e);
  }
  echo '</urlset>';
  ?>
 
<?php <?php
   
function include_header_documents($title) { function include_header_documents($title) {
?> header('X-UA-Compatible: IE=edge,chrome=1');
<!doctype html> ?>
<!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ --> <!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]--> <!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ -->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]--> <!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]--> <!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!-- Consider adding a manifest.appcache: h5bp.com/d/Offline --> <!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]--> <!-- Consider adding a manifest.appcache: h5bp.com/d/Offline -->
<head> <!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<meta charset="utf-8"> <head>
  <meta charset="utf-8">
   
<!-- Use the .htaccess and remove these lines to avoid edge case issues. <title>Australian Disclosure Logs<?php if ($title != "") echo " - $title"; ?></title>
More info: h5bp.com/i/378 --> <meta name="description" content="">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">  
   
<title>Australian Disclosure Logs<?php if ($title != "") echo " - $title";?></title> <!-- Mobile viewport optimized: h5bp.com/viewport -->
<meta name="description" content=""> <meta name="viewport" content="width=device-width">
  <link rel="alternate" type="application/rss+xml" title="Latest Disclosure Log Entries" href="rss.xml.php" />
  <!-- Place favicon.ico and apple-touch-icon.png in the root directory: mathiasbynens.be/notes/touch-icons -->
  <meta name="google-site-verification" content="jkknX5g2FCpQvrW030b1Nq2hyoa6mb3EDiA7kCoHNj8" />
   
<!-- Mobile viewport optimized: h5bp.com/viewport --> <!-- Le styles -->
<meta name="viewport" content="width=device-width"> <link href="css/bootstrap.min.css" rel="stylesheet">
  <style type="text/css">
  body {
  padding-top: 60px;
  padding-bottom: 40px;
  }
  .sidebar-nav {
  padding: 9px 0;
  }
  </style>
  <link href="css/bootstrap-responsive.min.css" rel="stylesheet">
   
<!-- Place favicon.ico and apple-touch-icon.png in the root directory: mathiasbynens.be/notes/touch-icons --> <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<meta name="google-site-verification" content="jkknX5g2FCpQvrW030b1Nq2hyoa6mb3EDiA7kCoHNj8" /> <!--[if lt IE 9]>
  <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
  <![endif]-->
  <!-- More ideas for your <head> here: h5bp.com/d/head-Tips -->
   
<!-- Le styles --> <!-- All JavaScript at the bottom, except this Modernizr build.
<link href="css/bootstrap.min.css" rel="stylesheet"> Modernizr enables HTML5 elements & feature detects for optimal performance.
<style type="text/css"> Create your own custom Modernizr build: www.modernizr.com/download/
body { <script src="js/libs/modernizr-2.5.3.min.js"></script>-->
padding-top: 60px; <script src="js/jquery.js"></script>
padding-bottom: 40px; <script type="text/javascript" src="js/flotr2.min.js"></script>
}  
.sidebar-nav {  
padding: 9px 0;  
}  
</style>  
<link href="css/bootstrap-responsive.min.css" rel="stylesheet">  
   
<!-- HTML5 shim, for IE6-8 support of HTML5 elements --> </head>
<!--[if lt IE 9]> <body>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script> <div class="navbar navbar-inverse navbar-fixed-top">
<![endif]--> <div class="navbar-inner">
<!-- More ideas for your <head> here: h5bp.com/d/head-Tips --> <div class="container-fluid">
  <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
  <span class="icon-bar"></span>
  <span class="icon-bar"></span>
  <span class="icon-bar"></span>
  </a>
  <a class="brand" href="#">Australian Disclosure Logs</a>
  <div class="nav-collapse collapse">
  <p class="navbar-text pull-right">
  <small>
  Subsites on:
  </small>
  <a href="http://orgs.disclosurelo.gs">Government Agencies</a>
  • <a href="http://lobbyists.disclosurelo.gs">Political Lobbyists</a>
  • <a href="http://contracts.disclosurelo.gs">Government Contracts and Spending</a>
   
<!-- All JavaScript at the bottom, except this Modernizr build. </p>
Modernizr enables HTML5 elements & feature detects for optimal performance. <ul class="nav">
Create your own custom Modernizr build: www.modernizr.com/download/ <li><a href="agency.php">By Agency</a></li>
<script src="js/libs/modernizr-2.5.3.min.js"></script>--> <li><a href="date.php">By Date</a></li>
<script src="js/jquery.js"></script> <li><a href="disclogsList.php">List of Disclosure Logs</a></li>
<script type="text/javascript" src="js/flotr2.min.js"></script> <li><a href="about.php">About</a></li>
   
</head>  
<body>  
<div class="navbar navbar-inverse navbar-fixed-top">  
<div class="navbar-inner">  
<div class="container-fluid">  
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">  
<span class="icon-bar"></span>  
<span class="icon-bar"></span>  
<span class="icon-bar"></span>  
</a>  
<a class="brand" href="#">Australian Disclosure Logs</a>  
<div class="nav-collapse collapse">  
<p class="navbar-text pull-right">  
Check out our subsites on:  
<a href="http://orgs.disclosurelo.gs">Government Agencies</a>  
• <a href="http://lobbyists.disclosurelo.gs">Political Lobbyists</a>  
• <a href="http://contracts.disclosurelo.gs">Government Contracts and Spending</a>  
   
</p> </ul>
<ul class="nav"> </div><!--/.nav-collapse -->
<li><a href="index.php">Home</a></li> </div>
<li><a href="disclogsList.php">List of Disclosure Logs</a></li> </div>
<li><a href="about.php">About</a></li> </div>
  <div class="container">
</ul> <?php
</div><!--/.nav-collapse --> }
</div>  
</div>  
</div>  
<div class="container">  
<?php  
}  
function include_footer_documents() {  
?>  
</div> <!-- /container -->  
<hr>  
   
<footer> function include_footer_documents() {
<p>&copy; Company 2012</p> global $ENV;
</footer> ?>
<script type="text/javascript"> </div> <!-- /container -->
  <hr>
   
var _gaq = _gaq || []; <footer>
_gaq.push(['_setAccount', 'UA-12341040-4']); <p>Not affiliated with or endorsed by any government agency.</p>
_gaq.push(['_setDomainName', 'disclosurelo.gs']); </footer>
_gaq.push(['_setAllowLinker', true]); <?php
_gaq.push(['_trackPageview']); if ($ENV != "DEV") {
  echo "<script type='text/javascript'>
   
(function() { var _gaq = _gaq || [];
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; _gaq.push(['_setAccount', 'UA-12341040-4']);
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; _gaq.push(['_setDomainName', 'disclosurelo.gs']);
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); _gaq.push(['_setAllowLinker', true]);
})(); _gaq.push(['_trackPageview']);
   
</script> (function() {
<!-- Le javascript var ga = document.createElement('script');
================================================== --> ga.type = 'text/javascript';
<!-- Placed at the end of the document so the pages load faster --> ga.async = true;
<!-- ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
<script src="js/bootstrap-transition.js"></script> var s = document.getElementsByTagName('script')[0];
<script src="js/bootstrap-alert.js"></script> s.parentNode.insertBefore(ga, s);
<script src="js/bootstrap-modal.js"></script> })();
<script src="js/bootstrap-dropdown.js"></script>  
<script src="js/bootstrap-scrollspy.js"></script> </script>";
<script src="js/bootstrap-tab.js"></script> }
<script src="js/bootstrap-tooltip.js"></script> ?>
<script src="js/bootstrap-popover.js"></script> <!-- Le javascript
<script src="js/bootstrap-button.js"></script> ================================================== -->
<script src="js/bootstrap-collapse.js"></script> <!-- Placed at the end of the document so the pages load faster -->
<script src="js/bootstrap-carousel.js"></script> <!--
<script src="js/bootstrap-typeahead.js"></script>--> <script src="js/bootstrap-transition.js"></script>
  <script src="js/bootstrap-alert.js"></script>
  <script src="js/bootstrap-modal.js"></script>
  <script src="js/bootstrap-dropdown.js"></script>
  <script src="js/bootstrap-scrollspy.js"></script>
  <script src="js/bootstrap-tab.js"></script>
  <script src="js/bootstrap-tooltip.js"></script>
  <script src="js/bootstrap-popover.js"></script>
  <script src="js/bootstrap-button.js"></script>
  <script src="js/bootstrap-collapse.js"></script>
  <script src="js/bootstrap-carousel.js"></script>
  <script src="js/bootstrap-typeahead.js"></script>-->
   
   
</body> </body>
</html> </html>
<?php <?php
  }
   
  function truncate($string, $length, $stopanywhere = false) {
  //truncates a string to a certain char length, stopping on a word if not specified otherwise.
  if (strlen($string) > $length) {
  //limit hit!
  $string = substr($string, 0, ($length - 3));
  if ($stopanywhere) {
  //stop anywhere
  $string .= '...';
  } else {
  //stop on a word.
  $string = substr($string, 0, strrpos($string, ' ')) . '...';
  }
  }
  return $string;
} }
   
function displayLogEntry($row, $idtoname) { function displayLogEntry($row, $idtoname) {
echo "<div><h2>".$row->value->date.": ".$row->value->title." (".$idtoname[$row->value->agencyID].")</h2> <p>".str_replace("\n","<br>",$row->value->description); $result = "";
if (isset($row->value->notes)) { $result .= '<div itemscope itemtype="http://schema.org/Article">';
echo " <br>Note: ".$row->value->notes; $result .= '<h2><a href="http://disclosurelo.gs/view.php?id='.$row->value->_id.'"> <span itemprop="datePublished">' . $row->value->date . "</span>: <span itemprop='name headline'>" . truncate($row->value->title, 120) . "</span>";
} $result .= ' (<span itemprop="author publisher creator">' . $idtoname[$row->value->agencyID] . '</span>)</a></h2>';
echo "</p>"; $result .= "<p itemprop='description articleBody text'> Title: " . $row->value->title . "<br/>";
  if (isset($row->value->description)) {
  $result .= str_replace("\n", "<br>", preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "",trim($row->value->description)));
  }
  if (isset($row->value->notes)) {
  $result .= " <br>Note: " . $row->value->notes;
  }
  $result .= "</p>";
   
if (isset($row->value->links)){ if (isset($row->value->links)) {
echo "<h3>Links/Documents</h3><ul>"; $result .= '<h3>Links/Documents</h3><ul itemprop="associatedMedia">';
foreach ($row->value->links as $link) { foreach ($row->value->links as $link) {
echo "<li><a href='$link'>".$link."</a></li>"; $result .= '<li itemscope itemtype="http://schema.org/MediaObject"><a href="' . htmlspecialchars ($link) . '" itemprop="url contentURL">' . htmlspecialchars ( $link) . "</a></li>";
  }
   
  $result .= "</ul>";
  }
  $result .= "<small><A itemprop='url' href='" . $row->value->url . "'>View original source...</a> ID: " . strip_tags($row->value->docID) . "</small>";
  $result .= "</div>\n";
  return $result;
} }
   
echo "</ul>";  
}  
echo "<small><A href='".$row->value->url."'>View original source...</a> ID: ".$row->value->docID."</small>";  
echo"</div>";  
}  
   
  <?php
  include('template.inc.php');
  include_once('../include/common.inc.php');
  ?>
  <?php
 
 
 
  $agenciesdb = $server->get_db('disclosr-agencies');
 
  $idtoname = Array();
  foreach ($agenciesdb->get_view("app", "byCanonicalName")->rows as $row) {
  $idtoname[$row->id] = trim($row->value->name);
  }
  $foidocsdb = $server->get_db('disclosr-foidocuments');
  try {
  $obj = new stdClass();
  $obj->value = $foidocsdb->get($_REQUEST['id']);
  include_header_documents($obj->value->title);
 
  echo displayLogEntry($obj,$idtoname);
 
  } catch (SetteeRestClientException $e) {
  setteErrorHandler($e);
  }
  include_footer_documents();
  ?>
 
<?php <?php
   
include_once('../include/common.inc.php'); include_once('../include/common.inc.php');
$hash = $_REQUEST['hash']; $hash = $_REQUEST['hash'];
$docsdb = $server->get_db('disclosr-documents'); $docsdb = $server->get_db('disclosr-documents');
  try {
$doc = object_to_array($docsdb->get($hash)); $doc = object_to_array($docsdb->get($hash));
   
  } catch (SetteeRestClientException $e) {
  setteErrorHandler($e);
  }
   
   
if (!isset($doc['_attachments']) || count($doc['_attachments']) == 0) die ("no attachments"); if (!isset($doc['_attachments']) || count($doc['_attachments']) == 0) die ("no attachments");
$attachments = $doc['_attachments']; $attachments = $doc['_attachments'];
$attachment_filenames = array_keys($attachments); $attachment_filenames = array_keys($attachments);
//print_r($attachments); //print_r($attachments);
$url = $serverAddr.'disclosr-documents/'.$hash.'/'.urlencode($attachment_filenames[0]); $url = $serverAddr.'disclosr-documents/'.$hash.'/'.urlencode($attachment_filenames[0]);
//echo $url; //echo $url;
$request = Requests::get($url); $request = Requests::get($url);
echo ($request->body); echo ($request->body);
   
<?php <?php
   
include_once('include/common.inc.php'); include_once('include/common.inc.php');
   
function displayValue($key, $value, $mode) { function displayValue($key, $value, $mode) {
global $db, $schemas; global $db, $schemas;
  $ignoreKeys = Array("metadata" ,"metaTags", "statistics","rtkURLs","rtkDescriptions");
if ($mode == "view") { if ($mode == "view") {
if (strpos($key, "_") === 0 || $key == "metadata") if (strpos($key, "_") === 0 || in_array($key,$ignoreKeys))
return; return;
echo "<tr>"; echo "<tr>";
   
echo "<td>"; echo "<td class='$key'>";
if (isset($schemas['agency']["properties"][$key])) { if (isset($schemas['agency']["properties"][$key])) {
echo $schemas['agency']["properties"][$key]['x-title'] . "<br><small>" . $schemas['agency']["properties"][$key]['description'] . "</small>"; echo $schemas['agency']["properties"][$key]['x-title'] . "<br><small>" . $schemas['agency']["properties"][$key]['description'] . "</small>";
} }
echo "</td><td>"; echo "</td><td>";
if (is_array($value)) { if (is_array($value)) {
echo "<ol>"; echo "<ol>";
foreach ($value as $subkey => $subvalue) { foreach ($value as $subkey => $subvalue) {
   
echo "<li "; echo "<li ";
if (isset($schemas['agency']["properties"][$key]['x-property'])) { if (isset($schemas['agency']["properties"][$key]['x-property'])) {
echo ' property="' . $schemas['agency']["properties"][$key]['x-property'] . '" '; echo ' property="' . $schemas['agency']["properties"][$key]['x-property'] . '" ';
} if (isset($schemas['agency']["properties"][$key]['x-itemprop'])) { } if (isset($schemas['agency']["properties"][$key]['x-itemprop'])) {
echo ' itemprop="' . $schemas['agency']["properties"][$key]['x-itemprop'] . '" '; echo ' itemprop="' . $schemas['agency']["properties"][$key]['x-itemprop'] . '" ';
} }
echo " >"; echo " >";
   
echo "$subvalue</li>"; echo "$subvalue</li>";
} }
echo "</ol></td></tr>"; echo "</ol></td></tr>";
} else { } else {
if (isset($schemas['agency']["properties"][$key]['x-property'])) { if (isset($schemas['agency']["properties"][$key]['x-property'])) {
echo '<span property="' . $schemas['agency']["properties"][$key]['x-property'] . '">'; echo '<span property="' . $schemas['agency']["properties"][$key]['x-property'] . '">';
} else { } else {
echo "<span>"; echo "<span>";
} }
   
if ((strpos($key, "URL") > 0 || $key == 'website') && $value != "") { if ((strpos($key, "URL") > 0 || $key == 'website') && $value != "") {
echo "<a " . ($key == 'website' ? 'itemprop="url"' : '') . " href='$value'>$value</a>"; echo "<a " . ($key == 'website' ? 'itemprop="url"' : '') . " href='$value'>$value</a>";
} else if ($key == 'abn') { } else if ($key == 'abn') {
echo "<a href='http://www.abr.business.gov.au/SearchByAbn.aspx?SearchText=$value'>$value</a>"; echo "<a href='http://www.abr.business.gov.au/SearchByAbn.aspx?SearchText=$value'>$value</a>";
} else { } else {
echo "$value"; echo "$value";
} }
echo "</span>"; echo "</span>";
} }
echo "</td></tr>"; echo "</td></tr>";
} }
if ($mode == "edit") { if ($mode == "edit") {
if (is_array($value)) { if (is_array($value)) {
echo '<div class="row"> echo '<div class="row">
<div class="seven columns"> <div class="seven columns">
<fieldset> <fieldset>
<h5>' . $key . '</h5>'; <h5>' . $key . '</h5>';
foreach ($value as $subkey => $subvalue) { foreach ($value as $subkey => $subvalue) {
echo "<label>$subkey</label><input class='input-text' type='text' id='$key$subkey' name='$key" . '[' . $subkey . "]' value='$subvalue'/></tr>"; echo "<label>$subkey</label><input class='input-text' type='text' id='$key$subkey' name='$key" . '[' . $subkey . "]' value='$subvalue'/></tr>";
} }
echo "</fieldset> echo "</fieldset>
</div> </div>
</div>"; </div>";
} else { } else {
if (strpos($key, "_") === 0) { if (strpos($key, "_") === 0) {
echo"<input type='hidden' id='$key' name='$key' value='$value'/>"; echo"<input type='hidden' id='$key' name='$key' value='$value'/>";
} else if ($key == "parentOrg") { } else if ($key == "parentOrg") {
echo "<label for='$key'>$key</label><select id='$key' name='$key'><option value=''> Select... </option>"; echo "<label for='$key'>$key</label><select id='$key' name='$key'><option value=''> Select... </option>";
$rows = $db->get_view("app", "byDeptStateName")->rows; $rows = $db->get_view("app", "byDeptStateName")->rows;
//print_r($rows); //print_r($rows);
foreach ($rows as $row) { foreach ($rows as $row) {
echo "<option value='{$row->value}'" . (($row->value == $value) ? "SELECTED" : "") . " >" . str_replace("Department of ", "", $row->key) . "</option>"; echo "<option value='{$row->value}'" . (($row->value == $value) ? "SELECTED" : "") . " >" . str_replace("Department of ", "", $row->key) . "</option>";
} }
echo" </select>"; echo" </select>";
} else { } else {
echo "<label>$key</label><input class='input-text' type='text' id='$key' name='$key' value='$value'/>"; echo "<label>$key</label><input class='input-text' type='text' id='$key' name='$key' value='$value'/>";
if ((strpos($key, "URL") > 0 || $key == 'website') && $value != "") { if ((strpos($key, "URL") > 0 || $key == 'website') && $value != "") {
echo "<a " . ($key == 'website' ? 'itemprop="url"' : '') . " href='$value'>view</a>"; echo "<a " . ($key == 'website' ? 'itemprop="url"' : '') . " href='$value'>view</a>";
} }
if ($key == 'abn') { if ($key == 'abn') {
echo "<a href='http://www.abr.business.gov.au/SearchByAbn.aspx?SearchText=$value'>view abn</a>"; echo "<a href='http://www.abr.business.gov.au/SearchByAbn.aspx?SearchText=$value'>view abn</a>";
} }
} }
} }
} }
// //
} }
   
function addDefaultFields($row) { function addDefaultFields($row) {
global $schemas; global $schemas;
$defaultFields = array_keys($schemas['agency']['properties']); $defaultFields = array_keys($schemas['agency']['properties']);
foreach ($defaultFields as $defaultField) { foreach ($defaultFields as $defaultField) {
if (!isset($row[$defaultField])) { if (!isset($row[$defaultField])) {
if ($schemas['agency']['properties'][$defaultField]['type'] == "string") { if ($schemas['agency']['properties'][$defaultField]['type'] == "string") {
$row[$defaultField] = ""; $row[$defaultField] = "";
} }
if ($schemas['agency']['properties'][$defaultField]['type'] == "array") { if ($schemas['agency']['properties'][$defaultField]['type'] == "array") {
$row[$defaultField] = Array(""); $row[$defaultField] = Array("");
} }
} else if ($schemas['agency']['properties'][$defaultField]['type'] == "array") { } else if ($schemas['agency']['properties'][$defaultField]['type'] == "array") {
if (is_array($row[$defaultField])) { if (is_array($row[$defaultField])) {
$row[$defaultField][] = ""; $row[$defaultField][] = "";
$row[$defaultField][] = ""; $row[$defaultField][] = "";
$row[$defaultField][] = ""; $row[$defaultField][] = "";
} else { } else {
$value = $row[$defaultField]; $value = $row[$defaultField];
$row[$defaultField] = Array($value); $row[$defaultField] = Array($value);
$row[$defaultField][] = ""; $row[$defaultField][] = "";
$row[$defaultField][] = ""; $row[$defaultField][] = "";
} }
} }
} }
return $row; return $row;
} }
   
$db = $server->get_db('disclosr-agencies'); $db = $server->get_db('disclosr-agencies');
   
if (isset($_REQUEST['id'])) { if (isset($_REQUEST['id'])) {
//get an agency record as json/html, search by name/abn/id //get an agency record as json/html, search by name/abn/id
// by name = startkey="Ham"&endkey="Ham\ufff0" // by name = startkey="Ham"&endkey="Ham\ufff0"
// edit? // edit?
   
$obj = $db->get($_REQUEST['id']); $obj = $db->get($_REQUEST['id']);
include_header(isset($obj->name) ? $obj->name : ""); include_header(isset($obj->name) ? $obj->name : "");
//print_r($row); //print_r($row);
if (sizeof($_POST) > 0) { if (sizeof($_POST) > 0) {
//print_r($_POST); //print_r($_POST);
foreach ($_POST as $postkey => $postvalue) { foreach ($_POST as $postkey => $postvalue) {
if ($postvalue == "") { if ($postvalue == "") {
unset($_POST[$postkey]); unset($_POST[$postkey]);
} }
if (is_array($postvalue)) { if (is_array($postvalue)) {
if (count($postvalue) == 1 && $postvalue[0] == "") { if (count($postvalue) == 1 && $postvalue[0] == "") {
unset($_POST[$postkey]); unset($_POST[$postkey]);
} else { } else {
foreach ($_POST[$postkey] as $key => &$value) { foreach ($_POST[$postkey] as $key => &$value) {
if ($value == "") { if ($value == "") {
unset($_POST[$postkey][$key]); unset($_POST[$postkey][$key]);
} }
} }
} }
} }
} }
if (isset($_POST['_id']) && $db->get_rev($_POST['_id']) == $_POST['_rev']) { if (isset($_POST['_id']) && $db->get_rev($_POST['_id']) == $_POST['_rev']) {
echo "Edited version was latest version, continue saving"; echo "Edited version was latest version, continue saving";
$newdoc = $_POST; $newdoc = $_POST;
$newdoc['metadata']['lastModified'] = time(); $newdoc['metadata']['lastModified'] = time();
$obj = $db->save($newdoc); $obj = $db->save($newdoc);
} else { } else {
echo "ALERT doc revised by someone else while editing. Document not saved."; echo "ALERT doc revised by someone else while editing. Document not saved.";
} }
} }
   
$mode = "view"; $mode = "view";
$rowArray = object_to_array($obj); $rowArray = object_to_array($obj);
ksort($rowArray); ksort($rowArray);
if ($mode == "edit") { if ($mode == "edit") {
$row = addDefaultFields($rowArray); $row = addDefaultFields($rowArray);
} else { } else {
$row = $rowArray; $row = $rowArray;
} }
   
if ($mode == "view") { if ($mode == "view") {
echo '<div itemscope itemtype="http://schema.org/GovernmentOrganization" typeof="schema:GovernmentOrganization" about="#' . $row['_id'] . '"><table width="100%">'; echo ' <div class="container-fluid">
echo '<tr> <td colspan="2"><h3 itemprop="name">' . $row['name'] . "</h3></td></tr>"; <div class="row-fluid">
  <div class="span3">
  <div class="well sidebar-nav">
  <ul class="nav nav-list">
  <li class="nav-header">Statistics</li>';
   
  if (isset($row['statistics']['employees'])) {
  echo '<div><i class="icon-user" style="float:left"></i><p style="margin-left:16px;">';
  $keys = array_keys($row['statistics']['employees']);
  $lastkey = $keys[count($keys)-1];
  echo $row['statistics']['employees'][$lastkey]['value'].' employees <small>('.$lastkey.')</small>';
  echo '</div>';
  }
  echo ' </ul>
  </div><!--/.well -->
  </div><!--/span-->
  <div class="span9">';
  echo '<div itemscope itemtype="http://schema.org/GovernmentOrganization" typeof="schema:GovernmentOrganization" about="#' . $row['_id'] . '">';
  echo '<div class="hero-unit">
  <h1 itemprop="name">' . $row['name'] . '</h1>';
  if (isset($row['description'])) {
  echo '<p>'.$row['description'].'</p>';
  }
  echo '</div><table width="100%">';
echo "<tr><th>Field Name</th><th>Field Value</th></tr>"; echo "<tr><th>Field Name</th><th>Field Value</th></tr>";
} }
if ($mode == "edit") { if ($mode == "edit") {
?> ?>
<input id="addfield" type="button" value="Add Field"/> <input id="addfield" type="button" value="Add Field"/>
<script> <script>
window.onload = function() { window.onload = function() {
$(document).ready(function() { $(document).ready(function() {
// put all your jQuery goodness in here. // put all your jQuery goodness in here.
// http://charlie.griefer.com/blog/2009/09/17/jquery-dynamically-adding-form-elements/ // http://charlie.griefer.com/blog/2009/09/17/jquery-dynamically-adding-form-elements/
$('#addfield').click(function() { $('#addfield').click(function() {
var field_name=window.prompt("fieldname?",""); var field_name=window.prompt("fieldname?","");
if (field_name !="") { if (field_name !="") {
$('#submitbutton').before($('<span></span>') $('#submitbutton').before($('<span></span>')
.append("<label>"+field_name+"</label>") .append("<label>"+field_name+"</label>")
.append("<input class='input-text' type='text' id='"+field_name+"' name='"+field_name+"'/>") .append("<input class='input-text' type='text' id='"+field_name+"' name='"+field_name+"'/>")
); );
} }
}); });
}); });
}; };
</script> </script>
<form id="editform" class="nice" method="post"> <form id="editform" class="nice" method="post">
<?php <?php
   
} }
foreach ($row as $key => $value) { foreach ($row as $key => $value) {
echo displayValue($key, $value, $mode); echo displayValue($key, $value, $mode);
} }
if ($mode == "view") { if ($mode == "view") {
echo "</table></div>"; echo "</table></div>";
  echo ' </div><!--/span-->
  </div><!--/row-->
  </div><!--/span-->
  </div><!--/row-->';
} }
if ($mode == "edit") { if ($mode == "edit") {
echo '<input id="submitbutton" type="submit"/></form>'; echo '<input id="submitbutton" type="submit"/></form>';
} }
} else { } else {
// show all list // show all list
include_header('Agencies'); include_header('Agencies');
  echo ' <div class="container-fluid">
  <div class="row-fluid">
  <div class="span3">
  <div class="well sidebar-nav">
  <ul class="nav nav-list">
  <li class="nav-header">Sidebar</li>';
  echo ' </ul>
  </div><!--/.well -->
  </div><!--/span-->
  <div class="span9">
  <div class="hero-unit">
  <h1>Hello, world!</h1>
  <p>This is a template for a simple marketing or informational website. It includes a large callout called the hero unit and three supporting pieces of content. Use it as a starting point to create something more unique.</p>
  <p><a class="btn btn-primary btn-large">Learn more &raquo;</a></p>
  </div>
  <div class="row-fluid">
  <div class="span4">';
try { try {
$rows = $db->get_view("app", "byCanonicalName")->rows; $rows = $db->get_view("app", "byCanonicalName")->rows;
//print_r($rows); //print_r($rows);
echo '<ul>'; $rowCount = count($rows);
foreach ($rows as $row) { foreach ($rows as $i => $row) {
  if ($i % ($rowCount/3) == 0 && $i != 0 && $i != $rowCount -2 ) echo '</div><div class="span4">';
// print_r($row); // print_r($row);
echo '<li itemscope itemtype="http://schema.org/GovernmentOrganization" typeof="schema:GovernmentOrganization foaf:Organization" about="getAgency.php?id=' . $row->value->_id . '"> echo '<span itemscope itemtype="http://schema.org/GovernmentOrganization" typeof="schema:GovernmentOrganization foaf:Organization" about="getAgency.php?id=' . $row->value->_id . '">
<a href="getAgency.php?id=' . $row->value->_id . '" rel="schema:url foaf:page" property="schema:name foaf:name" itemprop="url"><span itemprop="name">' . <a href="getAgency.php?id=' . $row->value->_id . '" rel="schema:url foaf:page" property="schema:name foaf:name" itemprop="url"><span itemprop="name">' .
(isset($row->value->name) ? $row->value->name : "ERROR NAME MISSING") (isset($row->value->name) ? $row->value->name : "ERROR NAME MISSING")
. '</span></a></li>'; . '</span></a></span><br><br>';
} }
echo "</ul>";  
} catch (SetteeRestClientException $e) { } catch (SetteeRestClientException $e) {
setteErrorHandler($e); setteErrorHandler($e);
} }
  echo ' </div><!--/span-->
  </div><!--/row-->
  </div><!--/span-->
  </div><!--/row-->';
} }
   
include_footer(); include_footer();
?> ?>
   
 Binary files a/images/misc/button-gloss.png and /dev/null differ
 Binary files a/images/misc/button-overlay.png and /dev/null differ
 Binary files a/images/misc/custom-form-sprites.png and /dev/null differ
 Binary files a/images/misc/input-bg.png and /dev/null differ
 Binary files a/images/misc/modal-gloss.png and /dev/null differ
 Binary files a/images/misc/table-sorter.png and /dev/null differ
 Binary files a/images/orbit/bullets.jpg and /dev/null differ
 Binary files a/images/orbit/left-arrow.png and /dev/null differ
 Binary files a/images/orbit/loading.gif and /dev/null differ
 Binary files a/images/orbit/mask-black.png and /dev/null differ
 Binary files a/images/orbit/pause-black.png and /dev/null differ
 Binary files a/images/orbit/right-arrow.png and /dev/null differ
 Binary files a/images/orbit/rotator-black.png and /dev/null differ
 Binary files a/images/orbit/timer-black.png and /dev/null differ
 Binary files /dev/null and b/img/glyphicons-halflings-white.png differ
 Binary files /dev/null and b/img/glyphicons-halflings.png differ
<?php <?php
   
date_default_timezone_set("Australia/Sydney"); date_default_timezone_set("Australia/Sydney");
   
$basePath = ""; $basePath = "";
if (strstr($_SERVER['PHP_SELF'], "alaveteli/") if (strstr($_SERVER['PHP_SELF'], "alaveteli/")
|| strstr($_SERVER['PHP_SELF'], "admin/") || strstr($_SERVER['PHP_SELF'], "admin/")
|| strstr($_SERVER['PHP_SELF'], "lib/") || strstr($_SERVER['PHP_SELF'], "lib/")
|| strstr($_SERVER['PHP_SELF'], "include/") || strstr($_SERVER['PHP_SELF'], "include/")
|| strstr($_SERVER['PHP_SELF'], "documents/") || strstr($_SERVER['PHP_SELF'], "documents/")
|| $_SERVER['SERVER_NAME'] == "disclosurelo.gs" || $_SERVER['SERVER_NAME'] == "disclosurelo.gs"
  || $_SERVER['SERVER_NAME'] == "www.disclosurelo.gs"
) )
$basePath = "../"; $basePath = "../";
   
include_once ('couchdb.inc.php'); include_once ('couchdb.inc.php');
include_once ('template.inc.php'); include_once ('template.inc.php');
require_once $basePath.'lib/Requests/library/Requests.php'; require_once $basePath.'lib/Requests/library/Requests.php';
   
Requests::register_autoloader(); Requests::register_autoloader();
$ENV = "DEV"; $ENV = "DEV";
if (isset($_SERVER['SERVER_NAME']) && $_SERVER['SERVER_NAME'] != 'localhost') { if (isset($_SERVER['SERVER_NAME']) && $_SERVER['SERVER_NAME'] != 'localhost') {
   
require $basePath."lib/amon-php/amon.php"; require $basePath."lib/amon-php/amon.php";
Amon::config(array('address'=> 'http://127.0.0.1:2464', Amon::config(array('address'=> 'http://127.0.0.1:2464',
'protocol' => 'http', 'protocol' => 'http',
'secret_key' => "I2LJ6dOMmlnXgVAkTPFXd5M3ejkga8Gd2FbBt6iqZdw")); 'secret_key' => "I2LJ6dOMmlnXgVAkTPFXd5M3ejkga8Gd2FbBt6iqZdw"));
Amon::setup_exception_handler(); Amon::setup_exception_handler();
$ENV = "PROD"; $ENV = "PROD";
} }
   
# Convert a stdClass to an Array. http://www.php.net/manual/en/language.types.object.php#102735 # Convert a stdClass to an Array. http://www.php.net/manual/en/language.types.object.php#102735
   
function object_to_array(stdClass $Class) { function object_to_array(stdClass $Class) {
# Typecast to (array) automatically converts stdClass -> array. # Typecast to (array) automatically converts stdClass -> array.
$Class = (array) $Class; $Class = (array) $Class;
   
# Iterate through the former properties looking for any stdClass properties. # Iterate through the former properties looking for any stdClass properties.
# Recursively apply (array). # Recursively apply (array).
foreach ($Class as $key => $value) { foreach ($Class as $key => $value) {
if (is_object($value) && get_class($value) === 'stdClass') { if (is_object($value) && get_class($value) === 'stdClass') {
$Class[$key] = object_to_array($value); $Class[$key] = object_to_array($value);
} }
} }
return $Class; return $Class;
} }
   
# Convert an Array to stdClass. http://www.php.net/manual/en/language.types.object.php#102735 # Convert an Array to stdClass. http://www.php.net/manual/en/language.types.object.php#102735
   
function array_to_object(array $array) { function array_to_object(array $array) {
# Iterate through our array looking for array values. # Iterate through our array looking for array values.
# If found recurvisely call itself. # If found recurvisely call itself.
foreach ($array as $key => $value) { foreach ($array as $key => $value) {
if (is_array($value)) { if (is_array($value)) {
$array[$key] = array_to_object($value); $array[$key] = array_to_object($value);
} }
} }
   
# Typecast to (object) will automatically convert array -> stdClass # Typecast to (object) will automatically convert array -> stdClass
return (object) $array; return (object) $array;
} }
   
function dept_to_portfolio($deptName) { function dept_to_portfolio($deptName) {
return trim(str_replace("Department of", "", str_replace("Department of the", "Department of", $deptName))); return trim(str_replace("Department of", "", str_replace("Department of the", "Department of", $deptName)));
} }
function phrase_to_tag ($phrase) { function phrase_to_tag ($phrase) {
return str_replace(" ","_",str_replace("'","",str_replace(",","",strtolower($phrase)))); return str_replace(" ","_",str_replace("'","",str_replace(",","",strtolower($phrase))));
} }
function local_url() { function local_url() {
return "http://" . $_SERVER['HTTP_HOST'] . rtrim(dirname($_SERVER['PHP_SELF']), '/\\') . "/"; return "http://" . $_SERVER['HTTP_HOST'] . rtrim(dirname($_SERVER['PHP_SELF']), '/\\') . "/";
} }
function GetDomain($url) function GetDomain($url)
{ {
$nowww = ereg_replace('www\.','',$url); $nowww = ereg_replace('www\.','',$url);
$domain = parse_url($nowww); $domain = parse_url($nowww);
if(!empty($domain["host"])) if(!empty($domain["host"]))
{ {
return $domain["host"]; return $domain["host"];
} else } else
{ {
return $domain["path"]; return $domain["path"];
} }
} }
   
<?php <?php
   
include $basePath . "schemas/schemas.inc.php"; include $basePath . "schemas/schemas.inc.php";
   
require ($basePath . 'couchdb/settee/src/settee.php'); require ($basePath . 'couchdb/settee/src/settee.php');
   
if (php_uname('n') == "vanille") { if (php_uname('n') == "vanille") {
$serverAddr = 'http://192.168.178.21:5984/'; $serverAddr = 'http://192.168.178.21:5984/';
} else } else
if (php_uname('n') == "KYUUBEY") { if (php_uname('n') == "KYUUBEY") {
   
$serverAddr = 'http://192.168.1.148:5984/'; $serverAddr = 'http://192.168.1.148:5984/';
  $serverAddr = 'http://127.0.0.1:5984/';
} else { } else {
$serverAddr = 'http://127.0.0.1:5984/'; $serverAddr = 'http://127.0.0.1:5984/';
} }
$server = new SetteeServer($serverAddr); $server = new SetteeServer($serverAddr);
   
function setteErrorHandler($e) { function setteErrorHandler($e) {
if (class_exists('Amon')) { if (class_exists('Amon')) {
Amon::log($e->getMessage() . " " . print_r($_SERVER,true), array('error')); Amon::log($e->getMessage() . " " . print_r($_SERVER,true), array('error'));
} }
echo $e->getMessage() . "<br>" . PHP_EOL; echo $e->getMessage() . "<br>" . PHP_EOL;
} }
   
<?php <?php
   
function include_header($title) { function include_header($title) {
global $basePath; global $basePath;
?> ?>
<!DOCTYPE html> <!DOCTYPE html>
   
<!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ --> <!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ -->
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]--> <!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]--> <!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]--> <!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html lang="en"> <!--<![endif]--> <!--[if gt IE 8]><!--> <html lang="en"> <!--<![endif]-->
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
   
<!-- Set the viewport width to device width for mobile --> <!-- Set the viewport width to device width for mobile -->
<meta name="viewport" content="width=device-width" /> <meta name="viewport" content="width=device-width" />
   
<title><?php echo $title; ?> - Disclosr</title> <title><?php echo $title; ?> - Disclosr</title>
   
<!-- Included CSS Files --> <!-- Included CSS Files -->
<link rel="stylesheet" href="<?php echo $basePath ?>stylesheets/foundation.css"> <link href="<?php echo $basePath ?>css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="<?php echo $basePath ?>stylesheets/app.css"> <style type="text/css">
  body {
  padding-top: 60px;
  padding-bottom: 40px;
  }
  .sidebar-nav {
  padding: 9px 0;
  }
  </style>
  <link href="<?php echo $basePath ?>css/bootstrap-responsive.min.css" rel="stylesheet">
<!--[if lt IE 9]> <!--[if lt IE 9]>
<link rel="stylesheet" href="<?php echo $basePath ?>stylesheets/ie.css"> <link rel="stylesheet" href="<?php echo $basePath ?>stylesheets/ie.css">
<![endif]--> <![endif]-->
   
   
<!-- IE Fix for HTML5 Tags --> <!-- IE Fix for HTML5 Tags -->
<!--[if lt IE 9]> <!--[if lt IE 9]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]--> <![endif]-->
   
</head> </head>
<body xmlns:schema="http://schema.org/" xmlns:foaf="http://xmlns.com/foaf/0.1/"> <body xmlns:schema="http://schema.org/" xmlns:foaf="http://xmlns.com/foaf/0.1/">
  <div class="navbar navbar-inverse navbar-fixed-top">
  <div class="navbar-inner">
  <div class="container-fluid">
  <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
  <span class="icon-bar"></span>
  <span class="icon-bar"></span>
  <span class="icon-bar"></span>
  </a>
  <a class="brand" href="#">Disclosr</a>
  <div class="nav-collapse collapse">
  <ul class="nav">
  <li><a href="getAgency.php">Agencies</a></li>
  <li><a href="about.php">About/FAQ</a></li>
  </ul>
  </div><!--/.nav-collapse -->
  </div>
  </div>
  </div>
   
<!-- navBar --> <div class="container-fluid">
<div id="navbar" class="container">  
<div class="row">  
<div class="four columns">  
<h1><a href="/">Disclosr</a></h1>  
</div>  
<div class="eight columns hide-on-phones">  
<strong class="right">  
<a href="getAgency.php">Agencies</a>  
<a href="about.php">About/FAQ</a>  
</strong>  
</div>  
</div>  
</div>  
<!-- /navBar -->  
   
<!-- container -->  
<div class="container">  
<?php } <?php }
   
function include_footer() { function include_footer() {
global $basePath; global $basePath;
?> ?>
</div> </div> <!-- /container -->
<!-- container --> <hr>
   
  <footer>
  <p>Not affiliated with or endorsed by any government agency.</p>
  </footer>
   
   
<!-- Included JS Files --> <!-- Included JS Files -->
<script src="<?php echo $basePath; ?>js/foundation.js"></script>  
<script src="<?php echo $basePath; ?>js/app.js"></script>  
<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script> <script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="<?php echo $basePath ?>js/flotr2/flotr2.js"></script> <script type="text/javascript" src="<?php echo $basePath ?>js/flotr2/flotr2.js"></script>
<?php <?php
if (strpos($_SERVER['SERVER_NAME'], ".gs")) { if (strpos($_SERVER['SERVER_NAME'], ".gs")) {
?> ?>
<script type="text/javascript"> <script type="text/javascript">
   
var _gaq = _gaq || []; var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-12341040-2']); _gaq.push(['_setAccount', 'UA-12341040-2']);
_gaq.push(['_trackPageview']); _gaq.push(['_trackPageview']);
   
(function() { (function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})(); })();
   
</script> </script>
   
</body> </body>
</html> </html>
   
<?php } <?php }
} }
   
file:a/js/foundation.js (deleted)
/* Foundation v2.1.4 http://foundation.zurb.com */  
/*! jQuery v1.7.1 jquery.com | jquery.org/license */  
(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!ck[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){cl||(cl=c.createElement("iframe"),cl.frameBorder=cl.width=cl.height=0),b.appendChild(cl);if(!cm||!cl.createElement){cm=(cl.contentWindow||cl.contentDocument).document,cm.write((c.compatMode==="CSS1Compat"?"<!doctype html>":"")+"<html><body>"),cm.close()}d=cm.createElement(a),cm.body.appendChild(d),e=f.css(d,"display"),b.removeChild(cl)}ck[a]=e}return ck[a]}function cu(a,b){var c={};f.each(cq.concat.apply([],cq.slice(0,b)),function(){c[this]=a});return c}function ct(){cr=b}function cs(){setTimeout(ct,0);return cr=f.now()}function cj(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ci(){try{return new a.XMLHttpRequest}catch(b){}}function cc(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g<i;g++){if(g===1){for(h in a.converters){typeof h=="string"&&(e[h.toLowerCase()]=a.converters[h])}}l=k,k=d[g];if(k==="*"){k=l}else{if(l!=="*"&&l!==k){m=l+" "+k,n=e[m]||e["* "+k];if(!n){p=b;for(o in e){j=o.split(" ");if(j[0]===l||j[0]==="*"){p=e[j[1]+" "+k];if(p){o=e[o],o===!0?n=p:p===!0&&(n=o);break}}}}!n&&!p&&f.error("No conversion from "+m.replace(" "," to ")),n!==!0&&(c=n?n(c):p(o(c)))}}}return c}function cb(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;for(i in g){i in d&&(c[g[i]]=d[i])}while(f[0]==="*"){f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"))}if(h){for(i in e){if(e[i]&&e[i].test(h)){f.unshift(i);break}}}if(f[0] in d){j=f[0]}else{for(i in d){if(!f[0]||a.converters[i+" "+f[0]]){j=i;break}k||(k=i)}j=j||k}if(j){j!==f[0]&&f.unshift(j);return d[j]}}function ca(a,b,c,d){if(f.isArray(b)){f.each(b,function(b,e){c||bE.test(a)?d(a,e):ca(a+"["+(typeof e=="object"||f.isArray(e)?b:"")+"]",e,c,d)})}else{if(!c&&b!=null&&typeof b=="object"){for(var e in b){ca(a+"["+e+"]",b[e],c,d)}}else{d(a,b)}}}function b_(a,c){var d,e,g=f.ajaxSettings.flatOptions||{};for(d in c){c[d]!==b&&((g[d]?a:e||(e={}))[d]=c[d])}e&&f.extend(!0,a,e)}function b$(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h=a[f],i=0,j=h?h.length:0,k=a===bT,l;for(;i<j&&(k||!l);i++){l=h[i](c,d,e),typeof l=="string"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=b$(a,c,d,e,l,g)))}(k||!l)&&!g["*"]&&(l=b$(a,c,d,e,"*",g));return l}function bZ(a){return function(b,c){typeof b!="string"&&(c=b,b="*");if(f.isFunction(c)){var d=b.toLowerCase().split(bP),e=0,g=d.length,h,i,j;for(;e<g;e++){h=d[e],j=/^\+/.test(h),j&&(h=h.substr(1)||"*"),i=a[h]=a[h]||[],i[j?"unshift":"push"](c)}}}}function bC(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=b==="width"?bx:by,g=0,h=e.length;if(d>0){if(c!=="border"){for(;g<h;g++){c||(d-=parseFloat(f.css(a,"padding"+e[g]))||0),c==="margin"?d+=parseFloat(f.css(a,c+e[g]))||0:d-=parseFloat(f.css(a,"border"+e[g]+"Width"))||0}}return d+"px"}d=bz(a,b,b);if(d<0||d==null){d=a.style[b]||0}d=parseFloat(d)||0;if(c){for(;g<h;g++){d+=parseFloat(f.css(a,"padding"+e[g]))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+e[g]+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+e[g]))||0)}}return d+"px"}function bp(a,b){b.src?f.ajax({url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(bf,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)}function bo(a){var b=c.createElement("div");bh.appendChild(b),b.innerHTML=a.outerHTML;return b.firstChild}function bn(a){var b=(a.nodeName||"").toLowerCase();b==="input"?bm(a):b!=="script"&&typeof a.getElementsByTagName!="undefined"&&f.grep(a.getElementsByTagName("input"),bm)}function bm(a){if(a.type==="checkbox"||a.type==="radio"){a.defaultChecked=a.checked}}function bl(a){return typeof a.getElementsByTagName!="undefined"?a.getElementsByTagName("*"):typeof a.querySelectorAll!="undefined"?a.querySelectorAll("*"):[]}function bk(a,b){var c;if(b.nodeType===1){b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase();if(c==="object"){b.outerHTML=a.outerHTML}else{if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option"){b.selected=a.defaultSelected}else{if(c==="input"||c==="textarea"){b.defaultValue=a.defaultValue}}}else{a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value)}}b.removeAttribute(f.expando)}}function bj(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c,d,e,g=f._data(a),h=f._data(b,g),i=g.events;if(i){delete h.handle,h.events={};for(c in i){for(d=0,e=i[c].length;d<e;d++){f.event.add(b,c+(i[c][d].namespace?".":"")+i[c][d].namespace,i[c][d],i[c][d].data)}}}h.data&&(h.data=f.extend({},h.data))}}function bi(a,b){return f.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function U(a){var b=V.split("|"),c=a.createDocumentFragment();if(c.createElement){while(b.length){c.createElement(b.pop())}}return c}function T(a,b,c){b=b||0;if(f.isFunction(b)){return f.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c})}if(b.nodeType){return f.grep(a,function(a,d){return a===b===c})}if(typeof b=="string"){var d=f.grep(a,function(a){return a.nodeType===1});if(O.test(b)){return f.filter(b,d,!c)}b=f.filter(b,d)}return f.grep(a,function(a,d){return f.inArray(a,b)>=0===c})}function S(a){return !a||!a.parentNode||a.parentNode.nodeType===11}function K(){return !0}function J(){return !1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b])){continue}if(b!=="toJSON"){return !1}}return !0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?parseFloat(d):j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else{d=b}}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c<d;c++){b[a[c]]=!0}return b}var c=a.document,d=a.navigator,e=a.location,f=function(){function J(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(J,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a){return this}if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2]){return f.find(a)}this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return !d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a)){return f.ready(a)}a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.1",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j<k;j++){if((a=arguments[j])!=null){for(c in a){d=i[c],f=a[c];if(i===f){continue}l&&f&&(e.isPlainObject(f)||(g=e.isArray(f)))?(g?(g=!1,h=d&&e.isArray(d)?d:[]):h=d&&e.isPlainObject(d)?d:{},i[c]=e.extend(l,h,f)):f!==b&&(i[c]=f)}}}return i},e.extend({noConflict:function(b){a.$===e&&(a.$=g),b&&a.jQuery===e&&(a.jQuery=f);return e},isReady:!1,readyWait:1,holdReady:function(a){a?e.readyWait++:e.ready(!0)},ready:function(a){if(a===!0&&!--e.readyWait||a!==!0&&!e.isReady){if(!c.body){return setTimeout(e.ready,1)}e.isReady=!0;if(a!==!0&&--e.readyWait>0){return}A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete"){return setTimeout(e.ready,1)}if(c.addEventListener){c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1)}else{if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval" in a},isNumeric:function(a){return !isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a)){return !1}try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf")){return !1}}catch(c){return !1}var d;for(d in a){}return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a){return !1}return !0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b){return null}b=e.trim(b);if(a.JSON&&a.JSON.parse){return a.JSON.parse(b)}if(n.test(b.replace(o,"@").replace(p,"]").replace(q,""))){return(new Function("return "+b))()}e.error("Invalid JSON: "+b)},parseXML:function(c){var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a){if(c.apply(a[f],d)===!1){break}}}else{for(;g<h;){if(c.apply(a[g++],d)===!1){break}}}}else{if(i){for(f in a){if(c.call(a[f],f,a[f])===!1){break}}}else{for(;g<h;){if(c.call(a[g],g,a[g++])===!1){break}}}}return a},trim:G?function(a){return a==null?"":G.call(a)}:function(a){return a==null?"":(a+"").replace(k,"").replace(l,"")},makeArray:function(a,b){var c=b||[];if(a!=null){var d=e.type(a);a.length==null||d==="string"||d==="function"||d==="regexp"||e.isWindow(a)?E.call(c,a):e.merge(c,a)}return c},inArray:function(a,b,c){var d;if(b){if(H){return H.call(b,a,c)}d=b.length,c=c?c<0?Math.max(0,d+c):c:0;for(;c<d;c++){if(c in b&&b[c]===a){return c}}}return -1},merge:function(a,c){var d=a.length,e=0;if(typeof c.length=="number"){for(var f=c.length;e<f;e++){a[d++]=c[e]}}else{while(c[e]!==b){a[d++]=c[e++]}}a.length=d;return a},grep:function(a,b,c){var d=[],e;c=!!c;for(var f=0,g=a.length;f<g;f++){e=!!b(a[f],f),c!==e&&d.push(a[f])}return d},map:function(a,c,d){var f,g,h=[],i=0,j=a.length,k=a instanceof e||j!==b&&typeof j=="number"&&(j>0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k){for(;i<j;i++){f=c(a[i],i,d),f!=null&&(h[h.length]=f)}}else{for(g in a){f=c(a[g],g,d),f!=null&&(h[h.length]=f)}}return h.concat.apply([],h)},guid:1,proxy:function(a,c){if(typeof c=="string"){var d=a[c];c=a,a=d}if(!e.isFunction(a)){return b}var f=F.call(arguments,2),g=function(){return a.apply(c,f.concat(F.call(arguments)))};g.guid=a.guid=a.guid||g.guid||e.guid++;return g},access:function(a,c,d,f,g,h){var i=a.length;if(typeof c=="object"){for(var j in c){e.access(a,j,c[j],f,g,d)}return a}if(d!==b){f=!h&&f&&e.isFunction(d);for(var k=0;k<i;k++){g(a[k],c,f?d.call(a[k],k,g(a[k],c)):d,h)}return a}return i?g(a[0],c):b},now:function(){return(new Date).getTime()},uaMatch:function(a){a=a.toLowerCase();var b=r.exec(a)||s.exec(a)||t.exec(a)||a.indexOf("compatible")<0&&u.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}e.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function(d,f){f&&f instanceof e&&!(f instanceof a)&&(f=a(f));return e.fn.init.call(this,d,f,b)},a.fn.init.prototype=a.fn;var b=a(c);return a},browser:{}}),e.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){I["[object "+b+"]"]=b.toLowerCase()}),z=e.uaMatch(y),z.browser&&(e.browser[z.browser]=!0,e.browser.version=z.version),e.browser.webkit&&(e.browser.safari=!0),j.test(" ")&&(k=/^[\s\xA0]+/,l=/[\s\xA0]+$/),h=e(c),c.addEventListener?B=function(){c.removeEventListener("DOMContentLoaded",B,!1),e.ready()}:c.attachEvent&&(B=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",B),e.ready())});return e}(),g={};f.Callbacks=function(a){a=a?g[a]||h(a):{};var c=[],d=[],e,i,j,k,l,m=function(b){var d,e,g,h,i;for(d=0,e=b.length;d<e;d++){g=b[d],h=f.type(g),h==="array"?m(g):h==="function"&&(!a.unique||!o.has(g))&&c.push(g)}},n=function(b,f){f=f||[],e=!a.memory||[b,f],i=!0,l=j||0,j=0,k=c.length;for(;c&&l<k;l++){if(c[l].apply(b,f)===!1&&a.stopOnFalse){e=!0;break}}i=!1,c&&(a.once?e===!0?o.disable():c=[]:d&&d.length&&(e=d.shift(),o.fireWith(e[0],e[1])))},o={add:function(){if(c){var a=c.length;m(arguments),i?k=c.length:e&&e!==!0&&(j=a,n(e[0],e[1]))}return this},remove:function(){if(c){var b=arguments,d=0,e=b.length;for(;d<e;d++){for(var f=0;f<c.length;f++){if(b[d]===c[f]){i&&f<=k&&(k--,f<=l&&l--),c.splice(f--,1);if(a.unique){break}}}}}return this},has:function(a){if(c){var b=0,d=c.length;for(;b<d;b++){if(a===c[b]){return !0}}}return !1},empty:function(){c=[];return this},disable:function(){c=d=e=b;return this},disabled:function(){return !c},lock:function(){d=b,(!e||e===!0)&&o.disable();return this},locked:function(){return !d},fireWith:function(b,c){d&&(i?a.once||d.push([b,c]):(!a.once||!e)&&n(b,c));return this},fire:function(){o.fireWith(this,arguments);return this},fired:function(){return !!e}};return o};var i=[].slice;f.extend({Deferred:function(a){var b=f.Callbacks("once memory"),c=f.Callbacks("once memory"),d=f.Callbacks("memory"),e="pending",g={resolve:b,reject:c,notify:d},h={done:b.add,fail:c.add,progress:d.add,state:function(){return e},isResolved:b.fired,isRejected:c.fired,then:function(a,b,c){i.done(a).fail(b).progress(c);return this},always:function(){i.done.apply(i,arguments).fail.apply(i,arguments);return this},pipe:function(a,b,c){return f.Deferred(function(d){f.each({done:[a,"resolve"],fail:[b,"reject"],progress:[c,"notify"]},function(a,b){var c=b[0],e=b[1],g;f.isFunction(c)?i[a](function(){g=c.apply(this,arguments),g&&f.isFunction(g.promise)?g.promise().then(d.resolve,d.reject,d.notify):d[e+"With"](this===i?d:this,[g])}):i[a](d[e])})}).promise()},promise:function(a){if(a==null){a=h}else{for(var b in h){a[b]=h[b]}}return a}},i=h.promise({}),j;for(j in g){i[j]=g[j].fire,i[j+"With"]=g[j].fireWith}i.done(function(){e="resolved"},c.disable,d.lock).fail(function(){e="rejected"},b.disable,d.lock),a&&a.call(i,i);return i},when:function(a){function m(a){return function(b){e[a]=arguments.length>1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c<d;c++){b[c]&&b[c].promise&&f.isFunction(b[c].promise)?b[c].promise().then(l(c),j.reject,m(c)):--g}g||j.resolveWith(j,b)}else{j!==a&&j.resolveWith(j,d?[a]:[])}return k}}),f.support=function(){var b,d,e,g,h,i,j,k,l,m,n,o,p,q=c.createElement("div"),r=c.documentElement;q.setAttribute("className","t"),q.innerHTML=" <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>",d=q.getElementsByTagName("*"),e=q.getElementsByTagName("a")[0];if(!d||!d.length||!e){return{}}g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=q.getElementsByTagName("input")[0],b={leadingWhitespace:q.firstChild.nodeType===3,tbody:!q.getElementsByTagName("tbody").length,htmlSerialize:!!q.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:q.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete q.test}catch(s){b.deleteExpando=!1}!q.addEventListener&&q.attachEvent&&q.fireEvent&&(q.attachEvent("onclick",function(){b.noCloneEvent=!1}),q.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),q.appendChild(i),k=c.createDocumentFragment(),k.appendChild(q.lastChild),b.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,k.removeChild(i),k.appendChild(q),q.innerHTML="",a.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",q.style.width="2px",q.appendChild(j),b.reliableMarginRight=(parseInt((a.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0);if(q.attachEvent){for(o in {submit:1,change:1,focusin:1}){n="on"+o,p=n in q,p||(q.setAttribute(n,"return;"),p=typeof q[n]=="function"),b[o+"Bubbles"]=p}}k.removeChild(q),k=g=h=j=q=i=null,f(function(){var a,d,e,g,h,i,j,k,m,n,o,r=c.getElementsByTagName("body")[0];!r||(j=1,k="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",m="visibility:hidden;border:0;",n="style='"+k+"border:5px solid #000;padding:0;'",o="<div "+n+"><div></div></div><table "+n+" cellpadding='0' cellspacing='0'><tr><td></td></tr></table>",a=c.createElement("div"),a.style.cssText=m+"width:0;height:0;position:static;top:0;margin-top:"+j+"px",r.insertBefore(a,r.firstChild),q=c.createElement("div"),a.appendChild(q),q.innerHTML="<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>",l=q.getElementsByTagName("td"),p=l[0].offsetHeight===0,l[0].style.display="",l[1].style.display="none",b.reliableHiddenOffsets=p&&l[0].offsetHeight===0,q.innerHTML="",q.style.width=q.style.paddingLeft="1px",f.boxModel=b.boxModel=q.offsetWidth===2,typeof q.style.zoom!="undefined"&&(q.style.display="inline",q.style.zoom=1,b.inlineBlockNeedsLayout=q.offsetWidth===2,q.style.display="",q.innerHTML="<div style='width:4px;'></div>",b.shrinkWrapBlocks=q.offsetWidth!==2),q.style.cssText=k+m,q.innerHTML=o,d=q.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,i={doesNotAddBorder:e.offsetTop!==5,doesAddBorderForTableAndCells:h.offsetTop===5},e.style.position="fixed",e.style.top="20px",i.fixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",i.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,i.doesNotIncludeMarginInBodyOffset=r.offsetTop!==j,r.removeChild(a),q=a=null,f.extend(b,i))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return !!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b){return}n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function"){e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c)}g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c]){return g.events}k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k]){return}if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e<g;e++){delete d[b[e]]}if(!(c?m:f.isEmptyObject)(d)){return}}}if(!c){delete j[k].data;if(!m(j[k])){return}}f.support.deleteExpando||!j.setInterval?delete j[k]:j[k]=null,i&&(f.support.deleteExpando?delete a[h]:a.removeAttribute?a.removeAttribute(h):a[h]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b){return b!==!0&&a.getAttribute("classid")===b}}return !0}}),f.fn.extend({data:function(a,c){var d,e,g,h=null;if(typeof a=="undefined"){if(this.length){h=f.data(this[0]);if(this[0].nodeType===1&&!f._data(this[0],"parsedAttrs")){e=this[0].attributes;for(var i=0,j=e.length;i<j;i++){g=e[i].name,g.indexOf("data-")===0&&(g=f.camelCase(g.substring(5)),l(this[0],g,h[g]))}f._data(this[0],"parsedAttrs",!0)}}return h}if(typeof a=="object"){return this.each(function(){f.data(this,a)})}d=a.split("."),d[1]=d[1]?"."+d[1]:"";if(c===b){h=this.triggerHandler("getData"+d[1]+"!",[d[0]]),h===b&&this.length&&(h=f.data(this[0],a),h=l(this[0],a,h));return h===b&&d[1]?this.data(d[0]):h}return this.each(function(){var b=f(this),e=[d[0],c];b.triggerHandler("setData"+d[1]+"!",e),f.data(this,a,c),b.triggerHandler("changeData"+d[1]+"!",e)})},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,b){a&&(b=(b||"fx")+"mark",f._data(a,b,(f._data(a,b)||0)+1))},_unmark:function(a,b,c){a!==!0&&(c=b,b=a,a=!1);if(b){c=c||"fx";var d=c+"mark",e=a?0:(f._data(b,d)||1)-1;e?f._data(b,d,e):(f.removeData(b,d,!0),n(b,c,"mark"))}},queue:function(a,b,c){var d;if(a){b=(b||"fx")+"queue",d=f._data(a,b),c&&(!d||f.isArray(c)?d=f._data(a,b,f.makeArray(c)):d.push(c));return d||[]}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e={};d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),f._data(a,b+".run",e),d.call(a,function(){f.dequeue(a,b)},e)),c.length||(f.removeData(a,b+"queue "+b+".run",!0),n(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){typeof a!="string"&&(c=a,a="fx");if(c===b){return f.queue(this[0],a)}return this.each(function(){var b=f.queue(this,a,c);a==="fx"&&b[0]!=="inprogress"&&f.dequeue(this,a)})},dequeue:function(a){return this.each(function(){f.dequeue(this,a)})},delay:function(a,b){a=f.fx?f.fx.speeds[a]||a:a,b=b||"fx";return this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,c){function m(){--h||d.resolveWith(e,[e])}typeof a!="string"&&(c=a,a=b),a=a||"fx";var d=f.Deferred(),e=this,g=e.length,h=1,i=a+"defer",j=a+"queue",k=a+"mark",l;while(g--){if(l=f.data(e[g],i,b,!0)||(f.data(e[g],j,b,!0)||f.data(e[g],k,b,!0))&&f.data(e[g],i,f.Callbacks("once memory"),!0)){h++,l.add(m)}}m();return d.promise()}});var o=/[\n\t\r]/g,p=/\s+/,q=/\r/g,r=/^(?:button|input)$/i,s=/^(?:button|input|object|select|textarea)$/i,t=/^a(?:rea)?$/i,u=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,v=f.support.getSetAttribute,w,x,y;f.fn.extend({attr:function(a,b){return f.access(this,a,b,!0,f.attr)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,a,b,!0,f.prop)},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,g,h,i;if(f.isFunction(a)){return this.each(function(b){f(this).addClass(a.call(this,b,this.className))})}if(a&&typeof a=="string"){b=a.split(p);for(c=0,d=this.length;c<d;c++){e=this[c];if(e.nodeType===1){if(!e.className&&b.length===1){e.className=a}else{g=" "+e.className+" ";for(h=0,i=b.length;h<i;h++){~g.indexOf(" "+b[h]+" ")||(g+=b[h]+" ")}e.className=f.trim(g)}}}}return this},removeClass:function(a){var c,d,e,g,h,i,j;if(f.isFunction(a)){return this.each(function(b){f(this).removeClass(a.call(this,b,this.className))})}if(a&&typeof a=="string"||a===b){c=(a||"").split(p);for(d=0,e=this.length;d<e;d++){g=this[d];if(g.nodeType===1&&g.className){if(a){h=(" "+g.className+" ").replace(o," ");for(i=0,j=c.length;i<j;i++){h=h.replace(" "+c[i]+" "," ")}g.className=f.trim(h)}else{g.className=""}}}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";if(f.isFunction(a)){return this.each(function(c){f(this).toggleClass(a.call(this,c,this.className,b),b)})}return this.each(function(){if(c==="string"){var e,g=0,h=f(this),i=b,j=a.split(p);while(e=j[g++]){i=d?i:!h.hasClass(e),h[i?"addClass":"removeClass"](e)}}else{if(c==="undefined"||c==="boolean"){this.className&&f._data(this,"__className__",this.className),this.className=this.className||a===!1?"":f._data(this,"__className__")||""}}})},hasClass:function(a){var b=" "+a+" ",c=0,d=this.length;for(;c<d;c++){if(this[c].nodeType===1&&(" "+this[c].className+" ").replace(o," ").indexOf(b)>-1){return !0}}return !1},val:function(a){var c,d,e,g=this[0];if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set" in c)||c.set(this,h,"value")===b){this.value=h}}})}if(g){c=f.valHooks[g.nodeName.toLowerCase()]||f.valHooks[g.type];if(c&&"get" in c&&(d=c.get(g,"value"))!==b){return d}d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return !b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0){return null}c=j?g:0,d=j?g+1:i.length;for(;c<d;c++){e=i[c];if(e.selected&&(f.support.optDisabled?!e.disabled:e.getAttribute("disabled")===null)&&(!e.parentNode.disabled||!f.nodeName(e.parentNode,"optgroup"))){b=f(e).val();if(j){return b}h.push(b)}}if(j&&!h.length&&i.length){return f(i[g]).val()}return h},set:function(a,b){var c=f.makeArray(b);f(a).find("option").each(function(){this.selected=f.inArray(f(this).val(),c)>=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn){return f(a)[c](d)}if(typeof a.getAttribute=="undefined"){return f.prop(a,c,d)}i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set" in h&&i&&(g=h.set(a,d,c))!==b){return g}a.setAttribute(c,""+d);return d}if(h&&"get" in h&&i&&(g=h.get(a,c))!==null){return g}g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;h<g;h++){e=d[h],e&&(c=f.propFix[e]||e,f.attr(a,e,""),a.removeAttribute(v?e:c),u.test(e)&&c in a&&(a[c]=!1))}}},attrHooks:{type:{set:function(a,b){if(r.test(a.nodeName)&&a.parentNode){f.error("type property can't be changed")}else{if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}}},value:{get:function(a,b){if(w&&f.nodeName(a,"button")){return w.get(a,b)}return b in a?a.value:null},set:function(a,b,c){if(w&&f.nodeName(a,"button")){return w.set(a,b,c)}a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e,g,h,i=a.nodeType;if(!!a&&i!==3&&i!==8&&i!==2){h=i!==1||!f.isXMLDoc(a),h&&(c=f.propFix[c]||c,g=f.propHooks[c]);return d!==b?g&&"set" in g&&(e=g.set(a,d,c))!==b?e:a[c]=d:g&&"get" in g&&(e=g.get(a,c))!==null?e:a[c]}},propHooks:{tabIndex:{get:function(a){var c=a.getAttributeNode("tabindex");return c&&c.specified?parseInt(c.value,10):s.test(a.nodeName)||t.test(a.nodeName)&&a.href?0:b}}}}),f.attrHooks.tabindex=f.propHooks.tabIndex,x={get:function(a,c){var d,e=f.prop(a,c);return e===!0||typeof e!="boolean"&&(d=a.getAttributeNode(c))&&d.nodeValue!==!1?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase()));return c}},v||(y={name:!0,id:!0},w=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&(y[c]?d.nodeValue!=="":d.specified)?d.nodeValue:b},set:function(a,b,d){var e=a.getAttributeNode(d);e||(e=c.createAttribute(d),a.setAttributeNode(e));return e.nodeValue=b+""}},f.attrHooks.tabindex.set=w.set,f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})}),f.attrHooks.contenteditable={get:w.get,set:function(a,b,c){b===""&&(b="false"),w.set(a,b,c)}}),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex);return null}})),f.support.enctype||(f.propFix.enctype="encoding"),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b)){return a.checked=f.inArray(f(a).val(),b)>=0}}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/\bhover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")};f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k<c.length;k++){l=A.exec(c[k])||[],m=l[1],n=(l[2]||"").split(".").sort(),s=f.event.special[m]||{},m=(g?s.delegateType:s.bindType)||m,s=f.event.special[m]||{},o=f.extend({type:m,origType:l[1],data:e,handler:d,guid:d.guid,selector:g,quick:G(g),namespace:n.join(".")},p),r=j[m];if(!r){r=j[m]=[],r.delegateCount=0;if(!s.setup||s.setup.call(a,e,n,i)===!1){a.addEventListener?a.addEventListener(m,i,!1):a.attachEvent&&a.attachEvent("on"+m,i)}}s.add&&(s.add.call(a,o),o.handler.guid||(o.handler.guid=d.guid)),g?r.splice(r.delegateCount++,0,o):r.push(o),f.event.global[m]=!0}a=null}},global:{},remove:function(a,b,c,d,e){var g=f.hasData(a)&&f._data(a),h,i,j,k,l,m,n,o,p,q,r,s;if(!!g&&!!(o=g.events)){b=f.trim(I(b||"")).split(" ");for(h=0;h<b.length;h++){i=A.exec(b[h])||[],j=k=i[1],l=i[2];if(!j){for(j in o){f.event.remove(a,j+b[h],c,d,!0)}continue}p=f.event.special[j]||{},j=(d?p.delegateType:p.bindType)||j,r=o[j]||[],m=r.length,l=l?new RegExp("(^|\\.)"+l.split(".").sort().join("\\.(?:.*\\.)?")+"(\\.|$)"):null;for(n=0;n<r.length;n++){s=r[n],(e||k===s.origType)&&(!c||c.guid===s.guid)&&(!l||l.test(s.namespace))&&(!d||d===s.selector||d==="**"&&s.selector)&&(r.splice(n--,1),s.selector&&r.delegateCount--,p.remove&&p.remove.call(a,s))}r.length===0&&m!==r.length&&((!p.teardown||p.teardown.call(a,l)===!1)&&f.removeEvent(a,j,g.handle),delete o[j])}f.isEmptyObject(o)&&(q=g.handle,q&&(q.elem=null),f.removeData(a,["events","handle"],!0))}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,e,g){if(!e||e.nodeType!==3&&e.nodeType!==8){var h=c.type||c,i=[],j,k,l,m,n,o,p,q,r,s;if(E.test(h+f.event.triggered)){return}h.indexOf("!")>=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h]){return}c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j){j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0)}return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1){return}r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode){r.push([m,s]),n=m}n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;l<r.length&&!c.isPropagationStopped();l++){m=r[l][0],c.type=r[l][1],q=(f._data(m,"events")||{})[c.type]&&f._data(m,"handle"),q&&q.apply(m,d),q=o&&m[o],q&&f.acceptData(m)&&q.apply(m,d)===!1&&c.preventDefault()}c.type=h,!g&&!c.isDefaultPrevented()&&(!p._default||p._default.apply(e.ownerDocument,d)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)&&o&&e[h]&&(h!=="focus"&&h!=="blur"||c.target.offsetWidth!==0)&&!f.isWindow(e)&&(n=e[o],n&&(e[o]=null),f.event.triggered=h,e[h](),f.event.triggered=b,n&&(e[o]=n));return c.result}},dispatch:function(c){c=f.event.fix(c||a.event);var d=(f._data(this,"events")||{})[c.type]||[],e=d.delegateCount,g=[].slice.call(arguments,0),h=!c.exclusive&&!c.namespace,i=[],j,k,l,m,n,o,p,q,r,s,t;g[0]=c,c.delegateTarget=this;if(e&&!c.target.disabled&&(!c.button||c.type!=="click")){m=f(this),m.context=this.ownerDocument||this;for(l=c.target;l!=this;l=l.parentNode||this){o={},q=[],m[0]=l;for(j=0;j<e;j++){r=d[j],s=r.selector,o[s]===b&&(o[s]=r.quick?H(l,r.quick):m.is(s)),o[s]&&q.push(r)}q.length&&i.push({elem:l,matches:q})}}d.length>e&&i.push({elem:this,matches:d.slice(e)});for(j=0;j<i.length&&!c.isPropagationStopped();j++){p=i[j],c.currentTarget=p.elem;for(k=0;k<p.matches.length&&!c.isImmediatePropagationStopped();k++){r=p.matches[k];if(h||!c.namespace&&!r.namespace||c.namespace_re&&c.namespace_re.test(r.namespace)){c.data=r.data,c.handleObj=r,n=((f.event.special[r.origType]||{}).handle||r.handler).apply(p.elem,g),n!==b&&(c.result=n,n===!1&&(c.preventDefault(),c.stopPropagation()))}}}return c.result},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){a.which==null&&(a.which=b.charCode!=null?b.charCode:b.keyCode);return a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,d){var e,f,g,h=d.button,i=d.fromElement;a.pageX==null&&d.clientX!=null&&(e=a.target.ownerDocument||c,f=e.documentElement,g=e.body,a.pageX=d.clientX+(f&&f.scrollLeft||g&&g.scrollLeft||0)-(f&&f.clientLeft||g&&g.clientLeft||0),a.pageY=d.clientY+(f&&f.scrollTop||g&&g.scrollTop||0)-(f&&f.clientTop||g&&g.clientTop||0)),!a.relatedTarget&&i&&(a.relatedTarget=i===a.target?d.toElement:i),!a.which&&h!==b&&(a.which=h&1?1:h&2?3:h&4?2:0);return a}},fix:function(a){if(a[f.expando]){return a}var d,e,g=a,h=f.event.fixHooks[a.type]||{},i=h.props?this.props.concat(h.props):this.props;a=f.Event(g);for(d=i.length;d;){e=i[--d],a[e]=g[e]}a.target||(a.target=g.srcElement||c),a.target.nodeType===3&&(a.target=a.target.parentNode),a.metaKey===b&&(a.metaKey=a.ctrlKey);return h.filter?h.filter(a,g):a},special:{ready:{setup:f.bindReady},load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(a,b,c){f.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}},simulate:function(a,b,c,d){var e=f.extend(new f.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?f.event.trigger(e,null,b):f.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},f.event.handle=f.event.dispatch,f.removeEvent=c.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)},f.Event=function(a,b){if(!(this instanceof f.Event)){return new f.Event(a,b)}a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?K:J):this.type=a,b&&f.extend(this,b),this.timeStamp=a&&a.timeStamp||f.now(),this[f.expando]=!0},f.Event.prototype={preventDefault:function(){this.isDefaultPrevented=K;var a=this.originalEvent;!a||(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=K;var a=this.originalEvent;!a||(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=K,this.stopPropagation()},isDefaultPrevented:J,isPropagationStopped:J,isImmediatePropagationStopped:J},f.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){f.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c=this,d=a.relatedTarget,e=a.handleObj,g=e.selector,h;if(!d||d!==c&&!f.contains(c,d)){a.type=e.origType,h=e.handler.apply(this,arguments),a.type=b}return h}}}),f.support.submitBubbles||(f.event.special.submit={setup:function(){if(f.nodeName(this,"form")){return !1}f.event.add(this,"click._submit keypress._submit",function(a){var c=a.target,d=f.nodeName(c,"input")||f.nodeName(c,"button")?c.form:b;d&&!d._submit_attached&&(f.event.add(d,"submit._submit",function(a){this.parentNode&&!a.isTrigger&&f.event.simulate("submit",this.parentNode,a,!0)}),d._submit_attached=!0)})},teardown:function(){if(f.nodeName(this,"form")){return !1}f.event.remove(this,"._submit")}}),f.support.changeBubbles||(f.event.special.change={setup:function(){if(z.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio"){f.event.add(this,"propertychange._change",function(a){a.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),f.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1,f.event.simulate("change",this,a,!0))})}return !1}f.event.add(this,"beforeactivate._change",function(a){var b=a.target;z.test(b.nodeName)&&!b._change_attached&&(f.event.add(b,"change._change",function(a){this.parentNode&&!a.isSimulated&&!a.isTrigger&&f.event.simulate("change",this.parentNode,a,!0)}),b._change_attached=!0)})},handle:function(a){var b=a.target;if(this!==b||a.isSimulated||a.isTrigger||b.type!=="radio"&&b.type!=="checkbox"){return a.handleObj.handler.apply(this,arguments)}},teardown:function(){f.event.remove(this,"._change");return z.test(this.nodeName)}}),f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){var d=0,e=function(a){f.event.simulate(b,a.target,f.event.fix(a),!0)};f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.fn.extend({on:function(a,c,d,e,g){var h,i;if(typeof a=="object"){typeof c!="string"&&(d=c,c=b);for(i in a){this.on(i,c,d,a[i],g)}return this}d==null&&e==null?(e=c,d=c=b):e==null&&(typeof c=="string"?(e=d,d=b):(e=d,d=c,c=b));if(e===!1){e=J}else{if(!e){return this}}g===1&&(h=e,e=function(a){f().off(a);return h.apply(this,arguments)},e.guid=h.guid||(h.guid=f.guid++));return this.each(function(){f.event.add(this,a,e,d,c)})},one:function(a,b,c,d){return this.on.call(this,a,b,c,d,1)},off:function(a,c,d){if(a&&a.preventDefault&&a.handleObj){var e=a.handleObj;f(a.delegateTarget).off(e.namespace?e.type+"."+e.namespace:e.type,e.selector,e.handler);return this}if(typeof a=="object"){for(var g in a){this.off(g,c,a[g])}return this}if(c===!1||typeof c=="function"){d=c,c=b}d===!1&&(d=J);return this.each(function(){f.event.remove(this,a,d,c)})},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},live:function(a,b,c){f(this.context).on(a,this.selector,b,c);return this},die:function(a,b){f(this.context).off(a,this.selector||"**",b);return this},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return arguments.length==1?this.off(a,"**"):this.off(b,a,c)},trigger:function(a,b){return this.each(function(){f.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){return f.event.trigger(a,b,this[0],!0)}},toggle:function(a){var b=arguments,c=a.guid||f.guid++,d=0,e=function(c){var e=(f._data(this,"lastToggle"+a.guid)||0)%d;f._data(this,"lastToggle"+a.guid,e+1),c.preventDefault();return b[e].apply(this,arguments)||!1};e.guid=c;while(d<b.length){b[d++].guid=c}return this.click(e)},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),f.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){f.fn[b]=function(a,c){c==null&&(c=a,a=null);return arguments.length>0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}if(j.nodeType===1){g||(j[d]=c,j.sizset=h);if(typeof b!="string"){if(j===b){k=!0;break}}else{if(m.filter(b,[j]).length>0){k=j;break}}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}j.nodeType===1&&!g&&(j[d]=c,j.sizset=h);if(j.nodeName.toLowerCase()===b){k=j;break}j=j[a]}e[h]=k}}}var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9){return[]}if(!b||typeof b!="string"){return e}var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b)){if(w.length===2&&o.relative[w[0]]){j=y(w[0]+w[1],d,f)}else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length){b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}}}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length){q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}}else{k=w=[]}}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]"){if(!u){e.push.apply(e,k)}else{if(d&&d.nodeType===1){for(t=0;k[t]!=null;t++){k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t])}}else{for(t=0;k[t]!=null;t++){k[t]&&k[t].nodeType===1&&e.push(j[t])}}}}else{s(k,e)}l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h){for(var b=1;b<a.length;b++){a[b]===a[b-1]&&a.splice(b--,1)}}}return a},m.matches=function(a,b){return m(a,null,null,b)},m.matchesSelector=function(a,b){return m(b,null,null,[a]).length>0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a){return[]}for(e=0,f=o.order.length;e<f;e++){h=o.order[e];if(g=o.leftMatch[h].exec(a)){i=g[1],g.splice(1,1);if(i.substr(i.length-1)!=="\\"){g[1]=(g[1]||"").replace(j,""),d=o.find[h](g,b,c);if(d!=null){a=a.replace(o.match[h],"");break}}}}d||(d=typeof b.getElementsByTagName!="undefined"?b.getElementsByTagName("*"):[]);return{set:d,expr:a}},m.filter=function(a,c,d,e){var f,g,h,i,j,k,l,n,p,q=a,r=[],s=c,t=c&&c[0]&&m.isXML(c[0]);while(a&&c.length){for(h in o.filter){if((f=o.leftMatch[h].exec(a))!=null&&f[2]){k=o.filter[h],l=f[1],g=!1,f.splice(1,1);if(l.substr(l.length-1)==="\\"){continue}s===r&&(r=[]);if(o.preFilter[h]){f=o.preFilter[h](f,s,d,r,e,t);if(!f){g=i=!0}else{if(f===!0){continue}}}if(f){for(n=0;(j=s[n])!=null;n++){j&&(i=k(j,f,n,s),p=e^i,d&&i!=null?p?g=!0:s[n]=!1:p&&(r.push(j),g=!0))}}if(i!==b){d||(s=r),a=a.replace(o.match[h],"");if(!g){return[]}break}}}if(a===q){if(g==null){m.error(a)}else{break}}q=a}return s},m.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)};var n=m.getText=function(a){var b,c,d=a.nodeType,e="";if(d){if(d===1||d===9){if(typeof a.textContent=="string"){return a.textContent}if(typeof a.innerText=="string"){return a.innerText.replace(k,"")}for(a=a.firstChild;a;a=a.nextSibling){e+=n(a)}}else{if(d===3||d===4){return a.nodeValue}}}else{for(b=0;c=a[b];b++){c.nodeType!==8&&(e+=n(c))}}return e},o=m.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c=typeof b=="string",d=c&&!l.test(b),e=c&&!d;d&&(b=b.toLowerCase());for(var f=0,g=a.length,h;f<g;f++){if(h=a[f]){while((h=h.previousSibling)&&h.nodeType!==1){}a[f]=e||h&&h.nodeName.toLowerCase()===b?h||!1:h===b}}e&&m.filter(b,a,!0)},">":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e<f;e++){c=a[e];if(c){var g=c.parentNode;a[e]=g.nodeName.toLowerCase()===b?g:!1}}}else{for(;e<f;e++){c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode===b)}d&&m.filter(b,a,!0)}},"":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("parentNode",b,f,a,d,c)},"~":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("previousSibling",b,f,a,d,c)}},find:{ID:function(a,b,c){if(typeof b.getElementById!="undefined"&&!c){var d=b.getElementById(a[1]);return d&&d.parentNode?[d]:[]}},NAME:function(a,b){if(typeof b.getElementsByName!="undefined"){var c=[],d=b.getElementsByName(a[1]);for(var e=0,f=d.length;e<f;e++){d[e].getAttribute("name")===a[1]&&c.push(d[e])}return c.length===0?null:c}},TAG:function(a,b){if(typeof b.getElementsByTagName!="undefined"){return b.getElementsByTagName(a[1])}}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(j,"")+" ";if(f){return a}for(var g=0,h;(h=b[g])!=null;g++){h&&(e^(h.className&&(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?c||d.push(h):c&&(b[g]=!1))}return !1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else{a[2]&&m.error(a[0])}a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not"){if((a.exec(b[3])||"").length>1||/^\w/.test(b[3])){b[3]=m(b[3],null,null,c)}else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return !1}}else{if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0])){return !0}}return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return !!a.firstChild},empty:function(a){return !a.firstChild},has:function(a,b,c){return !!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f){return f(a,c,b,d)}if(e==="contains"){return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0}if(e==="not"){var g=b[3];for(var h=0,i=g.length;h<i;h++){if(g[h]===a){return !1}}return !0}m.error(e)},CHILD:function(a,b){var c,e,f,g,h,i,j,k=b[1],l=a;switch(k){case"only":case"first":while(l=l.previousSibling){if(l.nodeType===1){return !1}}if(k==="first"){return !0}l=a;case"last":while(l=l.nextSibling){if(l.nodeType===1){return !1}}return !0;case"nth":c=b[2],e=b[3];if(c===1&&e===0){return !0}f=b[0],g=a.parentNode;if(g&&(g[d]!==f||!a.nodeIndex)){i=0;for(l=g.firstChild;l;l=l.nextSibling){l.nodeType===1&&(l.nodeIndex=++i)}g[d]=f}j=a.nodeIndex-e;return c===0?j===0:j%c===0&&j/c>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f){return f(a,c,b,d)}}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match){o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q))}var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]"){Array.prototype.push.apply(d,a)}else{if(typeof a.length=="number"){for(var e=a.length;c<e;c++){d.push(a[c])}}else{for(;a[c];c++){d.push(a[c])}}}return d}}var u,v;c.documentElement.compareDocumentPosition?u=function(a,b){if(a===b){h=!0;return 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition){return a.compareDocumentPosition?-1:1}return a.compareDocumentPosition(b)&4?-1:1}:(u=function(a,b){if(a===b){h=!0;return 0}if(a.sourceIndex&&b.sourceIndex){return a.sourceIndex-b.sourceIndex}var c,d,e=[],f=[],g=a.parentNode,i=b.parentNode,j=g;if(g===i){return v(a,b)}if(!g){return -1}if(!i){return 1}while(j){e.unshift(j),j=j.parentNode}j=i;while(j){f.unshift(j),j=j.parentNode}c=e.length,d=f.length;for(var k=0;k<c&&k<d;k++){if(e[k]!==f[k]){return v(e[k],f[k])}}return k===c?v(a,f[k],-1):v(e[k],b,1)},v=function(a,b,c){if(a===b){return c}var d=a.nextSibling;while(d){if(d===b){return -1}d=d.nextSibling}return 1}),function(){var a=c.createElement("div"),d="script"+(new Date).getTime(),e=c.documentElement;a.innerHTML="<a name='"+d+"'/>",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++){c[e].nodeType===1&&d.push(c[e])}c=d}return c}),a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1]){return s(e.getElementsByTagName(b),f)}if(h[2]&&o.find.CLASS&&e.getElementsByClassName){return s(e.getElementsByClassName(h[2]),f)}}if(e.nodeType===9){if(b==="body"&&e.body){return s([e.body],f)}if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode){return s([],f)}if(i.id===h[3]){return s([i],f)}}try{return s(e.querySelectorAll(b),f)}catch(j){}}else{if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p){return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}}catch(r){}finally{l||k.removeAttribute("id")}}}}return a(b,e,f,g)};for(var e in a){m[e]=a[e]}b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a)){try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11){return f}}}catch(g){}}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1){return}o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c){return b.getElementsByClassName(a[1])}},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return !!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return !1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a)){f+=d[0],a=a.replace(o.match.PSEUDO,"")}a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h<i;h++){m(a,g[h],e,c)}return m.filter(f,e)};m.attr=f.attr,m.selectors.attrMap={},f.find=m,f.expr=m.selectors,f.expr[":"]=f.expr.filters,f.unique=m.uniqueSort,f.text=m.getText,f.isXMLDoc=m.isXML,f.contains=m.contains}();var L=/Until$/,M=/^(?:parents|prevUntil|prevAll)/,N=/,/,O=/^.[^:#\[\.,]*$/,P=Array.prototype.slice,Q=f.expr.match.POS,R={children:!0,contents:!0,next:!0,prev:!0};f.fn.extend({find:function(a){var b=this,c,d;if(typeof a!="string"){return f(a).filter(function(){for(c=0,d=b.length;c<d;c++){if(f.contains(b[c],this)){return !0}}})}var e=this.pushStack("","find",a),g,h,i;for(c=0,d=this.length;c<d;c++){g=e.length,f.find(a,this[c],e);if(c>0){for(h=g;h<e.length;h++){for(i=0;i<g;i++){if(e[i]===e[h]){e.splice(h--,1);break}}}}}return e},has:function(a){var b=f(a);return this.filter(function(){for(var a=0,c=b.length;a<c;a++){if(f.contains(this,b[a])){return !0}}})},not:function(a){return this.pushStack(T(this,a,!1),"not",a)},filter:function(a){return this.pushStack(T(this,a,!0),"filter",a)},is:function(a){return !!a&&(typeof a=="string"?Q.test(a)?f(a,this.context).index(this[0])>=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d<a.length;d++){f(g).is(a[d])&&c.push({selector:a[d],elem:g,level:h})}g=g.parentNode,h++}return c}var i=Q.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d<e;d++){g=this[d];while(g){if(i?i.index(g)>-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11){break}}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a){return this[0]&&this[0].parentNode?this.prevAll().length:-1}if(typeof a=="string"){return f.inArray(this[0],f(a))}return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d))){g.nodeType===1&&e.push(g),g=g[c]}return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c]){if(a.nodeType===1&&++e===b){break}}return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling){a.nodeType===1&&a!==b&&c.push(a)}return c}});var V="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/<tbody/i,_=/<|&#?\w+;/,ba=/<(?:script|style)/i,bb=/<(?:script|object|embed|option|style)/i,bc=new RegExp("<(?:"+V+")","i"),bd=/checked\s*(?:[^=]|=\s*.checked.)/i,be=/\/(java|ecma)script/i,bf=/^\s*<!(?:\[CDATA\[|\-\-)/,bg={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div<div>","</div>"]),f.fn.extend({text:function(a){if(f.isFunction(a)){return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))})}if(typeof a!="object"&&a!==b){return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a))}return f.text(this)},wrapAll:function(a){if(f.isFunction(a)){return this.each(function(b){f(this).wrapAll(a.call(this,b))})}if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1){a=a.firstChild}return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a)){return this.each(function(b){f(this).wrapInner(a.call(this,b))})}return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)})}if(arguments.length){var a=f.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)})}if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++){if(!a||f.filter(a,[d]).length){!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d)}}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild){b.removeChild(b.firstChild)}}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b){return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(W,""):null}if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1></$2>");try{for(var c=0,d=this.length;c<d;c++){this[c].nodeType===1&&(f.cleanData(this[c].getElementsByTagName("*")),this[c].innerHTML=a)}}catch(e){this.empty().append(a)}}else{f.isFunction(a)?this.each(function(b){var c=f(this);c.html(a.call(this,b,c.html()))}):this.empty().append(a)}return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(f.isFunction(a)){return this.each(function(b){var c=f(this),d=c.html();c.replaceWith(a.call(this,b,d))})}typeof a!="string"&&(a=f(a).detach());return this.each(function(){var b=this.nextSibling,c=this.parentNode;f(this).remove(),b?f(b).before(a):f(c).append(a)})}return this.length?this.pushStack(f(f.isFunction(a)?a():a),"replaceWith",a):this},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){var e,g,h,i,j=a[0],k=[];if(!f.support.checkClone&&arguments.length===3&&typeof j=="string"&&bd.test(j)){return this.each(function(){f(this).domManip(a,c,d,!0)})}if(f.isFunction(j)){return this.each(function(e){var g=f(this);a[0]=j.call(this,e,c?g.html():b),g.domManip(a,c,d)})}if(this[0]){i=j&&j.parentNode,f.support.parentNode&&i&&i.nodeType===11&&i.childNodes.length===this.length?e={fragment:i}:e=f.buildFragment(a,this,k),h=e.fragment,h.childNodes.length===1?g=h=h.firstChild:g=h.firstChild;if(g){c=c&&f.nodeName(g,"tr");for(var l=0,m=this.length,n=m-1;l<m;l++){d.call(c?bi(this[l],g):this[l],e.cacheable||m>1&&l<n?f.clone(h,!0,!0):h)}}k.length&&f.each(k,bp)}return this}}),f.buildFragment=function(a,b,d){var e,g,h,i,j=a[0];b&&b[0]&&(i=b[0].ownerDocument||b[0]),i.createDocumentFragment||(i=c),a.length===1&&typeof j=="string"&&j.length<512&&i===c&&j.charAt(0)==="<"&&!bb.test(j)&&(f.support.checkClone||!bd.test(j))&&(f.support.html5Clone||!bc.test(j))&&(g=!0,h=f.fragments[j],h&&h!==1&&(e=h)),e||(e=i.createDocumentFragment(),f.clean(a,i,e,d)),g&&(f.fragments[j]=h?e:1);return{fragment:e,cacheable:g}},f.fragments={},f.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){f.fn[a]=function(c){var d=[],e=f(c),g=this.length===1&&this[0].parentNode;if(g&&g.nodeType===11&&g.childNodes.length===1&&e.length===1){e[b](this[0]);return this}for(var h=0,i=e.length;h<i;h++){var j=(h>0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||!bc.test("<"+a.nodeName)?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g){e[g]&&bk(d[g],e[g])}}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g){bj(d[g],e[g])}}}d=e=null;return h},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k){continue}if(typeof k=="string"){if(!_.test(k)){k=b.createTextNode(k)}else{k=k.replace(Y,"<$1></$2>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement("div");b===c?bh.appendChild(o):U(b).appendChild(o),o.innerHTML=m[1]+k+m[2];while(n--){o=o.lastChild}if(!f.support.tbody){var p=$.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]==="<table>"&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i){f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}}!f.support.leadingWhitespace&&X.test(k)&&o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes}}var r;if(!f.support.appendChecked){if(k[0]&&typeof(r=k.length)=="number"){for(i=0;i<r;i++){bn(k[i])}}else{bn(k)}}k.nodeType?h.push(k):h=f.merge(h,k)}if(d){g=function(a){return !a.type||be.test(a.type)};for(j=0;h[j];j++){if(e&&f.nodeName(h[j],"script")&&(!h[j].type||h[j].type.toLowerCase()==="text/javascript")){e.push(h[j].parentNode?h[j].parentNode.removeChild(h[j]):h[j])}else{if(h[j].nodeType===1){var s=f.grep(h[j].getElementsByTagName("script"),g);h.splice.apply(h,[j+1,0].concat(s))}d.appendChild(h[j])}}}return h},cleanData:function(a){var b,c,d=f.cache,e=f.event.special,g=f.support.deleteExpando;for(var h=0,i;(i=a[h])!=null;h++){if(i.nodeName&&f.noData[i.nodeName.toLowerCase()]){continue}c=i[f.expando];if(c){b=d[c];if(b&&b.events){for(var j in b.events){e[j]?f.event.remove(i,j):f.removeEvent(i,j,b.handle)}b.handle&&(b.handle.elem=null)}g?delete i[f.expando]:i.removeAttribute&&i.removeAttribute(f.expando),delete d[c]}}}});var bq=/alpha\([^)]*\)/i,br=/opacity=([^)]*)/,bs=/([A-Z]|^ms)/g,bt=/^-?\d+(?:px)?$/i,bu=/^-?\d/,bv=/^([\-+])=([\-+.\de]+)/,bw={position:"absolute",visibility:"hidden",display:"block"},bx=["Left","Right"],by=["Top","Bottom"],bz,bA,bB;f.fn.css=function(a,c){if(arguments.length===2&&c===b){return this}return f.access(this,a,c,!0,function(a,c,d){return d!==b?f.style(a,c,d):f.css(a,c)})},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bz(a,"opacity","opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&"get" in k&&(g=k.get(a,!1,e))!==b){return g}return j[c]}h=typeof d,h==="string"&&(g=bv.exec(d))&&(d=+(g[1]+1)*+g[2]+parseFloat(f.css(a,c)),h="number");if(d==null||h==="number"&&isNaN(d)){return}h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set" in k)||(d=k.set(a,d))!==b){try{j[c]=d}catch(l){}}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get" in g&&(e=g.get(a,!0,d))!==b){return e}if(bz){return bz(a,c)}},swap:function(a,b,c){var d={};for(var e in b){d[e]=a.style[e],a.style[e]=b[e]}c.call(a);for(e in b){a.style[e]=d[e]}}}),f.curCSS=f.css,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){var e;if(c){if(a.offsetWidth!==0){return bC(a,b,d)}f.swap(a,bw,function(){e=bC(a,b,d)});return e}},set:function(a,b){if(!bt.test(b)){return b}b=parseFloat(b);if(b>=0){return b+"px"}}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return br.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bq,""))===""){c.removeAttribute("filter");if(d&&!d.filter){return}}c.filter=bq.test(g)?g.replace(bq,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bz(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bA=function(a,b){var c,d,e;b=b.replace(bs,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b)));return c}),c.documentElement.currentStyle&&(bB=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f===null&&g&&(e=g[b])&&(f=e),!bt.test(f)&&bu.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f||0,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),bz=bA||bB,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return !f.expr.filters.hidden(a)});var bD=/%20/g,bE=/\[\]$/,bF=/\r?\n/g,bG=/#.*$/,bH=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bI=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bJ=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bK=/^(?:GET|HEAD)$/,bL=/^\/\//,bM=/\?/,bN=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bO=/^(?:select|textarea)/i,bP=/\s+/,bQ=/([?&])_=[^&]*/,bR=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bS=f.fn.load,bT={},bU={},bV,bW,bX=["*/"]+["*"];try{bV=e.href}catch(bY){bV=c.createElement("a"),bV.href="",bV=bV.href}bW=bR.exec(bV.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bS){return bS.apply(this,arguments)}if(!this.length){return this}var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("<div>").append(c.replace(bN,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bO.test(this.nodeName)||bI.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bF,"\r\n")}}):{name:b.name,value:c.replace(bF,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b_(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b_(a,b);return a},ajaxSettings:{url:bV,isLocal:bJ.test(bW[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bX},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bZ(bT),ajaxTransport:bZ(bU),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?cb(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified")){f.lastModified[k]=y}if(z=v.getResponseHeader("Etag")){f.etag[k]=z}}if(a===304){w="notmodified",o=!0}else{try{r=cc(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}}else{u=w;if(!w||a){w="error",a<0&&(a=0)}}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bH.exec(n)){o[c[1].toLowerCase()]=c[2]}}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2){for(b in a){j[b]=[j[b],a[b]]}}else{b=a[v.status],v.then(b,b)}}return this},d.url=((a||d.url)+"").replace(bG,"").replace(bL,bW[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bP),d.crossDomain==null&&(r=bR.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bW[1]&&r[2]==bW[2]&&(r[3]||(r[1]==="http:"?80:443))==(bW[3]||(bW[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),b$(bT,d,c,v);if(s===2){return !1}t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bK.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bM.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bQ,"$1_="+x);d.url=y+(y===d.url?(bM.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bX+"; q=0.01":""):d.accepts["*"]);for(u in d.headers){v.setRequestHeader(u,d.headers[u])}if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return !1}for(u in {success:1,error:1,complete:1}){v[u](d[u])}p=b$(bU,d,c,v);if(!p){w(-1,"No Transport")}else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2){w(-1,z)}else{throw z}}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a)){f.each(a,function(){e(this.name,this.value)})}else{for(var g in a){ca(g,a[g],c,e)}}return d.join("&").replace(bD,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cd=f.now(),ce=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cd++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ce.test(b.url)||e&&ce.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ce,l),b.url===j&&(e&&(k=k.replace(ce,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState)){d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")}},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cf=a.ActiveXObject?function(){for(var a in ch){ch[a](0,1)}}:!1,cg=0,ch;f.ajaxSettings.xhr=a.ActiveXObject?function(){return !this.isLocal&&ci()||cj()}:ci,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials" in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields){for(j in c.xhrFields){h[j]=c.xhrFields[j]}}c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e){h.setRequestHeader(j,e[j])}}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cf&&delete ch[i]);if(e){h.readyState!==4&&h.abort()}else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cg,cf&&(ch||(ch={},f(a).unload(cf)),ch[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var ck={},cl,cm,cn=/^(?:toggle|show|hide)$/,co=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cp,cq=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cr;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0){return this.animate(cu("show",3),a,b,c)}for(var g=0,h=this.length;g<h;g++){d=this[g],d.style&&(e=d.style.display,!f._data(d,"olddisplay")&&e==="none"&&(e=d.style.display=""),e===""&&f.css(d,"display")==="none"&&f._data(d,"olddisplay",cv(d.nodeName)))}for(g=0;g<h;g++){d=this[g];if(d.style){e=d.style.display;if(e===""||e==="none"){d.style.display=f._data(d,"olddisplay")||""}}}return this},hide:function(a,b,c){if(a||a===0){return this.animate(cu("hide",3),a,b,c)}var d,e,g=0,h=this.length;for(;g<h;g++){d=this[g],d.style&&(e=f.css(d,"display"),e!=="none"&&!f._data(d,"olddisplay")&&f._data(d,"olddisplay",e))}for(g=0;g<h;g++){this[g].style&&(this[g].style.display="none")}return this},_toggle:f.fn.toggle,toggle:function(a,b,c){var d=typeof a=="boolean";f.isFunction(a)&&f.isFunction(b)?this._toggle.apply(this,arguments):a==null||d?this.each(function(){var b=d?a:f(this).is(":hidden");f(this)[b?"show":"hide"]()}):this.animate(cu("toggle",3),a,b,c);return this},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){function g(){e.queue===!1&&f._mark(this);var b=f.extend({},e),c=this.nodeType===1,d=c&&f(this).is(":hidden"),g,h,i,j,k,l,m,n,o;b.animatedProperties={};for(i in a){g=f.camelCase(i),i!==g&&(a[g]=a[i],delete a[i]),h=a[g],f.isArray(h)?(b.animatedProperties[g]=h[1],h=a[g]=h[0]):b.animatedProperties[g]=b.specialEasing&&b.specialEasing[g]||b.easing||"swing";if(h==="hide"&&d||h==="show"&&!d){return b.complete.call(this)}c&&(g==="height"||g==="width")&&(b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY],f.css(this,"display")==="inline"&&f.css(this,"float")==="none"&&(!f.support.inlineBlockNeedsLayout||cv(this.nodeName)==="inline"?this.style.display="inline-block":this.style.zoom=1))}b.overflow!=null&&(this.style.overflow="hidden");for(i in a){j=new f.fx(this,b,i),h=a[i],cn.test(h)?(o=f._data(this,"toggle"+i)||(h==="toggle"?d?"show":"hide":0),o?(f._data(this,"toggle"+i,o==="show"?"hide":"show"),j[o]()):j[h]()):(k=co.exec(h),l=j.cur(),k?(m=parseFloat(k[2]),n=k[3]||(f.cssNumber[i]?"":"px"),n!=="px"&&(f.style(this,i,(m||1)+n),l=(m||1)/j.cur()*l,f.style(this,i,l+n)),k[1]&&(m=(k[1]==="-="?-1:1)*m+l),j.custom(l,m,n)):j.custom(l,h,""))}return !0}var e=f.speed(b,c,d);if(f.isEmptyObject(a)){return this.each(e.complete,[!1])}a=f.extend({},a);return e.queue===!1?this.each(g):this.queue(e.queue,g)},stop:function(a,c,d){typeof a!="string"&&(d=c,c=a,a=b),c&&a!==!1&&this.queue(a||"fx",[]);return this.each(function(){function h(a,b,c){var e=b[c];f.removeData(a,c,!0),e.stop(d)}var b,c=!1,e=f.timers,g=f._data(this);d||f._unmark(!0,this);if(a==null){for(b in g){g[b]&&g[b].stop&&b.indexOf(".run")===b.length-4&&h(this,g,b)}}else{g[b=a+".run"]&&g[b].stop&&h(this,g,b)}for(b=e.length;b--;){e[b].elem===this&&(a==null||e[b].queue===a)&&(d?e[b](!0):e[b].saveState(),c=!0,e.splice(b,1))}(!d||!c)&&f.dequeue(this,a)})}}),f.each({slideDown:cu("show",1),slideUp:cu("hide",1),slideToggle:cu("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){f.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),f.extend({speed:function(a,b,c){var d=a&&typeof a=="object"?f.extend({},a):{complete:c||!c&&b||f.isFunction(a)&&a,duration:a,easing:c&&b||b&&!f.isFunction(b)&&b};d.duration=f.fx.off?0:typeof d.duration=="number"?d.duration:d.duration in f.fx.speeds?f.fx.speeds[d.duration]:f.fx.speeds._default;if(d.queue==null||d.queue===!0){d.queue="fx"}d.old=d.complete,d.complete=function(a){f.isFunction(d.old)&&d.old.call(this),d.queue?f.dequeue(this,d.queue):a!==!1&&f._unmark(this)};return d},easing:{linear:function(a,b,c,d){return c+d*a},swing:function(a,b,c,d){return(-Math.cos(a*Math.PI)/2+0.5)*d+c}},timers:[],fx:function(a,b,c){this.options=b,this.elem=a,this.prop=c,b.orig=b.orig||{}}}),f.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(f.fx.step[this.prop]||f.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var a,b=f.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?!b||b==="auto"?0:b:a},custom:function(a,c,d){function h(a){return e.step(a)}var e=this,g=f.fx;this.startTime=cr||cs(),this.end=c,this.now=this.start=a,this.pos=this.state=0,this.unit=d||this.unit||(f.cssNumber[this.prop]?"":"px"),h.queue=this.options.queue,h.elem=this.elem,h.saveState=function(){e.options.hide&&f._data(e.elem,"fxshow"+e.prop)===b&&f._data(e.elem,"fxshow"+e.prop,e.start)},h()&&f.timers.push(h)&&!cp&&(cp=setInterval(g.tick,g.interval))},show:function(){var a=f._data(this.elem,"fxshow"+this.prop);this.options.orig[this.prop]=a||f.style(this.elem,this.prop),this.options.show=!0,a!==b?this.custom(this.cur(),a):this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),f(this.elem).show()},hide:function(){this.options.orig[this.prop]=f._data(this.elem,"fxshow"+this.prop)||f.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(a){var b,c,d,e=cr||cs(),g=!0,h=this.elem,i=this.options;if(a||e>=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties){i.animatedProperties[b]!==!0&&(g=!1)}if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show){for(b in i.animatedProperties){f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0)}}d=i.complete,d&&(i.complete=!1,d.call(h))}return !1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return !0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c<b.length;c++){a=b[c],!a()&&b[c]===a&&b.splice(c--,1)}b.length||f.fx.stop()},interval:13,stop:function(){clearInterval(cp),cp=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){f.style(a.elem,"opacity",a.now)},_default:function(a){a.elem.style&&a.elem.style[a.prop]!=null?a.elem.style[a.prop]=a.now+a.unit:a.elem[a.prop]=a.now}}}),f.each(["width","height"],function(a,b){f.fx.step[b]=function(a){f.style(a.elem,b,Math.max(0,a.now)+a.unit)}}),f.expr&&f.expr.filters&&(f.expr.filters.animated=function(a){return f.grep(f.timers,function(b){return a===b.elem}).length});var cw=/^t(?:able|d|h)$/i,cx=/^(?:body|html)$/i;"getBoundingClientRect" in c.documentElement?f.fn.offset=function(a){var b=this[0],c;if(a){return this.each(function(b){f.offset.setOffset(this,a,b)})}if(!b||!b.ownerDocument){return null}if(b===b.ownerDocument.body){return f.offset.bodyOffset(b)}try{c=b.getBoundingClientRect()}catch(d){}var e=b.ownerDocument,g=e.documentElement;if(!c||!f.contains(g,b)){return c?{top:c.top,left:c.left}:{top:0,left:0}}var h=e.body,i=cy(e),j=g.clientTop||h.clientTop||0,k=g.clientLeft||h.clientLeft||0,l=i.pageYOffset||f.support.boxModel&&g.scrollTop||h.scrollTop,m=i.pageXOffset||f.support.boxModel&&g.scrollLeft||h.scrollLeft,n=c.top+l-j,o=c.left+m-k;return{top:n,left:o}}:f.fn.offset=function(a){var b=this[0];if(a){return this.each(function(b){f.offset.setOffset(this,a,b)})}if(!b||!b.ownerDocument){return null}if(b===b.ownerDocument.body){return f.offset.bodyOffset(b)}var c,d=b.offsetParent,e=b,g=b.ownerDocument,h=g.documentElement,i=g.body,j=g.defaultView,k=j?j.getComputedStyle(b,null):b.currentStyle,l=b.offsetTop,m=b.offsetLeft;while((b=b.parentNode)&&b!==i&&b!==h){if(f.support.fixedPosition&&k.position==="fixed"){break}c=j?j.getComputedStyle(b,null):b.currentStyle,l-=b.scrollTop,m-=b.scrollLeft,b===d&&(l+=b.offsetTop,m+=b.offsetLeft,f.support.doesNotAddBorder&&(!f.support.doesAddBorderForTableAndCells||!cw.test(b.nodeName))&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),e=d,d=b.offsetParent),f.support.subtractsBorderForOverflowNotVisible&&c.overflow!=="visible"&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),k=c}if(k.position==="relative"||k.position==="static"){l+=i.offsetTop,m+=i.offsetLeft}f.support.fixedPosition&&k.position==="fixed"&&(l+=Math.max(h.scrollTop,i.scrollTop),m+=Math.max(h.scrollLeft,i.scrollLeft));return{top:l,left:m}},f.offset={bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.support.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=f.css(a,"position");d==="static"&&(a.style.position="relative");var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using" in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0]){return null}var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static"){a=a.offsetParent}return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e){return null}g=cy(e);return g?"pageXOffset" in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cy(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,d,"padding")):this[d]():null},f.fn["outer"+c]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,d,a?"margin":"border")):this[d]():null},f.fn[d]=function(a){var e=this[0];if(!e){return a==null?null:this}if(f.isFunction(a)){return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))})}if(f.isWindow(e)){var g=e.document.documentElement["client"+c],h=e.document.body;return e.document.compatMode==="CSS1Compat"&&g||h&&h["client"+c]||g}if(e.nodeType===9){return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c])}if(a===b){var i=f.css(e,d),j=parseFloat(i);return f.isNumeric(j)?j:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window);(function(a){a("a[data-reveal-id]").live("click",function(c){c.preventDefault();var b=a(this).attr("data-reveal-id");a("#"+b).reveal(a(this).data())});a.fn.reveal=function(b){var c={animation:"fadeAndPop",animationSpeed:300,closeOnBackgroundClick:true,dismissModalClass:"close-reveal-modal"};var b=a.extend({},c,b);return this.each(function(){var l=a(this),g=parseInt(l.css("top")),i=l.height()+g,h=false,e=a(".reveal-modal-bg");if(e.length==0){e=a('<div class="reveal-modal-bg" />').insertAfter(l);e.fadeTo("fast",0.8)}function k(){e.unbind("click.modalEvent");a("."+b.dismissModalClass).unbind("click.modalEvent");if(!h){m();if(b.animation=="fadeAndPop"){l.css({top:a(document).scrollTop()-i,opacity:0,visibility:"visible"});e.fadeIn(b.animationSpeed/2);l.delay(b.animationSpeed/2).animate({top:a(document).scrollTop()+g+"px",opacity:1},b.animationSpeed,j)}if(b.animation=="fade"){l.css({opacity:0,visibility:"visible",top:a(document).scrollTop()+g});e.fadeIn(b.animationSpeed/2);l.delay(b.animationSpeed/2).animate({opacity:1},b.animationSpeed,j)}if(b.animation=="none"){l.css({visibility:"visible",top:a(document).scrollTop()+g});e.css({display:"block"});j()}}l.unbind("reveal:open",k)}l.bind("reveal:open",k);function f(){if(!h){m();if(b.animation=="fadeAndPop"){e.delay(b.animationSpeed).fadeOut(b.animationSpeed);l.animate({top:a(document).scrollTop()-i+"px",opacity:0},b.animationSpeed/2,function(){l.css({top:g,opacity:1,visibility:"hidden"});j()})}if(b.animation=="fade"){e.delay(b.animationSpeed).fadeOut(b.animationSpeed);l.animate({opacity:0},b.animationSpeed,function(){l.css({opacity:1,visibility:"hidden",top:g});j()})}if(b.animation=="none"){l.css({visibility:"hidden",top:g});e.css({display:"none"})}}l.unbind("reveal:close",f)}l.bind("reveal:close",f);l.trigger("reveal:open");var d=a("."+b.dismissModalClass).bind("click.modalEvent",function(){l.trigger("reveal:close")});if(b.closeOnBackgroundClick){e.css({cursor:"pointer"});e.bind("click.modalEvent",function(){l.trigger("reveal:close")})}a("body").keyup(function(n){if(n.which===27){l.trigger("reveal:close")}});function j(){h=false}function m(){h=true}})}})(jQuery);(function(b){var a={defaults:{animation:"horizontal-push",animationSpeed:600,timer:true,advanceSpeed:4000,pauseOnHover:false,startClockOnMouseOut:false,startClockOnMouseOutAfter:1000,directionalNav:true,captions:true,captionAnimation:"fade",captionAnimationSpeed:600,bullets:false,bulletThumbs:false,bulletThumbLocation:"",afterSlideChange:b.noop,fluid:true,centerBullets:true},activeSlide:0,numberSlides:0,orbitWidth:null,orbitHeight:null,locked:null,timerRunning:null,degrees:0,wrapperHTML:'<div class="orbit-wrapper" />',timerHTML:'<div class="timer"><span class="mask"><span class="rotator"></span></span><span class="pause"></span></div>',captionHTML:'<div class="orbit-caption"></div>',directionalNavHTML:'<div class="slider-nav"><span class="right">Right</span><span class="left">Left</span></div>',bulletHTML:'<ul class="orbit-bullets"></ul>',init:function(f,e){var c,g=0,d=this;this.clickTimer=b.proxy(this.clickTimer,this);this.addBullet=b.proxy(this.addBullet,this);this.resetAndUnlock=b.proxy(this.resetAndUnlock,this);this.stopClock=b.proxy(this.stopClock,this);this.startTimerAfterMouseLeave=b.proxy(this.startTimerAfterMouseLeave,this);this.clearClockMouseLeaveTimer=b.proxy(this.clearClockMouseLeaveTimer,this);this.rotateTimer=b.proxy(this.rotateTimer,this);this.options=b.extend({},this.defaults,e);if(this.options.timer==="false"){this.options.timer=false}if(this.options.captions==="false"){this.options.captions=false}if(this.options.directionalNav==="false"){this.options.directionalNav=false}this.$element=b(f);this.$wrapper=this.$element.wrap(this.wrapperHTML).parent();this.$slides=this.$element.children("img, a, div");this.$element.bind("orbit.next",function(){d.shift("next")});this.$element.bind("orbit.prev",function(){d.shift("prev")});this.$element.bind("orbit.goto",function(i,h){d.shift(h)});this.$element.bind("orbit.start",function(i,h){d.startClock()});this.$element.bind("orbit.stop",function(i,h){d.stopClock()});c=this.$slides.filter("img");if(c.length===0){this.loaded()}else{c.bind("imageready",function(){g+=1;if(g===c.length){d.loaded()}})}},loaded:function(){this.$element.addClass("orbit").css({width:"1px",height:"1px"});this.setDimentionsFromLargestSlide();this.updateOptionsIfOnlyOneSlide();this.setupFirstSlide();if(this.options.timer){this.setupTimer();this.startClock()}if(this.options.captions){this.setupCaptions()}if(this.options.directionalNav){this.setupDirectionalNav()}if(this.options.bullets){this.setupBulletNav();this.setActiveBullet()}},currentSlide:function(){return this.$slides.eq(this.activeSlide)},setDimentionsFromLargestSlide:function(){var d=this,c;d.$element.add(d.$wrapper).width(this.$slides.first().width());d.$element.add(d.$wrapper).height(this.$slides.first().height());d.orbitWidth=this.$slides.first().width();d.orbitHeight=this.$slides.first().height();c=this.$slides.first().clone();this.$slides.each(function(){var e=b(this),g=e.width(),f=e.height();if(g>d.$element.width()){d.$element.add(d.$wrapper).width(g);d.orbitWidth=d.$element.width()}if(f>d.$element.height()){d.$element.add(d.$wrapper).height(f);d.orbitHeight=d.$element.height();c=b(this).clone()}d.numberSlides+=1});if(this.options.fluid){if(typeof this.options.fluid==="string"){c=b('<img src="http://placehold.it/'+this.options.fluid+'" />')}d.$element.prepend(c);c.addClass("fluid-placeholder");d.$element.add(d.$wrapper).css({width:"inherit"});d.$element.add(d.$wrapper).css({height:"inherit"});b(window).bind("resize",function(){d.orbitWidth=d.$element.width();d.orbitHeight=d.$element.height()})}},lock:function(){this.locked=true},unlock:function(){this.locked=false},updateOptionsIfOnlyOneSlide:function(){if(this.$slides.length===1){this.options.directionalNav=false;this.options.timer=false;this.options.bullets=false}},setupFirstSlide:function(){var c=this;this.$slides.first().css({"z-index":3}).fadeIn(function(){c.$slides.css({display:"block"})})},startClock:function(){var c=this;if(!this.options.timer){return false}if(this.$timer.is(":hidden")){this.clock=setInterval(function(){this.$element.trigger("orbit.next")},this.options.advanceSpeed)}else{this.timerRunning=true;this.$pause.removeClass("active");this.clock=setInterval(this.rotateTimer,this.options.advanceSpeed/180)}},rotateTimer:function(){var c="rotate("+this.degrees+"deg)";this.degrees+=2;this.$rotator.css({"-webkit-transform":c,"-moz-transform":c,"-o-transform":c});if(this.degrees>180){this.$rotator.addClass("move");this.$mask.addClass("move")}if(this.degrees>360){this.$rotator.removeClass("move");this.$mask.removeClass("move");this.degrees=0;this.$element.trigger("orbit.next")}},stopClock:function(){if(!this.options.timer){return false}else{this.timerRunning=false;clearInterval(this.clock);this.$pause.addClass("active")}},setupTimer:function(){this.$timer=b(this.timerHTML);this.$wrapper.append(this.$timer);this.$rotator=this.$timer.find(".rotator");this.$mask=this.$timer.find(".mask");this.$pause=this.$timer.find(".pause");this.$timer.click(this.clickTimer);if(this.options.startClockOnMouseOut){this.$wrapper.mouseleave(this.startTimerAfterMouseLeave);this.$wrapper.mouseenter(this.clearClockMouseLeaveTimer)}if(this.options.pauseOnHover){this.$wrapper.mouseenter(this.stopClock)}},startTimerAfterMouseLeave:function(){var c=this;this.outTimer=setTimeout(function(){if(!c.timerRunning){c.startClock()}},this.options.startClockOnMouseOutAfter)},clearClockMouseLeaveTimer:function(){clearTimeout(this.outTimer)},clickTimer:function(){if(!this.timerRunning){this.startClock()}else{this.stopClock()}},setupCaptions:function(){this.$caption=b(this.captionHTML);this.$wrapper.append(this.$caption);this.setCaption()},setCaption:function(){var d=this.currentSlide().attr("data-caption"),c;if(!this.options.captions){return false}if(d){c=b(d).html();this.$caption.attr("id",d).html(c);switch(this.options.captionAnimation){case"none":this.$caption.show();break;case"fade":this.$caption.fadeIn(this.options.captionAnimationSpeed);break;case"slideOpen":this.$caption.slideDown(this.options.captionAnimationSpeed);break}}else{switch(this.options.captionAnimation){case"none":this.$caption.hide();break;case"fade":this.$caption.fadeOut(this.options.captionAnimationSpeed);break;case"slideOpen":this.$caption.slideUp(this.options.captionAnimationSpeed);break}}},setupDirectionalNav:function(){var c=this;this.$wrapper.append(this.directionalNavHTML);this.$wrapper.find(".left").click(function(){c.stopClock();c.$element.trigger("orbit.prev")});this.$wrapper.find(".right").click(function(){c.stopClock();c.$element.trigger("orbit.next")})},setupBulletNav:function(){this.$bullets=b(this.bulletHTML);this.$wrapper.append(this.$bullets);this.$slides.each(this.addBullet);this.$element.addClass("with-bullets");if(this.options.centerBullets){this.$bullets.css("margin-left",-this.$bullets.width()/2)}},addBullet:function(g,e){var d=g+1,h=b("<li>"+(d)+"</li>"),c,f=this;if(this.options.bulletThumbs){c=b(e).attr("data-thumb");if(c){h.addClass("has-thumb").css({background:"url("+this.options.bulletThumbLocation+c+") no-repeat"})}}this.$bullets.append(h);h.data("index",g);h.click(function(){f.stopClock();f.$element.trigger("orbit.goto",[h.data("index")])})},setActiveBullet:function(){if(!this.options.bullets){return false}else{this.$bullets.find("li").removeClass("active").eq(this.activeSlide).addClass("active")}},resetAndUnlock:function(){this.$slides.eq(this.prevActiveSlide).css({"z-index":1});this.unlock();this.options.afterSlideChange.call(this,this.$slides.eq(this.prevActiveSlide),this.$slides.eq(this.activeSlide))},shift:function(d){var c=d;this.prevActiveSlide=this.activeSlide;if(this.prevActiveSlide==c){return false}if(this.$slides.length=="1"){return false}if(!this.locked){this.lock();if(d=="next"){this.activeSlide++;if(this.activeSlide==this.numberSlides){this.activeSlide=0}}else{if(d=="prev"){this.activeSlide--;if(this.activeSlide<0){this.activeSlide=this.numberSlides-1}}else{this.activeSlide=d;if(this.prevActiveSlide<this.activeSlide){c="next"}else{if(this.prevActiveSlide>this.activeSlide){c="prev"}}}}this.setActiveBullet();this.$slides.eq(this.prevActiveSlide).css({"z-index":2});if(this.options.animation=="fade"){this.$slides.eq(this.activeSlide).css({opacity:0,"z-index":3}).animate({opacity:1},this.options.animationSpeed,this.resetAndUnlock)}if(this.options.animation=="horizontal-slide"){if(c=="next"){this.$slides.eq(this.activeSlide).css({left:this.orbitWidth,"z-index":3}).animate({left:0},this.options.animationSpeed,this.resetAndUnlock)}if(c=="prev"){this.$slides.eq(this.activeSlide).css({left:-this.orbitWidth,"z-index":3}).animate({left:0},this.options.animationSpeed,this.resetAndUnlock)}}if(this.options.animation=="vertical-slide"){if(c=="prev"){this.$slides.eq(this.activeSlide).css({top:this.orbitHeight,"z-index":3}).animate({top:0},this.options.animationSpeed,this.resetAndUnlock)}if(c=="next"){this.$slides.eq(this.activeSlide).css({top:-this.orbitHeight,"z-index":3}).animate({top:0},this.options.animationSpeed,this.resetAndUnlock)}}if(this.options.animation=="horizontal-push"){if(c=="next"){this.$slides.eq(this.activeSlide).css({left:this.orbitWidth,"z-index":3}).animate({left:0},this.options.animationSpeed,this.resetAndUnlock);this.$slides.eq(this.prevActiveSlide).animate({left:-this.orbitWidth},this.options.animationSpeed)}if(c=="prev"){this.$slides.eq(this.activeSlide).css({left:-this.orbitWidth,"z-index":3}).animate({left:0},this.options.animationSpeed,this.resetAndUnlock);this.$slides.eq(this.prevActiveSlide).animate({left:this.orbitWidth},this.options.animationSpeed)}}if(this.options.animation=="vertical-push"){if(c=="next"){this.$slides.eq(this.activeSlide).css({top:-this.orbitHeight,"z-index":3}).animate({top:0},this.options.animationSpeed,this.resetAndUnlock);this.$slides.eq(this.prevActiveSlide).animate({top:this.orbitHeight},this.options.animationSpeed)}if(c=="prev"){this.$slides.eq(this.activeSlide).css({top:this.orbitHeight,"z-index":3}).animate({top:0},this.options.animationSpeed,this.resetAndUnlock);this.$slides.eq(this.prevActiveSlide).animate({top:-this.orbitHeight},this.options.animationSpeed)}}this.setCaption()}}};b.fn.orbit=function(c){return this.each(function(){var d=b.extend({},a);d.init(this,c)})}})(jQuery);  
/*!  
* jQuery imageready Plugin  
* http://www.zurb.com/playground/  
*  
* Copyright 2011, ZURB  
* Released under the MIT License  
*/  
(function(c){var b={};c.event.special.imageready={setup:function(f,e,d){b=f||b},add:function(d){var e=c(this),f;if(this.nodeType===1&&this.tagName.toLowerCase()==="img"&&this.src!==""){if(b.forceLoad){f=e.attr("src");e.attr("src","");a(this,d.handler);e.attr("src",f)}else{if(this.complete||this.readyState===4){d.handler.apply(this,arguments)}else{a(this,d.handler)}}}},teardown:function(d){c(this).unbind(".imageready")}};function a(d,f){var e=c(d);e.bind("load.imageready",function(){f.apply(d,arguments);e.unbind("load.imageready")})}}(jQuery));new function(a){a.fn.placeholder=function(b){b=b||{};var j=b.dataKey||"placeholderValue";var f=b.attr||"placeholder";var h=b.className||"placeholder";var k=b.values||[];var c=b.blockSubmit||false;var e=b.blankSubmit||false;var g=b.onSubmit||false;var i=b.value||"";var d=b.cursor_position||0;return this.filter(":input").each(function(l){a.data(this,j,k[l]||a(this).attr(f))}).each(function(){if(a.trim(a(this).val())===""){a(this).addClass(h).val(a.data(this,j))}}).focus(function(){if(a.trim(a(this).val())===a.data(this,j)){a(this).removeClass(h).val(i)}if(a.fn.setCursorPosition){a(this).setCursorPosition(d)}}).blur(function(){if(a.trim(a(this).val())===i){a(this).addClass(h).val(a.data(this,j))}}).each(function(l,m){if(c){new function(n){a(n.form).submit(function(){return a.trim(a(n).val())!=a.data(n,j)})}(m)}else{if(e){new function(n){a(n.form).submit(function(){if(a.trim(a(n).val())==a.data(n,j)){a(n).removeClass(h).val("")}return true})}(m)}else{if(g){new function(n){a(n.form).submit(g)}(m)}}}})}}(jQuery);jQuery(document).ready(function(b){function a(c){b("form.custom input:"+c).each(function(){var e=b(this).hide(),d=e.next("span.custom."+c);if(d.length===0){d=b('<span class="custom '+c+'"></span>').insertAfter(e)}d.toggleClass("checked",e.is(":checked"))})}a("checkbox");a("radio");b("form.custom select").each(function(){var e=b(this),g=e.next("div.custom.dropdown"),c=e.find("option"),d=0,f;if(g.length===0){g=b('<div class="custom dropdown"><a href="#" class="selector"></a><ul></ul></div>"');c.each(function(){f=b("<li>"+b(this).html()+"</li>");g.find("ul").append(f)});g.prepend('<a href="#" class="current">'+c.first().html()+"</a>");e.after(g);e.hide()}c.each(function(h){if(this.selected){g.find("li").eq(h).addClass("selected");g.find(".current").html(b(this).html())}});g.find("li").each(function(){g.addClass("open");if(b(this).outerWidth()>d){d=b(this).outerWidth()}g.removeClass("open")});g.css("width",d+18+"px");g.find("ul").css("width",d+16+"px")})});(function(b){function a(d){var f=d.prev(),e=f[0];e.checked=((e.checked)?false:true);d.toggleClass("checked");f.trigger("change")}function c(d){var f=d.prev(),e=f[0];b('input:radio[name="'+f.attr("name")+'"]').each(function(){b(this).next().removeClass("checked")});e.checked=((e.checked)?false:true);d.toggleClass("checked");f.trigger("change")}b(document).on("click","form.custom span.custom.checkbox",function(d){d.preventDefault();d.stopPropagation();a(b(this))});b(document).on("click","form.custom span.custom.radio",function(d){d.preventDefault();d.stopPropagation();c(b(this))});b(document).on("click","form.custom label",function(e){var d=b("#"+b(this).attr("for")),g,f;if(d.length!==0){if(d.attr("type")==="checkbox"){e.preventDefault();g=b(this).find("span.custom.checkbox");a(g)}else{if(d.attr("type")==="radio"){e.preventDefault();f=b(this).find("span.custom.radio");c(f)}}}});b(document).on("click","form.custom div.custom.dropdown a.current, form.custom div.custom.dropdown a.selector",function(d){var f=b(this),e=f.closest("div.custom.dropdown");d.preventDefault();e.toggleClass("open");if(e.hasClass("open")){b(document).bind("click.customdropdown",function(g){e.removeClass("open");b(document).unbind(".customdropdown")})}else{b(document).unbind(".customdropdown")}});b(document).on("click","form.custom div.custom.dropdown li",function(g){var h=b(this),e=h.closest("div.custom.dropdown"),f=e.prev(),d=0;g.preventDefault();g.stopPropagation();h.closest("ul").find("li").removeClass("selected");h.addClass("selected");e.removeClass("open").find("a.current").html(h.html());h.closest("ul").find("li").each(function(i){if(h[0]==this){d=i}});f[0].selectedIndex=d;f.trigger("change")})})(jQuery);  
/*! http://mths.be/placeholder v1.8.5 by @mathias */  
(function(j,i,l){var k="placeholder" in i.createElement("input"),h="placeholder" in i.createElement("textarea");if(k&&h){l.fn.placeholder=function(){return this};l.fn.placeholder.input=l.fn.placeholder.textarea=true}else{l.fn.placeholder=function(){return this.filter((k?"textarea":":input")+"[placeholder]").bind("focus.placeholder",o).bind("blur.placeholder",m).trigger("blur.placeholder").end()};l.fn.placeholder.input=k;l.fn.placeholder.textarea=h;l(function(){l("form").bind("submit.placeholder",function(){var a=l(".placeholder",this).each(o);setTimeout(function(){a.each(m)},10)})});l(j).bind("unload.placeholder",function(){l(".placeholder").val("")})}function n(b){var c={},a=/^jQuery\d+$/;l.each(b.attributes,function(d,e){if(e.specified&&!a.test(e.name)){c[e.name]=e.value}});return c}function o(){var a=l(this);if(a.val()===a.attr("placeholder")&&a.hasClass("placeholder")){if(a.data("placeholder-password")){a.hide().next().show().focus().attr("id",a.removeAttr("id").data("placeholder-id"))}else{a.val("").removeClass("placeholder")}}}function m(){var a,b=l(this),e=b,c=this.id;if(b.val()===""){if(b.is(":password")){if(!b.data("placeholder-textinput")){try{a=b.clone().attr({type:"text"})}catch(d){a=l("<input>").attr(l.extend(n(this),{type:"text"}))}a.removeAttr("name").data("placeholder-password",true).data("placeholder-id",c).bind("focus.placeholder",o);b.data("placeholder-textinput",a).data("placeholder-id",c).before(a)}b=b.removeAttr("id").hide().prev().attr("id",c).show()}b.addClass("placeholder").val(b.attr("placeholder"))}else{b.removeClass("placeholder")}}}(this,document,jQuery));  
 
file:a/lib/FeedItem.php (deleted)
<?php  
/**  
* Univarsel Feed Writer  
*  
* FeedItem class - Used as feed element in FeedWriter class  
*  
* @package UnivarselFeedWriter  
* @author Anis uddin Ahmad <anisniit@gmail.com>  
* @link http://www.ajaxray.com/projects/rss  
*/  
class FeedItem  
{  
private $elements = array(); //Collection of feed elements  
private $version;  
 
/**  
* Constructor  
*  
* @param contant (RSS1/RSS2/ATOM) RSS2 is default.  
*/  
function __construct($version = RSS2)  
{  
$this->version = $version;  
}  
 
/**  
* Add an element to elements array  
*  
* @access public  
* @param srting The tag name of an element  
* @param srting The content of tag  
* @param array Attributes(if any) in 'attrName' => 'attrValue' format  
* @return void  
*/  
public function addElement($elementName, $content, $attributes = null)  
{  
$this->elements[$elementName]['name'] = $elementName;  
$this->elements[$elementName]['content'] = $content;  
$this->elements[$elementName]['attributes'] = $attributes;  
}  
 
/**  
* Set multiple feed elements from an array.  
* Elements which have attributes cannot be added by this method  
*  
* @access public  
* @param array array of elements in 'tagName' => 'tagContent' format.  
* @return void  
*/  
public function addElementArray($elementArray)  
{  
if(! is_array($elementArray)) return;  
foreach ($elementArray as $elementName => $content)  
{  
$this->addElement($elementName, $content);  
}  
}  
 
/**  
* Return the collection of elements in this feed item  
*  
* @access public  
* @return array  
*/  
public function getElements()  
{  
return $this->elements;  
}  
 
// Wrapper functions ------------------------------------------------------  
 
/**  
* Set the 'dscription' element of feed item  
*  
* @access public  
* @param string The content of 'description' element  
* @return void  
*/  
public function setDescription($description)  
{  
$tag = ($this->version == ATOM)? 'summary' : 'description';  
$this->addElement($tag, $description);  
}  
 
/**  
* @desc Set the 'title' element of feed item  
* @access public  
* @param string The content of 'title' element  
* @return void  
*/  
public function setTitle($title)  
{  
$this->addElement('title', $title);  
}  
 
/**  
* Set the 'date' element of feed item  
*  
* @access public  
* @param string The content of 'date' element  
* @return void  
*/  
public function setDate($date)  
{  
if(! is_numeric($date))  
{  
$date = strtotime($date);  
}  
 
if($this->version == ATOM)  
{  
$tag = 'updated';  
$value = date(DATE_ATOM, $date);  
}  
elseif($this->version == RSS2)  
{  
$tag = 'pubDate';  
$value = date(DATE_RSS, $date);  
}  
else  
{  
$tag = 'dc:date';  
$value = date("Y-m-d", $date);  
}  
 
$this->addElement($tag, $value);  
}  
 
/**  
* Set the 'link' element of feed item  
*  
* @access public  
* @param string The content of 'link' element  
* @return void  
*/  
public function setLink($link)  
{  
if($this->version == RSS2 || $this->version == RSS1)  
{  
$this->addElement('link', $link);  
}  
else  
{  
$this->addElement('link','',array('href'=>$link));  
$this->addElement('id', FeedWriter::uuid($link,'urn:uuid:'));  
}  
 
}  
 
/**  
* Set the 'encloser' element of feed item  
* For RSS 2.0 only  
*  
* @access public  
* @param string The url attribute of encloser tag  
* @param string The length attribute of encloser tag  
* @param string The type attribute of encloser tag  
* @return void  
*/  
public function setEncloser($url, $length, $type)  
{  
$attributes = array('url'=>$url, 'length'=>$length, 'type'=>$type);  
$this->addElement('enclosure','',$attributes);  
}  
 
} // end of class FeedItem  
?>  
 
file:a/lib/FeedWriter.php (deleted)
<?php  
// RSS 0.90 Officially obsoleted by 1.0  
// RSS 0.91, 0.92, 0.93 and 0.94 Officially obsoleted by 2.0  
// So, define constants for RSS 1.0, RSS 2.0 and ATOM  
 
define('RSS1', 'RSS 1.0', true);  
define('RSS2', 'RSS 2.0', true);  
define('ATOM', 'ATOM', true);  
 
/**  
* Univarsel Feed Writer class  
*  
* Genarate RSS 1.0, RSS2.0 and ATOM Feed  
*  
* @package UnivarselFeedWriter  
* @author Anis uddin Ahmad <anisniit@gmail.com>  
* @link http://www.ajaxray.com/projects/rss  
*/  
class FeedWriter  
{  
private $channels = array(); // Collection of channel elements  
private $items = array(); // Collection of items as object of FeedItem class.  
private $data = array(); // Store some other version wise data  
private $CDATAEncoding = array(); // The tag names which have to encoded as CDATA  
 
private $version = null;  
 
/**  
* Constructor  
*  
* @param constant the version constant (RSS1/RSS2/ATOM).  
*/  
function __construct($version = RSS2)  
{  
$this->version = $version;  
 
// Setting default value for assential channel elements  
$this->channels['title'] = $version . ' Feed';  
$this->channels['link'] = 'http://www.ajaxray.com/blog';  
 
//Tag names to encode in CDATA  
$this->CDATAEncoding = array('description', 'content:encoded', 'summary');  
}  
 
// Start # public functions ---------------------------------------------  
 
/**  
* Set a channel element  
* @access public  
* @param srting name of the channel tag  
* @param string content of the channel tag  
* @return void  
*/  
public function setChannelElement($elementName, $content)  
{  
$this->channels[$elementName] = $content ;  
}  
 
/**  
* Set multiple channel elements from an array. Array elements  
* should be 'channelName' => 'channelContent' format.  
*  
* @access public  
* @param array array of channels  
* @return void  
*/  
public function setChannelElementsFromArray($elementArray)  
{  
if(! is_array($elementArray)) return;  
foreach ($elementArray as $elementName => $content)  
{  
$this->setChannelElement($elementName, $content);  
}  
}  
 
/**  
* Genarate the actual RSS/ATOM file  
*  
* @access public  
* @return void  
*/  
public function genarateFeed()  
{  
header("Content-type: text/xml");  
 
$this->printHead();  
$this->printChannels();  
$this->printItems();  
$this->printTale();  
}  
 
/**  
* Create a new FeedItem.  
*  
* @access public  
* @return object instance of FeedItem class  
*/  
public function createNewItem()  
{  
$Item = new FeedItem($this->version);  
return $Item;  
}  
 
/**  
* Add a FeedItem to the main class  
*  
* @access public  
* @param object instance of FeedItem class  
* @return void  
*/  
public function addItem($feedItem)  
{  
$this->items[] = $feedItem;  
}  
 
 
// Wrapper functions -------------------------------------------------------------------  
 
/**  
* Set the 'title' channel element  
*  
* @access public  
* @param srting value of 'title' channel tag  
* @return void  
*/  
public function setTitle($title)  
{  
$this->setChannelElement('title', $title);  
}  
 
/**  
* Set the 'description' channel element  
*  
* @access public  
* @param srting value of 'description' channel tag  
* @return void  
*/  
public function setDescription($desciption)  
{  
$this->setChannelElement('description', $desciption);  
}  
 
/**  
* Set the 'link' channel element  
*  
* @access public  
* @param srting value of 'link' channel tag  
* @return void  
*/  
public function setLink($link)  
{  
$this->setChannelElement('link', $link);  
}  
 
/**  
* Set the 'image' channel element  
*  
* @access public  
* @param srting title of image  
* @param srting link url of the imahe  
* @param srting path url of the image  
* @return void  
*/  
public function setImage($title, $link, $url)  
{  
$this->setChannelElement('image', array('title'=>$title, 'link'=>$link, 'url'=>$url));  
}  
 
/**  
* Set the 'about' channel element. Only for RSS 1.0  
*  
* @access public  
* @param srting value of 'about' channel tag  
* @return void  
*/  
public function setChannelAbout($url)  
{  
$this->data['ChannelAbout'] = $url;  
}  
 
/**  
* Genarates an UUID  
* @author Anis uddin Ahmad <admin@ajaxray.com>  
* @param string an optional prefix  
* @return string the formated uuid  
*/  
public function uuid($key = null, $prefix = '')  
{  
$key = ($key == null)? uniqid(rand()) : $key;  
$chars = md5($key);  
$uuid = substr($chars,0,8) . '-';  
$uuid .= substr($chars,8,4) . '-';  
$uuid .= substr($chars,12,4) . '-';  
$uuid .= substr($chars,16,4) . '-';  
$uuid .= substr($chars,20,12);  
 
return $prefix . $uuid;  
}  
// End # public functions ----------------------------------------------  
 
// Start # private functions ----------------------------------------------  
 
/**  
* Prints the xml and rss namespace  
*  
* @access private  
* @return void  
*/  
private function printHead()  
{  
$out = '<?xml version="1.0" encoding="utf-8"?>' . "\n";  
 
if($this->version == RSS2)  
{  
$out .= '<rss version="2.0"  
xmlns:content="http://purl.org/rss/1.0/modules/content/"  
xmlns:wfw="http://wellformedweb.org/CommentAPI/"  
>' . PHP_EOL;  
}  
elseif($this->version == RSS1)  
{  
$out .= '<rdf:RDF  
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"  
xmlns="http://purl.org/rss/1.0/"  
xmlns:dc="http://purl.org/dc/elements/1.1/"  
>' . PHP_EOL;;  
}  
else if($this->version == ATOM)  
{  
$out .= '<feed xmlns="http://www.w3.org/2005/Atom">' . PHP_EOL;;  
}  
echo $out;  
}  
 
/**  
* Closes the open tags at the end of file  
*  
* @access private  
* @return void  
*/  
private function printTale()  
{  
if($this->version == RSS2)  
{  
echo '</channel>' . PHP_EOL . '</rss>';  
}  
elseif($this->version == RSS1)  
{  
echo '</rdf:RDF>';  
}  
else if($this->version == ATOM)  
{  
echo '</feed>';  
}  
 
}  
 
/**  
* Creates a single node as xml format  
*  
* @access private  
* @param srting name of the tag  
* @param mixed tag value as string or array of nested tags in 'tagName' => 'tagValue' format  
* @param array Attributes(if any) in 'attrName' => 'attrValue' format  
* @return string formatted xml tag  
*/  
private function makeNode($tagName, $tagContent, $attributes = null)  
{  
$nodeText = '';  
$attrText = '';  
 
if(is_array($attributes))  
{  
foreach ($attributes as $key => $value)  
{  
$attrText .= " $key=\"$value\" ";  
}  
}  
 
if(is_array($tagContent) && $this->version == RSS1)  
{  
$attrText = ' rdf:parseType="Resource"';  
}  
 
 
$attrText .= (in_array($tagName, $this->CDATAEncoding) && $this->version == ATOM)? ' type="html" ' : '';  
$nodeText .= (in_array($tagName, $this->CDATAEncoding))? "<{$tagName}{$attrText}><![CDATA[" : "<{$tagName}{$attrText}>";  
 
if(is_array($tagContent))  
{  
foreach ($tagContent as $key => $value)  
{  
$nodeText .= $this->makeNode($key, $value);  
}  
}  
else  
{  
$nodeText .= (in_array($tagName, $this->CDATAEncoding))? $tagContent : htmlentities($tagContent);  
}  
 
$nodeText .= (in_array($tagName, $this->CDATAEncoding))? "]]></$tagName>" : "</$tagName>";  
 
return $nodeText . PHP_EOL;  
}  
 
/**  
* @desc Print channels  
* @access private  
* @return void  
*/  
private function printChannels()  
{  
//Start channel tag  
switch ($this->version)  
{  
case RSS2:  
echo '<channel>' . PHP_EOL;  
break;  
case RSS1:  
echo (isset($this->data['ChannelAbout']))? "<channel rdf:about=\"{$this->data['ChannelAbout']}\">" : "<channel rdf:about=\"{$this->channels['link']}\">";  
break;  
}  
 
//Print Items of channel  
foreach ($this->channels as $key => $value)  
{  
if($this->version == ATOM && $key == 'link')  
{  
// ATOM prints link element as href attribute  
echo $this->makeNode($key,'',array('href'=>$value));  
//Add the id for ATOM  
echo $this->makeNode('id',$this->uuid($value,'urn:uuid:'));  
}  
else  
{  
echo $this->makeNode($key, $value);  
}  
 
}  
 
//RSS 1.0 have special tag <rdf:Seq> with channel  
if($this->version == RSS1)  
{  
echo "<items>" . PHP_EOL . "<rdf:Seq>" . PHP_EOL;  
foreach ($this->items as $item)  
{  
$thisItems = $item->getElements();  
echo "<rdf:li resource=\"{$thisItems['link']['content']}\"/>" . PHP_EOL;  
}  
echo "</rdf:Seq>" . PHP_EOL . "</items>" . PHP_EOL . "</channel>" . PHP_EOL;  
}  
}  
 
/**  
* Prints formatted feed items  
*  
* @access private  
* @return void  
*/  
private function printItems()  
{  
foreach ($this->items as $item)  
{  
$thisItems = $item->getElements();  
 
//the argument is printed as rdf:about attribute of item in rss 1.0  
echo $this->startItem($thisItems['link']['content']);  
 
foreach ($thisItems as $feedItem )  
{  
echo $this->makeNode($feedItem['name'], $feedItem['content'], $feedItem['attributes']);  
}  
echo $this->endItem();  
}  
}  
 
/**  
* Make the starting tag of channels  
*  
* @access private  
* @param srting The vale of about tag which is used for only RSS 1.0  
* @return void  
*/  
private function startItem($about = false)  
{  
if($this->version == RSS2)  
{  
echo '<item>' . PHP_EOL;  
}  
elseif($this->version == RSS1)  
{  
if($about)  
{  
echo "<item rdf:about=\"$about\">" . PHP_EOL;  
}  
else  
{  
die('link element is not set .\n It\'s required for RSS 1.0 to be used as about attribute of item');  
}  
}  
else if($this->version == ATOM)  
{  
echo "<entry>" . PHP_EOL;  
}  
}  
 
/**  
* Closes feed item tag  
*  
* @access private  
* @return void  
*/  
private function endItem()  
{  
if($this->version == RSS2 || $this->version == RSS1)  
{  
echo '</item>' . PHP_EOL;  
}  
else if($this->version == ATOM)  
{  
echo "</entry>" . PHP_EOL;  
}  
}  
 
 
 
// End # private functions ----------------------------------------------  
 
} // end of class FeedWriter  
 
// autoload classes  
function __autoload($class_name)  
{  
require_once $class_name . '.php';  
}  
  GNU GENERAL PUBLIC LICENSE
  Version 3, 29 June 2007
 
  Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
  Everyone is permitted to copy and distribute verbatim copies
  of this license document, but changing it is not allowed.
 
  Preamble
 
  The GNU General Public License is a free, copyleft license for
  software and other kinds of works.
 
  The licenses for most software and other practical works are designed
  to take away your freedom to share and change the works. By contrast,
  the GNU General Public License is intended to guarantee your freedom to
  share and change all versions of a program--to make sure it remains free
  software for all its users. We, the Free Software Foundation, use the
  GNU General Public License for most of our software; it applies also to
  any other work released this way by its authors. You can apply it to
  your programs, too.
 
  When we speak of free software, we are referring to freedom, not
  price. Our General Public Licenses are designed to make sure that you
  have the freedom to distribute copies of free software (and charge for
  them if you wish), that you receive source code or can get it if you
  want it, that you can change the software or use pieces of it in new
  free programs, and that you know you can do these things.
 
  To protect your rights, we need to prevent others from denying you
  these rights or asking you to surrender the rights. Therefore, you have
  certain responsibilities if you distribute copies of the software, or if
  you modify it: responsibilities to respect the freedom of others.
 
  For example, if you distribute copies of such a program, whether
  gratis or for a fee, you must pass on to the recipients the same
  freedoms that you received. You must make sure that they, too, receive
  or can get the source code. And you must show them these terms so they
  know their rights.
 
  Developers that use the GNU GPL protect your rights with two steps:
  (1) assert copyright on the software, and (2) offer you this License
  giving you legal permission to copy, distribute and/or modify it.
 
  For the developers' and authors' protection, the GPL clearly explains
  that there is no warranty for this free software. For both users' and
  authors' sake, the GPL requires that modified versions be marked as
  changed, so that their problems will not be attributed erroneously to
  authors of previous versions.
 
  Some devices are designed to deny users access to install or run
  modified versions of the software inside them, although the manufacturer
  can do so. This is fundamentally incompatible with the aim of
  protecting users' freedom to change the software. The systematic
  pattern of such abuse occurs in the area of products for individuals to
  use, which is precisely where it is most unacceptable. Therefore, we
  have designed this version of the GPL to prohibit the practice for those
  products. If such problems arise substantially in other domains, we
  stand ready to extend this provision to those domains in future versions
  of the GPL, as needed to protect the freedom of users.
 
  Finally, every program is threatened constantly by software patents.
  States should not allow patents to restrict development and use of
  software on general-purpose computers, but in those that do, we wish to
  avoid the special danger that patents applied to a free program could
  make it effectively proprietary. To prevent this, the GPL assures that
  patents cannot be used to render the program non-free.
 
  The precise terms and conditions for copying, distribution and
  modification follow.
 
  TERMS AND CONDITIONS
 
  0. Definitions.
 
  "This License" refers to version 3 of the GNU General Public License.
 
  "Copyright" also means copyright-like laws that apply to other kinds of
  works, such as semiconductor masks.
 
  "The Program" refers to any copyrightable work licensed under this
  License. Each licensee is addressed as "you". "Licensees" and
  "recipients" may be individuals or organizations.
 
  To "modify" a work means to copy from or adapt all or part of the work
  in a fashion requiring copyright permission, other than the making of an
  exact copy. The resulting work is called a "modified version" of the
  earlier work or a work "based on" the earlier work.
 
  A "covered work" means either the unmodified Program or a work based
  on the Program.
 
  To "propagate" a work means to do anything with it that, without
  permission, would make you directly or secondarily liable for
  infringement under applicable copyright law, except executing it on a
  computer or modifying a private copy. Propagation includes copying,
  distribution (with or without modification), making available to the
  public, and in some countries other activities as well.
 
  To "convey" a work means any kind of propagation that enables other
  parties to make or receive copies. Mere interaction with a user through
  a computer network, with no transfer of a copy, is not conveying.
 
  An interactive user interface displays "Appropriate Legal Notices"
  to the extent that it includes a convenient and prominently visible
  feature that (1) displays an appropriate copyright notice, and (2)
  tells the user that there is no warranty for the work (except to the
  extent that warranties are provided), that licensees may convey the
  work under this License, and how to view a copy of this License. If
  the interface presents a list of user commands or options, such as a
  menu, a prominent item in the list meets this criterion.
 
  1. Source Code.
 
  The "source code" for a work means the preferred form of the work
  for making modifications to it. "Object code" means any non-source
  form of a work.
 
  A "Standard Interface" means an interface that either is an official
  standard defined by a recognized standards body, or, in the case of
  interfaces specified for a particular programming language, one that
  is widely used among developers working in that language.
 
  The "System Libraries" of an executable work include anything, other
  than the work as a whole, that (a) is included in the normal form of
  packaging a Major Component, but which is not part of that Major
  Component, and (b) serves only to enable use of the work with that
  Major Component, or to implement a Standard Interface for which an
  implementation is available to the public in source code form. A
  "Major Component", in this context, means a major essential component
  (kernel, window system, and so on) of the specific operating system
  (if any) on which the executable work runs, or a compiler used to
  produce the work, or an object code interpreter used to run it.
 
  The "Corresponding Source" for a work in object code form means all
  the source code needed to generate, install, and (for an executable
  work) run the object code and to modify the work, including scripts to
  control those activities. However, it does not include the work's
  System Libraries, or general-purpose tools or generally available free
  programs which are used unmodified in performing those activities but
  which are not part of the work. For example, Corresponding Source
  includes interface definition files associated with source files for
  the work, and the source code for shared libraries and dynamically
  linked subprograms that the work is specifically designed to require,
  such as by intimate data communication or control flow between those
  subprograms and other parts of the work.
 
  The Corresponding Source need not include anything that users
  can regenerate automatically from other parts of the Corresponding
  Source.
 
  The Corresponding Source for a work in source code form is that
  same work.
 
  2. Basic Permissions.
 
  All rights granted under this License are granted for the term of
  copyright on the Program, and are irrevocable provided the stated
  conditions are met. This License explicitly affirms your unlimited
  permission to run the unmodified Program. The output from running a
  covered work is covered by this License only if the output, given its
  content, constitutes a covered work. This License acknowledges your
  rights of fair use or other equivalent, as provided by copyright law.
 
  You may make, run and propagate covered works that you do not
  convey, without conditions so long as your license otherwise remains
  in force. You may convey covered works to others for the sole purpose
  of having them make modifications exclusively for you, or provide you
  with facilities for running those works, provided that you comply with
  the terms of this License in conveying all material for which you do
  not control copyright. Those thus making or running the covered works
  for you must do so exclusively on your behalf, under your direction
  and control, on terms that prohibit them from making any copies of
  your copyrighted material outside their relationship with you.
 
  Conveying under any other circumstances is permitted solely under
  the conditions stated below. Sublicensing is not allowed; section 10
  makes it unnecessary.
 
  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
 
  No covered work shall be deemed part of an effective technological
  measure under any applicable law fulfilling obligations under article
  11 of the WIPO copyright treaty adopted on 20 December 1996, or
  similar laws prohibiting or restricting circumvention of such
  measures.
 
  When you convey a covered work, you waive any legal power to forbid
  circumvention of technological measures to the extent such circumvention
  is effected by exercising rights under this License with respect to
  the covered work, and you disclaim any intention to limit operation or
  modification of the work as a means of enforcing, against the work's
  users, your or third parties' legal rights to forbid circumvention of
  technological measures.
 
  4. Conveying Verbatim Copies.
 
  You may convey verbatim copies of the Program's source code as you
  receive it, in any medium, provided that you conspicuously and
  appropriately publish on each copy an appropriate copyright notice;
  keep intact all notices stating that this License and any
  non-permissive terms added in accord with section 7 apply to the code;
  keep intact all notices of the absence of any warranty; and give all
  recipients a copy of this License along with the Program.
 
  You may charge any price or no price for each copy that you convey,
  and you may offer support or warranty protection for a fee.
 
  5. Conveying Modified Source Versions.
 
  You may convey a work based on the Program, or the modifications to
  produce it from the Program, in the form of source code under the
  terms of section 4, provided that you also meet all of these conditions:
 
  a) The work must carry prominent notices stating that you modified
  it, and giving a relevant date.
 
  b) The work must carry prominent notices stating that it is
  released under this License and any conditions added under section
  7. This requirement modifies the requirement in section 4 to
  "keep intact all notices".
 
  c) You must license the entire work, as a whole, under this
  License to anyone who comes into possession of a copy. This
  License will therefore apply, along with any applicable section 7
  additional terms, to the whole of the work, and all its parts,
  regardless of how they are packaged. This License gives no
  permission to license the work in any other way, but it does not
  invalidate such permission if you have separately received it.
 
  d) If the work has interactive user interfaces, each must display
  Appropriate Legal Notices; however, if the Program has interactive
  interfaces that do not display Appropriate Legal Notices, your
  work need not make them do so.
 
  A compilation of a covered work with other separate and independent
  works, which are not by their nature extensions of the covered work,
  and which are not combined with it such as to form a larger program,
  in or on a volume of a storage or distribution medium, is called an
  "aggregate" if the compilation and its resulting copyright are not
  used to limit the access or legal rights of the compilation's users
  beyond what the individual works permit. Inclusion of a covered work
  in an aggregate does not cause this License to apply to the other
  parts of the aggregate.
 
  6. Conveying Non-Source Forms.
 
  You may convey a covered work in object code form under the terms
  of sections 4 and 5, provided that you also convey the
  machine-readable Corresponding Source under the terms of this License,
  in one of these ways:
 
  a) Convey the object code in, or embodied in, a physical product
  (including a physical distribution medium), accompanied by the
  Corresponding Source fixed on a durable physical medium
  customarily used for software interchange.
 
  b) Convey the object code in, or embodied in, a physical product
  (including a physical distribution medium), accompanied by a
  written offer, valid for at least three years and valid for as
  long as you offer spare parts or customer support for that product
  model, to give anyone who possesses the object code either (1) a
  copy of the Corresponding Source for all the software in the
  product that is covered by this License, on a durable physical
  medium customarily used for software interchange, for a price no
  more than your reasonable cost of physically performing this
  conveying of source, or (2) access to copy the
  Corresponding Source from a network server at no charge.
 
  c) Convey individual copies of the object code with a copy of the
  written offer to provide the Corresponding Source. This
  alternative is allowed only occasionally and noncommercially, and
  only if you received the object code with such an offer, in accord
  with subsection 6b.
 
  d) Convey the object code by offering access from a designated
  place (gratis or for a charge), and offer equivalent access to the
  Corresponding Source in the same way through the same place at no
  further charge. You need not require recipients to copy the
  Corresponding Source along with the object code. If the place to
  copy the object code is a network server, the Corresponding Source
  may be on a different server (operated by you or a third party)
  that supports equivalent copying facilities, provided you maintain
  clear directions next to the object code saying where to find the
  Corresponding Source. Regardless of what server hosts the
  Corresponding Source, you remain obligated to ensure that it is
  available for as long as needed to satisfy these requirements.
 
  e) Convey the object code using peer-to-peer transmission, provided
  you inform other peers where the object code and Corresponding
  Source of the work are being offered to the general public at no
  charge under subsection 6d.
 
  A separable portion of the object code, whose source code is excluded
  from the Corresponding Source as a System Library, need not be
  included in conveying the object code work.
 
  A "User Product" is either (1) a "consumer product", which means any
  tangible personal property which is normally used for personal, family,
  or household purposes, or (2) anything designed or sold for incorporation
  into a dwelling. In determining whether a product is a consumer product,
  doubtful cases shall be resolved in favor of coverage. For a particular
  product received by a particular user, "normally used" refers to a
  typical or common use of that class of product, regardless of the status
  of the particular user or of the way in which the particular user
  actually uses, or expects or is expected to use, the product. A product
  is a consumer product regardless of whether the product has substantial
  commercial, industrial or non-consumer uses, unless such uses represent
  the only significant mode of use of the product.
 
  "Installation Information" for a User Product means any methods,
  procedures, authorization keys, or other information required to install
  and execute modified versions of a covered work in that User Product from
  a modified version of its Corresponding Source. The information must
  suffice to ensure that the continued functioning of the modified object
  code is in no case prevented or interfered with solely because
  modification has been made.
 
  If you convey an object code work under this section in, or with, or
  specifically for use in, a User Product, and the conveying occurs as
  part of a transaction in which the right of possession and use of the
  User Product is transferred to the recipient in perpetuity or for a
  fixed term (regardless of how the transaction is characterized), the
  Corresponding Source conveyed under this section must be accompanied
  by the Installation Information. But this requirement does not apply
  if neither you nor any third party retains the ability to install
  modified object code on the User Product (for example, the work has
  been installed in ROM).
 
  The requirement to provide Installation Information does not include a
  requirement to continue to provide support service, warranty, or updates
  for a work that has been modified or installed by the recipient, or for
  the User Product in which it has been modified or installed. Access to a
  network may be denied when the modification itself materially and
  adversely affects the operation of the network or violates the rules and
  protocols for communication across the network.
 
  Corresponding Source conveyed, and Installation Information provided,
  in accord with this section must be in a format that is publicly
  documented (and with an implementation available to the public in
  source code form), and must require no special password or key for
  unpacking, reading or copying.
 
  7. Additional Terms.
 
  "Additional permissions" are terms that supplement the terms of this
  License by making exceptions from one or more of its conditions.
  Additional permissions that are applicable to the entire Program shall
  be treated as though they were included in this License, to the extent
  that they are valid under applicable law. If additional permissions
  apply only to part of the Program, that part may be used separately
  under those permissions, but the entire Program remains governed by
  this License without regard to the additional permissions.
 
  When you convey a copy of a covered work, you may at your option
  remove any additional permissions from that copy, or from any part of
  it. (Additional permissions may be written to require their own
  removal in certain cases when you modify the work.) You may place
  additional permissions on material, added by you to a covered work,
  for which you have or can give appropriate copyright permission.
 
  Notwithstanding any other provision of this License, for material you
  add to a covered work, you may (if authorized by the copyright holders of
  that material) supplement the terms of this License with terms:
 
  a) Disclaiming warranty or limiting liability differently from the
  terms of sections 15 and 16 of this License; or
 
  b) Requiring preservation of specified reasonable legal notices or
  author attributions in that material or in the Appropriate Legal
  Notices displayed by works containing it; or
 
  c) Prohibiting misrepresentation of the origin of that material, or
  requiring that modified versions of such material be marked in
  reasonable ways as different from the original version; or
 
  d) Limiting the use for publicity purposes of names of licensors or
  authors of the material; or
 
  e) Declining to grant rights under trademark law for use of some
  trade names, trademarks, or service marks; or
 
  f) Requiring indemnification of licensors and authors of that
  material by anyone who conveys the material (or modified versions of
  it) with contractual assumptions of liability to the recipient, for
  any liability that these contractual assumptions directly impose on
  those licensors and authors.
 
  All other non-permissive additional terms are considered "further
  restrictions" within the meaning of section 10. If the Program as you
  received it, or any part of it, contains a notice stating that it is
  governed by this License along with a term that is a further
  restriction, you may remove that term. If a license document contains
  a further restriction but permits relicensing or conveying under this
  License, you may add to a covered work material governed by the terms
  of that license document, provided that the further restriction does
  not survive such relicensing or conveying.
 
  If you add terms to a covered work in accord with this section, you
  must place, in the relevant source files, a statement of the
  additional terms that apply to those files, or a notice indicating
  where to find the applicable terms.
 
  Additional terms, permissive or non-permissive, may be stated in the
  form of a separately written license, or stated as exceptions;
  the above requirements apply either way.
 
  8. Termination.
 
  You may not propagate or modify a covered work except as expressly
  provided under this License. Any attempt otherwise to propagate or
  modify it is void, and will automatically terminate your rights under
  this License (including any patent licenses granted under the third
  paragraph of section 11).
 
  However, if you cease all violation of this License, then your
  license from a particular copyright holder is reinstated (a)
  provisionally, unless and until the copyright holder explicitly and
  finally terminates your license, and (b) permanently, if the copyright
  holder fails to notify you of the violation by some reasonable means
  prior to 60 days after the cessation.
 
  Moreover, your license from a particular copyright holder is
  reinstated permanently if the copyright holder notifies you of the
  violation by some reasonable means, this is the first time you have
  received notice of violation of this License (for any work) from that
  copyright holder, and you cure the violation prior to 30 days after
  your receipt of the notice.
 
  Termination of your rights under this section does not terminate the
  licenses of parties who have received copies or rights from you under
  this License. If your rights have been terminated and not permanently
  reinstated, you do not qualify to receive new licenses for the same
  material under section 10.
 
  9. Acceptance Not Required for Having Copies.
 
  You are not required to accept this License in order to receive or
  run a copy of the Program. Ancillary propagation of a covered work
  occurring solely as a consequence of using peer-to-peer transmission
  to receive a copy likewise does not require acceptance. However,
  nothing other than this License grants you permission to propagate or
  modify any covered work. These actions infringe copyright if you do
  not accept this License. Therefore, by modifying or propagating a
  covered work, you indicate your acceptance of this License to do so.
 
  10. Automatic Licensing of Downstream Recipients.
 
  Each time you convey a covered work, the recipient automatically
  receives a license from the original licensors, to run, modify and
  propagate that work, subject to this License. You are not responsible
  for enforcing compliance by third parties with this License.
 
  An "entity transaction" is a transaction transferring control of an
  organization, or substantially all assets of one, or subdividing an
  organization, or merging organizations. If propagation of a covered
  work results from an entity transaction, each party to that
  transaction who receives a copy of the work also receives whatever
  licenses to the work the party's predecessor in interest had or could
  give under the previous paragraph, plus a right to possession of the
  Corresponding Source of the work from the predecessor in interest, if
  the predecessor has it or can get it with reasonable efforts.
 
  You may not impose any further restrictions on the exercise of the
  rights granted or affirmed under this License. For example, you may
  not impose a license fee, royalty, or other charge for exercise of
  rights granted under this License, and you may not initiate litigation
  (including a cross-claim or counterclaim in a lawsuit) alleging that
  any patent claim is infringed by making, using, selling, offering for
  sale, or importing the Program or any portion of it.
 
  11. Patents.
 
  A "contributor" is a copyright holder who authorizes use under this
  License of the Program or a work on which the Program is based. The
  work thus licensed is called the contributor's "contributor version".
 
  A contributor's "essential patent claims" are all patent claims
  owned or controlled by the contributor, whether already acquired or
  hereafter acquired, that would be infringed by some manner, permitted
  by this License, of making, using, or selling its contributor version,
  but do not include claims that would be infringed only as a
  consequence of further modification of the contributor version. For
  purposes of this definition, "control" includes the right to grant
  patent sublicenses in a manner consistent with the requirements of
  this License.
 
  Each contributor grants you a non-exclusive, worldwide, royalty-free
  patent license under the contributor's essential patent claims, to
  make, use, sell, offer for sale, import and otherwise run, modify and
  propagate the contents of its contributor version.
 
  In the following three paragraphs, a "patent license" is any express
  agreement or commitment, however denominated, not to enforce a patent
  (such as an express permission to practice a patent or covenant not to
  sue for patent infringement). To "grant" such a patent license to a
  party means to make such an agreement or commitment not to enforce a
  patent against the party.
 
  If you convey a covered work, knowingly relying on a patent license,
  and the Corresponding Source of the work is not available for anyone
  to copy, free of charge and under the terms of this License, through a
  publicly available network server or other readily accessible means,
  then you must either (1) cause the Corresponding Source to be so
  available, or (2) arrange to deprive yourself of the benefit of the
  patent license for this particular work, or (3) arrange, in a manner
  consistent with the requirements of this License, to extend the patent
  license to downstream recipients. "Knowingly relying" means you have
  actual knowledge that, but for the patent license, your conveying the
  covered work in a country, or your recipient's use of the covered work
  in a country, would infringe one or more identifiable patents in that
  country that you have reason to believe are valid.
 
  If, pursuant to or in connection with a single transaction or
  arrangement, you convey, or propagate by procuring conveyance of, a
  covered work, and grant a patent license to some of the parties
  receiving the covered work authorizing them to use, propagate, modify
  or convey a specific copy of the covered work, then the patent license
  you grant is automatically extended to all recipients of the covered
  work and works based on it.
 
  A patent license is "discriminatory" if it does not include within
  the scope of its coverage, prohibits the exercise of, or is
  conditioned on the non-exercise of one or more of the rights that are
  specifically granted under this License. You may not convey a covered
  work if you are a party to an arrangement with a third party that is
  in the business of distributing software, under which you make payment
  to the third party based on the extent of your activity of conveying
  the work, and under which the third party grants, to any of the
  parties who would receive the covered work from you, a discriminatory
  patent license (a) in connection with copies of the covered work
  conveyed by you (or copies made from those copies), or (b) primarily
  for and in connection with specific products or compilations that
  contain the covered work, unless you entered into that arrangement,
  or that patent license was granted, prior to 28 March 2007.
 
  Nothing in this License shall be construed as excluding or limiting
  any implied license or other defenses to infringement that may
  otherwise be available to you under applicable patent law.
 
  12. No Surrender of Others' Freedom.
 
  If conditions are imposed on you (whether by court order, agreement or
  otherwise) that contradict the conditions of this License, they do not
  excuse you from the conditions of this License. If you cannot convey a
  covered work so as to satisfy simultaneously your obligations under this
  License and any other pertinent obligations, then as a consequence you may
  not convey it at all. For example, if you agree to terms that obligate you
  to collect a royalty for further conveying from those to whom you convey
  the Program, the only way you could satisfy both those terms and this
  License would be to refrain entirely from conveying the Program.
 
  13. Use with the GNU Affero General Public License.
 
  Notwithstanding any other provision of this License, you have
  permission to link or combine any covered work with a work licensed
  under version 3 of the GNU Affero General Public License into a single
  combined work, and to convey the resulting work. The terms of this
  License will continue to apply to the part which is the covered work,
  but the special requirements of the GNU Affero General Public License,
  section 13, concerning interaction through a network will apply to the
  combination as such.
 
  14. Revised Versions of this License.
 
  The Free Software Foundation may publish revised and/or new versions of
  the GNU General Public License from time to time. Such new versions will
  be similar in spirit to the present version, but may differ in detail to
  address new problems or concerns.
 
  Each version is given a distinguishing version number. If the
  Program specifies that a certain numbered version of the GNU General
  Public License "or any later version" applies to it, you have the
  option of following the terms and conditions either of that numbered
  version or of any later version published by the Free Software
  Foundation. If the Program does not specify a version number of the
  GNU General Public License, you may choose any version ever published
  by the Free Software Foundation.
 
  If the Program specifies that a proxy can decide which future
  versions of the GNU General Public License can be used, that proxy's
  public statement of acceptance of a version permanently authorizes you
  to choose that version for the Program.
 
  Later license versions may give you additional or different
  permissions. However, no additional obligations are imposed on any
  author or copyright holder as a result of your choosing to follow a
  later version.
 
  15. Disclaimer of Warranty.
 
  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
  APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
  HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
  OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
  IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
  ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
 
  16. Limitation of Liability.
 
  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
  WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
  THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
  GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
  USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
  DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
  PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
  EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
  SUCH DAMAGES.
 
  17. Interpretation of Sections 15 and 16.
 
  If the disclaimer of warranty and limitation of liability provided
  above cannot be given local legal effect according to their terms,
  reviewing courts shall apply local law that most closely approximates
  an absolute waiver of all civil liability in connection with the
  Program, unless a warranty or assumption of liability accompanies a
  copy of the Program in return for a fee.
 
  END OF TERMS AND CONDITIONS
 
  How to Apply These Terms to Your New Programs
 
  If you develop a new program, and you want it to be of the greatest
  possible use to the public, the best way to achieve this is to make it
  free software which everyone can redistribute and change under these terms.
 
  To do so, attach the following notices to the program. It is safest
  to attach them to the start of each source file to most effectively
  state the exclusion of warranty; and each file should have at least
  the "copyright" line and a pointer to where the full notice is found.
 
  <one line to give the program's name and a brief idea of what it does.>
  Copyright (C) <year> <name of author>
 
  This program is free software: you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation, either version 3 of the License, or
  (at your option) any later version.
 
  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  GNU General Public License for more details.
 
  You should have received a copy of the GNU General Public License
  along with this program. If not, see <http://www.gnu.org/licenses/>.
 
  Also add information on how to contact you by electronic and paper mail.
 
  If the program does terminal interaction, make it output a short
  notice like this when it starts in an interactive mode:
 
  <program> Copyright (C) <year> <name of author>
  This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
  This is free software, and you are welcome to redistribute it
  under certain conditions; type `show c' for details.
 
  The hypothetical commands `show w' and `show c' should show the appropriate
  parts of the General Public License. Of course, your program's commands
  might be different; for a GUI interface, you would use an "about box".
 
  You should also get your employer (if you work as a programmer) or school,
  if any, to sign a "copyright disclaimer" for the program, if necessary.
  For more information on this, and how to apply and follow the GNU GPL, see
  <http://www.gnu.org/licenses/>.
 
  The GNU General Public License does not permit incorporating your program
  into proprietary programs. If your program is a subroutine library, you
  may consider it more useful to permit linking proprietary applications with
  the library. If this is what you want to do, use the GNU Lesser General
  Public License instead of this License. But first, please read
  <http://www.gnu.org/philosophy/why-not-lgpl.html>.
 
  <?php
 
  /*
  * Copyright (C) 2008 Anis uddin Ahmad <anisniit@gmail.com>
  * Copyright (C) 2010-2012 Michael Bemmerl <mail@mx-server.de>
  *
  * This file is part of the "Universal Feed Writer" project.
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation, either version 3 of the License, or
  * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 
  /**
  * Universal Feed Writer
  *
  * FeedItem class - Used as feed element in FeedWriter class
  *
  * @package UniversalFeedWriter
  * @author Anis uddin Ahmad <anisniit@gmail.com>
  * @link http://www.ajaxray.com/projects/rss
  */
  class FeedItem
  {
  private $elements = array(); //Collection of feed elements
  private $version;
 
  /**
  * Constructor
  *
  * @param contant (RSS1/RSS2/ATOM) RSS2 is default.
  */
  function __construct($version = RSS2)
  {
  $this->version = $version;
  }
 
  /**
  * Add an element to elements array
  *
  * @access public
  * @param string The tag name of an element
  * @param string The content of tag
  * @param array Attributes(if any) in 'attrName' => 'attrValue' format
  * @param boolean Specifies, if an already existing element is overwritten.
  * @return void
  */
  public function addElement($elementName, $content, $attributes = null, $overwrite = FALSE)
  {
  // return if element already exists & if overwriting is disabled.
  if (isset($this->elements[$elementName]) && !$overwrite)
  return;
 
  $this->elements[$elementName]['name'] = $elementName;
  $this->elements[$elementName]['content'] = $content;
  $this->elements[$elementName]['attributes'] = $attributes;
  }
 
  /**
  * Set multiple feed elements from an array.
  * Elements which have attributes cannot be added by this method
  *
  * @access public
  * @param array array of elements in 'tagName' => 'tagContent' format.
  * @return void
  */
  public function addElementArray($elementArray)
  {
  if (!is_array($elementArray))
  return;
 
  foreach ($elementArray as $elementName => $content)
  {
  $this->addElement($elementName, $content);
  }
  }
 
  /**
  * Return the collection of elements in this feed item
  *
  * @access public
  * @return array
  */
  public function getElements()
  {
  return $this->elements;
  }
 
  /**
  * Return the type of this feed item
  *
  * @access public
  * @return string The feed type, as defined in FeedWriter.php
  */
  public function getVersion()
  {
  return $this->version;
  }
 
  // Wrapper functions ------------------------------------------------------
 
  /**
  * Set the 'dscription' element of feed item
  *
  * @access public
  * @param string The content of 'description' or 'summary' element
  * @return void
  */
  public function setDescription($description)
  {
  $tag = ($this->version == ATOM) ? 'summary' : 'description';
  $this->addElement($tag, $description);
  }
 
  /**
  * @desc Set the 'title' element of feed item
  * @access public
  * @param string The content of 'title' element
  * @return void
  */
  public function setTitle($title)
  {
  $this->addElement('title', $title);
  }
 
  /**
  * Set the 'date' element of feed item
  *
  * @access public
  * @param string The content of 'date' element
  * @return void
  */
  public function setDate($date)
  {
  if(!is_numeric($date))
  {
  if ($date instanceof DateTime)
  {
  if (version_compare(PHP_VERSION, '5.3.0', '>='))
  $date = $date->getTimestamp();
  else
  $date = strtotime($date->format('r'));
  }
  else
  $date = strtotime($date);
  }
 
  if($this->version == ATOM)
  {
  $tag = 'updated';
  $value = date(DATE_ATOM, $date);
  }
  elseif($this->version == RSS2)
  {
  $tag = 'pubDate';
  $value = date(DATE_RSS, $date);
  }
  else
  {
  $tag = 'dc:date';
  $value = date("Y-m-d", $date);
  }
 
  $this->addElement($tag, $value);
  }
 
  /**
  * Set the 'link' element of feed item
  *
  * @access public
  * @param string The content of 'link' element
  * @return void
  */
  public function setLink($link)
  {
  if($this->version == RSS2 || $this->version == RSS1)
  {
  $this->addElement('link', $link);
  }
  else
  {
  $this->addElement('link','',array('href'=>$link));
  $this->addElement('id', FeedWriter::uuid($link,'urn:uuid:'));
  }
  }
 
  /**
  * Set the 'encloser' element of feed item
  * For RSS 2.0 only
  *
  * @access public
  * @param string The url attribute of encloser tag
  * @param string The length attribute of encloser tag
  * @param string The type attribute of encloser tag
  * @return void
  */
  public function setEncloser($url, $length, $type)
  {
  if ($this->version != RSS2)
  return;
 
  $attributes = array('url'=>$url, 'length'=>$length, 'type'=>$type);
  $this->addElement('enclosure','',$attributes);
  }
 
  /**
  * Set the 'author' element of feed item
  * For ATOM only
  *
  * @access public
  * @param string The author of this item
  * @return void
  */
  public function setAuthor($author)
  {
  if ($this->version != ATOM)
  return;
 
  $this->addElement('author', '<name>' . $author . '</name>');
  }
 
  /**
  * Set the unique identifier of the feed item
  *
  * @access public
  * @param string The unique identifier of this item
  * @return void
  */
  public function setId($id)
  {
  if ($this->version == RSS2)
  {
  $this->addElement('guid', $id, array('isPermaLink' => 'false'));
  }
  else if ($this->version == ATOM)
  {
  $this->addElement('id', FeedWriter::uuid($id,'urn:uuid:'), NULL, TRUE);
  }
  }
 
  } // end of class FeedItem
 
  <?php
 
  /*
  * Copyright (C) 2012 Michael Bemmerl <mail@mx-server.de>
  *
  * This file is part of the "Universal Feed Writer" project.
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation, either version 3 of the License, or
  * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 
  if (!class_exists('FeedWriter'))
  require dirname(__FILE__) . '/FeedWriter.php';
 
  /**
  * Wrapper for creating RSS1 feeds
  *
  * @package UniversalFeedWriter
  */
  class RSS1FeedWriter extends FeedWriter
  {
  function __construct()
  {
  parent::__construct(RSS1);
  }
  }
 
  /**
  * Wrapper for creating RSS2 feeds
  *
  * @package UniversalFeedWriter
  */
  class RSS2FeedWriter extends FeedWriter
  {
  function __construct()
  {
  parent::__construct(RSS2);
  }
  }
 
  /**
  * Wrapper for creating ATOM feeds
  *
  * @package UniversalFeedWriter
  */
  class ATOMFeedWriter extends FeedWriter
  {
  function __construct()
  {
  parent::__construct(ATOM);
  }
  }
 
  <?php
 
  /*
  * Copyright (C) 2008 Anis uddin Ahmad <anisniit@gmail.com>
  * Copyright (C) 2010-2012 Michael Bemmerl <mail@mx-server.de>
  *
  * This file is part of the "Universal Feed Writer" project.
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation, either version 3 of the License, or
  * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 
  // RSS 0.90 Officially obsoleted by 1.0
  // RSS 0.91, 0.92, 0.93 and 0.94 Officially obsoleted by 2.0
  // So, define constants for RSS 1.0, RSS 2.0 and ATOM
 
  define('RSS1', 'RSS 1.0', true);
  define('RSS2', 'RSS 2.0', true);
  define('ATOM', 'ATOM', true);
 
  if (!class_exists('FeedItem'))
  require dirname(__FILE__) . '/FeedItem.php';
 
  /**
  * Universal Feed Writer class
  *
  * Generate RSS 1.0, RSS2.0 and ATOM Feeds
  *
  * @package UniversalFeedWriter
  * @author Anis uddin Ahmad <anisniit@gmail.com>
  * @link http://www.ajaxray.com/projects/rss
  */
  abstract class FeedWriter
  {
  private $channels = array(); // Collection of channel elements
  private $items = array(); // Collection of items as object of FeedItem class.
  private $data = array(); // Store some other version wise data
  private $CDATAEncoding = array(); // The tag names which have to encoded as CDATA
 
  private $version = null;
 
  /**
  * Constructor
  *
  * @param constant the version constant (RSS1/RSS2/ATOM).
  */
  protected function __construct($version = RSS2)
  {
  $this->version = $version;
 
  // Setting default value for essential channel elements
  $this->channels['title'] = $version . ' Feed';
  $this->channels['link'] = 'http://www.ajaxray.com/blog';
 
  //Tag names to encode in CDATA
  $this->CDATAEncoding = array('description', 'content:encoded', 'summary');
  }
 
  // Start # public functions ---------------------------------------------
 
  /**
  * Set a channel element
  * @access public
  * @param string name of the channel tag
  * @param string content of the channel tag
  * @return void
  */
  public function setChannelElement($elementName, $content)
  {
  $this->channels[$elementName] = $content;
  }
 
  /**
  * Set multiple channel elements from an array. Array elements
  * should be 'channelName' => 'channelContent' format.
  *
  * @access public
  * @param array array of channels
  * @return void
  */
  public function setChannelElementsFromArray($elementArray)
  {
  if (!is_array($elementArray))
  return;
 
  foreach ($elementArray as $elementName => $content)
  {
  $this->setChannelElement($elementName, $content);
  }
  }
 
  /**
  * Genarate the actual RSS/ATOM file
  *
  * @access public
  * @param bool FALSE if the specific feed media type should be send.
  * @return void
  */
  public function generateFeed($useGenericContentType = FALSE)
  {
  $contentType = "text/xml";
 
  if (!$useGenericContentType)
  {
  switch($this->version)
  {
  case RSS2 : $contentType = "application/rss+xml";
  break;
  case RSS1 : $contentType = "application/rdf+xml";
  break;
  case ATOM : $contentType = "application/atom+xml";
  break;
  }
  }
 
  header("Content-Type: " . $contentType);
 
  $this->printHeader();
  $this->printChannels();
  $this->printItems();
  $this->printFooter();
  }
 
  /**
  * Create a new FeedItem.
  *
  * @access public
  * @return object instance of FeedItem class
  */
  public function createNewItem()
  {
  $Item = new FeedItem($this->version);
  return $Item;
  }
 
  /**
  * Add a FeedItem to the main class
  *
  * @access public
  * @param object instance of FeedItem class
  * @return void
  */
  public function addItem(FeedItem $feedItem)
  {
  if ($feedItem->getVersion() != $this->version)
  die('Feed type mismatch: This instance can handle ' . $this->version . ' feeds only, but item with type ' . $feedItem->getVersion() . ' given.');
 
  $this->items[] = $feedItem;
  }
 
 
  // Wrapper functions -------------------------------------------------------------------
 
  /**
  * Set the 'title' channel element
  *
  * @access public
  * @param string value of 'title' channel tag
  * @return void
  */
  public function setTitle($title)
  {
  $this->setChannelElement('title', $title);
  }
 
  /**
  * Set the 'updated' channel element of an ATOM feed
  *
  * @access public
  * @param string value of 'updated' channel tag
  * @return void
  */
  public function setDate($date)
  {
  if ($this->version != ATOM)
  return;
 
  if ($date instanceof DateTime)
  $date = $date->format(DateTime::ATOM);
  else if(is_numeric($date))
  $date = date(DATE_ATOM, $date);
  else
  $date = date(DATE_ATOM, strtotime($date));
 
  $this->setChannelElement('updated', $date);
  }
 
  /**
  * Set the 'description' channel element
  *
  * @access public
  * @param string value of 'description' channel tag
  * @return void
  */
  public function setDescription($desciption)
  {
  if ($this->version != ATOM)
  $this->setChannelElement('description', $desciption);
  }
 
  /**
  * Set the 'link' channel element
  *
  * @access public
  * @param string value of 'link' channel tag
  * @return void
  */
  public function setLink($link)
  {
  $this->setChannelElement('link', $link);
  }
 
  /**
  * Set the 'image' channel element
  *
  * @access public
  * @param string title of image
  * @param string link url of the image
  * @param string path url of the image
  * @return void
  */
  public function setImage($title, $link, $url)
  {
  $this->setChannelElement('image', array('title'=>$title, 'link'=>$link, 'url'=>$url));
  }
 
  /**
  * Set the 'about' channel element. Only for RSS 1.0
  *
  * @access public
  * @param string value of 'about' channel tag
  * @return void
  */
  public function setChannelAbout($url)
  {
  $this->data['ChannelAbout'] = $url;
  }
 
  /**
  * Generates an UUID
  * @author Anis uddin Ahmad <admin@ajaxray.com>
  * @param string an optional prefix
  * @return string the formated uuid
  */
  public static function uuid($key = null, $prefix = '')
  {
  $key = ($key == null)? uniqid(rand()) : $key;
  $chars = md5($key);
  $uuid = substr($chars,0,8) . '-';
  $uuid .= substr($chars,8,4) . '-';
  $uuid .= substr($chars,12,4) . '-';
  $uuid .= substr($chars,16,4) . '-';
  $uuid .= substr($chars,20,12);
 
  return $prefix . $uuid;
  }
  // End # public functions ----------------------------------------------
 
  // Start # private functions ----------------------------------------------
 
  /**
  * Prints the xml and rss namespace
  *
  * @access private
  * @return void
  */
  private function printHeader()
  {
  $out = '<?xml version="1.0" encoding="utf-8"?>' . PHP_EOL;
 
  if($this->version == RSS2)
  {
  $out .= '<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/">';
  }
  elseif($this->version == RSS1)
  {
  $out .= '<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:dc="http://purl.org/dc/elements/1.1/">';
  }
  else if($this->version == ATOM)
  {
  $out .= '<feed xmlns="http://www.w3.org/2005/Atom">';
  }
 
  $out .= PHP_EOL;
 
  echo $out;
  }
 
  /**
  * Closes the open tags at the end of file
  *
  * @access private
  * @return void
  */
  private function printFooter()
  {
  if($this->version == RSS2)
  {
  echo '</channel>' . PHP_EOL . '</rss>';
  }
  elseif($this->version == RSS1)
  {
  echo '</rdf:RDF>';
  }
  else if($this->version == ATOM)
  {
  echo '</feed>';
  }
  }
 
  /**
  * Creates a single node as xml format
  *
  * @access private
  * @param string name of the tag
  * @param mixed tag value as string or array of nested tags in 'tagName' => 'tagValue' format
  * @param array Attributes(if any) in 'attrName' => 'attrValue' format
  * @return string formatted xml tag
  */
  private function makeNode($tagName, $tagContent, $attributes = null)
  {
  $nodeText = '';
  $attrText = '';
 
  if(is_array($attributes) && count($attributes) > 0)
  {
  foreach ($attributes as $key => $value)
  {
  $value = htmlspecialchars($value);
  $attrText .= " $key=\"$value\" ";
  }
 
  // Get rid of the last whitespace
  $attrText = substr($attrText, 0, strlen($attrText) - 1);
  }
 
  if(is_array($tagContent) && $this->version == RSS1)
  {
  $attrText = ' rdf:parseType="Resource"';
  }
 
  $attrText .= (in_array($tagName, $this->CDATAEncoding) && $this->version == ATOM) ? ' type="html"' : '';
  $nodeText .= "<{$tagName}{$attrText}>";
  $nodeText .= (in_array($tagName, $this->CDATAEncoding)) ? '<![CDATA[' : '';
 
  if(is_array($tagContent))
  {
  foreach ($tagContent as $key => $value)
  {
  $nodeText .= $this->makeNode($key, $value);
  }
  }
  else
  {
  $nodeText .= (in_array($tagName, $this->CDATAEncoding))? $this->sanitizeCDATA($tagContent) : htmlspecialchars($tagContent);
  }
 
  $nodeText .= (in_array($tagName, $this->CDATAEncoding)) ? ']]>' : '';
  $nodeText .= "</$tagName>" . PHP_EOL;
 
  return $nodeText;
  }
 
  /**
  * @desc Print channels
  * @access private
  * @return void
  */
  private function printChannels()
  {
  //Start channel tag
  switch ($this->version)
  {
  case RSS2:
  echo '<channel>' . PHP_EOL;
  break;
  case RSS1:
  echo (isset($this->data['ChannelAbout']))? "<channel rdf:about=\"{$this->data['ChannelAbout']}\">" : "<channel rdf:about=\"{$this->channels['link']}\">";
  break;
  }
 
  //Print Items of channel
  foreach ($this->channels as $key => $value)
  {
  if($this->version == ATOM && $key == 'link')
  {
  // ATOM prints link element as href attribute
  echo $this->makeNode($key,'', array('href' => $value));
  //Add the id for ATOM
  echo $this->makeNode('id', FeedWriter::uuid($value, 'urn:uuid:'));
  }
  else
  {
  echo $this->makeNode($key, $value);
  }
 
  }
 
  //RSS 1.0 have special tag <rdf:Seq> with channel
  if($this->version == RSS1)
  {
  echo "<items>" . PHP_EOL . "<rdf:Seq>" . PHP_EOL;
  foreach ($this->items as $item)
  {
  $thisItems = $item->getElements();
  echo "<rdf:li resource=\"{$thisItems['link']['content']}\"/>" . PHP_EOL;
  }
  echo "</rdf:Seq>" . PHP_EOL . "</items>" . PHP_EOL . "</channel>" . PHP_EOL;
  }
  }
 
  /**
  * Prints formatted feed items
  *
  * @access private
  * @return void
  */
  private function printItems()
  {
  foreach ($this->items as $item)
  {
  $thisItems = $item->getElements();
 
  //the argument is printed as rdf:about attribute of item in rss 1.0
  echo $this->startItem($thisItems['link']['content']);
 
  foreach ($thisItems as $feedItem)
  {
  echo $this->makeNode($feedItem['name'], $feedItem['content'], $feedItem['attributes']);
  }
  echo $this->endItem();
  }
  }
 
  /**
  * Make the starting tag of channels
  *
  * @access private
  * @param string The vale of about tag which is used for RSS 1.0 only.
  * @return void
  */
  private function startItem($about = false)
  {
  if($this->version == RSS2)
  {
  echo '<item>' . PHP_EOL;
  }
  else if($this->version == RSS1)
  {
  if($about)
  {
  echo "<item rdf:about=\"$about\">" . PHP_EOL;
  }
  else
  {
  die("link element is not set." . PHP_EOL . "It's required for RSS 1.0 to be used as the about attribute of the item tag.");
  }
  }
  else if($this->version == ATOM)
  {
  echo "<entry>" . PHP_EOL;
  }
  }
 
  /**
  * Closes feed item tag
  *
  * @access private
  * @return void
  */
  private function endItem()
  {
  if($this->version == RSS2 || $this->version == RSS1)
  {
  echo '</item>' . PHP_EOL;
  }
  else if($this->version == ATOM)
  {
  echo "</entry>" . PHP_EOL;
  }
  }
 
  /**
  * Sanitizes data which will be later on returned as CDATA in the feed.
  *
  * A "]]>" respectively "<![CDATA" in the data would break the CDATA in the
  * XML, so the brackets are converted to a HTML entity.
  *
  * @access private
  * @param string Data to be sanitized
  * @return string Sanitized data
  */
  private function sanitizeCDATA($text)
  {
  $text = str_replace("]]>", "]]&gt;", $text);
  $text = str_replace("<![CDATA[", "&lt;![CDATA[", $text);
 
  return $text;
  }
 
  // End # private functions ----------------------------------------------
 
  } // end of class FeedWriter
 
  This package can be used to generate feeds in either RSS 1.0, RSS 2.0 or ATOM
  formats.
 
  There are three main classes that abstracts the feed information and another to
  encapsulate the feed items information.
 
  Applications can create feed writer object, several feed item objects, set
  several types of properties of either feeds and feed items, and add items to
  the feed.
 
  Once a feed is fully composed with its items, the feed writer class can generate
  the necessary XML structure to describe the feed in the RSS or ATOM formats.
  The feed is generated as part of the current feed output.
 
 
  Requirements
  ============
 
  PHP >= 5.0
 
  <?php
 
  /*
  * Copyright (C) 2008 Anis uddin Ahmad <anisniit@gmail.com>
  *
  * This file is part of the "Universal Feed Writer" project.
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation, either version 3 of the License, or
  * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 
 
  include("../FeedTypes.php");
 
  // IMPORTANT : No need to add id for feed or channel. It will be automatically created from link.
 
  //Creating an instance of ATOMFeedWriter class.
  //The constant ATOM is passed to mention the version
  $TestFeed = new ATOMFeedWriter();
 
  //Setting the channel elements
  //Use wrapper functions for common elements
  $TestFeed->setTitle('Testing the RSS writer class');
  $TestFeed->setLink('http://www.ajaxray.com/rss2/channel/about');
 
  //For other channel elements, use setChannelElement() function
  $TestFeed->setChannelElement('updated', date(DATE_ATOM , time()));
  $TestFeed->setChannelElement('author', array('name'=>'Anis uddin Ahmad'));
 
  //Adding a feed. Genarally this protion will be in a loop and add all feeds.
 
  //Create an empty FeedItem
  $newItem = $TestFeed->createNewItem();
 
  //Add elements to the feed item
  //Use wrapper functions to add common feed elements
  $newItem->setTitle('The first feed');
  $newItem->setLink('http://www.yahoo.com');
  $newItem->setDate(time());
  //Internally changed to "summary" tag for ATOM feed
  $newItem->setDescription('This is a test of adding CDATA encoded description by the php <b>Universal Feed Writer</b> class');
 
  //Now add the feed item
  $TestFeed->addItem($newItem);
 
  //OK. Everything is done. Now genarate the feed.
  $TestFeed->generateFeed();
 
  ?>
 
  <?php
 
  /*
  * Copyright (C) 2008 Anis uddin Ahmad <anisniit@gmail.com>
  *
  * This file is part of the "Universal Feed Writer" project.
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation, either version 3 of the License, or
  * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 
  // This is a minimum example of using the class
  include("../FeedTypes.php");
 
  //Creating an instance of RSS2FeedWriter class.
  $TestFeed = new RSS2FeedWriter();
 
  //Setting the channel elements
  //Use wrapper functions for common channel elements
  $TestFeed->setTitle('Testing & Checking the RSS writer class');
  $TestFeed->setLink('http://www.ajaxray.com/projects/rss');
  $TestFeed->setDescription('This is a test of creating a RSS 2.0 feed Universal Feed Writer');
 
  //Image title and link must match with the 'title' and 'link' channel elements for valid RSS 2.0
  $TestFeed->setImage('Testing the RSS writer class','http://www.ajaxray.com/projects/rss','http://www.rightbrainsolution.com/_resources/img/logo.png');
 
  //Let's add some feed items: Create two empty FeedItem instances
  $itemOne = $TestFeed->createNewItem();
  $itemTwo = $TestFeed->createNewItem();
 
  //Add item details
  $itemOne->setTitle('The title of the first entry.');
  $itemOne->setLink('http://www.google.de');
  $itemOne->setDate(time());
  $itemOne->setDescription('And here\'s the description of the entry.');
  $itemTwo->setTitle('Lorem ipsum');
  $itemTwo->setLink('http://www.example.com');
  $itemTwo->setDate(1234567890);
  $itemTwo->setDescription('Lorem ipsum dolor sit amet, consectetur, adipisci velit');
 
  //Now add the feed item
  $TestFeed->addItem($itemOne);
  $TestFeed->addItem($itemTwo);
 
  //OK. Everything is done. Now genarate the feed.
  $TestFeed->generateFeed();
 
  ?>
 
  <?php
 
  /*
  * Copyright (C) 2008 Anis uddin Ahmad <anisniit@gmail.com>
  *
  * This file is part of the "Universal Feed Writer" project.
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation, either version 3 of the License, or
  * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 
 
  include("../FeedTypes.php");
 
  //Creating an instance of RSS1FeedWriter class.
  //The constant RSS1 is passed to mention the version
  $TestFeed = new RSS1FeedWriter();
 
  //Setting the channel elements
  //Use wrapper functions for common elements
  //For other optional channel elements, use setChannelElement() function
  $TestFeed->setTitle('Testing the RSS writer class');
  $TestFeed->setLink('http://www.ajaxray.com/rss2/channel/about');
  $TestFeed->setDescription('This is test of creating a RSS 1.0 feed by Universal Feed Writer');
 
  //It's important for RSS 1.0
  $TestFeed->setChannelAbout('http://www.ajaxray.com/rss2/channel/about');
 
  //Adding a feed. Genarally this protion will be in a loop and add all feeds.
 
  //Create an empty FeedItem
  $newItem = $TestFeed->createNewItem();
 
  //Add elements to the feed item
  //Use wrapper functions to add common feed elements
  $newItem->setTitle('The first feed');
  $newItem->setLink('http://www.yahoo.com');
  //The parameter is a timestamp for setDate() function
  $newItem->setDate(time());
  $newItem->setDescription('This is test of adding CDATA encoded description by the php <b>Universal Feed Writer</b> class');
  //Use core addElement() function for other supported optional elements
  $newItem->addElement('dc:subject', 'Nothing but test');
 
  //Now add the feed item
  $TestFeed->addItem($newItem);
 
  //Adding multiple elements from array
  //Elements which have an attribute cannot be added by this way
  $newItem = $TestFeed->createNewItem();
  $newItem->addElementArray(array('title'=>'The 2nd feed', 'link'=>'http://www.google.com', 'description'=>'This is a test of the FeedWriter class'));
  $TestFeed->addItem($newItem);
 
  //OK. Everything is done. Now genarate the feed.
  $TestFeed->generateFeed();
 
  ?>
 
  <?php
 
  /*
  * Copyright (C) 2008 Anis uddin Ahmad <anisniit@gmail.com>
  *
  * This file is part of the "Universal Feed Writer" project.
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation, either version 3 of the License, or
  * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 
 
  include("../FeedTypes.php");
 
  //Creating an instance of RSS2FeedWriter class.
  //The constant RSS2 is passed to mention the version
  $TestFeed = new RSS2FeedWriter();
 
  //Setting the channel elements
  //Use wrapper functions for common channel elements
  $TestFeed->setTitle('Testing & Checking the RSS writer class');
  $TestFeed->setLink('http://www.ajaxray.com/projects/rss');
  $TestFeed->setDescription('This is a test of creating a RSS 2.0 feed with Universal Feed Writer');
 
  //Image title and link must match with the 'title' and 'link' channel elements for RSS 2.0
  $TestFeed->setImage('Testing the RSS writer class','http://www.ajaxray.com/projects/rss','http://www.rightbrainsolution.com/_resources/img/logo.png');
 
  //Use core setChannelElement() function for other optional channels
  $TestFeed->setChannelElement('language', 'en-us');
  $TestFeed->setChannelElement('pubDate', date(DATE_RSS, time()));
 
  //Adding a feed. Genarally this portion will be in a loop and add all feeds.
 
  //Create an empty FeedItem
  $newItem = $TestFeed->createNewItem();
 
  //Add elements to the feed item
  //Use wrapper functions to add common feed elements
  $newItem->setTitle('The first feed');
  $newItem->setLink('http://www.yahoo.com');
  //The parameter is a timestamp for setDate() function
  $newItem->setDate(time());
  $newItem->setDescription('This is a test of adding CDATA encoded description by the php <b>Universal Feed Writer</b> class');
  $newItem->setEncloser('http://www.attrtest.com', '1283629', 'audio/mpeg');
  //Use core addElement() function for other supported optional elements
  $newItem->addElement('author', 'admin@ajaxray.com (Anis uddin Ahmad)');
  //Attributes have to passed as array in 3rd parameter
  $newItem->addElement('guid', 'http://www.ajaxray.com',array('isPermaLink'=>'true'));
 
  //Now add the feed item
  $TestFeed->addItem($newItem);
 
  //Another method to add feeds from array()
  //Elements which have attribute cannot be added by this way
  $newItem = $TestFeed->createNewItem();
  $newItem->addElementArray(array('title'=>'The 2nd feed', 'link'=>'http://www.google.com', 'description'=>'This is a test of the FeedWriter class'));
  $TestFeed->addItem($newItem);
 
  //OK. Everything is done. Now genarate the feed.
  $TestFeed->generateFeed();
 
  ?>
 
file:a/stylesheets/app.css (deleted)
/* Foundation v2.1.4 http://foundation.zurb.com */  
/* Artfully masterminded by ZURB */  
 
/* ZURB bar copy*/  
#navbar {  
background: #222222;  
border-bottom: solid 4px #00a5ff;  
padding: 15px 20px 13px 20px; }  
 
@media handheld, only screen and (max-width: 767px) {  
#navbar {  
padding-left: 20px;  
padding-right: 20px; }  
}  
 
#navbar h1, #navbar h2 {  
margin-bottom: 0;  
line-height: 1; }  
#navbar h1 {  
color: white;  
font-size: 16px;  
font-size: 1.6rem;  
font-weight: 800; }  
#navbar a { color: #fff; font-weight: bold; }  
 
#navbar strong { display: block; margin: 0; padding: 0; height: 14px; line-height: 14px; position: relative; bottom: 4px; }  
#navbar strong a {  
line-height: 14px;  
color: #fff;  
font-weight: 500;  
padding-right: 12px;  
}  
#navbar strong a.button { padding: 4px 10px; font-weight: bold; }  
 
/* other zurb copied css */  
.row { max-width: 1200px; }  
 
div.foundation-header { margin: 0 0 40px 0; padding: 30px 0 0 0; border-bottom: solid 1px #ccc; }  
div.foundation-header h1 { margin-bottom: 0; padding: 0; }  
div.foundation-header h1 a { color: #181818; }  
div.foundation-header h1 a:hover { color: #181818; }  
div.foundation-header .subheader { margin-bottom: 9px; }  
 
div.highlight { margin-bottom: 12px; }  
 
img.beta { position: absolute; top: 0px; right: 0px; }  
 
/* Footer */  
footer.row {  
margin-top: 80px;  
border-top: solid 1px #e6e6e6;  
padding-top: 20px; }  
footer.row h6 {  
color: #6f6f6f;  
font-size: 14px;  
font-size: 1.4rem;  
margin-bottom: 4px; }  
footer.row p {  
color: #626262;  
font-size: 12px;  
font-size: 1.2rem;  
line-height: 18px; }  
footer.row a {  
color: #222222; }  
footer.row a:hover {  
text-decoration: underline; }  
 
 
 
.row.display { background: #f4f4f4; margin-bottom: 10px; border-radius: 3px; -webkit-border-radius: 3px; -moz-border-radius: 3px; }  
.row.display .column, .row.display .columns { background: #e7e7e7; font-size: 11px; text-indent: 3px; padding-top: 6px; padding-bottom: 6px; border-radius: 3px; -webkit-border-radius: 3px; -moz-border-radius: 3px; }  
 
/* Foundation v2.1.4 http://foundation.zurb.com */  
/* Artfully Masterminded by ZURB */  
 
/* --------------------------------------------------  
Table of Contents  
-----------------------------------------------------  
:: Reset & Standards  
:: Links  
:: Lists  
:: Tables  
:: Misc  
*/  
 
 
/* --------------------------------------------------  
:: Global Reset & Standards  
-------------------------------------------------- */  
 
/*  
Eric Meyer's CSS Reset  
http://meyerweb.com/eric/tools/css/reset/  
v2.0 | 20110126  
License: none (public domain)  
*/  
 
html, body, div, span, applet, object, iframe,  
h1, h2, h3, h4, h5, h6, p, blockquote, pre,  
a, abbr, acronym, address, big, cite, code,  
del, dfn, em, img, ins, kbd, q, s, samp,  
small, strike, strong, sub, sup, tt, var,  
b, u, i, center,  
dl, dt, dd, ol, ul, li,  
fieldset, form, label, legend,  
table, caption, tbody, tfoot, thead, tr, th, td,  
article, aside, canvas, details, embed,  
figure, figcaption, footer, header, hgroup,  
menu, nav, output, ruby, section, summary,  
time, mark, audio, video {  
margin: 0;  
padding: 0;  
border: 0;  
font: inherit;  
vertical-align: baseline;  
}  
html {  
font-size: 62.5%;  
}  
/* HTML5 display-role reset for older browsers */  
article, aside, details, figcaption, figure,  
footer, header, hgroup, menu, nav, section {  
display: block;  
}  
body {  
line-height: 1;  
}  
ol, ul {  
list-style: none;  
}  
blockquote, q {  
quotes: none;  
}  
blockquote:before, blockquote:after,  
q:before, q:after {  
content: '';  
content: none;  
}  
table {  
border-collapse: collapse;  
border-spacing: 0;  
}  
 
 
 
body { background: #fff; font-family: "Helvetica Neue", "HelveticaNeue", Helvetica, Arial, "Lucida Grande", sans-serif; font-size: 13px; line-height: 18px; color: #555; position: relative; -webkit-font-smoothing: antialiased; }  
 
 
 
/* --------------------------------------------------  
:: Links  
-------------------------------------------------- */  
a { color: #2a85e8; text-decoration: none; line-height: inherit; }  
a:hover { color: #11639d; }  
a:focus { color: #cc4714; outline: none; }  
p a, p a:visited { line-height: inherit; }  
 
 
/* --------------------------------------------------  
:: Lists  
-------------------------------------------------- */  
ul, ol { margin-bottom: 18px; }  
ul { list-style: none outside; }  
ol { list-style: decimal; }  
ol, ul.square, ul.circle, ul.disc { margin-left: 30px; }  
ul.square { list-style: square outside; }  
ul.circle { list-style: circle outside; }  
ul.disc { list-style: disc outside; }  
li { margin-bottom: 12px; }  
ul.large li { line-height: 21px; }  
 
 
/* --------------------------------------------------  
:: Tables  
-------------------------------------------------- */  
table { background: #fff; -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; margin: 0 0 18px; border: 1px solid #ddd; }  
 
table thead, table tfoot { background: #f5f5f5; }  
table thead tr th,  
table tfoot tr th,  
table tbody tr td,  
table tr td,  
table tfoot tr td { font-size: 12px; line-height: 18px; text-align: left; }  
table thead tr th,  
table tfoot tr td { padding: 8px 10px 9px; font-size: 14px; font-weight: bold; color: #222; }  
table thead tr th:first-child, table tfoot tr td:first-child { border-left: none; }  
table thead tr th:last-child, table tfoot tr td:last-child { border-right: none; }  
 
table tbody tr.even,  
table tbody tr.alt { background: #f9f9f9; }  
table tbody tr:nth-child(even) { background: #f9f9f9; }  
table tbody tr td { color: #333; padding: 9px 10px; vertical-align: top; border: none; }  
 
/* --------------------------------------------------  
:: Misc  
---------------------------------------------------*/  
.left { float: left; }  
.right { float: right; }  
.hide { display: none; }  
.highlight { background: #ff0; }  
 
/* Arfully Masterminded by ZURB */  
 
/* --------------------------------------------------  
:: Typography  
-------------------------------------------------- */  
h1, h2, h3, h4, h5, h6 { color: #181818; font-weight: bold; line-height: 1.25 }  
h1 a, h2 a, h3 a, h4 a, h5 a, h6 a { font-weight: inherit; }  
h1 { font-size: 46px; font-size: 4.6rem; margin-bottom: 12px;}  
h2 { font-size: 35px; font-size: 3.5rem; margin-bottom: 9px; }  
h3 { font-size: 28px; font-size: 2.8rem; margin-bottom: 9px; }  
h4 { font-size: 21px; font-size: 2.1rem; margin-bottom: 3px; }  
h5 { font-size: 18px; font-size: 1.8rem; font-weight: normal; margin-bottom: 3px; }  
h6 { font-size: 15px; font-size: 1.5rem; font-weight: normal; }  
 
.subheader { color: #777; font-weight: 300; margin-bottom: 24px; }  
 
p { line-height: 17px; margin: 0 0 18px; }  
p img { margin: 0; }  
p.lead { font-size: 18px; font-size: 1.8rem; line-height: 24px; }  
 
em, i { font-style: italic; line-height: inherit; }  
strong, b { font-weight: bold; line-height: inherit; }  
small { font-size: 60%; line-height: inherit; }  
 
h1 small, h2 small, h3 small, h4 small, h5 small { color: #777; }  
 
/* Blockquotes */  
blockquote, blockquote p { line-height: 20px; color: #777; }  
blockquote { margin: 0 0 18px; padding: 9px 20px 0 19px; border-left: 1px solid #ddd; }  
blockquote cite { display: block; font-size: 12px; font-size: 1.2rem; color: #555; }  
blockquote cite:before { content: "\2014 \0020"; }  
blockquote cite a, blockquote cite a:visited { color: #555; }  
 
hr { border: solid #ddd; border-width: 1px 0 0; clear: both; margin: 12px 0 18px; height: 0; }  
 
abbr, acronym { text-transform: uppercase; font-size: 90%; color: #222; border-bottom: 1px solid #ddd; cursor: help; }  
abbr { text-transform: none; }  
 
/**  
* Print styles.  
*  
* Inlined to avoid required HTTP connection: www.phpied.com/delay-loading-your-print-css/  
* Credit to Paul Irish and HTML5 Boilerplate (html5boilerplate.com)  
*/  
.print-only { display: none !important; }  
@media print {  
* { background: transparent !important; color: black !important; text-shadow: none !important; filter:none !important;  
-ms-filter: none !important; } /* Black prints faster: sanbeiji.com/archives/953 */  
p a, p a:visited { color: #444 !important; text-decoration: underline; }  
p a[href]:after { content: " (" attr(href) ")"; }  
abbr[title]:after { content: " (" attr(title) ")"; }  
.ir a:after, a[href^="javascript:"]:after, a[href^="#"]:after { content: ""; } /* Don't show links for images, or javascript/internal links */  
pre, blockquote { border: 1px solid #999; page-break-inside: avoid; }  
thead { display: table-header-group; } /* css-discuss.incutio.com/wiki/Printing_Tables */  
tr, img { page-break-inside: avoid; }  
@page { margin: 0.5cm; }  
p, h2, h3 { orphans: 3; widows: 3; }  
h2, h3{ page-break-after: avoid; }  
.hide-on-print { display: none !important; }  
.print-only { display: block !important; }  
}  
/* Arfully Masterminded by ZURB */  
 
/* --------------------------------------------------  
:: Grid  
 
This is the mobile-friendly, responsive grid that  
lets Foundation work much of its magic.  
 
-------------------------------------------------- */  
 
.container { padding: 0 20px; }  
 
.row { width: 100%; max-width: 980px; min-width: 727px; margin: 0 auto; }  
/* To fix the grid into a certain size, set max-width to width */  
.row .row { min-width: 0; }  
 
.column, .columns { margin-left: 4.4%; float: left; min-height: 1px; position: relative; }  
.column:first-child, .columns:first-child { margin-left: 0; }  
 
.row .one.columns { width: 4.3%; }  
.row .two.columns { width: 13%; }  
.row .three.columns { width: 21.68%; }  
.row .four.columns { width: 30.37%; }  
.row .five.columns { width: 39.1%; }  
.row .six.columns { width: 47.8%; }  
.row .seven.columns { width: 56.5%; }  
.row .eight.columns { width: 65.2%; }  
.row .nine.columns { width: 73.9%; }  
.row .ten.columns { width: 82.6%; }  
.row .eleven.columns { width: 91.3%; }  
.row .twelve.columns { width: 100%; }  
 
.row .offset-by-one { margin-left: 13.1%; }  
.row .offset-by-two { margin-left: 21.8%; }  
.row .offset-by-three { margin-left: 30.5%; }  
.row .offset-by-four { margin-left: 39.2%; }  
.row .offset-by-five { margin-left: 47.9%; }  
.row .offset-by-six { margin-left: 56.6%; }  
.row .offset-by-seven { margin-left: 65.3%; }  
.row .offset-by-eight { margin-left: 74.0%; }  
.row .offset-by-nine { margin-left: 82.7%; }  
.row .offset-by-ten { margin-left: 91.4%; }  
 
.row .centered { float: none; margin: 0 auto; }  
 
.row .offset-by-one:first-child { margin-left: 8.7%; }  
.row .offset-by-two:first-child { margin-left: 17.4%; }  
.row .offset-by-three:first-child { margin-left: 26.1%; }  
.row .offset-by-four:first-child { margin-left: 34.8%; }  
.row .offset-by-five:first-child { margin-left: 43.5%; }  
.row .offset-by-six:first-child { margin-left: 52.2%; }  
.row .offset-by-seven:first-child { margin-left: 60.9%; }  
.row .offset-by-eight:first-child { margin-left: 69.6%; }  
.row .offset-by-nine:first-child { margin-left: 78.3%; }  
.row .offset-by-ten:first-child { margin-left: 87%; }  
.row .offset-by-eleven:first-child { margin-left: 95.7%; }  
 
/* Source Ordering */  
.push-two { left: 17.4% }  
.push-three { left: 26.1%; }  
.push-four { left: 34.8%; }  
.push-five { left: 43.5%; }  
.push-six { left: 52.2%; }  
.push-seven { left: 60.9%; }  
.push-eight { left: 69.6%; }  
.push-nine { left: 78.3%; }  
.push-ten { left: 87%; }  
 
.pull-two { right: 17.4% }  
.pull-three { right: 26.1%; }  
.pull-four { right: 34.8%; }  
.pull-five { right: 43.5%; }  
.pull-six { right: 52.2%; }  
.pull-seven { right: 60.9%; }  
.pull-eight { right: 69.6%; }  
.pull-nine { right: 78.3%; }  
.pull-ten { right: 87%; }  
 
 
 
img, object, embed { max-width: 100%; height: auto; }  
img { -ms-interpolation-mode: bicubic; }  
 
/* Nicolas Gallagher's micro clearfix */  
.row:before, .row:after, .clearfix:before, .clearfix:after { content:""; display:table; }  
.row:after, .clearfix:after { clear: both; }  
.row, .clearfix { zoom: 1; }  
 
 
 
 
/* --------------------------------------------------  
:: Block grids  
 
These are 2-up, 3-up, 4-up and 5-up ULs, suited  
for repeating blocks of content. Add 'mobile' to  
them to switch them just like the layout grid  
(one item per line) on phones  
 
For IE7/8 compatibility block-grid items need to be  
the same height. You can optionally uncomment the  
lines below to support arbitrary height, but know  
that IE7/8 do not support :nth-child.  
-------------------------------------------------- */  
 
.block-grid { display: block; overflow: hidden; }  
.block-grid>li { display: block; height: auto; float: left; }  
 
.block-grid.two-up { margin-left: -4% }  
.block-grid.two-up>li { margin-left: 4%; width: 46%; }  
/* .block-grid.two-up>li:nth-child(2n+1) {clear: left;} */  
 
.block-grid.three-up { margin-left: -2% }  
.block-grid.three-up>li { margin-left: 2%; width: 31.3%; }  
/* .block-grid.three-up>li:nth-child(3n+1) {clear: left;} */  
 
.block-grid.four-up { margin-left: -2% }  
.block-grid.four-up>li { margin-left: 2%; width: 23%; }  
/* .block-grid.four-up>li:nth-child(4n+1) {clear: left;} */  
 
.block-grid.five-up { margin-left: -1.5% }  
.block-grid.five-up>li { margin-left: 1.5%; width: 18.5%; }  
/* .block-grid.five-up>li:nth-child(5n+1) {clear: left;} */  
 
/* Artfully masterminded by ZURB */  
 
 
 
/* --------------------------------------------------  
Table of Contents  
-----------------------------------------------------  
:: Buttons  
:: Alerts  
:: Notices/Alerts  
:: Tabs  
:: Pagination  
:: Lists  
:: Panels  
:: Nav  
:: Video  
:: Microformats  
*/  
 
 
 
 
/* --------------------------------------------------  
Buttons  
-------------------------------------------------- */  
 
.button {  
background: #00a6fc;  
display: inline-block;  
text-align: center;  
padding: 9px 34px 11px;  
color: #fff;  
text-decoration: none;  
font-weight: bold;  
line-height: 1;  
font-family: "Helvetica Neue", "Helvetica", Arial, Verdana, sans-serif;  
position: relative;  
cursor: pointer;  
border: none;  
}  
 
/* Don't use native buttons on iOS */  
input[type=submit].button { -webkit-appearance: none; }  
 
.button.nice {  
background: #00a6fc url(../images/misc/button-gloss.png) repeat-x 0 -34px;  
-moz-box-shadow: inset 0 1px 0 rgba(255,255,255,.5);  
-webkit-box-shadow: inset 0 1px 0 rgba(255,255,255,.5);  
text-shadow: 0 -1px 1px rgba(0,0,0,0.28);  
background: #00a6fc url(../images/misc/button-gloss.png) repeat-x 0 -34px, -moz-linear-gradient(top, rgba(255,255,255,.4) 0%, transparent 100%);  
background: #00a6fc url(../images/misc/button-gloss.png) repeat-x 0 -34px, -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(255,255,255,.4)), color-stop(100%,transparent));  
border: 1px solid #0593dc;  
-webkit-transition: background-color .15s ease-in-out;  
-moz-transition: background-color .15s ease-in-out;  
-o-transition: background-color .15s ease-in-out;  
}  
 
.button.radius {  
-moz-border-radius: 3px;  
-webkit-border-radius: 3px;  
border-radius: 3px;  
}  
.button.round {  
-moz-border-radius: 1000px;  
-webkit-border-radius: 1000px;  
border-radius: 1000px;  
}  
 
.button.full-width {  
width: 100%;  
padding-left: 0 !important;  
padding-right: 0 !important;  
text-align: center;  
}  
 
.button.left-align {  
text-align: left;  
text-indent: 12px;  
}  
 
/* Sizes ---------- */  
.small.button { font-size: 11px; padding: 8px 20px 10px; width: auto; }  
.medium.button { font-size: 13px; width: auto; }  
.large.button { font-size: 18px; padding: 11px 48px 13px; width: auto; }  
 
/* Nice Sizes ---------- */  
.nice.small.button { background-position: 0 -36px; }  
.nice.large.button { background-position: 0 -30px; }  
 
/* Colors ---------- */  
.blue.button { background-color: #00a6fc; }  
.red.button { background-color: #e91c21; }  
.white.button { background-color: #e9e9e9; color: #333; }  
.black.button { background-color: #141414; }  
 
/* Nice Colors ---------- */  
.nice.blue.button { border: 1px solid #0593dc; }  
.nice.red.button { border: 1px solid #b90b0b; }  
.nice.white.button { border: 1px solid #cacaca; text-shadow: none !important; }  
.nice.black.button { border: 1px solid #000; }  
 
/* Hovers ---------- */  
.button:hover, .button:focus { background-color: #0192dd; color: #fff; }  
.blue.button:hover, .blue.button:focus { background-color: #0192dd; }  
.red.button:hover, .red.button:focus { background-color: #d01217; }  
.white.button:hover, .white.button:focus { background-color: #dadada; color: #333; }  
.black.button:hover, .black.button:focus { background-color: #000; }  
 
/* Disabled ---------- */  
.button.disabled, .button[disabled] { opacity: 0.6; cursor: default; }  
 
 
 
/* --------------------------------------------------  
Alerts  
-------------------------------------------------- */  
 
div.alert-box { display: block; padding: 6px 7px; font-weight: bold; font-size: 13px; background: #eee; border: 1px solid rgba(0,0,0,0.1); margin-bottom: 12px; border-radius: 3px; -webkit-border-radius: 3px; -moz-border-radius: 3px; text-shadow: 0 1px rgba(255,255,255,0.9); position: relative; }  
.alert-box.success { background-color: #7fae00; color: #fff; text-shadow: 0 -1px rgba(0,0,0,0.3); }  
.alert-box.warning { background-color: #c08c00; color: #fff; text-shadow: 0 -1px rgba(0,0,0,0.3); }  
.alert-box.error { background-color: #c00000; color: #fff; text-shadow: 0 -1px rgba(0,0,0,0.3); }  
 
.alert-box a.close { color: #000; position: absolute; right: 4px; top: 0; font-size: 18px; opacity: 0.2; padding: 4px; }  
.alert-box a.close:hover,.alert-box a.close:focus { opacity: 0.4; }  
 
 
/* --------------------------------------------------  
Tabs  
-------------------------------------------------- */  
dl.tabs { display: block; margin: 0 0 20px 0; padding: 0; height: 30px; border-bottom: solid 1px #ddd; }  
dl.tabs dt { display: block; width: auto; height: 30px; padding: 0 9px 0 20px; line-height: 30px; float: left; color: #999; font-size: 11px; text-transform: uppercase; cursor: default; }  
dl.tabs dt:first-child { padding: 0 9px 0 0; }  
dl.tabs dd { display: block; width: auto; height: 30px; padding: 0; float: left; }  
dl.tabs dd a { display: block; width: auto; height: 29px; padding: 0 9px; line-height: 30px; border: solid 1px #ddd; margin: 0 -1px 0 0; color: #555; background: #eee; }  
dl.tabs dd a.active { background: #fff; border-width: 1px 1px 0 1px; height: 30px; }  
 
.nice.tabs { border-bottom: solid 1px #eee; margin: 0 0 30px 0; height:43px; }  
.nice.tabs dd a { padding: 7px 18px 9px; font-size: 15px; font-size: 1.5rem; color: #555555; background: none; border: none; }  
.nice.tabs dd a.active { font-weight: bold; color: #333; background: #fff; border-left: 1px solid #eee; border-right: 1px solid #eee; border-top: 3px solid #00a6fc; margin: 0 10px; position: relative; top: -5px; }  
.nice.tabs dd:first-child a.active { margin-left: 0; }  
 
dl.tabs.vertical { height: auto; }  
dl.tabs.vertical dt, dl.tabs.vertical dd, dl.nice.tabs.vertical dt, dl.nice.tabs.vertical dd { float: none; height: auto; }  
dl.tabs.vertical dd a { display: block; width: auto; height: auto; padding: 15px 20px; line-height: 1; border: solid 0 #ccc; border-width: 1px 1px 0; margin: 0; color: #555; background: #eee; font-size: 15px; font-size: 1.5rem; }  
dl.tabs.vertical dd a.active { height: auto; margin: 0; border-width: 1px 0 0; background: #fff; }  
 
.nice.tabs.vertical { border-bottom: solid 1px #eee; height: auto; }  
.nice.tabs.vertical dd a { padding: 15px 20px; border: none; border-left: 1px solid #eee; border-right: 1px solid #eee; border-top: 1px solid #eee; background: #fff; }  
.nice.tabs.vertical dd a.active { border: none; background: #00a6fc; color: #fff; margin: 0; position: static; top: 0; height: auto; }  
.nice.tabs.vertical dd:first-child a.active { margin: 0; }  
 
ul.tabs-content { margin: 0; display: block; }  
ul.tabs-content>li { display:none; }  
ul.tabs-content>li.active { display: block; }  
 
dl.contained, dl.nice.contained { margin-bottom: 0; }  
dl.contained.tabs dd a { padding: 0 14px; }  
dl.nice.contained.tabs dd a { padding: 7px 18px 9px; }  
 
ul.contained.tabs-content { padding: 0; }  
ul.contained.tabs-content>li { padding: 20px; border: solid 0 #ddd; border-width: 0 1px 1px 1px; }  
ul.nice.contained.tabs-content>li { border-color: #eee; }  
 
/* --------------------------------------------------  
Pagination  
-------------------------------------------------- */  
ul.pagination { display: block; height: 24px; margin-left: -5px; }  
ul.pagination li { float: left; display: block; height: 24px; color: #999; font-size: 15px; margin-left: 5px; }  
ul.pagination li a { display: block; padding: 6px 7px 4px; color: #555; }  
ul.pagination li.current a, ul.pagination li:hover a, ul.pagination li a:focus { border-bottom: solid 2px #00a6fc; color: #141414; }  
ul.pagination li.unavailable a { cursor: default; color: #999; }  
ul.pagination li.unavailable:hover a, ul.pagination li.unavailable a:focus { border-bottom: none; }  
 
/* --------------------------------------------------  
Lists  
-------------------------------------------------- */  
ul.nice, ol.nice { list-style: none; margin: 0; }  
ul.nice li, ol.nice li { padding-left: 13px; position: relative }  
ul.nice li span.bullet, ol.nice li span.number { position: absolute; left: 0; top: 0; color: #ccc; }  
 
/* --------------------------------------------------  
Panels  
-------------------------------------------------- */  
div.panel {  
padding: 20px 20px 2px 20px;  
background: #efefef;  
background: -moz-linear-gradient(top, #FFFFFF 0%, #F4F4F4 100%);  
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#FFFFFF), color-stop(100%,#F4F4F4));  
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#FFFFFF', endColorstr='#F4F4F4',GradientType=0 );  
box-shadow: 0 2px 5px rgba(0,0,0,0.15);  
-webkit-box-shadow: 0 2px 5px rgba(0,0,0,0.15);  
-moz-box-shadow: 0 2px 5px rgba(0,0,0,0.25);  
margin: 0 0 20px 0;  
}  
 
/* --------------------------------------------------  
Nav Bar with Dropdowns  
-------------------------------------------------- */  
 
.nav-bar { height: 45px; background: #fff; margin-top: 20px; border: 1px solid #ddd; }  
.nav-bar>li { float: left; display: block; position: relative; padding: 0; margin: 0; border-right: 1px solid #ddd; line-height: 45px; }  
.nav-bar>li>a { position: relative; font-size: 14px; padding: 0 20px; display: block; text-decoration: none; font-size: 15px; font-size: 1.5rem; }  
.nav-bar>li>input { margin: 0 16px; }  
.nav-bar>li ul { margin-bottom: 0; }  
.nav-bar>li li { line-height: 1.3; }  
.nav-bar>li.has-flyout>a { padding-right: 36px; }  
.nav-bar>li.has-flyout>a:after { content: ""; width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 4px solid #2a85e8; display: block; position: absolute; right: 18px; bottom: 20px; }  
.nav-bar>li:hover>a { color: #141414; z-index: 2; }  
.nav-bar>li:hover>a:after { border-top-color: #141414; }  
 
.flyout { background: #fff; margin: 0; padding: 20px; border: 1px solid #ddd; position: absolute; top: 45px; left: -1px; width: 400px; z-index: 10; }  
.flyout.small { width: 200px; }  
.flyout.large { width: 600px; }  
.flyout.right { left: auto; right: 0; }  
.flyout p:last-child { margin-bottom: 0; }  
.nav-bar>li .flyout { display: none; }  
.nav-bar>li:hover .flyout { display: block; }  
 
 
/* --------------------------------------------------  
Video  
Mad props to http://www.alistapart.com/articles/creating-intrinsic-ratios-for-video/  
-------------------------------------------------- */  
 
.flex-video {  
position: relative;  
padding-top: 25px;  
padding-bottom: 67.5%;  
height: 0;  
margin-bottom: 16px;  
overflow: hidden;  
}  
 
.flex-video.widescreen { padding-bottom: 57.25%; }  
.flex-video.vimeo { padding-top: 0; }  
 
.flex-video iframe,  
.flex-video object,  
.flex-video embed {  
position: absolute;  
top: 0;  
left: 0;  
width: 100%;  
height: 100%;  
}  
 
 
 
/* --------------------------------------------------  
Microformats  
-------------------------------------------------- */  
 
/* hCard */  
ul.vcard { display: inline-block; margin: 0 0 12px 0; border: 1px solid #ddd; padding: 10px; }  
ul.vcard li { margin: 0; display: block; }  
ul.vcard li.fn { font-weight: bold; font-size: 15px; font-size: 1.5rem; }  
 
p.vevent span.summary { font-weight: bold; }  
p.vevent abbr { cursor: default; text-decoration: none; font-weight: bold; border: none; padding: 0 1px; }  
 
 
 
 
 
/* Artfully masterminded by ZURB  
Make sure to include app.js / foundation.js if you are going to use inline label inputs  
*/  
 
 
/* -----------------------------------------  
Standard Forms  
----------------------------------------- */  
 
form { margin: 0 0 18px; }  
form label { display: block; font-size: 13px; line-height: 18px; cursor: pointer; margin-bottom: 9px; }  
 
input.input-text, textarea { border-right: 1px solid #bbb; border-bottom: 1px solid #bbb; }  
input.input-text, textarea, select { display: block; margin-bottom: 9px; }  
label + input.input-text, label + textarea, label + select, label + div.dropdown, select + div.dropdown { margin-top: -9px; }  
 
/* Text input and textarea font and padding */  
input.input-text, textarea { font-size: 13px; padding: 4px 3px 2px; background: #fff; }  
input.input-text:focus, textarea:focus { outline: none !important; }  
input.input-text.oversize, textarea.oversize { font-size: 18px !important; padding: 4px 5px !important; }  
input.input-text:focus, textarea:focus { background: #f9f9f9; }  
 
/* Inlined Label Style */  
input.placeholder, textarea.placeholder { color: #888; }  
 
/* Text input and textarea sizes */  
input.input-text, textarea { width: 254px; }  
input.small, textarea.small { width: 134px; }  
input.medium, textarea.medium { width: 254px; }  
input.large, textarea.large { width: 434px; }  
 
/* Fieldsets */  
form fieldset { padding: 9px 9px 2px 9px; border: solid 1px #ddd; margin: 18px 0; }  
 
/* Inlined Radio & Checkbox */  
.form-field input[type=radio], div.form-field input[type=checkbox] { display: inline; width:auto; margin-bottom:0; }  
 
/* Errors */  
.form-field.error input, input.input-text.red { border-color: #C00000; background-color: rgba(255,0,0,0.15); }  
.form-field.error label, label.red { color: #C00000; }  
.form-field.error small, small.error { margin-top: -6px; display: block; margin-bottom: 9px; font-size: 11px; color: #C00000; width: 260px; }  
 
.small + small.error { width: 140px; }  
.medium + small.error { width: 260px; }  
.large + small.error { width: 440px; }  
 
/* -----------------------------------------  
Nicer Forms  
----------------------------------------- */  
form.nice div.form-field input, form.nice input.input-text, form.nice textarea { border: solid 1px #bbb; border-radius: 2px; -webkit-border-radius: 2px; -moz-border-radius: 2px; }  
form.nice div.form-field input, form.nice input.input-text, form.nice textarea { font-size: 13px; padding: 6px 3px 4px; outline: none !important; background: url(../images/misc/input-bg.png) #fff; }  
form.nice div.form-field input:focus, form.nice input.input-text:focus, form.nice textarea:focus { background-color: #f9f9f9; }  
 
form.nice fieldset { border-radius: 3px; -webkit-border-radius: 3px; -moz-border-radius: 3px; }  
 
form.nice div.form-field input[type=radio], form.nice div.form-field input[type=checkbox] { display: inline; width:auto; margin-bottom:0; }  
 
form.nice div.form-field.error small, form.nice small.error { padding: 6px 4px; border: solid 0 #C00000; border-width: 0 1px 1px 1px; margin-top: -10px; background: #C00000; color: #fff; font-size: 12px; font-weight: bold; border-bottom-left-radius: 2px; border-bottom-right-radius: 2px; -webkit-border-bottom-left-radius: 2px; -webkit-border-bottom-right-radius: 2px; -moz-border-radius-bottomleft: 2px; -moz-border-radius-bottomright: 2px; }  
 
form.nice div.form-field.error .small + small, form.nice .small + small.error { width: 132px; }  
form.nice div.form-field.error .medium + small, form.nice .medium + small.error { width: 252px; }  
form.nice div.form-field.error .large + small, form.nice .large + small.error { width: 432px; }  
 
/* -----------------------------------------  
Custom Forms  
----------------------------------------- */  
 
form.custom span.custom { display: inline-block; width: 14px; height: 14px; position: relative; top: 2px; border: solid 1px #ccc; background: url(../images/misc/custom-form-sprites.png) 0 0 no-repeat; }  
form.custom span.custom.radio { border-radius: 7px; -webkit-border-radius: 7px; -moz-border-radius: 7px; }  
form.custom span.custom.radio.checked { background-position: 0 -14px; }  
form.custom span.custom.checkbox.checked { background-position: 0 -28px; }  
 
form.custom div.custom.dropdown { position: relative; display: inline-block; width: auto; height: 28px; margin-bottom: 9px; }  
form.custom div.custom.dropdown a.current { display: block; width: auto; line-height: 26px; padding: 0 38px 0 6px; border: solid 1px #ddd; color: #141414; }  
form.custom div.custom.dropdown a.selector { position: absolute; width: 26px; height: 26px; display: block; background: url(../images/misc/custom-form-sprites.png) -14px 0 no-repeat; right: 0; top: 0; border: solid 1px #ddd; }  
form.custom div.custom.dropdown:hover a.selector,  
form.custom div.custom.dropdown.open a.selector { background-position: -14px -26px; }  
 
form.custom div.custom.dropdown ul { position: absolute; width: auto; display: none; margin: 0; left: 0; top: 27px; margin: 0; padding: 0; background: rgba(255,255,255,0.9); border: solid 1px #ddd; z-index: 10; }  
form.custom div.custom.dropdown ul li { cursor: pointer; padding: 3px 38px 3px 6px; margin: 0; white-space: nowrap}  
form.custom div.custom.dropdown ul li.selected { background: url(../images/misc/custom-form-sprites.png) right -52px no-repeat; }  
form.custom div.custom.dropdown ul li:hover { background-color: #2a85e8; color: #fff; }  
form.custom div.custom.dropdown ul li.selected:hover { background: url(../images/misc/custom-form-sprites.png) #2a85e8 right -78px no-repeat; }  
form.custom div.custom.dropdown ul.show { display: block; }  
 
form.custom div.custom.dropdown.open ul { display: block; }  
 
 
/* CSS for jQuery Orbit Plugin 1.2.3  
* www.ZURB.com/playground  
* Copyright 2010, ZURB  
* Free to use under the MIT license.  
* http://www.opensource.org/licenses/mit-license.php  
 
 
 
/* PUT IN YOUR SLIDER ID AND SIZE TO MAKE LOAD BEAUTIFULLY  
================================================== */  
#caseStudies {  
width: 1000px;  
height: 210px;  
background: #fff url('../images/orbit/loading.gif') no-repeat center center;  
overflow: hidden; }  
#caseStudies>img,  
#caseStudies>div,  
#caseStudies>a { display: none; }  
 
 
 
 
/* CONTAINER  
================================================== */  
 
div.orbit-wrapper {  
width: 1px;  
height: 1px;  
position: relative; }  
 
div.orbit {  
width: 1px;  
height: 1px;  
position: relative;  
overflow: hidden }  
 
div.orbit.with-bullets {  
margin-bottom: 40px;  
}  
 
div.orbit>img {  
position: absolute;  
top: 0;  
left: 0;  
/* display: none; */ }  
 
div.orbit>a {  
border: none;  
position: absolute;  
top: 0;  
left: 0;  
line-height: 0;  
display: none; }  
 
.orbit>div {  
position: absolute;  
top: 0;  
left: 0;  
width: 100%;  
height: 100%; }  
 
/* Note: If your slider only uses content or anchors, you're going to want to put the width and height declarations on the ".orbit>div" and "div.orbit>a" tags in addition to just the .orbit-wrapper */  
 
 
/* TIMER  
================================================== */  
 
div.timer {  
width: 40px;  
height: 40px;  
overflow: hidden;  
position: absolute;  
top: 10px;  
right: 10px;  
opacity: .6;  
cursor: pointer;  
z-index: 1001; }  
 
span.rotator {  
display: block;  
width: 40px;  
height: 40px;  
position: absolute;  
top: 0;  
left: -20px;  
background: url(../images/orbit/rotator-black.png) no-repeat;  
z-index: 3; }  
 
span.mask {  
display: block;  
width: 20px;  
height: 40px;  
position: absolute;  
top: 0;  
right: 0;  
z-index: 2;  
overflow: hidden; }  
 
span.rotator.move {  
left: 0 }  
 
span.mask.move {  
width: 40px;  
left: 0;  
background: url(../images/orbit/timer-black.png) repeat 0 0; }  
 
span.pause {  
display: block;  
width: 40px;  
height: 40px;  
position: absolute;  
top: 0;  
left: 0;  
background: url(../images/orbit/pause-black.png) no-repeat;  
z-index: 4;  
opacity: 0; }  
 
span.pause.active {  
background: url(../images/orbit/pause-black.png) no-repeat 0 -40px }  
 
div.timer:hover span.pause,  
span.pause.active {  
opacity: 1 }  
 
 
/* CAPTIONS  
================================================== */  
 
.orbit-caption {  
display: none;  
font-family: "HelveticaNeue", "Helvetica-Neue", Helvetica, Arial, sans-serif; }  
 
.orbit-wrapper .orbit-caption {  
background: #000;  
background: rgba(0,0,0,.6);  
z-index: 1000;  
color: #fff;  
text-align: center;  
padding: 7px 0;  
font-size: 13px;  
position: absolute;  
right: 0;  
bottom: 0;  
width: 100%; }  
 
 
/* DIRECTIONAL NAV  
================================================== */  
 
div.slider-nav {  
display: block }  
 
div.slider-nav span {  
width: 78px;  
height: 100px;  
text-indent: -9999px;  
position: absolute;  
z-index: 1000;  
top: 50%;  
margin-top: -50px;  
cursor: pointer; }  
 
div.slider-nav span.right {  
background: url(../images/orbit/right-arrow.png);  
right: 0; }  
 
div.slider-nav span.left {  
background: url(../images/orbit/left-arrow.png);  
left: 0; }  
 
/* BULLET NAV  
================================================== */  
 
.orbit-bullets {  
position: absolute;  
z-index: 1000;  
list-style: none;  
bottom: -40px;  
left: 50%;  
margin-left: -50px;  
padding: 0; }  
 
.orbit-bullets li {  
float: left;  
margin-left: 5px;  
cursor: pointer;  
color: #999;  
text-indent: -9999px;  
background: url(../images/orbit/bullets.jpg) no-repeat 4px 0;  
width: 13px;  
height: 12px;  
overflow: hidden; }  
 
.orbit-bullets li.active {  
color: #222;  
background-position: -8px 0; }  
 
.orbit-bullets li.has-thumb {  
background: none;  
width: 100px;  
height: 75px; }  
 
.orbit-bullets li.active.has-thumb {  
background-position: 0 0;  
border-top: 2px solid #000; }  
 
/* FLUID LAYOUT  
================================================== */  
.orbit .fluid-placeholder {  
visibility: hidden;  
position: static;  
display: block;  
width: 100%;  
}  
 
.orbit, .orbit-wrapper { width: 100% !important; }  
 
.orbit-bullets {  
position: absolute;  
z-index: 1000;  
list-style: none;  
bottom: -50px;  
left: 50%;  
margin-left: -50px;  
padding: 0; }  
 
.orbit-bullets li {  
float: left;  
margin-left: 5px;  
cursor: pointer;  
color: #999;  
text-indent: -9999px;  
background: url(../images/orbit/bullets.jpg) no-repeat 4px 0;  
width: 13px;  
height: 12px;  
overflow: hidden; }  
 
.orbit-bullets li.has-thumb {  
background: none;  
width: 100px;  
height: 75px; }  
 
.orbit-bullets li.active {  
color: #222;  
background-position: -8px 0; }  
 
.orbit-bullets li.active.has-thumb {  
background-position: 0 0;  
border-top: 2px solid #000; }  
/* --------------------------------------------------  
Reveal Modals  
-------------------------------------------------- */  
 
.reveal-modal-bg {  
position: fixed;  
height: 100%;  
width: 100%;  
background: #000;  
z-index: 2000;  
display: none;  
top: 0;  
left: 0;  
}  
 
.reveal-modal {  
visibility: hidden;  
top: 100px;  
left: 50%;  
margin-left: -300px;  
width: 520px;  
background: #eee url(../images/misc/modal-gloss.png) no-repeat -200px -80px;  
position: absolute;  
z-index: 2001;  
padding: 30px 40px 34px;  
-moz-border-radius: 5px;  
-webkit-border-radius: 5px;  
border-radius: 5px;  
-moz-box-shadow: 0 0 10px rgba(0,0,0,.4);  
-webkit-box-shadow: 0 0 10px rgba(0,0,0,.4);  
box-shadow: 0 0 10px rgba(0,0,0,.4);  
}  
 
.reveal-modal.small { width: 200px; margin-left: -140px;}  
.reveal-modal.medium { width: 400px; margin-left: -240px;}  
.reveal-modal.large { width: 600px; margin-left: -340px;}  
.reveal-modal.xlarge { width: 800px; margin-left: -440px;}  
 
.reveal-modal .close-reveal-modal {  
font-size: 22px;  
line-height: .5;  
position: absolute;  
top: 8px;  
right: 11px;  
color: #aaa;  
text-shadow: 0 -1px 1px rbga(0,0,0,.6);  
font-weight: bold;  
cursor: pointer;  
}  
 
.reveal-modal .row {  
min-width: 0;  
}  
 
/* Mobile */  
 
@media handheld, only screen and (device-width: 768px), (device-width: 800px) {  
.reveal-modal-bg { position: absolute; }  
 
.reveal-modal,  
.reveal-modal.small,  
.reveal-modal.medium,  
.reveal-modal.large,  
.reveal-modal.xlarge { width: 60%; top: 30%; left: 15%; margin-left: 0; padding: 5%; height: auto; }  
}  
 
@media handheld, only screen and (max-width: 767px) {  
.reveal-modal-bg { position: absolute; }  
 
.reveal-modal,  
.reveal-modal.small,  
.reveal-modal.medium,  
.reveal-modal.large,  
.reveal-modal.xlarge { width: 80%; top: 15%; left: 5%; margin-left: 0; padding: 5%; height: auto; }  
}  
 
 
/*  
 
NOTES  
 
Close button entity is &#215;  
 
Example markup  
 
<div id="myModal" class="reveal-modal">  
<h2>Awesome. I have it.</h2>  
<p class="lead">Your couch. I it's mine.</p>  
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. In ultrices aliquet placerat. Duis pulvinar orci et nisi euismod vitae tempus lorem consectetur. Duis at magna quis turpis mattis venenatis eget id diam. </p>  
<a class="close-reveal-modal">&#215;</a>  
</div>  
 
*/  
/* --------------------------------------------------  
:: Typography  
-------------------------------------------------- */  
 
@media handheld, only screen and (max-width: 767px) {  
h1 { font-size: 32px; font-size: 3.2rem; line-height: 1.3; }  
h2 { font-size: 28px; font-size: 2.8rem; line-height: 1.3; }  
h3 { font-size: 21px; font-size: 2.1rem; line-height: 1.3; }  
h4 { font-size: 18px; font-size: 1.8rem; line-height: 1.2; }  
h5 { font-size: 16px; font-size: 1.6rem; line-height: 1.2; }  
h6 { font-size: 15px; font-size: 1.5rem; line-height: 1.2; }  
body, p { font-size: 15px; font-size: 1.5rem; line-height: 1.4; }  
}  
 
 
/* --------------------------------------------------  
:: Grid  
-------------------------------------------------- */  
 
/* Tablet screens */  
@media only screen and (device-width: 768px), (device-width: 800px) {  
/* Currently unused */  
}  
 
 
/* Mobile */  
@media only screen and (max-width: 767px) {  
body { -webkit-text-size-adjust: none; -ms-text-size-adjust: none; width: 100%; min-width: 0; margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; }  
.container { min-width: 0; margin-left: 0; margin-right: 0; }  
.row { width: 100%; min-width: 0; margin-left: 0; margin-right: 0; }  
.row .row .column, .row .row .columns { padding: 0; }  
.column, .columns { width: auto !important; float: none; margin-left: 0; margin-right: 0; }  
.column:last-child, .columns:last-child { margin-right: 0; }  
 
.offset-by-one, .offset-by-two, .offset-by-three, .offset-by-four, .offset-by-five, .offset-by-six, .offset-by-seven, .offset-by-eight, .offset-by-nine, .offset-by-ten, .offset-by-eleven, .centered { margin-left: 0 !important; }  
 
.push-two, .push-three, .push-four, .push-five, .push-six, .push-seven, .push-eight, .push-nine, .push-ten { left: auto; }  
.pull-two, .pull-three, .pull-four, .pull-five, .pull-six, .pull-seven, .pull-eight, .pull-nine, .pull-ten { right: auto; }  
 
/* Mobile 4-column Grid */  
.row .phone-one.column:first-child, .row .phone-two.column:first-child, .row .phone-three.column:first-child, .row .phone-four.column:first-child, .row .phone-one.columns:first-child, .row .phone-two.columns:first-child, .row .phone-three.columns:first-child, .row .phone-four.columns:first-child { margin-left: 0; }  
 
.row .phone-one.column, .row .phone-two.column, .row .phone-three.column, .row .phone-four.column,  
.row .phone-one.columns, .row .phone-two.columns, .row .phone-three.columns, .row .phone-four.columns { margin-left: 4.4%; float: left; min-height: 1px; position: relative; padding: 0; }  
 
.row .phone-one.columns { width: 21.68% !important; }  
.row .phone-two.columns { width: 47.8% !important; }  
.row .phone-three.columns { width: 73.9% !important; }  
.row .phone-four.columns { width: 100% !important; }  
 
.row .columns.push-one-phone { left: 26.08%; }  
.row .columns.push-two-phone { left: 52.2% }  
.row .columns.push-three-phone { left: 78.3% }  
 
.row .columns.pull-one-phone { right: 26.08% }  
.row .columns.pull-two-phone { right: 52.2% }  
.row .columns.pull-three-phone { right: 78.3%; }  
 
 
}  
 
 
/* --------------------------------------------------  
:: Block Grids  
-------------------------------------------------- */  
 
@media only screen and (max-width: 767px) {  
.block-grid.mobile { margin-left: 0; }  
.block-grid.mobile li { float: none; width: 100%; margin-left: 0; }  
}  
 
 
 
/* --------------------------------------------------  
:: Mobile Visibility Affordances  
---------------------------------------------------*/  
 
 
.show-on-phones { display: none !important; }  
.show-on-tablets { display: none !important; }  
.show-on-desktops { display: block !important; }  
 
.hide-on-phones { display: block !important; }  
.hide-on-tablets { display: block !important; }  
.hide-on-desktops { display: none !important; }  
 
 
@media only screen and (max-device-width: 800px), only screen and (device-width: 1024px) and (device-height: 600px), only screen and (width: 1280px) and (orientation: landscape), only screen and (device-width: 800px) {  
.hide-on-phones { display: block !important; }  
.hide-on-tablets { display: none !important; }  
.hide-on-desktops { display: block !important; }  
 
.show-on-phones { display: none !important; }  
.show-on-tablets { display: block !important; }  
.show-on-desktops { display: none !important; }  
}  
 
 
@media only screen and (max-width: 767px) {  
.hide-on-phones { display: none !important; }  
.hide-on-tablets { display: block !important; }  
.hide-on-desktops { display: block !important; }  
 
.show-on-phones { display: block !important; }  
.show-on-tablets { display: none !important; }  
.show-on-desktops { display: none !important; }  
}  
 
/* only screen and (device-width: 1280px), only screen and (max-device-width: 1280px), /*  
/* Keeping this in as a reminder to address support for other tablet devices like the Xoom in the future */  
 
/* Specific overrides for elements that require something other than display: block */  
 
table.show-on-desktops { display: table !important; }  
table.hide-on-phones { display: table !important; }  
table.hide-on-tablets { display: table !important; }  
 
@media only screen and (max-device-width: 800px), only screen and (device-width: 1024px) and (device-height: 600px), only screen and (width: 1280px) and (orientation: landscape), only screen and (device-width: 800px) {  
table.hide-on-phones { display: block !important; }  
table.hide-on-desktops { display: block !important; }  
table.show-on-tablets { display: block !important; }  
}  
 
@media only screen and (max-width: 767px) {  
table.hide-on-tablets { display: block !important; }  
table.hide-on-desktops { display: block !important; }  
table.show-on-phones { display: block !important; }  
}  
 
 
/* --------------------------------------------------  
:: Forms  
---------------------------------------------------*/  
 
 
@media only screen and (max-width: 767px) {  
div.form-field input, div.form-field input.small, div.form-field input.medium, div.form-field input.large, div.form-field input.oversize, input.input-text, input.input-text.oversize, textarea,  
form.nice div.form-field input, form.nice div.form-field input.oversize, form.nice input.input-text, form.nice input.input-text.oversize, form.nice textarea { display: block; width: 96%; padding: 6px 2% 4px; font-size: 18px; }  
form.nice div.form-field input, form.nice div.form-field input.oversize, form.nice input.input-text, form.nice input.input-text.oversize, form.nice textarea { -webkit-border-radius: 2px; -moz-border-radius: 2px; border-radius: 2px; }  
form.nice div.form-field.error small, form.nice small.error { padding: 6px 2%; display: block; }  
form.nice div.form-field.error .small + small, form.nice .small + .error { width: auto; }  
form.nice div.form-field.error .medium + small, form.nice .medium + .error { width: auto; }  
form.nice div.form-field.error .large + small, form.nice .large + .error { width: auto; }  
}  
 
 
/* --------------------------------------------------  
:: UI  
---------------------------------------------------*/  
 
/* Buttons */  
@media only screen and (max-width: 767px) {  
.button { display: block; }  
button.button { width: 100%; padding-left: 0; padding-right: 0; }  
}  
 
/* Tabs */  
 
@media only screen and (max-width: 767px) {  
dl.tabs.mobile, dl.nice.tabs.mobile { width: auto; margin: 20px -20px 40px; height: auto; }  
dl.tabs.mobile dt, dl.tabs.mobile dd, dl.nice.tabs.mobile dt, dl.nice.tabs.mobile dd { float: none; height: auto; }  
 
dl.tabs.mobile dd a { display: block; width: auto; height: auto; padding: 18px 20px; line-height: 1; border: solid 0 #ccc; border-width: 1px 0 0; margin: 0; color: #555; background: #eee; font-size: 15px; font-size: 1.5rem; }  
dl.tabs.mobile dd a.active { height: auto; margin: 0; border-width: 1px 0 0; }  
 
.nice.tabs.mobile { border-bottom: solid 1px #ccc; height: auto; }  
.nice.tabs.mobile dd a { padding: 18px 20px; border: none; border-left: none; border-right: none; border-top: 1px solid #ccc; background: #fff; }  
.nice.tabs.mobile dd a.active { border: none; background: #00a6fc; color: #fff; margin: 0; position: static; top: 0; height: auto; }  
.nice.tabs.mobile dd:first-child a.active { margin: 0; }  
 
dl.contained.mobile, dl.nice.contained.mobile { margin-bottom: 0; }  
dl.contained.tabs.mobile dd a { padding: 18px 20px; }  
dl.nice.contained.tabs.mobile dd a { padding: 18px 20px; }  
}  
 
/* Nav Bar */  
 
@media only screen and (max-width: 767px) {  
.nav-bar { height: auto; }  
.nav-bar>li { float: none; display: block; border-right: none; }  
.nav-bar>li>a { text-align: left; border-top: 1px solid #ddd; border-right: none; }  
.nav-bar>li:first-child>a { border-top: none; }  
.nav-bar>li.has-flyout>a:after { content: ""; width: 0; height: 0; border-left: 4px solid transparent;border-right: 4px solid transparent; border-top: 4px solid #2a85e8; display: block; }  
.nav-bar>li:hover>a { font-weight: bold; }  
.nav-bar>li:hover ul { position: relative; }  
 
.flyout { position: relative; width: auto; top: auto; margin-right: -2px; border-width: 1px 1px 0px 1px; }  
.flyout.right { float: none; right: auto; left: -1px; }  
.flyout.small, .flyout.large { width: auto; }  
.flyout p:last-child { margin-bottom: 18px; }  
}  
 
/* Nav Bar */  
 
@media only screen and (max-device-width: 800px), only screen and (device-width: 1024px) and (device-height: 600px), only screen and (width: 1280px) and (orientation: landscape), only screen and (device-width: 800px), only screen and (max-width: 767px) {  
.video { padding-top: 0; }  
}  
 
file:a/stylesheets/ie.css (deleted)
/* Foundation v2.1.4 http://foundation.zurb.com */  
/* This is for all IE specfific style less than IE9. We hate IE. */  
 
div.panel { border: 1px solid #ccc; }  
.lt-ie8 .nav-bar li.has-flyout a { padding-right: 20px; }  
.lt-ie8 .nav-bar li.has-flyout a:after { border-top: none; }