Merge branch 'master' of ssh://apples.lambdacomplex.org/git/bus
Merge branch 'master' of ssh://apples.lambdacomplex.org/git/bus

file:a/busui/about.php (deleted)
<?php  
include('common.inc.php');  
include_header("About")  
?>  
<p>  
Busness Time - An ACT bus timetable webapp<br />  
Based on the maxious-canberra-transit-feed (<a href="cbrfeed.zip">download</a>, last updated <?php echo date("F d Y.", @filemtime('cbrfeed.zip')); ?>)<br />  
Source code for the transit feed and this site @ <a href="http://maxious.lambdacomplex.org/git">http://maxious.lambdacomplex.org/git</a><br />  
Uses jQuery Mobile, PHP, Ruby, Python, Google Transit Feed Specification tools, OpenTripPlanner, OpenLayers, OpenStreetMap, Cloudmade Geocoder and Tile Service<br />  
<br />  
Feedback encouraged; contact maxious@lambdacomplex.org<br />  
<br />  
Some icons by Joseph Wain / glyphish.com<br />  
<br />  
<small>Disclaimer: The content of this website is of a general and informative nature. Please check with printed timetables or those available on http://action.act.gov.au before your trip.  
Whilst every effort has been made to ensure the high quality and accuracy of the Site, the Author makes no warranty,  
express or implied concerning the topicality, correctness, completeness or quality of the information, which is provided  
"as is". The Author expressly disclaims all warranties, including but not limited to warranties of fitness for a particular purpose and warranties of merchantability.  
All offers are not binding and without obligation. The Author expressly reserves the right, in his discretion, to suspend,  
change, modify, add or remove portions of the Site and to restrict or terminate the use and accessibility of the Site  
without prior notice. </small>  
<?  
include_footer();  
?>  
 
file:a/busui/common.inc.php (deleted)
<?php  
date_default_timezone_set('Australia/ACT');  
$APIurl = "http://localhost:8765";  
$cloudmadeAPIkey="daa03470bb8740298d4b10e3f03d63e6";  
$googleMapsAPIkey="ABQIAAAA95XYXN0cki3Yj_Sb71CFvBTPaLd08ONybQDjcH_VdYtHHLgZvRTw2INzI_m17_IoOUqH3RNNmlTk1Q";  
$otpAPIurl = 'http://10.1.0.243:5080/opentripplanner-api-webapp/';  
if (isDebug()) error_reporting(E_ALL ^ E_NOTICE);  
 
// SELECT array_to_string(array(SELECT REPLACE(name_2006, ',', '\,') as name FROM suburbs order by name), ',')  
$suburbs = explode(",","Acton,Ainslie,Amaroo,Aranda,Banks,Barton,Belconnen,Bonner,Bonython,Braddon,Bruce,Calwell,Campbell,Chapman,Charnwood,Chifley,Chisholm,City,Conder,Cook,Curtin,Deakin,Dickson,Downer,Duffy,Dunlop,Evatt,Fadden,Farrer,Fisher,Florey,Flynn,Forrest,Franklin,Fraser,Fyshwick,Garran,Gilmore,Giralang,Gordon,Gowrie,Greenway,Griffith,Gungahlin,Hackett,Hall,Harrison,Hawker,Higgins,Holder,Holt,Hughes,Hume,Isaacs,Isabella Plains,Kaleen,Kambah,Kingston,Latham,Lawson,Lyneham,Lyons,Macarthur,Macgregor,Macquarie,Mawson,McKellar,Melba,Mitchell,Monash,Narrabundah,Ngunnawal,Nicholls,Oaks Estate,O'Connor,O'Malley,Oxley,Page,Palmerston,Parkes,Pearce,Phillip,Pialligo,Red Hill,Reid,Richardson,Rivett,Russell,Scullin,Spence,Stirling,Symonston,Tharwa,Theodore,Torrens,Turner,Wanniassa,Waramanga,Watson,Weetangera,Weston,Yarralumla");  
 
// you have to open the session to be able to modify or remove it  
session_start();  
if (isset($_REQUEST['service_period'])) $_SESSION['service_period'] = filter_var($_REQUEST['service_period'],FILTER_SANITIZE_STRING);  
if (isset($_REQUEST['time'])) $_SESSION['time'] = filter_var($_REQUEST['time'],FILTER_SANITIZE_STRING);  
if (isset($_REQUEST['geolocate'])) {  
$contents = geocode(var_filter($_REQUEST['geolocate'],FILTER_SANITIZE_URL),true);  
if (isset($contents[0]->centroid)) {  
$session['lat'] = $contents[0]->centroid->coordinates[0];  
$session['lon'] = $contents[0]->centroid->coordinates[1];  
}  
else {  
$session['lat'] = "";  
$session['lon'] = "";  
}  
}  
//print_r ($_SESSION);  
function isDebug()  
{  
return $_SERVER['SERVER_NAME'] == "10.0.1.154" || $_SERVER['SERVER_NAME'] == "localhost" || $_SERVER['SERVER_NAME'] == "127.0.0.1" || !$_SERVER['SERVER_NAME'];  
}  
 
function isMetricsOn()  
{  
return true;  
}  
 
function debug($msg) {  
if (isDebug()) echo "<!-- $msg -->";  
}  
function isFastDevice() {  
$fastDevices = Array("Mozilla/5.0 (X11;", "Mozilla/5.0 (Windows;", "Mozilla/5.0 (iP", "Mozilla/5.0 (Linux; U; Android", "Mozilla/4.0 (compatible; MSIE");  
$slowDevices = Array("J2ME","MIDP","Opera/","Mozilla/2.0 (compatible;","Mozilla/3.0 (compatible;");  
return true;  
}  
 
function include_header($pageTitle, $opendiv = true, $geolocate = false) {  
echo '  
<!DOCTYPE html>  
<html>  
<head>  
<title>'.$pageTitle.'</title>';  
if (isDebug()) echo '<link rel="stylesheet" href="css/jquery-mobile-1.0a3.css" />  
<script type="text/javascript" src="js/jquery-1.5.js"></script>  
<script type="text/javascript" src="js/jquery-mobile-1.0a3.js"></script>';  
else echo '<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0a3/jquery.mobile-1.0a3.css" />  
<script type="text/javascript" src="http://code.jquery.com/jquery-1.5.js"></script>  
<script type="text/javascript" src="http://code.jquery.com/mobile/1.0a3/jquery.mobile-1.0a3.js"></script>';  
echo '  
<link rel="stylesheet" href="css/jquery.ui.datepicker.mobile.css" />  
<script>  
//reset type=date inputs to text  
$( document ).bind( "mobileinit", function(){  
$.mobile.page.prototype.options.degradeInputs.date = true;  
});  
</script>  
<script src="js/jQuery.ui.datepicker.js"></script>  
<script src="js/jquery.ui.datepicker.mobile.js"></script>  
<style type="text/css">  
.ui-navbar {  
width: 100%;  
}  
.ui-btn-inner {  
white-space: normal !important;  
}  
.ui-li-heading {  
white-space: normal !important;  
}  
.ui-listview-filter {  
margin: 0 !important;  
}  
#footer {  
text-size: 0.75em;  
text-align: center;  
}  
body {  
background-color: #F0F0F0;  
}  
</style>  
<meta name="apple-mobile-web-app-capable" content="yes" />  
<meta name="apple-mobile-web-app-status-bar-style" content="black" />  
<link rel="apple-touch-startup-image" href="startup.png" />  
<link rel="apple-touch-icon" href="apple-touch-icon.png" />';  
if ($geolocate) {  
echo "<script>  
 
function success(position) {  
$('#geolocate').val(position.coords.latitude+','+position.coords.longitude);  
// setCookie('geolocate',position.coords.latitude+','+position.coords.longitude,1);  
$('#here').click(function(event) { $('#geolocate').val(doAJAXrequestForGeolocSessionHere()); return false;});  
$('#here').show();  
}  
function error(msg) {  
console.log(msg);  
}  
 
if (navigator.geolocation) {  
navigator.geolocation.getCurrentPosition(success, error);  
}  
 
</script> ";  
}  
echo '</head>  
<body>  
 
';  
if ($opendiv) {  
echo '<div data-role="page">  
<script>  
$(document).ready(function ()  
{  
document.title = "'.$pageTitle.'";  
});  
</script>  
<div data-role="header">  
<h1>'.$pageTitle.'</h1>  
</div><!-- /header -->  
<div data-role="content"> ';  
}  
}  
 
function include_footer()  
{  
if ($geolocate && isset($_SESSION['lat'])) {  
echo "<script>  
$('#here').click(function(event) { $('#geolocate').val(doAJAXrequestForGeolocSessionHere()); return false;});  
$('#here').show();  
</script>";  
}  
echo '<div id="footer"><a href="about.php">About/Contact Us</a>&nbsp;<a href="feedback.php">Feedback/Bug Report</a></a>';  
echo '</div>';  
}  
 
$service_periods = Array ('sunday','saturday','weekday');  
 
function service_period()  
{  
if (isset($_SESSION['service_period'])) return $_SESSION['service_period'];  
 
switch (date('w')){  
 
case 0:  
return 'sunday';  
case 6:  
return 'saturday';  
default:  
return 'weekday';  
}  
}  
 
function remove_spaces($string)  
{  
return str_replace(' ','',$string);  
}  
 
function midnight_seconds()  
{  
// from http://www.perturb.org/display/Perlfunc__Seconds_Since_Midnight.html  
if (isset($_SESSION['time'])) {  
$time = strtotime($_SESSION['time']);  
return (date("G",$time) * 3600) + (date("i",$time) * 60) + date("s",$time);  
}  
return (date("G") * 3600) + (date("i") * 60) + date("s");  
}  
 
function midnight_seconds_to_time($seconds)  
{  
if ($seconds > 0) {  
$midnight = mktime (0, 0, 0, date("n"), date("j"), date("Y"));  
return date("h:ia",$midnight+$seconds);  
} else {  
return "";  
}  
}  
function getPage($url)  
{  
debug($url);  
$ch = curl_init($url);  
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );  
curl_setopt( $ch, CURLOPT_HEADER, 0 );  
curl_setopt($ch,CURLOPT_TIMEOUT,30);  
$page = curl_exec($ch);  
if(curl_errno($ch)) echo "<font color=red> Database temporarily unavailable: ".curl_errno($ch)." ".curl_error($ch)."</font>";  
curl_close($ch);  
return $page;  
}  
function array_flatten($a,$f=array()){  
if(!$a||!is_array($a))return '';  
foreach($a as $k=>$v){  
if(is_array($v))$f=array_flatten($v,$f);  
else $f[$k]=$v;  
}  
return $f;  
}  
 
function staticmap($mapPoints, $zoom = 0, $markerImage = "iconb")  
{  
$width = 300;  
$height = 300;  
$metersperpixel[9]=305.492*$width;  
$metersperpixel[10]=152.746*$width;  
$metersperpixel[11]=76.373*$width;  
$metersperpixel[12]=38.187*$width;  
$metersperpixel[13]=19.093*$width;  
$metersperpixel[14]=9.547*$width;  
$metersperpixel[15]=4.773*$width;  
$metersperpixel[16]=2.387*$width;  
// $metersperpixel[17]=1.193*$width;  
$center = "";  
$markers = "";  
$minlat = 999;  
$minlon = 999;  
$maxlat = 0;  
$maxlon = 0;  
 
if (sizeof($mapPoints) < 1) return "map error";  
if (sizeof($mapPoints) === 1) {  
if ($zoom == 0) $zoom = 14;  
$markers .= "{$mapPoints[0][0]},{$mapPoints[0][1]},$markerimage";  
$center = "{$mapPoints[0][0]},{$mapPoints[0][1]}";  
} else {  
foreach ($mapPoints as $index => $mapPoint) {  
$markers .= $mapPoint[0].",".$mapPoint[1].",".$markerImage.($index+1);  
if ($index+1 != sizeof($mapPoints)) $markers .= "|";  
if ($mapPoint[0] < $minlat) $minlat = $mapPoint[0];  
if ($mapPoint[0] > $maxlat) $maxlat = $mapPoint[0];  
if ($mapPoint[1] < $minlon) $minlon = $mapPoint[1];  
if ($mapPoint[1] > $maxlon) $maxlon = $mapPoint[1];  
$totalLat += $mapPoint[0];  
$totalLon += $mapPoint[1];  
}  
if ($zoom == 0) {  
$mapwidthinmeters = distance($minlat,$minlon,$minlat,$maxlon);  
foreach (array_reverse($metersperpixel,true) as $zoomLevel => $maxdistance)  
{  
if ($zoom == 0 && $mapwidthinmeters < ($maxdistance + 50)) $zoom = $zoomLevel;  
}  
}  
$center = $totalLat/sizeof($mapPoints).",".$totalLon/sizeof($mapPoints);  
}  
$output = "";  
$output .= '<div data-role="collapsible" data-collapsed="true"><h3>Open Map...</h3>';  
$output .= '<center><img src="staticmaplite/staticmap.php?center='.$center.'&zoom='.$zoom.'&size='.$width.'x'.$height.'&maptype=mapnik&markers='.$markers.'" width='.$width.' height='.$height.'></center>';  
$output .= '</div>';  
return $output;  
}  
 
function distance($lat1, $lng1, $lat2, $lng2)  
{  
$pi80 = M_PI / 180;  
$lat1 *= $pi80;  
$lng1 *= $pi80;  
$lat2 *= $pi80;  
$lng2 *= $pi80;  
 
$r = 6372.797; // mean radius of Earth in km  
$dlat = $lat2 - $lat1;  
$dlng = $lng2 - $lng1;  
$a = sin($dlat / 2) * sin($dlat / 2) + cos($lat1) * cos($lat2) * sin($dlng / 2) * sin($dlng / 2);  
$c = 2 * atan2(sqrt($a), sqrt(1 - $a));  
$km = $r * $c;  
 
return $km * 1000;  
}  
 
function decodePolylineToArray($encoded)  
{  
// source: http://latlongeeks.com/forum/viewtopic.php?f=4&t=5  
$length = strlen($encoded);  
$index = 0;  
$points = array();  
$lat = 0;  
$lng = 0;  
 
while ($index < $length)  
{  
// Temporary variable to hold each ASCII byte.  
$b = 0;  
 
// The encoded polyline consists of a latitude value followed by a  
// longitude value. They should always come in pairs. Read the  
// latitude value first.  
$shift = 0;  
$result = 0;  
do  
{  
// The `ord(substr($encoded, $index++))` statement returns the ASCII  
// code for the character at $index. Subtract 63 to get the original  
// value. (63 was added to ensure proper ASCII characters are displayed  
// in the encoded polyline string, which is `human` readable)  
$b = ord(substr($encoded, $index++)) - 63;  
 
// AND the bits of the byte with 0x1f to get the original 5-bit `chunk.  
// Then left shift the bits by the required amount, which increases  
// by 5 bits each time.  
// OR the value into $results, which sums up the individual 5-bit chunks  
// into the original value. Since the 5-bit chunks were reversed in  
// order during encoding, reading them in this way ensures proper  
// summation.  
$result |= ($b & 0x1f) << $shift;  
$shift += 5;  
}  
// Continue while the read byte is >= 0x20 since the last `chunk`  
// was not OR'd with 0x20 during the conversion process. (Signals the end)  
while ($b >= 0x20);  
 
// Check if negative, and convert. (All negative values have the last bit  
// set)  
$dlat = (($result & 1) ? ~($result >> 1) : ($result >> 1));  
 
// Compute actual latitude since value is offset from previous value.  
$lat += $dlat;  
 
// The next values will correspond to the longitude for this point.  
$shift = 0;  
$result = 0;  
do  
{  
$b = ord(substr($encoded, $index++)) - 63;  
$result |= ($b & 0x1f) << $shift;  
$shift += 5;  
}  
while ($b >= 0x20);  
 
$dlng = (($result & 1) ? ~($result >> 1) : ($result >> 1));  
$lng += $dlng;  
 
// The actual latitude and longitude values were multiplied by  
// 1e5 before encoding so that they could be converted to a 32-bit  
// integer representation. (With a decimal accuracy of 5 places)  
// Convert back to original values.  
$points[] = array($lat * 1e-5, $lng * 1e-5);  
}  
 
return $points;  
}  
 
function object2array($object) {  
if (is_object($object)) {  
foreach ($object as $key => $value) {  
$array[$key] = $value;  
}  
}  
else {  
$array = $object;  
}  
return $array;  
}  
 
function geocode($query, $giveOptions) {  
global $cloudmadeAPIkey;  
$url = "http://geocoding.cloudmade.com/$cloudmadeAPIkey/geocoding/v2/find.js?query=".$query."&bbox=-35.5,149.00,-35.15,149.1930&return_location=true&bbox_only=true";  
$contents = json_decode(getPage($url));  
if ($giveOptions) return $contents->features;  
elseif (isset($contents->features[0]->centroid)) return $contents->features[0]->centroid->coordinates[0].",".$contents->features[0]->centroid->coordinates[1];  
else return "";  
}  
 
function reverseGeocode($lat,$lng) {  
global $cloudmadeAPIkey;  
$url = "http://geocoding.cloudmade.com/$cloudmadeAPIkey/geocoding/v2/find.js?around=".$lat.",".$lng."&distance=closest&object_type=road";  
$contents = json_decode(getPage($url));  
return $contents->features[0]->properties->name;  
}  
 
function startsWith($haystack,$needle,$case=true) {  
if($case){return (strcmp(substr($haystack, 0, strlen($needle)),$needle)===0);}  
return (strcasecmp(substr($haystack, 0, strlen($needle)),$needle)===0);  
}  
 
function endsWith($haystack,$needle,$case=true) {  
if($case){return (strcmp(substr($haystack, strlen($haystack) - strlen($needle)),$needle)===0);}  
return (strcasecmp(substr($haystack, strlen($haystack) - strlen($needle)),$needle)===0);  
}  
function bracketsMeanNewLine($input) {  
return str_replace(")","</small>",str_replace("(","<br><small>",$input));  
}  
 
function viaPoints($tripid,$stopid, $timingPointsOnly = false) {  
global $APIurl;  
$url = $APIurl."/json/tripstoptimes?trip=".$tripid;  
 
$json = json_decode(getPage($url));  
debug(print_r($json,true));  
$stops = $json[0];  
$times = $json[1];  
$foundStop = false;  
$viaPoints = Array();  
foreach ($stops as $key => $row)  
{  
if ($foundStop) {  
if (!$timingPointsOnly || !startsWith($row[5],"Wj") ) {  
$viaPoints[] = Array("id" => $row[0], "name" => $row[1], "time" => $times[$key]);  
}  
} else {  
if ($row[0] == $stopid) $foundStop = true;  
}  
}  
return $viaPoints;  
}  
 
function viaPointNames($tripid,$stopid) {  
$points = viaPoints($tripid,$stopid,true);  
$pointNames = Array();  
foreach ($points as $point) {  
$pointNames[] = $point['name'];  
}  
return implode(", ",$pointNames);  
}  
 
function timePlaceSettings($geolocate = false) {  
global $service_periods;  
$geoerror = false;  
if ($geolocate == true) {  
$geoerror = !isset($_SESSION['lat']) || !isset($_SESSION['lat'])  
|| $_SESSION['lat'] == "" || $_SESSION['lon'] == "";  
}  
if ($geoerror) {  
echo '<div class="error">Sorry, but your location could not currently be detected.  
Please allow location permission, wait for your location to be detected,  
or enter an address/co-ordinates in the box below.</div>';  
}  
echo '<div data-role="collapsible" data-collapsed="'.!$geoerror.'">  
<h3>Change Time/Place...</h3>  
<form action="" method="post">  
<div class="ui-body">  
<div data-role="fieldcontain">  
<label for="geolocate"> Current Location: </label>  
<input type="text" id="geolocate" name="geolocate" value="Enter co-ordinates or address here"/> <a href="#" style="display:none" name="here" id="here"/>Here?</a>  
</div>  
<div data-role="fieldcontain">  
<label for="time"> Time: </label>  
<input type="time" name="time" id="time" value="'. ($_SESSION['time'] ? $_SESSION['time'] : date("H:m")).'"/> <a href="#" name="currentTime" id="currentTime"/>Current Time?</a>  
</div>  
<div data-role="fieldcontain">  
<label for="service_period"> Service Period: </label>  
<select name="service_period">';  
 
foreach ($service_periods as $service_period) {  
echo "<option value=\"$service_period\"".(service_period() === $service_period ? "SELECTED" : "").'>'.ucwords($service_period).'</option>';  
}  
echo '</select>  
<a href="#" style="display:none" name="currentPeriod" id="currentPeriod"/>Current Period?</a>  
</div>  
 
<input type="submit" value="Update"/>  
</form>  
</div></div>';  
}  
?>  
 Binary files a/busui/css/images/01-refresh.png and /dev/null differ
 Binary files a/busui/css/images/02-redo.png and /dev/null differ
 Binary files a/busui/css/images/06-magnify.png and /dev/null differ
 Binary files a/busui/css/images/07-map-marker.png and /dev/null differ
 Binary files a/busui/css/images/101-gameplan.png and /dev/null differ
 Binary files a/busui/css/images/102-walk.png and /dev/null differ
 Binary files a/busui/css/images/103-map.png and /dev/null differ
 Binary files a/busui/css/images/113-navigation.png and /dev/null differ
 Binary files a/busui/css/images/121-landscape.png and /dev/null differ
 Binary files a/busui/css/images/13-target.png and /dev/null differ
 Binary files a/busui/css/images/139-flags.png and /dev/null differ
 Binary files a/busui/css/images/145-persondot.png and /dev/null differ
 Binary files a/busui/css/images/184-warning.png and /dev/null differ
 Binary files a/busui/css/images/193-location-arrow.png and /dev/null differ
 Binary files a/busui/css/images/28-star.png and /dev/null differ
 Binary files a/busui/css/images/53-house.png and /dev/null differ
 Binary files a/busui/css/images/55-network.png and /dev/null differ
 Binary files a/busui/css/images/57-download.png and /dev/null differ
 Binary files a/busui/css/images/58-bookmark.png and /dev/null differ
 Binary files a/busui/css/images/59-flag.png and /dev/null differ
 Binary files a/busui/css/images/60-signpost.png and /dev/null differ
 Binary files a/busui/css/images/73-radar.png and /dev/null differ
 Binary files a/busui/css/images/74-location.png and /dev/null differ
 Binary files a/busui/css/images/83-calendar.png and /dev/null differ
 Binary files a/busui/css/images/ajax-loader.png and /dev/null differ
 Binary files a/busui/css/images/form-check-off.png and /dev/null differ
 Binary files a/busui/css/images/form-check-on.png and /dev/null differ
 Binary files a/busui/css/images/form-radio-off.png and /dev/null differ
 Binary files a/busui/css/images/form-radio-on.png and /dev/null differ
 Binary files a/busui/css/images/icon-search-black.png and /dev/null differ
 Binary files a/busui/css/images/icons-18-black.png and /dev/null differ
 Binary files a/busui/css/images/icons-18-white.png and /dev/null differ
 Binary files a/busui/css/images/icons-36-black.png and /dev/null differ
 Binary files a/busui/css/images/icons-36-white.png and /dev/null differ
/*!  
* jQuery Mobile v1.0a3  
* http://jquerymobile.com/  
*  
* Copyright 2010, jQuery Project  
* Dual licensed under the MIT or GPL Version 2 licenses.  
* http://jquery.org/license  
*/  
/*!  
* jQuery Mobile v1.0a3  
* http://jquerymobile.com/  
*  
* Copyright 2010, jQuery Project  
* Dual licensed under the MIT or GPL Version 2 licenses.  
* http://jquery.org/license  
*/.ui-bar-a{border:1px solid #2a2a2a;background:#111;color:#fff;font-weight:bold;text-shadow:0 -1px 1px #000;background-image:-moz-linear-gradient(top,#3c3c3c,#111);background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0,#3c3c3c),color-stop(1,#111));-msfilter:"progid:DXImageTransform.Microsoft.gradient(startColorStr='#3c3c3c', EndColorStr='#111111')"}.ui-bar-a,.ui-bar-a input,.ui-bar-a select,.ui-bar-a textarea,.ui-bar-a button{font-family:Helvetica,Arial,sans-serif}.ui-bar-a .ui-link-inherit{color:#fff}.ui-bar-a .ui-link{color:#7cc4e7;font-weight:bold}.ui-body-a{border:1px solid #2a2a2a;background:#222;color:#fff;text-shadow:0 1px 0 #000;font-weight:normal;background-image:-moz-linear-gradient(top,#666,#222);background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0,#666),color-stop(1,#222));-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorStr='#666666', EndColorStr='#222222)')"}.ui-body-a,.ui-body-a input,.ui-body-a select,.ui-body-a textarea,.ui-body-a button{font-family:Helvetica,Arial,sans-serif}.ui-body-a .ui-link-inherit{color:#fff}.ui-body-a .ui-link{color:#2489ce;font-weight:bold}.ui-br{border-bottom:1px solid rgba(130,130,130,.3)}.ui-btn-up-a{border:1px solid #222;background:#333;font-weight:bold;color:#fff;cursor:pointer;text-shadow:0 -1px 1px #000;text-decoration:none;background-image:-moz-linear-gradient(top,#555,#333);background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0,#555),color-stop(1,#333));-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorStr='#555555', EndColorStr='#333333')"}.ui-btn-up-a a.ui-link-inherit{color:#fff}.ui-btn-hover-a{border:1px solid #000;background:#444;font-weight:bold;color:#fff;text-shadow:0 -1px 1px #000;text-decoration:none;background-image:-moz-linear-gradient(top,#666,#444);background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0,#666),color-stop(1,#444));-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorStr='#666666', EndColorStr='#444444')"}.ui-btn-hover-a a.ui-link-inherit{color:#fff}.ui-btn-down-a{border:1px solid #000;background:#3d3d3d;font-weight:bold;color:#fff;text-shadow:0 -1px 1px #000;background-image:-moz-linear-gradient(top,#333,#5a5a5a);background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0,#333),color-stop(1,#5a5a5a));-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorStr='#333333', EndColorStr='#5a5a5a')"}.ui-btn-down-a a.ui-link-inherit{color:#fff}.ui-btn-up-a,.ui-btn-hover-a,.ui-btn-down-a{font-family:Helvetica,Arial,sans-serif}.ui-bar-b{border:1px solid #456f9a;background:#5e87b0;color:#fff;font-weight:bold;text-shadow:0 -1px 1px #254f7a;background-image:-moz-linear-gradient(top,#81a8ce,#5e87b0);background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0,#81a8ce),color-stop(1,#5e87b0));-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorStr='#81a8ce', EndColorStr='#5e87b0')"}.ui-bar-b,.ui-bar-b input,.ui-bar-b select,.ui-bar-b textarea,.ui-bar-b button{font-family:Helvetica,Arial,sans-serif}.ui-bar-b .ui-link-inherit{color:#fff}.ui-bar-b .ui-link{color:#7cc4e7;font-weight:bold}.ui-body-b{border:1px solid #c6c6c6;background:#ccc;color:#333;text-shadow:0 1px 0 #fff;font-weight:normal;background-image:-moz-linear-gradient(top,#e6e6e6,#ccc);background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0,#e6e6e6),color-stop(1,#ccc));-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorStr='#e6e6e6', EndColorStr='#cccccc')"}.ui-body-b,.ui-body-b input,.ui-body-b select,.ui-body-b textarea,.ui-body-b button{font-family:Helvetica,Arial,sans-serif}.ui-body-b .ui-link-inherit{color:#333}.ui-body-b .ui-link{color:#2489ce;font-weight:bold}.ui-btn-up-b{border:1px solid #145072;background:#2567ab;font-weight:bold;color:#fff;cursor:pointer;text-shadow:0 -1px 1px #145072;text-decoration:none;background-image:-moz-linear-gradient(top,#4e89c5,#2567ab);background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0,#5f9cc5),color-stop(1,#396b9e));-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorStr='#4e89c5', EndColorStr='#2567ab')"}.ui-btn-up-b a.ui-link-inherit{color:#fff}.ui-btn-hover-b{border:1px solid #00516e;background:#4b88b6;font-weight:bold;color:#fff;text-shadow:0 -1px 1px #014d68;background-image:-moz-linear-gradient(top,#72b0d4,#4b88b6);text-decoration:none;background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0,#72b0d4),color-stop(1,#4b88b6));-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorStr='#72b0d4', EndColorStr='#4b88b6')"}.ui-btn-hover-b a.ui-link-inherit{color:#fff}.ui-btn-down-b{border:1px solid #225377;background:#4e89c5;font-weight:bold;color:#fff;text-shadow:0 -1px 1px #225377;background-image:-moz-linear-gradient(top,#396b9e,#4e89c5);background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0,#396b9e),color-stop(1,#4e89c5));-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorStr='#396b9e', EndColorStr='#4e89c5')"}.ui-btn-down-b a.ui-link-inherit{color:#fff}.ui-btn-up-b,.ui-btn-hover-b,.ui-btn-down-b{font-family:Helvetica,Arial,sans-serif}.ui-bar-c{border:1px solid #b3b3b3;background:#e9eaeb;color:#3e3e3e;font-weight:bold;text-shadow:0 1px 1px #fff;background-image:-moz-linear-gradient(top,#f0f0f0,#e9eaeb);background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0,#f0f0f0),color-stop(1,#e9eaeb));-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorStr='#f0f0f0', EndColorStr='#e9eaeb')"}.ui-bar-c,.ui-bar-c input,.ui-bar-c select,.ui-bar-c textarea,.ui-bar-c button{font-family:Helvetica,Arial,sans-serif}.ui-body-c{border:1px solid #b3b3b3;color:#333;text-shadow:0 1px 0 #fff;background:#f0f0f0;background-image:-moz-linear-gradient(top,#eee,#ddd);background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0,#eee),color-stop(1,#ddd));-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorStr='#eeeeee', EndColorStr='#dddddd')"}.ui-body-c,.ui-body-c input,.ui-body-c select,.ui-body-c textarea,.ui-body-c button{font-family:Helvetica,Arial,sans-serif}.ui-body-c .ui-link-inherit{color:#333}.ui-body-c .ui-link{color:#2489ce;font-weight:bold}.ui-btn-up-c{border:1px solid #ccc;background:#eee;font-weight:bold;color:#444;cursor:pointer;text-shadow:0 1px 1px #f6f6f6;text-decoration:none;background-image:-moz-linear-gradient(top,#fefefe,#eee);background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0,#fdfdfd),color-stop(1,#eee));-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorStr='#fdfdfd', EndColorStr='#eeeeee')"}.ui-btn-up-c a.ui-link-inherit{color:#2f3e46}.ui-btn-hover-c{border:1px solid #bbb;background:#dadada;font-weight:bold;color:#101010;text-decoration:none;text-shadow:0 1px 1px #fff;background-image:-moz-linear-gradient(top,#ededed,#dadada);background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0,#ededed),color-stop(1,#dadada));-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorStr='#ededed', EndColorStr='#dadada')"}.ui-btn-hover-c a.ui-link-inherit{color:#2f3e46}.ui-btn-down-c{border:1px solid #808080;background:#fdfdfd;font-weight:bold;color:#111;text-shadow:0 1px 1px #fff;background-image:-moz-linear-gradient(top,#eee,#fdfdfd);background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0,#eee),color-stop(1,#fdfdfd));-msfilter:"progid:DXImageTransform.Microsoft.gradient(startColorStr='#eeeeee', EndColorStr='#fdfdfd')"}.ui-btn-down-c a.ui-link-inherit{color:#2f3e46}.ui-btn-up-c,.ui-btn-hover-c,.ui-btn-down-c{font-family:Helvetica,Arial,sans-serif}.ui-bar-d{border:1px solid #ccc;background:#bbb;color:#333;text-shadow:0 1px 0 #eee;background-image:-moz-linear-gradient(top,#ddd,#bbb);background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0,#ddd),color-stop(1,#bbb));-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorStr='#dddddd', EndColorStr='#bbbbbb')"}.ui-bar-d,.ui-bar-d input,.ui-bar-d select,.ui-bar-d textarea,.ui-bar-d button{font-family:Helvetica,Arial,sans-serif}.ui-bar-d .ui-link-inherit{color:#333}.ui-bar-d .ui-link{color:#2489ce;font-weight:bold}.ui-body-d{border:1px solid #ccc;color:#333;text-shadow:0 1px 0 #fff;background:#fff}.ui-body-d,.ui-body-d input,.ui-body-d select,.ui-body-d textarea,.ui-body-d button{font-family:Helvetica,Arial,sans-serif}.ui-body-d .ui-link-inherit{color:#333}.ui-body-d .ui-link{color:#2489ce;font-weight:bold}.ui-btn-up-d{border:1px solid #ccc;background:#fff;font-weight:bold;color:#444;text-decoration:none;text-shadow:0 1px 1px #fff}.ui-btn-up-d a.ui-link-inherit{color:#333}.ui-btn-hover-d{border:1px solid #aaa;background:#eee;font-weight:bold;color:#222;cursor:pointer;text-shadow:0 1px 1px #fff;text-decoration:none;background-image:-moz-linear-gradient(top,#fdfdfd,#eee);background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0,#fdfdfd),color-stop(1,#eee));-msfilter:"progid:DXImageTransform.Microsoft.gradient(startColorStr='#fdfdfd', EndColorStr='#eeeeee')"}.ui-btn-hover-d a.ui-link-inherit{color:#222}.ui-btn-down-d{border:1px solid #aaa;background:#fff;font-weight:bold;color:#111;text-shadow:0 1px 1px #fff;background-image:-moz-linear-gradient(top,#eee,#fff);background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0,#eee),color-stop(1,#fff));-msfilter:"progid:DXImageTransform.Microsoft.gradient(startColorStr='#eeeeee', EndColorStr='#ffffff')"}.ui-btn-down-d a.ui-link-inherit{border:1px solid #808080;background:#ced0d2;font-weight:bold;color:#111;text-shadow:none;background-image:-moz-linear-gradient(top,#ccc,#eee);background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0,#ccc),color-stop(1,#eee));-msfilter:"progid:DXImageTransform.Microsoft.gradient(startColorStr='#cccccc', EndColorStr='#eeeeee')"}.ui-btn-up-d,.ui-btn-hover-d,.ui-btn-down-d{font-family:Helvetica,Arial,sans-serif}.ui-bar-e{border:1px solid #f7c942;background:#fadb4e;color:#333;text-shadow:0 1px 0 #fff;background-image:-moz-linear-gradient(top,#fceda7,#fadb4e);background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0,#fceda7),color-stop(1,#fadb4e));-msfilter:"progid:DXImageTransform.Microsoft.gradient(startColorStr='#fceda7', EndColorStr='#fadb4e')"}.ui-bar-e,.ui-bar-e input,.ui-bar-e select,.ui-bar-e textarea,.ui-bar-d button{font-family:Helvetica,Arial,sans-serif}.ui-bar-e .ui-link-inherit{color:#333}.ui-bar-e .ui-link{color:#2489ce;font-weight:bold}.ui-body-e{border:1px solid #f7c942;color:#333;text-shadow:0 1px 0 #fff;background:#faeb9e;background-image:-moz-linear-gradient(top,#fff,#faeb9e);background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0,#fff),color-stop(1,#faeb9e));-msfilter:"progid:DXImageTransform.Microsoft.gradient(startColorStr='#ffffff', EndColorStr='#faeb9e')"}.ui-body-e,.ui-body-e input,.ui-body-e select,.ui-body-e textarea,.ui-body-e button{font-family:Helvetica,Arial,sans-serif}.ui-body-e .ui-link-inherit{color:#333}.ui-body-e .ui-link{color:#2489ce;font-weight:bold}.ui-btn-up-e{border:1px solid #f7c942;background:#fadb4e;font-weight:bold;color:#333;cursor:pointer;text-shadow:0 1px 1px #fe3;text-decoration:none;text-shadow:0 1px 0 #fff;background-image:-moz-linear-gradient(top,#fceda7,#fadb4e);background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0,#fceda7),color-stop(1,#fadb4e));-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorStr='#fceda7', EndColorStr='#fadb4e')"}.ui-btn-up-e a.ui-link-inherit{color:#333}.ui-btn-hover-e{border:1px solid #e79952;background:#fbe26f;font-weight:bold;color:#111;text-decoration:none;text-shadow:0 1px 1px #fff;background-image:-moz-linear-gradient(top,#fcf0b5,#fbe26f);background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0,#fcf0b5),color-stop(1,#fbe26f));-msfilter:"progid:DXImageTransform.Microsoft.gradient(startColorStr='#fcf0b5', EndColorStr='#fbe26f')"}.ui-btn-hover-e a.ui-link-inherit{color:#333}.ui-btn-down-e{border:1px solid #f7c942;background:#fceda7;font-weight:bold;color:#111;text-shadow:0 1px 1px #fff;background-image:-moz-linear-gradient(top,#fadb4e,#fceda7);background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0,#fadb4e),color-stop(1,#fceda7));-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorStr='#fadb4e', EndColorStr='#fceda7')"}.ui-btn-down-e a.ui-link-inherit{color:#333}.ui-btn-up-e,.ui-btn-hover-e,.ui-btn-down-e{font-family:Helvetica,Arial,sans-serif}a.ui-link-inherit{text-decoration:none!important}.ui-btn-active{border:1px solid #155678;background:#4596ce;font-weight:bold;color:#fff;cursor:pointer;text-shadow:0 -1px 1px #145072;text-decoration:none;background-image:-moz-linear-gradient(top,#85bae4,#5393c5);background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0,#85bae4),color-stop(1,#5393c5));-msfilter:"progid:DXImageTransform.Microsoft.gradient(startColorStr='#85bae4', EndColorStr='#5393c5')";outline:0}.ui-btn-active a.ui-link-inherit{color:#fff}.ui-btn-inner{border-top:1px solid #fff;border-color:rgba(255,255,255,.3)}.ui-corner-tl{-moz-border-radius-topleft:.6em;-webkit-border-top-left-radius:.6em;border-top-left-radius:.6em}.ui-corner-tr{-moz-border-radius-topright:.6em;-webkit-border-top-right-radius:.6em;border-top-right-radius:.6em}.ui-corner-bl{-moz-border-radius-bottomleft:.6em;-webkit-border-bottom-left-radius:.6em;border-bottom-left-radius:.6em}.ui-corner-br{-moz-border-radius-bottomright:.6em;-webkit-border-bottom-right-radius:.6em;border-bottom-right-radius:.6em}.ui-corner-top{-moz-border-radius-topleft:.6em;-webkit-border-top-left-radius:.6em;border-top-left-radius:.6em;-moz-border-radius-topright:.6em;-webkit-border-top-right-radius:.6em;border-top-right-radius:.6em}.ui-corner-bottom{-moz-border-radius-bottomleft:.6em;-webkit-border-bottom-left-radius:.6em;border-bottom-left-radius:.6em;-moz-border-radius-bottomright:.6em;-webkit-border-bottom-right-radius:.6em;border-bottom-right-radius:.6em}.ui-corner-right{-moz-border-radius-topright:.6em;-webkit-border-top-right-radius:.6em;border-top-right-radius:.6em;-moz-border-radius-bottomright:.6em;-webkit-border-bottom-right-radius:.6em;border-bottom-right-radius:.6em}.ui-corner-left{-moz-border-radius-topleft:.6em;-webkit-border-top-left-radius:.6em;border-top-left-radius:.6em;-moz-border-radius-bottomleft:.6em;-webkit-border-bottom-left-radius:.6em;border-bottom-left-radius:.6em}.ui-corner-all{-moz-border-radius:.6em;-webkit-border-radius:.6em;border-radius:.6em}.ui-disabled{opacity:.3}.ui-disabled,.ui-disabled a{cursor:default!important}.ui-icon{background-image:url(images/icons-18-white.png);background-repeat:no-repeat;background-color:#666;background-color:rgba(0,0,0,.4);-moz-border-radius:9px;-webkit-border-radius:9px;border-radius:9px}.ui-icon-disc{background-color:#666;background-color:rgba(0,0,0,.3);-moz-border-radius:9px;-webkit-border-radius:9px;border-radius:9px}.ui-icon-black{background-image:url(images/icons-18-black.png)}.ui-icon-black-disc{background-color:#fff;background-color:rgba(255,255,255,.3);-moz-border-radius:9px;-webkit-border-radius:9px;border-radius:9px}@media screen and (-webkit-min-device-pixel-ratio:2),screen and (max--moz-device-pixel-ratio:2){.ui-icon{background-image:url(images/icons-36-white.png);background-size:630px 18px}.ui-icon-black{background-image:url(images/icons-36-black.png)}}.ui-icon-plus{background-position:-0 0}.ui-icon-minus{background-position:-36px 0}.ui-icon-delete{background-position:-72px 0}.ui-icon-arrow-r{background-position:-108px 0}.ui-icon-arrow-l{background-position:-144px 0}.ui-icon-arrow-u{background-position:-180px 0}.ui-icon-arrow-d{background-position:-216px 0}.ui-icon-check{background-position:-252px 0}.ui-icon-gear{background-position:-288px 0}.ui-icon-refresh{background-position:-324px 0}.ui-icon-forward{background-position:-360px 0}.ui-icon-back{background-position:-396px 0}.ui-icon-grid{background-position:-432px 0}.ui-icon-star{background-position:-468px 0}.ui-icon-alert{background-position:-504px 0}.ui-icon-info{background-position:-540px 0}.ui-icon-home{background-position:-576px 0}.ui-icon-search{background-position:-612px 0}.ui-icon-checkbox-off,.ui-icon-checkbox-on,.ui-icon-radio-off,.ui-icon-radio-on{background-color:transparent;-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;background-size:20px 20px}.ui-icon-checkbox-off{background-image:url(images/form-check-off.png)}.ui-icon-checkbox-on{background-image:url(images/form-check-on.png)}.ui-icon-radio-off{background-image:url(images/form-radio-off.png)}.ui-icon-radio-on{background-image:url(images/form-radio-on.png)}.ui-icon-searchfield{background-image:url(images/icon-search-black.png);background-size:16px 16px}.ui-icon-loading{background-image:url(images/ajax-loader.png);width:40px;height:40px;-moz-border-radius:20px;-webkit-border-radius:20px;border-radius:20px;background-size:35px 35px}.ui-btn-corner-tl{-moz-border-radius-topleft:1em;-webkit-border-top-left-radius:1em;border-top-left-radius:1em}.ui-btn-corner-tr{-moz-border-radius-topright:1em;-webkit-border-top-right-radius:1em;border-top-right-radius:1em}.ui-btn-corner-bl{-moz-border-radius-bottomleft:1em;-webkit-border-bottom-left-radius:1em;border-bottom-left-radius:1em}.ui-btn-corner-br{-moz-border-radius-bottomright:1em;-webkit-border-bottom-right-radius:1em;border-bottom-right-radius:1em}.ui-btn-corner-top{-moz-border-radius-topleft:1em;-webkit-border-top-left-radius:1em;border-top-left-radius:1em;-moz-border-radius-topright:1em;-webkit-border-top-right-radius:1em;border-top-right-radius:1em}.ui-btn-corner-bottom{-moz-border-radius-bottomleft:1em;-webkit-border-bottom-left-radius:1em;border-bottom-left-radius:1em;-moz-border-radius-bottomright:1em;-webkit-border-bottom-right-radius:1em;border-bottom-right-radius:1em}.ui-btn-corner-right{-moz-border-radius-topright:1em;-webkit-border-top-right-radius:1em;border-top-right-radius:1em;-moz-border-radius-bottomright:1em;-webkit-border-bottom-right-radius:1em;border-bottom-right-radius:1em}.ui-btn-corner-left{-moz-border-radius-topleft:1em;-webkit-border-top-left-radius:1em;border-top-left-radius:1em;-moz-border-radius-bottomleft:1em;-webkit-border-bottom-left-radius:1em;border-bottom-left-radius:1em}.ui-btn-corner-all{-moz-border-radius:1em;-webkit-border-radius:1em;border-radius:1em}.ui-corner-tl,.ui-corner-tr,.ui-corner-bl,.ui-corner-br,.ui-corner-top,.ui-corner-bottom,.ui-corner-right,.ui-corner-left,.ui-corner-all,.ui-btn-corner-tl,.ui-btn-corner-tr,.ui-btn-corner-bl,.ui-btn-corner-br,.ui-btn-corner-top,.ui-btn-corner-bottom,.ui-btn-corner-right,.ui-btn-corner-left,.ui-btn-corner-all{-webkit-background-clip:padding-box;-moz-background-clip:padding-box;background-clip:padding-box}.ui-overlay{background:#666;opacity:.5;filter:Alpha(Opacity=50);position:absolute;width:100%;height:100%}.ui-overlay-shadow{-moz-box-shadow:0 0 12px rgba(0,0,0,.6);-webkit-box-shadow:0 0 12px rgba(0,0,0,.6);box-shadow:0 0 12px rgba(0,0,0,.6)}.ui-shadow{-moz-box-shadow:0 1px 4px rgba(0,0,0,.3);-webkit-box-shadow:0 1px 4px rgba(0,0,0,.3);box-shadow:0 1px 4px rgba(0,0,0,.3)}.ui-bar-a .ui-shadow,.ui-bar-b .ui-shadow,.ui-bar-c .ui-shadow{-moz-box-shadow:0 1px 0 rgba(255,255,255,.3);-webkit-box-shadow:0 1px 0 rgba(255,255,255,.3);box-shadow:0 1px 0 rgba(255,255,255,.3)}.ui-shadow-inset{-moz-box-shadow:inset 0 1px 4px rgba(0,0,0,.2);-webkit-box-shadow:inset 0 1px 4px rgba(0,0,0,.2);box-shadow:inset 0 1px 4px rgba(0,0,0,.2)}.ui-icon-shadow{-moz-box-shadow:0 1px 0 rgba(255,255,255,.4);-webkit-box-shadow:0 1px 0 rgba(255,255,255,.4);box-shadow:0 1px 0 rgba(255,255,255,.4)}.ui-focus{-moz-box-shadow:0 0 12px #387bbe;-webkit-box-shadow:0 0 12px #387bbe;box-shadow:0 0 12px #387bbe}.ui-mobile-nosupport-boxshadow *{-moz-box-shadow:none!important;-webkit-box-shadow:none!important;box-shadow:none!important}.ui-mobile-nosupport-boxshadow .ui-focus{outline-width:2px}.ui-mobile fieldset,.ui-page{padding:0;margin:0}.ui-mobile a img,.ui-mobile fieldset{border:0}.ui-mobile-viewport{margin:0;overflow-x:hidden;-webkit-text-size-adjust:none;-ms-text-size-adjust:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}[data-role=page],[data-role=dialog],.ui-page{top:0;left:0;width:100%;min-height:100%;position:absolute;display:none;border:0}.ui-page-active{display:block;overflow:visible}.portrait,.portrait .ui-page{min-height:480px}.landscape,.landscape .ui-page{min-height:320px}.ui-loading .ui-mobile-viewport{overflow:hidden!important}.ui-loading .ui-loader{display:block}.ui-loading .ui-page{overflow:hidden}.ui-loader{display:none;position:absolute;opacity:.85;z-index:10;left:50%;width:200px;margin-left:-130px;margin-top:-35px;padding:10px 30px}.ui-loader h1{font-size:15px;text-align:center}.ui-loader .ui-icon{position:static;display:block;opacity:.9;margin:0 auto;width:35px;height:35px;background-color:transparent}.ui-mobile-rendering>*{visibility:hidden}.ui-bar,.ui-body{position:relative;padding:.4em 15px;overflow:hidden;display:block;clear:both}.ui-bar{font-size:16px;margin:0}.ui-bar h1,.ui-bar h2,.ui-bar h3,.ui-bar h4,.ui-bar h5,.ui-bar h6{margin:0;padding:0;font-size:16px;display:inline-block}.ui-header,.ui-footer{display:block}.ui-page .ui-header,.ui-page .ui-footer{position:relative}.ui-header .ui-btn-left{position:absolute;left:10px;top:.4em}.ui-header .ui-title,.ui-footer .ui-title{text-align:center;font-size:16px;display:block;margin:.6em 90px .8em;padding:0;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;outline:0!important}.ui-header .ui-btn-right{position:absolute;right:10px;top:.4em}.ui-content{border-width:0;overflow:visible;overflow-x:hidden;padding:15px}.ui-page-fullscreen .ui-content{padding:0}.ui-icon{width:18px;height:18px}.ui-fullscreen img{max-width:100%}.ui-nojs{position:absolute;left:-9999px}.spin{-webkit-transform:rotate(360deg);-webkit-animation-name:spin;-webkit-animation-duration:1s;-webkit-animation-iteration-count:infinite}@-webkit-keyframes spin{from{-webkit-transform:rotate(0deg)}to{-webkit-transform:rotate(360deg)}}.in,.out{-webkit-animation-timing-function:ease-in-out;-webkit-animation-duration:350ms}.slide.in{-webkit-transform:translateX(0);-webkit-animation-name:slideinfromright}.slide.out{-webkit-transform:translateX(-100%);-webkit-animation-name:slideouttoleft}.slide.in.reverse{-webkit-transform:translateX(0);-webkit-animation-name:slideinfromleft}.slide.out.reverse{-webkit-transform:translateX(100%);-webkit-animation-name:slideouttoright}.slideup.in{-webkit-transform:translateY(0);-webkit-animation-name:slideinfrombottom;z-index:10}.slideup.out{-webkit-animation-name:dontmove;z-index:0}.slideup.out.reverse{-webkit-transform:translateY(100%);z-index:10;-webkit-animation-name:slideouttobottom}.slideup.in.reverse{z-index:0;-webkit-animation-name:dontmove}.slidedown.in{-webkit-transform:translateY(0);-webkit-animation-name:slideinfromtop;z-index:10}.slidedown.out{-webkit-animation-name:dontmove;z-index:0}.slidedown.out.reverse{-webkit-transform:translateY(-100%);z-index:10;-webkit-animation-name:slideouttotop}.slidedown.in.reverse{z-index:0;-webkit-animation-name:dontmove}@-webkit-keyframes slideinfromright{from{-webkit-transform:translateX(100%)}to{-webkit-transform:translateX(0)}}@-webkit-keyframes slideinfromleft{from{-webkit-transform:translateX(-100%)}to{-webkit-transform:translateX(0)}}@-webkit-keyframes slideouttoleft{from{-webkit-transform:translateX(0)}to{-webkit-transform:translateX(-100%)}}@-webkit-keyframes slideouttoright{from{-webkit-transform:translateX(0)}to{-webkit-transform:translateX(100%)}}@-webkit-keyframes slideinfromtop{from{-webkit-transform:translateY(-100%)}to{-webkit-transform:translateY(0)}}@-webkit-keyframes slideinfrombottom{from{-webkit-transform:translateY(100%)}to{-webkit-transform:translateY(0)}}@-webkit-keyframes slideouttobottom{from{-webkit-transform:translateY(0)}to{-webkit-transform:translateY(100%)}}@-webkit-keyframes slideouttotop{from{-webkit-transform:translateY(0)}to{-webkit-transform:translateY(-100%)}}@-webkit-keyframes fadein{from{opacity:0}to{opacity:1}}@-webkit-keyframes fadeout{from{opacity:1}to{opacity:0}}.fade.in{opacity:1;z-index:10;-webkit-animation-name:fadein}.fade.out{z-index:0;-webkit-animation-name:fadeout}.ui-mobile-viewport-perspective{-webkit-perspective:1000;position:absolute}.ui-mobile-viewport-transitioning,.ui-mobile-viewport-transitioning .ui-page{width:100%;height:100%;overflow:hidden}.flip{-webkit-animation-duration:.65s;-webkit-backface-visibility:hidden;-webkit-transform:translateX(0)}.flip.in{-webkit-transform:rotateY(0) scale(1);-webkit-animation-name:flipinfromleft}.flip.out{-webkit-transform:rotateY(-180deg) scale(.8);-webkit-animation-name:flipouttoleft}.flip.in.reverse{-webkit-transform:rotateY(0) scale(1);-webkit-animation-name:flipinfromright}.flip.out.reverse{-webkit-transform:rotateY(180deg) scale(.8);-webkit-animation-name:flipouttoright}@-webkit-keyframes flipinfromright{from{-webkit-transform:rotateY(-180deg) scale(.8)}to{-webkit-transform:rotateY(0) scale(1)}}@-webkit-keyframes flipinfromleft{from{-webkit-transform:rotateY(180deg) scale(.8)}to{-webkit-transform:rotateY(0) scale(1)}}@-webkit-keyframes flipouttoleft{from{-webkit-transform:rotateY(0) scale(1)}to{-webkit-transform:rotateY(-180deg) scale(.8)}}@-webkit-keyframes flipouttoright{from{-webkit-transform:rotateY(0) scale(1)}to{-webkit-transform:rotateY(180deg) scale(.8)}}@-webkit-keyframes dontmove{from{opacity:1}to{opacity:1}}.pop{-webkit-transform-origin:50% 50%}.pop.in{-webkit-transform:scale(1);opacity:1;-webkit-animation-name:popin;z-index:10}.pop.out.reverse{-webkit-transform:scale(.2);opacity:0;-webkit-animation-name:popout;z-index:10}.pop.in.reverse{z-index:0;-webkit-animation-name:dontmove}@-webkit-keyframes popin{from{-webkit-transform:scale(.2);opacity:0}to{-webkit-transform:scale(1);opacity:1}}@-webkit-keyframes popout{from{-webkit-transform:scale(1);opacity:1}to{-webkit-transform:scale(.2);opacity:0}}.ui-grid-a,.ui-grid-b,.ui-grid-c,.ui-grid-d{overflow:hidden}.ui-block-a,.ui-block-b,.ui-block-c,.ui-block-d,.ui-block-e{margin:0;padding:0;border:0;float:left}.ui-grid-a .ui-block-a,.ui-grid-a .ui-block-b{width:50%}.ui-grid-a .ui-block-a{clear:left}.ui-grid-b .ui-block-a,.ui-grid-b .ui-block-b,.ui-grid-b .ui-block-c{width:33.333%}.ui-grid-b .ui-block-a{clear:left}.ui-grid-c .ui-block-a,.ui-grid-c .ui-block-b,.ui-grid-c .ui-block-c,.ui-grid-c .ui-block-d{width:25%}.ui-grid-c .ui-block-a{clear:left}.ui-grid-d .ui-block-a,.ui-grid-d .ui-block-b,.ui-grid-d .ui-block-c,.ui-grid-d .ui-block-d,.ui-grid-d .ui-block-e{width:20%}.ui-grid-d .ui-block-a{clear:left}.ui-header,.ui-footer,.ui-page-fullscreen .ui-header,.ui-page-fullscreen .ui-footer{position:absolute;overflow:hidden;width:100%;border-left-width:0;border-right-width:0}.ui-header-fixed,.ui-footer-fixed{z-index:1000;-webkit-transform:translateZ(0)}.ui-footer-duplicate,.ui-page-fullscreen .ui-fixed-inline{display:none}.ui-page-fullscreen .ui-header,.ui-page-fullscreen .ui-footer{opacity:.9}.ui-navbar{overflow:hidden}.ui-navbar ul,.ui-navbar-expanded ul{list-style:none;padding:0;margin:0;position:relative;display:block;border:0}.ui-navbar-collapsed ul{float:left;width:75%;margin-right:-2px}.ui-navbar-collapsed .ui-navbar-toggle{float:left;width:25%}.ui-navbar li.ui-navbar-truncate{position:absolute;left:-9999px;top:-9999px}.ui-navbar li .ui-btn,.ui-navbar .ui-navbar-toggle .ui-btn{display:block;font-size:12px;text-align:center;margin:0;border-right-width:0}.ui-navbar li .ui-btn{margin-right:-1px}.ui-navbar li .ui-btn:last-child{margin-right:0}.ui-header .ui-navbar li .ui-btn,.ui-header .ui-navbar .ui-navbar-toggle .ui-btn,.ui-footer .ui-navbar li .ui-btn,.ui-footer .ui-navbar .ui-navbar-toggle .ui-btn{border-top-width:0;border-bottom-width:0}.ui-navbar .ui-btn-inner{padding-left:2px;padding-right:2px}.ui-navbar-noicons li .ui-btn .ui-btn-inner,.ui-navbar-noicons .ui-navbar-toggle .ui-btn-inner{padding-top:.8em;padding-bottom:.9em}.ui-navbar-expanded .ui-btn{margin:0;font-size:14px}.ui-navbar-expanded .ui-btn-inner{padding-left:5px;padding-right:5px}.ui-navbar-expanded .ui-btn-icon-top .ui-btn-inner{padding:45px 5px 15px;text-align:center}.ui-navbar-expanded .ui-btn-icon-top .ui-icon{top:15px}.ui-navbar-expanded .ui-btn-icon-bottom .ui-btn-inner{padding:15px 5px 45px;text-align:center}.ui-navbar-expanded .ui-btn-icon-bottom .ui-icon{bottom:15px}.ui-navbar-expanded li .ui-btn .ui-btn-inner{min-height:2.5em}.ui-navbar-expanded .ui-navbar-noicons .ui-btn .ui-btn-inner{padding-top:1.8em;padding-bottom:1.9em}.ui-btn{display:block;text-align:center;cursor:pointer;position:relative;margin:.5em 5px;padding:0}.ui-btn:focus,.ui-btn:active{outline:0}.ui-header .ui-btn,.ui-footer .ui-btn,.ui-bar .ui-btn{display:inline-block;font-size:13px;margin:0}.ui-btn-inline{display:inline-block}.ui-btn-inner{padding:.6em 25px;display:block;height:100%;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;position:relative}.ui-header .ui-btn-inner,.ui-footer .ui-btn-inner,.ui-bar .ui-btn-inner{padding:.4em 8px .5em}.ui-btn-icon-notext{display:inline-block;width:20px;height:20px;padding:2px 1px 2px 3px;text-indent:-9999px}.ui-btn-icon-notext .ui-btn-inner{padding:0}.ui-btn-icon-notext .ui-btn-text{position:absolute;left:-999px}.ui-btn-icon-left .ui-btn-inner{padding-left:33px}.ui-header .ui-btn-icon-left .ui-btn-inner,.ui-footer .ui-btn-icon-left .ui-btn-inner,.ui-bar .ui-btn-icon-left .ui-btn-inner{padding-left:27px}.ui-btn-icon-right .ui-btn-inner{padding-right:33px}.ui-header .ui-btn-icon-right .ui-btn-inner,.ui-footer .ui-btn-icon-right .ui-btn-inner,.ui-bar .ui-btn-icon-right .ui-btn-inner{padding-right:27px}.ui-btn-icon-top .ui-btn-inner{padding-top:33px}.ui-header .ui-btn-icon-top .ui-btn-inner,.ui-footer .ui-btn-icon-top .ui-btn-inner,.ui-bar .ui-btn-icon-top .ui-btn-inner{padding-top:27px}.ui-btn-icon-bottom .ui-btn-inner{padding-bottom:33px}.ui-header .ui-btn-icon-bottom .ui-btn-inner,.ui-footer .ui-btn-icon-bottom .ui-btn-inner,.ui-bar .ui-btn-icon-bottom .ui-btn-inner{padding-bottom:27px}.ui-btn-icon-notext .ui-icon{display:block}.ui-btn-icon-left .ui-icon,.ui-btn-icon-right .ui-icon{position:absolute;top:50%;margin-top:-9px}.ui-btn-icon-top .ui-icon,.ui-btn-icon-bottom .ui-icon{position:absolute;left:50%;margin-left:-9px}.ui-btn-icon-left .ui-icon{left:10px}.ui-btn-icon-right .ui-icon{right:10px}.ui-header .ui-btn-icon-left .ui-icon,.ui-footer .ui-btn-icon-left .ui-icon,.ui-bar .ui-btn-icon-left .ui-icon{left:4px}.ui-header .ui-btn-icon-right .ui-icon,.ui-footer .ui-btn-icon-right .ui-icon,.ui-bar .ui-btn-icon-right .ui-icon{right:4px}.ui-header .ui-btn-icon-top .ui-icon,.ui-footer .ui-btn-icon-top .ui-icon,.ui-bar .ui-btn-icon-top .ui-icon{top:4px}.ui-header .ui-btn-icon-bottom .ui-icon,.ui-footer .ui-btn-icon-bottom .ui-icon,.ui-bar .ui-btn-icon-bottom .ui-icon{bottom:4px}.ui-btn-icon-top .ui-icon{top:5px}.ui-btn-icon-bottom .ui-icon{bottom:5px}.ui-btn-hidden{position:absolute;top:0;left:0;width:100%;height:100%;-webkit-appearance:button;opacity:0;cursor:pointer}.ui-collapsible-contain{margin:.5em 0}.ui-collapsible-heading{font-size:16px;display:block;margin:0 -8px;padding:0;border-width:0 0 1px 0;position:relative}.ui-collapsible-heading a{text-align:left;margin:0}.ui-collapsible-heading a .ui-btn-inner{padding-left:40px}.ui-collapsible-heading a span.ui-btn{position:absolute;left:6px;top:50%;margin:-12px 0 0 0;width:20px;height:20px;padding:1px 0 1px 2px;text-indent:-9999px}.ui-collapsible-heading a span.ui-btn .ui-btn-inner{padding:0}.ui-collapsible-heading a span.ui-btn .ui-icon{left:0;margin-top:-10px}.ui-collapsible-heading-status{position:absolute;left:-9999px}.ui-collapsible-content{display:block;padding:10px 0 10px 8px}.ui-collapsible-content-collapsed{display:none}.ui-collapsible-set{margin:.5em 0}.ui-collapsible-set .ui-collapsible-contain{margin:-1px 0 0}.ui-controlgroup,fieldset.ui-controlgroup{padding:0;margin:.5em 0 1em}.ui-bar .ui-controlgroup{margin:0 .3em}.ui-controlgroup-label{font-size:16px;line-height:1.4;font-weight:normal;margin:0 0 .3em}.ui-controlgroup-controls{display:block;width:95%}.ui-controlgroup li{list-style:none}.ui-controlgroup-vertical .ui-btn,.ui-controlgroup-vertical .ui-checkbox,.ui-controlgroup-vertical .ui-radio{margin:0;border-bottom-width:0}.ui-controlgroup-vertical .ui-controlgroup-last{border-bottom-width:1px}.ui-controlgroup-horizontal{padding:0}.ui-controlgroup-horizontal .ui-btn,.ui-controlgroup-horizontal .ui-checkbox,.ui-controlgroup-horizontal .ui-radio{margin:0 -5px 0 0;display:inline-block}.ui-controlgroup-horizontal .ui-checkbox .ui-btn,.ui-controlgroup-horizontal .ui-radio .ui-btn,.ui-controlgroup-horizontal .ui-checkbox:last-child,.ui-controlgroup-horizontal .ui-radio:last-child{margin-right:0}.ui-controlgroup-horizontal .ui-controlgroup-last{margin-right:0}.ui-controlgroup .ui-checkbox label,.ui-controlgroup .ui-radio label{font-size:16px}.min-width-480px .ui-controlgroup-label{vertical-align:top;display:inline-block;width:20%;margin:0 2% 0 0}.min-width-480px .ui-controlgroup-controls{width:60%;display:inline-block}.ui-dialog{min-height:480px}.ui-dialog .ui-header,.ui-dialog .ui-content,.ui-dialog .ui-footer{margin:15px;position:relative}.ui-dialog .ui-header,.ui-dialog .ui-footer{z-index:10;width:auto}.ui-dialog .ui-content,.ui-dialog .ui-footer{margin-top:-15px}.ui-checkbox,.ui-radio{position:relative;margin:.2em 0 .5em;z-index:1}.ui-checkbox .ui-btn,.ui-radio .ui-btn{margin:0;text-align:left;z-index:2}.ui-checkbox .ui-btn-icon-left .ui-btn-inner,.ui-radio .ui-btn-icon-left .ui-btn-inner{padding-left:45px}.ui-checkbox .ui-btn-icon-right .ui-btn-inner,.ui-radio .ui-btn-icon-right .ui-btn-inner{padding-right:45px}.ui-checkbox .ui-btn-icon-left .ui-icon,.ui-radio .ui-btn-icon-left .ui-icon{left:15px}.ui-checkbox .ui-btn-icon-right .ui-icon,.ui-radio .ui-btn-icon-right .ui-icon{right:15px}.ui-checkbox input,.ui-radio input{position:absolute;left:20px;top:50%;width:10px;height:10px;margin:-5px 0 0 0;outline:0!important;z-index:1}.ui-field-contain{background:0;padding:1.5em 0;margin:0;border-bottom-width:1px;overflow:visible}.ui-field-contain:first-child{border-top-width:0}.min-width-480px .ui-field-contain{border-width:0;padding:0;margin:1em 0}.ui-select{display:block;position:relative}.ui-select select{position:absolute;left:-9999px;top:-9999px}.ui-select .ui-btn select{cursor:pointer;-webkit-appearance:button;left:0;top:0;width:100%;height:100%;opacity:.001}.ui-select .ui-btn select.ui-select-nativeonly{opacity:1}.ui-select .ui-btn-icon-right .ui-btn-inner{padding-right:45px}.ui-select .ui-btn-icon-right .ui-icon{right:15px}label.ui-select{font-size:16px;line-height:1.4;font-weight:normal;margin:0 0 .3em;display:block}.ui-select .ui-btn-text,.ui-selectmenu .ui-btn-text{display:inline-block;min-height:1em}.ui-select .ui-btn-text{text-overflow:ellipsis;overflow:hidden;width:85%}.ui-selectmenu{position:absolute;padding:0;z-index:100!important;width:80%;max-width:350px;padding:6px}.ui-selectmenu .ui-listview{margin:0}.ui-selectmenu .ui-btn.ui-li-divider{cursor:default}.ui-selectmenu-hidden{top:-9999px;left:-9999px}.ui-selectmenu-screen{position:absolute;top:0;left:0;width:100%;height:100%;z-index:99}.ui-screen-hidden,.ui-selectmenu-list .ui-li .ui-icon{display:none}.ui-selectmenu-list .ui-li .ui-icon{display:block}.ui-li.ui-selectmenu-placeholder{display:none}.min-width-480px label.ui-select{display:inline-block;width:20%;margin:0 2% 0 0}.min-width-480px .ui-select{width:60%;display:inline-block}.ui-selectmenu .ui-header h1:after{content:'.';visibility:hidden}label.ui-input-text{font-size:16px;line-height:1.4;display:block;font-weight:normal;margin:0 0 .3em}input.ui-input-text,textarea.ui-input-text{background-image:none;padding:.4em;line-height:1.4;font-size:16px;display:block;width:95%}input.ui-input-text{-webkit-appearance:none}textarea.ui-input-text{height:50px;-webkit-transition:height 200ms linear;-moz-transition:height 200ms linear;-o-transition:height 200ms linear;transition:height 200ms linear}.ui-input-search{padding:0 30px;width:77%;background-position:8px 50%;background-repeat:no-repeat;position:relative}.ui-input-search input.ui-input-text{border:0;width:98%;padding:.4em 0;margin:0;display:block;background:transparent none;outline:0!important}.ui-input-search .ui-input-clear{position:absolute;right:0;top:50%;margin-top:-14px}.ui-input-search .ui-input-clear-hidden{display:none}.min-width-480px label.ui-input-text{vertical-align:top}.min-width-480px label.ui-input-text{display:inline-block;width:20%;margin:0 2% 0 0}.min-width-480px input.ui-input-text,.min-width-480px textarea.ui-input-text,.min-width-480px .ui-input-search{width:60%;display:inline-block}.min-width-480px .ui-input-search{width:50%}.ui-listview{margin:0;counter-reset:listnumbering}.ui-content .ui-listview{margin:-15px}.ui-content .ui-listview-inset{margin:1em 0}.ui-listview,.ui-li{list-style:none;padding:0;zoom:1}.ui-li{display:block;margin:0;position:relative;overflow:hidden;text-align:left;border-width:0;border-top-width:1px}.ui-li .ui-btn-text{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.ui-li-divider,.ui-li-static{padding:.5em 15px;font-size:14px;font-weight:bold;counter-reset:listnumbering}ol.ui-listview .ui-link-inherit:before,.ui-li-dec{font-size:.8em;display:inline-block;padding-right:.3em;font-weight:normal;counter-increment:listnumbering;content:counter(listnumbering) ". "}ol.ui-listview .ui-li-jsnumbering:before{content:""!important}.ui-listview-inset .ui-li{border-right-width:1px;border-left-width:1px}.ui-li:last-child{border-bottom-width:1px}.ui-li .ui-btn-inner{display:block;position:relative;padding:.7em 75px .7em 15px}.ui-li-has-thumb .ui-btn-inner{min-height:60px;padding-left:100px}.ui-li-has-icon .ui-btn-inner{min-height:20px;padding-left:40px}.ui-li-heading{font-size:16px;font-weight:bold;display:block;margin:.6em 0;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.ui-li-desc{font-size:12px;font-weight:normal;display:block;margin:-.5em 0 .6em;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.ui-li-thumb,.ui-li-icon{position:absolute;left:1px;top:0;max-height:80px;max-width:80px}.ui-li-icon{max-height:40px;max-width:40px;left:10px;top:.9em}.ui-li-thumb,.ui-li-icon,.ui-li-content{float:left;margin-right:10px}.ui-li-aside{float:right;width:50%;text-align:right;margin:.3em 0}.min-width-480px .ui-li-aside{width:45%}.ui-li-has-alt .ui-btn-inner{padding-right:95px}.ui-li-count{position:absolute;font-size:11px;font-weight:bold;padding:.2em .5em;top:50%;margin-top:-.9em;right:38px}.ui-li-divider .ui-li-count{right:10px}.ui-li-has-alt .ui-li-count{right:55px}.ui-li-link-alt{position:absolute;width:40px;height:100%;border-width:0;border-left-width:1px;top:0;right:0;margin:0;padding:0}.ui-li-link-alt .ui-btn{overflow:hidden;position:absolute;right:8px;top:50%;margin:-11px 0 0 0;border-bottom-width:1px}.ui-li-link-alt .ui-btn-inner{padding:0;position:static}.ui-li-link-alt .ui-btn .ui-icon{right:50%;margin-right:-9px}.ui-listview-filter{border-width:0;overflow:hidden;margin:-15px -15px 15px -15px}.ui-listview-filter .ui-input-search{margin:5px;width:auto;display:block}@media only screen and (min-device-width:768px) and (max-device-width:1024px){.ui-li .ui-btn-text{overflow:visible}}label.ui-slider{display:block}input.ui-slider-input,.min-width-480px input.ui-slider-input{display:inline-block;width:50px}select.ui-slider-switch{display:none}div.ui-slider{position:relative;display:inline-block;overflow:visible;height:15px;padding:0;margin:0 2% 0 20px;top:4px;width:66%}a.ui-slider-handle{position:absolute;z-index:10;top:50%;width:28px;height:28px;margin-top:-15px;margin-left:-15px}a.ui-slider-handle .ui-btn-inner{padding-left:0;padding-right:0}.min-width-480px label.ui-slider{display:inline-block;width:20%;margin:0 2% 0 0}.min-width-480px div.ui-slider{width:45%}div.ui-slider-switch{height:32px;overflow:hidden;margin-left:0}div.ui-slider-inneroffset{margin-left:50%;position:absolute;top:1px;height:100%;width:50%}div.ui-slider-handle-snapping{-webkit-transition:left 100ms linear}div.ui-slider-labelbg{position:absolute;top:0;margin:0;border-width:0}div.ui-slider-switch div.ui-slider-labelbg-a{width:60%;height:100%;left:0}div.ui-slider-switch div.ui-slider-labelbg-b{width:60%;height:100%;right:0}.ui-slider-switch-a div.ui-slider-labelbg-a,.ui-slider-switch-b div.ui-slider-labelbg-b{z-index:1}.ui-slider-switch-a div.ui-slider-labelbg-b,.ui-slider-switch-b div.ui-slider-labelbg-a{z-index:10}div.ui-slider-switch a.ui-slider-handle{z-index:20;width:101%;height:32px;margin-top:-18px;margin-left:-101%}span.ui-slider-label{width:100%;position:absolute;height:32px;font-size:16px;text-align:center;line-height:2;background:0;border-color:transparent}span.ui-slider-label-a{left:-100%;margin-right:-1px}span.ui-slider-label-b{right:-100%;margin-left:-1px}  
/*  
* jQuery UI Datepicker @VERSION  
*  
* Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)  
* Dual licensed under the MIT or GPL Version 2 licenses.  
* http://jquery.org/license  
*  
* http://docs.jquery.com/UI/Datepicker#theming  
*/  
div.hasDatepicker{ display: block; padding: 0; overflow: visible; margin: 8px 0; }  
.ui-datepicker { overflow: visible; margin: 0; max-width: 500px; }  
.ui-datepicker .ui-datepicker-header { position:relative; padding:.4em 0; border-bottom: 0; font-weight: bold; }  
.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { padding: 1px 0 1px 2px; position:absolute; top: .5em; margin-top: 0; text-indent: -9999px; }  
 
.ui-datepicker .ui-datepicker-prev { left:6px; }  
.ui-datepicker .ui-datepicker-next { right:6px; }  
.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; }  
.ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; }  
.ui-datepicker select.ui-datepicker-month-year {width: 100%;}  
.ui-datepicker select.ui-datepicker-month,  
.ui-datepicker select.ui-datepicker-year { width: 49%;}  
.ui-datepicker table {width: 100%; border-collapse: collapse; margin:0; }  
.ui-datepicker td { border-width: 1px; padding: 0; text-align: center; }  
.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em 0; font-weight: bold; margin: 0; border-width: 0; text-align: center; text-decoration: none; }  
 
.ui-datepicker-calendar th { padding-top: .3em; padding-bottom: .3em; }  
.ui-datepicker-calendar th span, .ui-datepicker-calendar span.ui-state-default { opacity: .3; }  
.ui-datepicker-calendar td a { padding-top: .5em; padding-bottom: .5em; }  
 
.min-width-480px div.hasDatepicker { width: 63%; display: inline-block; margin: 0; }  
file:a/busui/feedback.php (deleted)
<?php  
include('common.inc.php');  
include_header("Feedback")  
?>  
<h3>Add/Move/Delete a Bus Stop Location</h3>  
StopID:  
or StopCode:  
 
Suggested Stop Location (lat/long or words):  
 
<h3>Bug Report/Feedback</h3>  
<textarea id="extrainfo">  
Referrer URL  
User Agent  
User host/IP  
Current date/time  
Dump of $_SESSION  
</textarea>  
file:a/busui/index.php (deleted)
<?php  
include('common.inc.php');  
include_header("bus.lambdacomplex.org",false, true)  
?>  
<div data-role="page">  
<div data-role="content">  
<div id="jqm-homeheader">  
<center><h3>busness time</h3><br><small>Canberra Bus Timetables and Trip Planner</small></center>  
</div>  
<a href="tripPlanner.php" data-role="button">Launch Trip Planner...</a>  
<ul data-role="listview" data-inset="true" data-theme="c" data-dividertheme="b">  
<li data-role="list-divider">Timetables - Stops</li>  
<li><a href="stopList.php">Major (Timing Point) Stops</a></li>  
<li><a href="stopList.php">All Stops</a></li>  
<li><a href="stopList.php?suburbs=yes">Stops By Suburb</a></li>  
<li><a class="nearby" href="stopList.php?nearby=yes">Nearby Stops</a></li>  
</ul>  
<ul data-role="listview" data-inset="true" data-theme="c" data-dividertheme="b">  
<li data-role="list-divider">Timetables - Routes</li>  
<li><a href="routeList.php">Routes By Final Destination</a></li>  
<li><a href="routeList.php?bynumber=yes">Routes By Number</a></li>  
<li><a class="nearby" href="routeList.php?nearby=yes">Nearby Routes</a></li>  
</ul>  
<?php  
echo timePlaceSettings();  
include_footer(true)  
?>  
 
/*!  
* jQuery UI 1.8.5  
*  
* Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)  
* Dual licensed under the MIT or GPL Version 2 licenses.  
* http://jquery.org/license  
*  
* http://docs.jquery.com/UI  
*/  
(function(c,j){function k(a){return!c(a).parents().andSelf().filter(function(){return c.curCSS(this,"visibility")==="hidden"||c.expr.filters.hidden(this)}).length}c.ui=c.ui||{};if(!c.ui.version){c.extend(c.ui,{version:"1.8.5",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,  
NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});c.fn.extend({_focus:c.fn.focus,focus:function(a,b){return typeof a==="number"?this.each(function(){var d=this;setTimeout(function(){c(d).focus();b&&b.call(d)},a)}):this._focus.apply(this,arguments)},scrollParent:function(){var a;a=c.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(c.curCSS(this,  
"position",1))&&/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!a.length?c(document):a},zIndex:function(a){if(a!==j)return this.css("zIndex",a);if(this.length){a=c(this[0]);for(var b;a.length&&a[0]!==document;){b=a.css("position");  
if(b==="absolute"||b==="relative"||b==="fixed"){b=parseInt(a.css("zIndex"));if(!isNaN(b)&&b!=0)return b}a=a.parent()}}return 0},disableSelection:function(){return this.bind("mousedown.ui-disableSelection selectstart.ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});c.each(["Width","Height"],function(a,b){function d(f,g,l,m){c.each(e,function(){g-=parseFloat(c.curCSS(f,"padding"+this,true))||0;if(l)g-=parseFloat(c.curCSS(f,  
"border"+this+"Width",true))||0;if(m)g-=parseFloat(c.curCSS(f,"margin"+this,true))||0});return g}var e=b==="Width"?["Left","Right"]:["Top","Bottom"],h=b.toLowerCase(),i={innerWidth:c.fn.innerWidth,innerHeight:c.fn.innerHeight,outerWidth:c.fn.outerWidth,outerHeight:c.fn.outerHeight};c.fn["inner"+b]=function(f){if(f===j)return i["inner"+b].call(this);return this.each(function(){c.style(this,h,d(this,f)+"px")})};c.fn["outer"+b]=function(f,g){if(typeof f!=="number")return i["outer"+b].call(this,f);return this.each(function(){c.style(this,  
h,d(this,f,true,g)+"px")})}});c.extend(c.expr[":"],{data:function(a,b,d){return!!c.data(a,d[3])},focusable:function(a){var b=a.nodeName.toLowerCase(),d=c.attr(a,"tabindex");if("area"===b){b=a.parentNode;d=b.name;if(!a.href||!d||b.nodeName.toLowerCase()!=="map")return false;a=c("img[usemap=#"+d+"]")[0];return!!a&&k(a)}return(/input|select|textarea|button|object/.test(b)?!a.disabled:"a"==b?a.href||!isNaN(d):!isNaN(d))&&k(a)},tabbable:function(a){var b=c.attr(a,"tabindex");return(isNaN(b)||b>=0)&&c(a).is(":focusable")}});  
c(function(){var a=document.createElement("div"),b=document.body;c.extend(a.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});c.support.minHeight=b.appendChild(a).offsetHeight===100;b.removeChild(a).style.display="none"});c.extend(c.ui,{plugin:{add:function(a,b,d){a=c.ui[a].prototype;for(var e in d){a.plugins[e]=a.plugins[e]||[];a.plugins[e].push([b,d[e]])}},call:function(a,b,d){if((b=a.plugins[b])&&a.element[0].parentNode)for(var e=0;e<b.length;e++)a.options[b[e][0]]&&b[e][1].apply(a.element,  
d)}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b)},hasScroll:function(a,b){if(c(a).css("overflow")==="hidden")return false;b=b&&b==="left"?"scrollLeft":"scrollTop";var d=false;if(a[b]>0)return true;a[b]=1;d=a[b]>0;a[b]=0;return d},isOverAxis:function(a,b,d){return a>b&&a<b+d},isOver:function(a,b,d,e,h,i){return c.ui.isOverAxis(a,d,h)&&c.ui.isOverAxis(b,e,i)}})}})(jQuery);  
;/*  
* jQuery UI Datepicker 1.8.5  
*  
* Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)  
* Dual licensed under the MIT or GPL Version 2 licenses.  
* http://jquery.org/license  
*  
* http://docs.jquery.com/UI/Datepicker  
*  
* Depends:  
* jquery.ui.core.js  
*/  
(function(d,G){function L(){this.debug=false;this._curInst=null;this._keyEvent=false;this._disabledInputs=[];this._inDialog=this._datepickerShowing=false;this._mainDivId="ui-datepicker-div";this._inlineClass="ui-datepicker-inline";this._appendClass="ui-datepicker-append";this._triggerClass="ui-datepicker-trigger";this._dialogClass="ui-datepicker-dialog";this._disableClass="ui-datepicker-disabled";this._unselectableClass="ui-datepicker-unselectable";this._currentClass="ui-datepicker-current-day";this._dayOverClass=  
"ui-datepicker-days-cell-over";this.regional=[];this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su",  
"Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:false,showMonthAfterYear:false,yearSuffix:""};this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:false,hideIfNoPrevNext:false,navigationAsDateFormat:false,gotoCurrent:false,changeMonth:false,changeYear:false,yearRange:"c-10:c+10",showOtherMonths:false,selectOtherMonths:false,showWeek:false,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",  
minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:true,showButtonPanel:false,autoSize:false};d.extend(this._defaults,this.regional[""]);this.dpDiv=d('<div id="'+this._mainDivId+'" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all ui-helper-hidden-accessible"></div>')}function E(a,b){d.extend(a,  
b);for(var c in b)if(b[c]==null||b[c]==G)a[c]=b[c];return a}d.extend(d.ui,{datepicker:{version:"1.8.5"}});var y=(new Date).getTime();d.extend(L.prototype,{markerClassName:"hasDatepicker",log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(a){E(this._defaults,a||{});return this},_attachDatepicker:function(a,b){var c=null;for(var e in this._defaults){var f=a.getAttribute("date:"+e);if(f){c=c||{};try{c[e]=eval(f)}catch(h){c[e]=  
f}}}e=a.nodeName.toLowerCase();f=e=="div"||e=="span";if(!a.id){this.uuid+=1;a.id="dp"+this.uuid}var i=this._newInst(d(a),f);i.settings=d.extend({},b||{},c||{});if(e=="input")this._connectDatepicker(a,i);else f&&this._inlineDatepicker(a,i)},_newInst:function(a,b){return{id:a[0].id.replace(/([^A-Za-z0-9_])/g,"\\\\$1"),input:a,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:b,dpDiv:!b?this.dpDiv:d('<div class="'+this._inlineClass+' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>')}},  
_connectDatepicker:function(a,b){var c=d(a);b.append=d([]);b.trigger=d([]);if(!c.hasClass(this.markerClassName)){this._attachments(c,b);c.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",function(e,f,h){b.settings[f]=h}).bind("getData.datepicker",function(e,f){return this._get(b,f)});this._autoSize(b);d.data(a,"datepicker",b)}},_attachments:function(a,b){var c=this._get(b,"appendText"),e=this._get(b,"isRTL");b.append&&  
b.append.remove();if(c){b.append=d('<span class="'+this._appendClass+'">'+c+"</span>");a[e?"before":"after"](b.append)}a.unbind("focus",this._showDatepicker);b.trigger&&b.trigger.remove();c=this._get(b,"showOn");if(c=="focus"||c=="both")a.focus(this._showDatepicker);if(c=="button"||c=="both"){c=this._get(b,"buttonText");var f=this._get(b,"buttonImage");b.trigger=d(this._get(b,"buttonImageOnly")?d("<img/>").addClass(this._triggerClass).attr({src:f,alt:c,title:c}):d('<button type="button"></button>').addClass(this._triggerClass).html(f==  
""?c:d("<img/>").attr({src:f,alt:c,title:c})));a[e?"before":"after"](b.trigger);b.trigger.click(function(){d.datepicker._datepickerShowing&&d.datepicker._lastInput==a[0]?d.datepicker._hideDatepicker():d.datepicker._showDatepicker(a[0]);return false})}},_autoSize:function(a){if(this._get(a,"autoSize")&&!a.inline){var b=new Date(2009,11,20),c=this._get(a,"dateFormat");if(c.match(/[DM]/)){var e=function(f){for(var h=0,i=0,g=0;g<f.length;g++)if(f[g].length>h){h=f[g].length;i=g}return i};b.setMonth(e(this._get(a,  
c.match(/MM/)?"monthNames":"monthNamesShort")));b.setDate(e(this._get(a,c.match(/DD/)?"dayNames":"dayNamesShort"))+20-b.getDay())}a.input.attr("size",this._formatDate(a,b).length)}},_inlineDatepicker:function(a,b){var c=d(a);if(!c.hasClass(this.markerClassName)){c.addClass(this.markerClassName).append(b.dpDiv).bind("setData.datepicker",function(e,f,h){b.settings[f]=h}).bind("getData.datepicker",function(e,f){return this._get(b,f)});d.data(a,"datepicker",b);this._setDate(b,this._getDefaultDate(b),  
true);this._updateDatepicker(b);this._updateAlternate(b)}},_dialogDatepicker:function(a,b,c,e,f){a=this._dialogInst;if(!a){this.uuid+=1;this._dialogInput=d('<input type="text" id="'+("dp"+this.uuid)+'" style="position: absolute; top: -100px; width: 0px; z-index: -10;"/>');this._dialogInput.keydown(this._doKeyDown);d("body").append(this._dialogInput);a=this._dialogInst=this._newInst(this._dialogInput,false);a.settings={};d.data(this._dialogInput[0],"datepicker",a)}E(a.settings,e||{});b=b&&b.constructor==  
Date?this._formatDate(a,b):b;this._dialogInput.val(b);this._pos=f?f.length?f:[f.pageX,f.pageY]:null;if(!this._pos)this._pos=[document.documentElement.clientWidth/2-100+(document.documentElement.scrollLeft||document.body.scrollLeft),document.documentElement.clientHeight/2-150+(document.documentElement.scrollTop||document.body.scrollTop)];this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px");a.settings.onSelect=c;this._inDialog=true;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]);  
d.blockUI&&d.blockUI(this.dpDiv);d.data(this._dialogInput[0],"datepicker",a);return this},_destroyDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();d.removeData(a,"datepicker");if(e=="input"){c.append.remove();c.trigger.remove();b.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)}else if(e=="div"||e=="span")b.removeClass(this.markerClassName).empty()}},  
_enableDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();if(e=="input"){a.disabled=false;c.trigger.filter("button").each(function(){this.disabled=false}).end().filter("img").css({opacity:"1.0",cursor:""})}else if(e=="div"||e=="span")b.children("."+this._inlineClass).children().removeClass("ui-state-disabled");this._disabledInputs=d.map(this._disabledInputs,function(f){return f==a?null:f})}},_disableDatepicker:function(a){var b=  
d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();if(e=="input"){a.disabled=true;c.trigger.filter("button").each(function(){this.disabled=true}).end().filter("img").css({opacity:"0.5",cursor:"default"})}else if(e=="div"||e=="span")b.children("."+this._inlineClass).children().addClass("ui-state-disabled");this._disabledInputs=d.map(this._disabledInputs,function(f){return f==a?null:f});this._disabledInputs[this._disabledInputs.length]=a}},_isDisabledDatepicker:function(a){if(!a)return false;  
for(var b=0;b<this._disabledInputs.length;b++)if(this._disabledInputs[b]==a)return true;return false},_getInst:function(a){try{return d.data(a,"datepicker")}catch(b){throw"Missing instance data for this datepicker";}},_optionDatepicker:function(a,b,c){var e=this._getInst(a);if(arguments.length==2&&typeof b=="string")return b=="defaults"?d.extend({},d.datepicker._defaults):e?b=="all"?d.extend({},e.settings):this._get(e,b):null;var f=b||{};if(typeof b=="string"){f={};f[b]=c}if(e){this._curInst==e&&  
this._hideDatepicker();var h=this._getDateDatepicker(a,true);E(e.settings,f);this._attachments(d(a),e);this._autoSize(e);this._setDateDatepicker(a,h);this._updateDatepicker(e)}},_changeDatepicker:function(a,b,c){this._optionDatepicker(a,b,c)},_refreshDatepicker:function(a){(a=this._getInst(a))&&this._updateDatepicker(a)},_setDateDatepicker:function(a,b){if(a=this._getInst(a)){this._setDate(a,b);this._updateDatepicker(a);this._updateAlternate(a)}},_getDateDatepicker:function(a,b){(a=this._getInst(a))&&  
!a.inline&&this._setDateFromField(a,b);return a?this._getDate(a):null},_doKeyDown:function(a){var b=d.datepicker._getInst(a.target),c=true,e=b.dpDiv.is(".ui-datepicker-rtl");b._keyEvent=true;if(d.datepicker._datepickerShowing)switch(a.keyCode){case 9:d.datepicker._hideDatepicker();c=false;break;case 13:c=d("td."+d.datepicker._dayOverClass,b.dpDiv).add(d("td."+d.datepicker._currentClass,b.dpDiv));c[0]?d.datepicker._selectDay(a.target,b.selectedMonth,b.selectedYear,c[0]):d.datepicker._hideDatepicker();  
return false;case 27:d.datepicker._hideDatepicker();break;case 33:d.datepicker._adjustDate(a.target,a.ctrlKey?-d.datepicker._get(b,"stepBigMonths"):-d.datepicker._get(b,"stepMonths"),"M");break;case 34:d.datepicker._adjustDate(a.target,a.ctrlKey?+d.datepicker._get(b,"stepBigMonths"):+d.datepicker._get(b,"stepMonths"),"M");break;case 35:if(a.ctrlKey||a.metaKey)d.datepicker._clearDate(a.target);c=a.ctrlKey||a.metaKey;break;case 36:if(a.ctrlKey||a.metaKey)d.datepicker._gotoToday(a.target);c=a.ctrlKey||  
a.metaKey;break;case 37:if(a.ctrlKey||a.metaKey)d.datepicker._adjustDate(a.target,e?+1:-1,"D");c=a.ctrlKey||a.metaKey;if(a.originalEvent.altKey)d.datepicker._adjustDate(a.target,a.ctrlKey?-d.datepicker._get(b,"stepBigMonths"):-d.datepicker._get(b,"stepMonths"),"M");break;case 38:if(a.ctrlKey||a.metaKey)d.datepicker._adjustDate(a.target,-7,"D");c=a.ctrlKey||a.metaKey;break;case 39:if(a.ctrlKey||a.metaKey)d.datepicker._adjustDate(a.target,e?-1:+1,"D");c=a.ctrlKey||a.metaKey;if(a.originalEvent.altKey)d.datepicker._adjustDate(a.target,  
a.ctrlKey?+d.datepicker._get(b,"stepBigMonths"):+d.datepicker._get(b,"stepMonths"),"M");break;case 40:if(a.ctrlKey||a.metaKey)d.datepicker._adjustDate(a.target,+7,"D");c=a.ctrlKey||a.metaKey;break;default:c=false}else if(a.keyCode==36&&a.ctrlKey)d.datepicker._showDatepicker(this);else c=false;if(c){a.preventDefault();a.stopPropagation()}},_doKeyPress:function(a){var b=d.datepicker._getInst(a.target);if(d.datepicker._get(b,"constrainInput")){b=d.datepicker._possibleChars(d.datepicker._get(b,"dateFormat"));  
var c=String.fromCharCode(a.charCode==G?a.keyCode:a.charCode);return a.ctrlKey||c<" "||!b||b.indexOf(c)>-1}},_doKeyUp:function(a){a=d.datepicker._getInst(a.target);if(a.input.val()!=a.lastVal)try{if(d.datepicker.parseDate(d.datepicker._get(a,"dateFormat"),a.input?a.input.val():null,d.datepicker._getFormatConfig(a))){d.datepicker._setDateFromField(a);d.datepicker._updateAlternate(a);d.datepicker._updateDatepicker(a)}}catch(b){d.datepicker.log(b)}return true},_showDatepicker:function(a){a=a.target||  
a;if(a.nodeName.toLowerCase()!="input")a=d("input",a.parentNode)[0];if(!(d.datepicker._isDisabledDatepicker(a)||d.datepicker._lastInput==a)){var b=d.datepicker._getInst(a);d.datepicker._curInst&&d.datepicker._curInst!=b&&d.datepicker._curInst.dpDiv.stop(true,true);var c=d.datepicker._get(b,"beforeShow");E(b.settings,c?c.apply(a,[a,b]):{});b.lastVal=null;d.datepicker._lastInput=a;d.datepicker._setDateFromField(b);if(d.datepicker._inDialog)a.value="";if(!d.datepicker._pos){d.datepicker._pos=d.datepicker._findPos(a);  
d.datepicker._pos[1]+=a.offsetHeight}var e=false;d(a).parents().each(function(){e|=d(this).css("position")=="fixed";return!e});if(e&&d.browser.opera){d.datepicker._pos[0]-=document.documentElement.scrollLeft;d.datepicker._pos[1]-=document.documentElement.scrollTop}c={left:d.datepicker._pos[0],top:d.datepicker._pos[1]};d.datepicker._pos=null;b.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});d.datepicker._updateDatepicker(b);c=d.datepicker._checkOffset(b,c,e);b.dpDiv.css({position:d.datepicker._inDialog&&  
d.blockUI?"static":e?"fixed":"absolute",display:"none",left:c.left+"px",top:c.top+"px"});if(!b.inline){c=d.datepicker._get(b,"showAnim");var f=d.datepicker._get(b,"duration"),h=function(){d.datepicker._datepickerShowing=true;var i=d.datepicker._getBorders(b.dpDiv);b.dpDiv.find("iframe.ui-datepicker-cover").css({left:-i[0],top:-i[1],width:b.dpDiv.outerWidth(),height:b.dpDiv.outerHeight()})};b.dpDiv.zIndex(d(a).zIndex()+1);d.effects&&d.effects[c]?b.dpDiv.show(c,d.datepicker._get(b,"showOptions"),f,  
h):b.dpDiv[c||"show"](c?f:null,h);if(!c||!f)h();b.input.is(":visible")&&!b.input.is(":disabled")&&b.input.focus();d.datepicker._curInst=b}}},_updateDatepicker:function(a){var b=this,c=d.datepicker._getBorders(a.dpDiv);a.dpDiv.empty().append(this._generateHTML(a)).find("iframe.ui-datepicker-cover").css({left:-c[0],top:-c[1],width:a.dpDiv.outerWidth(),height:a.dpDiv.outerHeight()}).end().find("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a").bind("mouseout",function(){d(this).removeClass("ui-state-hover");  
this.className.indexOf("ui-datepicker-prev")!=-1&&d(this).removeClass("ui-datepicker-prev-hover");this.className.indexOf("ui-datepicker-next")!=-1&&d(this).removeClass("ui-datepicker-next-hover")}).bind("mouseover",function(){if(!b._isDisabledDatepicker(a.inline?a.dpDiv.parent()[0]:a.input[0])){d(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");d(this).addClass("ui-state-hover");this.className.indexOf("ui-datepicker-prev")!=-1&&d(this).addClass("ui-datepicker-prev-hover");  
this.className.indexOf("ui-datepicker-next")!=-1&&d(this).addClass("ui-datepicker-next-hover")}}).end().find("."+this._dayOverClass+" a").trigger("mouseover").end();c=this._getNumberOfMonths(a);var e=c[1];e>1?a.dpDiv.addClass("ui-datepicker-multi-"+e).css("width",17*e+"em"):a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");a.dpDiv[(c[0]!=1||c[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi");a.dpDiv[(this._get(a,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");  
a==d.datepicker._curInst&&d.datepicker._datepickerShowing&&a.input&&a.input.is(":visible")&&!a.input.is(":disabled")&&a.input.focus()},_getBorders:function(a){var b=function(c){return{thin:1,medium:2,thick:3}[c]||c};return[parseFloat(b(a.css("border-left-width"))),parseFloat(b(a.css("border-top-width")))]},_checkOffset:function(a,b,c){var e=a.dpDiv.outerWidth(),f=a.dpDiv.outerHeight(),h=a.input?a.input.outerWidth():0,i=a.input?a.input.outerHeight():0,g=document.documentElement.clientWidth+d(document).scrollLeft(),  
k=document.documentElement.clientHeight+d(document).scrollTop();b.left-=this._get(a,"isRTL")?e-h:0;b.left-=c&&b.left==a.input.offset().left?d(document).scrollLeft():0;b.top-=c&&b.top==a.input.offset().top+i?d(document).scrollTop():0;b.left-=Math.min(b.left,b.left+e>g&&g>e?Math.abs(b.left+e-g):0);b.top-=Math.min(b.top,b.top+f>k&&k>f?Math.abs(f+i):0);return b},_findPos:function(a){for(var b=this._get(this._getInst(a),"isRTL");a&&(a.type=="hidden"||a.nodeType!=1);)a=a[b?"previousSibling":"nextSibling"];  
a=d(a).offset();return[a.left,a.top]},_hideDatepicker:function(a){var b=this._curInst;if(!(!b||a&&b!=d.data(a,"datepicker")))if(this._datepickerShowing){a=this._get(b,"showAnim");var c=this._get(b,"duration"),e=function(){d.datepicker._tidyDialog(b);this._curInst=null};d.effects&&d.effects[a]?b.dpDiv.hide(a,d.datepicker._get(b,"showOptions"),c,e):b.dpDiv[a=="slideDown"?"slideUp":a=="fadeIn"?"fadeOut":"hide"](a?c:null,e);a||e();if(a=this._get(b,"onClose"))a.apply(b.input?b.input[0]:null,[b.input?b.input.val():  
"",b]);this._datepickerShowing=false;this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if(d.blockUI){d.unblockUI();d("body").append(this.dpDiv)}}this._inDialog=false}},_tidyDialog:function(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(a){if(d.datepicker._curInst){a=d(a.target);a[0].id!=d.datepicker._mainDivId&&a.parents("#"+d.datepicker._mainDivId).length==0&&!a.hasClass(d.datepicker.markerClassName)&&  
!a.hasClass(d.datepicker._triggerClass)&&d.datepicker._datepickerShowing&&!(d.datepicker._inDialog&&d.blockUI)&&d.datepicker._hideDatepicker()}},_adjustDate:function(a,b,c){a=d(a);var e=this._getInst(a[0]);if(!this._isDisabledDatepicker(a[0])){this._adjustInstDate(e,b+(c=="M"?this._get(e,"showCurrentAtPos"):0),c);this._updateDatepicker(e)}},_gotoToday:function(a){a=d(a);var b=this._getInst(a[0]);if(this._get(b,"gotoCurrent")&&b.currentDay){b.selectedDay=b.currentDay;b.drawMonth=b.selectedMonth=b.currentMonth;  
b.drawYear=b.selectedYear=b.currentYear}else{var c=new Date;b.selectedDay=c.getDate();b.drawMonth=b.selectedMonth=c.getMonth();b.drawYear=b.selectedYear=c.getFullYear()}this._notifyChange(b);this._adjustDate(a)},_selectMonthYear:function(a,b,c){a=d(a);var e=this._getInst(a[0]);e._selectingMonthYear=false;e["selected"+(c=="M"?"Month":"Year")]=e["draw"+(c=="M"?"Month":"Year")]=parseInt(b.options[b.selectedIndex].value,10);this._notifyChange(e);this._adjustDate(a)},_clickMonthYear:function(a){var b=  
this._getInst(d(a)[0]);b.input&&b._selectingMonthYear&&setTimeout(function(){b.input.focus()},0);b._selectingMonthYear=!b._selectingMonthYear},_selectDay:function(a,b,c,e){var f=d(a);if(!(d(e).hasClass(this._unselectableClass)||this._isDisabledDatepicker(f[0]))){f=this._getInst(f[0]);f.selectedDay=f.currentDay=d("a",e).html();f.selectedMonth=f.currentMonth=b;f.selectedYear=f.currentYear=c;this._selectDate(a,this._formatDate(f,f.currentDay,f.currentMonth,f.currentYear))}},_clearDate:function(a){a=  
d(a);this._getInst(a[0]);this._selectDate(a,"")},_selectDate:function(a,b){a=this._getInst(d(a)[0]);b=b!=null?b:this._formatDate(a);a.input&&a.input.val(b);this._updateAlternate(a);var c=this._get(a,"onSelect");if(c)c.apply(a.input?a.input[0]:null,[b,a]);else a.input&&a.input.trigger("change");if(a.inline)this._updateDatepicker(a);else{this._hideDatepicker();this._lastInput=a.input[0];typeof a.input[0]!="object"&&a.input.focus();this._lastInput=null}},_updateAlternate:function(a){var b=this._get(a,  
"altField");if(b){var c=this._get(a,"altFormat")||this._get(a,"dateFormat"),e=this._getDate(a),f=this.formatDate(c,e,this._getFormatConfig(a));d(b).each(function(){d(this).val(f)})}},noWeekends:function(a){a=a.getDay();return[a>0&&a<6,""]},iso8601Week:function(a){a=new Date(a.getTime());a.setDate(a.getDate()+4-(a.getDay()||7));var b=a.getTime();a.setMonth(0);a.setDate(1);return Math.floor(Math.round((b-a)/864E5)/7)+1},parseDate:function(a,b,c){if(a==null||b==null)throw"Invalid arguments";b=typeof b==  
"object"?b.toString():b+"";if(b=="")return null;for(var e=(c?c.shortYearCutoff:null)||this._defaults.shortYearCutoff,f=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,h=(c?c.dayNames:null)||this._defaults.dayNames,i=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,g=(c?c.monthNames:null)||this._defaults.monthNames,k=c=-1,l=-1,u=-1,j=false,o=function(p){(p=z+1<a.length&&a.charAt(z+1)==p)&&z++;return p},m=function(p){o(p);p=new RegExp("^\\d{1,"+(p=="@"?14:p=="!"?20:p=="y"?4:p=="o"?  
3:2)+"}");p=b.substring(s).match(p);if(!p)throw"Missing number at position "+s;s+=p[0].length;return parseInt(p[0],10)},n=function(p,w,H){p=o(p)?H:w;for(w=0;w<p.length;w++)if(b.substr(s,p[w].length).toLowerCase()==p[w].toLowerCase()){s+=p[w].length;return w+1}throw"Unknown name at position "+s;},r=function(){if(b.charAt(s)!=a.charAt(z))throw"Unexpected literal at position "+s;s++},s=0,z=0;z<a.length;z++)if(j)if(a.charAt(z)=="'"&&!o("'"))j=false;else r();else switch(a.charAt(z)){case "d":l=m("d");  
break;case "D":n("D",f,h);break;case "o":u=m("o");break;case "m":k=m("m");break;case "M":k=n("M",i,g);break;case "y":c=m("y");break;case "@":var v=new Date(m("@"));c=v.getFullYear();k=v.getMonth()+1;l=v.getDate();break;case "!":v=new Date((m("!")-this._ticksTo1970)/1E4);c=v.getFullYear();k=v.getMonth()+1;l=v.getDate();break;case "'":if(o("'"))r();else j=true;break;default:r()}if(c==-1)c=(new Date).getFullYear();else if(c<100)c+=(new Date).getFullYear()-(new Date).getFullYear()%100+(c<=e?0:-100);if(u>  
-1){k=1;l=u;do{e=this._getDaysInMonth(c,k-1);if(l<=e)break;k++;l-=e}while(1)}v=this._daylightSavingAdjust(new Date(c,k-1,l));if(v.getFullYear()!=c||v.getMonth()+1!=k||v.getDate()!=l)throw"Invalid date";return v},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*  
60*60*1E7,formatDate:function(a,b,c){if(!b)return"";var e=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,f=(c?c.dayNames:null)||this._defaults.dayNames,h=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort;c=(c?c.monthNames:null)||this._defaults.monthNames;var i=function(o){(o=j+1<a.length&&a.charAt(j+1)==o)&&j++;return o},g=function(o,m,n){m=""+m;if(i(o))for(;m.length<n;)m="0"+m;return m},k=function(o,m,n,r){return i(o)?r[m]:n[m]},l="",u=false;if(b)for(var j=0;j<a.length;j++)if(u)if(a.charAt(j)==  
"'"&&!i("'"))u=false;else l+=a.charAt(j);else switch(a.charAt(j)){case "d":l+=g("d",b.getDate(),2);break;case "D":l+=k("D",b.getDay(),e,f);break;case "o":l+=g("o",(b.getTime()-(new Date(b.getFullYear(),0,0)).getTime())/864E5,3);break;case "m":l+=g("m",b.getMonth()+1,2);break;case "M":l+=k("M",b.getMonth(),h,c);break;case "y":l+=i("y")?b.getFullYear():(b.getYear()%100<10?"0":"")+b.getYear()%100;break;case "@":l+=b.getTime();break;case "!":l+=b.getTime()*1E4+this._ticksTo1970;break;case "'":if(i("'"))l+=  
"'";else u=true;break;default:l+=a.charAt(j)}return l},_possibleChars:function(a){for(var b="",c=false,e=function(h){(h=f+1<a.length&&a.charAt(f+1)==h)&&f++;return h},f=0;f<a.length;f++)if(c)if(a.charAt(f)=="'"&&!e("'"))c=false;else b+=a.charAt(f);else switch(a.charAt(f)){case "d":case "m":case "y":case "@":b+="0123456789";break;case "D":case "M":return null;case "'":if(e("'"))b+="'";else c=true;break;default:b+=a.charAt(f)}return b},_get:function(a,b){return a.settings[b]!==G?a.settings[b]:this._defaults[b]},  
_setDateFromField:function(a,b){if(a.input.val()!=a.lastVal){var c=this._get(a,"dateFormat"),e=a.lastVal=a.input?a.input.val():null,f,h;f=h=this._getDefaultDate(a);var i=this._getFormatConfig(a);try{f=this.parseDate(c,e,i)||h}catch(g){this.log(g);e=b?"":e}a.selectedDay=f.getDate();a.drawMonth=a.selectedMonth=f.getMonth();a.drawYear=a.selectedYear=f.getFullYear();a.currentDay=e?f.getDate():0;a.currentMonth=e?f.getMonth():0;a.currentYear=e?f.getFullYear():0;this._adjustInstDate(a)}},_getDefaultDate:function(a){return this._restrictMinMax(a,  
this._determineDate(a,this._get(a,"defaultDate"),new Date))},_determineDate:function(a,b,c){var e=function(h){var i=new Date;i.setDate(i.getDate()+h);return i},f=function(h){try{return d.datepicker.parseDate(d.datepicker._get(a,"dateFormat"),h,d.datepicker._getFormatConfig(a))}catch(i){}var g=(h.toLowerCase().match(/^c/)?d.datepicker._getDate(a):null)||new Date,k=g.getFullYear(),l=g.getMonth();g=g.getDate();for(var u=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,j=u.exec(h);j;){switch(j[2]||"d"){case "d":case "D":g+=  
parseInt(j[1],10);break;case "w":case "W":g+=parseInt(j[1],10)*7;break;case "m":case "M":l+=parseInt(j[1],10);g=Math.min(g,d.datepicker._getDaysInMonth(k,l));break;case "y":case "Y":k+=parseInt(j[1],10);g=Math.min(g,d.datepicker._getDaysInMonth(k,l));break}j=u.exec(h)}return new Date(k,l,g)};if(b=(b=b==null?c:typeof b=="string"?f(b):typeof b=="number"?isNaN(b)?c:e(b):b)&&b.toString()=="Invalid Date"?c:b){b.setHours(0);b.setMinutes(0);b.setSeconds(0);b.setMilliseconds(0)}return this._daylightSavingAdjust(b)},  
_daylightSavingAdjust:function(a){if(!a)return null;a.setHours(a.getHours()>12?a.getHours()+2:0);return a},_setDate:function(a,b,c){var e=!b,f=a.selectedMonth,h=a.selectedYear;b=this._restrictMinMax(a,this._determineDate(a,b,new Date));a.selectedDay=a.currentDay=b.getDate();a.drawMonth=a.selectedMonth=a.currentMonth=b.getMonth();a.drawYear=a.selectedYear=a.currentYear=b.getFullYear();if((f!=a.selectedMonth||h!=a.selectedYear)&&!c)this._notifyChange(a);this._adjustInstDate(a);if(a.input)a.input.val(e?  
"":this._formatDate(a))},_getDate:function(a){return!a.currentYear||a.input&&a.input.val()==""?null:this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay))},_generateHTML:function(a){var b=new Date;b=this._daylightSavingAdjust(new Date(b.getFullYear(),b.getMonth(),b.getDate()));var c=this._get(a,"isRTL"),e=this._get(a,"showButtonPanel"),f=this._get(a,"hideIfNoPrevNext"),h=this._get(a,"navigationAsDateFormat"),i=this._getNumberOfMonths(a),g=this._get(a,"showCurrentAtPos"),k=  
this._get(a,"stepMonths"),l=i[0]!=1||i[1]!=1,u=this._daylightSavingAdjust(!a.currentDay?new Date(9999,9,9):new Date(a.currentYear,a.currentMonth,a.currentDay)),j=this._getMinMaxDate(a,"min"),o=this._getMinMaxDate(a,"max");g=a.drawMonth-g;var m=a.drawYear;if(g<0){g+=12;m--}if(o){var n=this._daylightSavingAdjust(new Date(o.getFullYear(),o.getMonth()-i[0]*i[1]+1,o.getDate()));for(n=j&&n<j?j:n;this._daylightSavingAdjust(new Date(m,g,1))>n;){g--;if(g<0){g=11;m--}}}a.drawMonth=g;a.drawYear=m;n=this._get(a,  
"prevText");n=!h?n:this.formatDate(n,this._daylightSavingAdjust(new Date(m,g-k,1)),this._getFormatConfig(a));n=this._canAdjustMonth(a,-1,m,g)?'<a class="ui-datepicker-prev ui-corner-all" onclick="DP_jQuery_'+y+".datepicker._adjustDate('#"+a.id+"', -"+k+", 'M');\" title=\""+n+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"e":"w")+'">'+n+"</span></a>":f?"":'<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+n+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"e":"w")+'">'+  
n+"</span></a>";var r=this._get(a,"nextText");r=!h?r:this.formatDate(r,this._daylightSavingAdjust(new Date(m,g+k,1)),this._getFormatConfig(a));f=this._canAdjustMonth(a,+1,m,g)?'<a class="ui-datepicker-next ui-corner-all" onclick="DP_jQuery_'+y+".datepicker._adjustDate('#"+a.id+"', +"+k+", 'M');\" title=\""+r+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"w":"e")+'">'+r+"</span></a>":f?"":'<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+r+'"><span class="ui-icon ui-icon-circle-triangle-'+  
(c?"w":"e")+'">'+r+"</span></a>";k=this._get(a,"currentText");r=this._get(a,"gotoCurrent")&&a.currentDay?u:b;k=!h?k:this.formatDate(k,r,this._getFormatConfig(a));h=!a.inline?'<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" onclick="DP_jQuery_'+y+'.datepicker._hideDatepicker();">'+this._get(a,"closeText")+"</button>":"";e=e?'<div class="ui-datepicker-buttonpane ui-widget-content">'+(c?h:"")+(this._isInRange(a,r)?'<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" onclick="DP_jQuery_'+  
y+".datepicker._gotoToday('#"+a.id+"');\">"+k+"</button>":"")+(c?"":h)+"</div>":"";h=parseInt(this._get(a,"firstDay"),10);h=isNaN(h)?0:h;k=this._get(a,"showWeek");r=this._get(a,"dayNames");this._get(a,"dayNamesShort");var s=this._get(a,"dayNamesMin"),z=this._get(a,"monthNames"),v=this._get(a,"monthNamesShort"),p=this._get(a,"beforeShowDay"),w=this._get(a,"showOtherMonths"),H=this._get(a,"selectOtherMonths");this._get(a,"calculateWeek");for(var M=this._getDefaultDate(a),I="",C=0;C<i[0];C++){for(var N=  
"",D=0;D<i[1];D++){var J=this._daylightSavingAdjust(new Date(m,g,a.selectedDay)),t=" ui-corner-all",x="";if(l){x+='<div class="ui-datepicker-group';if(i[1]>1)switch(D){case 0:x+=" ui-datepicker-group-first";t=" ui-corner-"+(c?"right":"left");break;case i[1]-1:x+=" ui-datepicker-group-last";t=" ui-corner-"+(c?"left":"right");break;default:x+=" ui-datepicker-group-middle";t="";break}x+='">'}x+='<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix'+t+'">'+(/all|left/.test(t)&&C==0?c?  
f:n:"")+(/all|right/.test(t)&&C==0?c?n:f:"")+this._generateMonthYearHeader(a,g,m,j,o,C>0||D>0,z,v)+'</div><table class="ui-datepicker-calendar"><thead><tr>';var A=k?'<th class="ui-datepicker-week-col">'+this._get(a,"weekHeader")+"</th>":"";for(t=0;t<7;t++){var q=(t+h)%7;A+="<th"+((t+h+6)%7>=5?' class="ui-datepicker-week-end"':"")+'><span title="'+r[q]+'">'+s[q]+"</span></th>"}x+=A+"</tr></thead><tbody>";A=this._getDaysInMonth(m,g);if(m==a.selectedYear&&g==a.selectedMonth)a.selectedDay=Math.min(a.selectedDay,  
A);t=(this._getFirstDayOfMonth(m,g)-h+7)%7;A=l?6:Math.ceil((t+A)/7);q=this._daylightSavingAdjust(new Date(m,g,1-t));for(var O=0;O<A;O++){x+="<tr>";var P=!k?"":'<td class="ui-datepicker-week-col">'+this._get(a,"calculateWeek")(q)+"</td>";for(t=0;t<7;t++){var F=p?p.apply(a.input?a.input[0]:null,[q]):[true,""],B=q.getMonth()!=g,K=B&&!H||!F[0]||j&&q<j||o&&q>o;P+='<td class="'+((t+h+6)%7>=5?" ui-datepicker-week-end":"")+(B?" ui-datepicker-other-month":"")+(q.getTime()==J.getTime()&&g==a.selectedMonth&&  
a._keyEvent||M.getTime()==q.getTime()&&M.getTime()==J.getTime()?" "+this._dayOverClass:"")+(K?" "+this._unselectableClass+" ui-state-disabled":"")+(B&&!w?"":" "+F[1]+(q.getTime()==u.getTime()?" "+this._currentClass:"")+(q.getTime()==b.getTime()?" ui-datepicker-today":""))+'"'+((!B||w)&&F[2]?' title="'+F[2]+'"':"")+(K?"":' onclick="DP_jQuery_'+y+".datepicker._selectDay('#"+a.id+"',"+q.getMonth()+","+q.getFullYear()+', this);return false;"')+">"+(B&&!w?"&#xa0;":K?'<span class="ui-state-default">'+q.getDate()+  
"</span>":'<a class="ui-state-default'+(q.getTime()==b.getTime()?" ui-state-highlight":"")+(q.getTime()==J.getTime()?" ui-state-active":"")+(B?" ui-priority-secondary":"")+'" href="#">'+q.getDate()+"</a>")+"</td>";q.setDate(q.getDate()+1);q=this._daylightSavingAdjust(q)}x+=P+"</tr>"}g++;if(g>11){g=0;m++}x+="</tbody></table>"+(l?"</div>"+(i[0]>0&&D==i[1]-1?'<div class="ui-datepicker-row-break"></div>':""):"");N+=x}I+=N}I+=e+(d.browser.msie&&parseInt(d.browser.version,10)<7&&!a.inline?'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>':  
"");a._keyEvent=false;return I},_generateMonthYearHeader:function(a,b,c,e,f,h,i,g){var k=this._get(a,"changeMonth"),l=this._get(a,"changeYear"),u=this._get(a,"showMonthAfterYear"),j='<div class="ui-datepicker-title">',o="";if(h||!k)o+='<span class="ui-datepicker-month">'+i[b]+"</span>";else{i=e&&e.getFullYear()==c;var m=f&&f.getFullYear()==c;o+='<select class="ui-datepicker-month" onchange="DP_jQuery_'+y+".datepicker._selectMonthYear('#"+a.id+"', this, 'M');\" onclick=\"DP_jQuery_"+y+".datepicker._clickMonthYear('#"+  
a.id+"');\">";for(var n=0;n<12;n++)if((!i||n>=e.getMonth())&&(!m||n<=f.getMonth()))o+='<option value="'+n+'"'+(n==b?' selected="selected"':"")+">"+g[n]+"</option>";o+="</select>"}u||(j+=o+(h||!(k&&l)?"&#xa0;":""));if(h||!l)j+='<span class="ui-datepicker-year">'+c+"</span>";else{g=this._get(a,"yearRange").split(":");var r=(new Date).getFullYear();i=function(s){s=s.match(/c[+-].*/)?c+parseInt(s.substring(1),10):s.match(/[+-].*/)?r+parseInt(s,10):parseInt(s,10);return isNaN(s)?r:s};b=i(g[0]);g=Math.max(b,  
i(g[1]||""));b=e?Math.max(b,e.getFullYear()):b;g=f?Math.min(g,f.getFullYear()):g;for(j+='<select class="ui-datepicker-year" onchange="DP_jQuery_'+y+".datepicker._selectMonthYear('#"+a.id+"', this, 'Y');\" onclick=\"DP_jQuery_"+y+".datepicker._clickMonthYear('#"+a.id+"');\">";b<=g;b++)j+='<option value="'+b+'"'+(b==c?' selected="selected"':"")+">"+b+"</option>";j+="</select>"}j+=this._get(a,"yearSuffix");if(u)j+=(h||!(k&&l)?"&#xa0;":"")+o;j+="</div>";return j},_adjustInstDate:function(a,b,c){var e=  
a.drawYear+(c=="Y"?b:0),f=a.drawMonth+(c=="M"?b:0);b=Math.min(a.selectedDay,this._getDaysInMonth(e,f))+(c=="D"?b:0);e=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(e,f,b)));a.selectedDay=e.getDate();a.drawMonth=a.selectedMonth=e.getMonth();a.drawYear=a.selectedYear=e.getFullYear();if(c=="M"||c=="Y")this._notifyChange(a)},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");b=c&&b<c?c:b;return b=a&&b>a?a:b},_notifyChange:function(a){var b=this._get(a,  
"onChangeMonthYear");if(b)b.apply(a.input?a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){a=this._get(a,"numberOfMonths");return a==null?[1,1]:typeof a=="number"?[1,a]:a},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null)},_getDaysInMonth:function(a,b){return 32-(new Date(a,b,32)).getDate()},_getFirstDayOfMonth:function(a,b){return(new Date(a,b,1)).getDay()},_canAdjustMonth:function(a,b,c,e){var f=this._getNumberOfMonths(a);  
c=this._daylightSavingAdjust(new Date(c,e+(b<0?b:f[0]*f[1]),1));b<0&&c.setDate(this._getDaysInMonth(c.getFullYear(),c.getMonth()));return this._isInRange(a,c)},_isInRange:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");return(!c||b.getTime()>=c.getTime())&&(!a||b.getTime()<=a.getTime())},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff");b=typeof b!="string"?b:(new Date).getFullYear()%100+parseInt(b,10);return{shortYearCutoff:b,dayNamesShort:this._get(a,  
"dayNamesShort"),dayNames:this._get(a,"dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,b,c,e){if(!b){a.currentDay=a.selectedDay;a.currentMonth=a.selectedMonth;a.currentYear=a.selectedYear}b=b?typeof b=="object"?b:this._daylightSavingAdjust(new Date(e,c,b)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),b,this._getFormatConfig(a))}});d.fn.datepicker=  
function(a){if(!d.datepicker.initialized){d(document).mousedown(d.datepicker._checkExternalClick).find("body").append(d.datepicker.dpDiv);d.datepicker.initialized=true}var b=Array.prototype.slice.call(arguments,1);if(typeof a=="string"&&(a=="isDisabled"||a=="getDate"||a=="widget"))return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this[0]].concat(b));if(a=="option"&&arguments.length==2&&typeof arguments[1]=="string")return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this[0]].concat(b));  
return this.each(function(){typeof a=="string"?d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this].concat(b)):d.datepicker._attachDatepicker(this,a)})};d.datepicker=new L;d.datepicker.initialized=false;d.datepicker.uuid=(new Date).getTime();d.datepicker.version="1.8.5";window["DP_jQuery_"+y]=d})(jQuery);  
;  
file:a/busui/js/jquery-1.5.js (deleted)
/*!  
* jQuery JavaScript Library v1.5  
* http://jquery.com/  
*  
* Copyright 2011, John Resig  
* Dual licensed under the MIT or GPL Version 2 licenses.  
* http://jquery.org/license  
*  
* Includes Sizzle.js  
* http://sizzlejs.com/  
* Copyright 2011, The Dojo Foundation  
* Released under the MIT, BSD, and GPL Licenses.  
*  
* Date: Mon Jan 31 08:31:29 2011 -0500  
*/  
(function( window, undefined ) {  
 
// Use the correct document accordingly with window argument (sandbox)  
var document = window.document;  
var jQuery = (function() {  
 
// Define a local copy of jQuery  
var jQuery = function( selector, context ) {  
// The jQuery object is actually just the init constructor 'enhanced'  
return new jQuery.fn.init( selector, context, rootjQuery );  
},  
 
// Map over jQuery in case of overwrite  
_jQuery = window.jQuery,  
 
// Map over the $ in case of overwrite  
_$ = window.$,  
 
// A central reference to the root jQuery(document)  
rootjQuery,  
 
// A simple way to check for HTML strings or ID strings  
// (both of which we optimize for)  
quickExpr = /^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,  
 
// Check if a string has a non-whitespace character in it  
rnotwhite = /\S/,  
 
// Used for trimming whitespace  
trimLeft = /^\s+/,  
trimRight = /\s+$/,  
 
// Check for digits  
rdigit = /\d/,  
 
// Match a standalone tag  
rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,  
 
// JSON RegExp  
rvalidchars = /^[\],:{}\s]*$/,  
rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,  
rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,  
rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,  
 
// Useragent RegExp  
rwebkit = /(webkit)[ \/]([\w.]+)/,  
ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/,  
rmsie = /(msie) ([\w.]+)/,  
rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/,  
 
// Keep a UserAgent string for use with jQuery.browser  
userAgent = navigator.userAgent,  
 
// For matching the engine and version of the browser  
browserMatch,  
 
// Has the ready events already been bound?  
readyBound = false,  
 
// The deferred used on DOM ready  
readyList,  
 
// Promise methods  
promiseMethods = "then done fail isResolved isRejected promise".split( " " ),  
 
// The ready event handler  
DOMContentLoaded,  
 
// Save a reference to some core methods  
toString = Object.prototype.toString,  
hasOwn = Object.prototype.hasOwnProperty,  
push = Array.prototype.push,  
slice = Array.prototype.slice,  
trim = String.prototype.trim,  
indexOf = Array.prototype.indexOf,  
 
// [[Class]] -> type pairs  
class2type = {};  
 
jQuery.fn = jQuery.prototype = {  
constructor: jQuery,  
init: function( selector, context, rootjQuery ) {  
var match, elem, ret, doc;  
 
// Handle $(""), $(null), or $(undefined)  
if ( !selector ) {  
return this;  
}  
 
// Handle $(DOMElement)  
if ( selector.nodeType ) {  
this.context = this[0] = selector;  
this.length = 1;  
return this;  
}  
 
// The body element only exists once, optimize finding it  
if ( selector === "body" && !context && document.body ) {  
this.context = document;  
this[0] = document.body;  
this.selector = "body";  
this.length = 1;  
return this;  
}  
 
// Handle HTML strings  
if ( typeof selector === "string" ) {  
// Are we dealing with HTML string or an ID?  
match = quickExpr.exec( selector );  
 
// Verify a match, and that no context was specified for #id  
if ( match && (match[1] || !context) ) {  
 
// HANDLE: $(html) -> $(array)  
if ( match[1] ) {  
context = context instanceof jQuery ? context[0] : context;  
doc = (context ? context.ownerDocument || context : document);  
 
// If a single string is passed in and it's a single tag  
// just do a createElement and skip the rest  
ret = rsingleTag.exec( selector );  
 
if ( ret ) {  
if ( jQuery.isPlainObject( context ) ) {  
selector = [ document.createElement( ret[1] ) ];  
jQuery.fn.attr.call( selector, context, true );  
 
} else {  
selector = [ doc.createElement( ret[1] ) ];  
}  
 
} else {  
ret = jQuery.buildFragment( [ match[1] ], [ doc ] );  
selector = (ret.cacheable ? jQuery.clone(ret.fragment) : ret.fragment).childNodes;  
}  
 
return jQuery.merge( this, selector );  
 
// HANDLE: $("#id")  
} else {  
elem = document.getElementById( match[2] );  
 
// Check parentNode to catch when Blackberry 4.6 returns  
// nodes that are no longer in the document #6963  
if ( elem && elem.parentNode ) {  
// Handle the case where IE and Opera return items  
// by name instead of ID  
if ( elem.id !== match[2] ) {  
return rootjQuery.find( selector );  
}  
 
// Otherwise, we inject the element directly into the jQuery object  
this.length = 1;  
this[0] = elem;  
}  
 
this.context = document;  
this.selector = selector;  
return this;  
}  
 
// HANDLE: $(expr, $(...))  
} else if ( !context || context.jquery ) {  
return (context || rootjQuery).find( selector );  
 
// HANDLE: $(expr, context)  
// (which is just equivalent to: $(context).find(expr)  
} else {  
return this.constructor( context ).find( selector );  
}  
 
// HANDLE: $(function)  
// Shortcut for document ready  
} else if ( jQuery.isFunction( selector ) ) {  
return rootjQuery.ready( selector );  
}  
 
if (selector.selector !== undefined) {  
this.selector = selector.selector;  
this.context = selector.context;  
}  
 
return jQuery.makeArray( selector, this );  
},  
 
// Start with an empty selector  
selector: "",  
 
// The current version of jQuery being used  
jquery: "1.5",  
 
// The default length of a jQuery object is 0  
length: 0,  
 
// The number of elements contained in the matched element set  
size: function() {  
return this.length;  
},  
 
toArray: function() {  
return slice.call( this, 0 );  
},  
 
// Get the Nth element in the matched element set OR  
// Get the whole matched element set as a clean array  
get: function( num ) {  
return num == null ?  
 
// Return a 'clean' array  
this.toArray() :  
 
// Return just the object  
( num < 0 ? this[ this.length + num ] : this[ num ] );  
},  
 
// Take an array of elements and push it onto the stack  
// (returning the new matched element set)  
pushStack: function( elems, name, selector ) {  
// Build a new jQuery matched element set  
var ret = this.constructor();  
 
if ( jQuery.isArray( elems ) ) {  
push.apply( ret, elems );  
 
} else {  
jQuery.merge( ret, elems );  
}  
 
// Add the old object onto the stack (as a reference)  
ret.prevObject = this;  
 
ret.context = this.context;  
 
if ( name === "find" ) {  
ret.selector = this.selector + (this.selector ? " " : "") + selector;  
} else if ( name ) {  
ret.selector = this.selector + "." + name + "(" + selector + ")";  
}  
 
// Return the newly-formed element set  
return ret;  
},  
 
// Execute a callback for every element in the matched set.  
// (You can seed the arguments with an array of args, but this is  
// only used internally.)  
each: function( callback, args ) {  
return jQuery.each( this, callback, args );  
},  
 
ready: function( fn ) {  
// Attach the listeners  
jQuery.bindReady();  
 
// Add the callback  
readyList.done( fn );  
 
return this;  
},  
 
eq: function( i ) {  
return i === -1 ?  
this.slice( i ) :  
this.slice( i, +i + 1 );  
},  
 
first: function() {  
return this.eq( 0 );  
},  
 
last: function() {  
return this.eq( -1 );  
},  
 
slice: function() {  
return this.pushStack( slice.apply( this, arguments ),  
"slice", slice.call(arguments).join(",") );  
},  
 
map: function( callback ) {  
return this.pushStack( jQuery.map(this, function( elem, i ) {  
return callback.call( elem, i, elem );  
}));  
},  
 
end: function() {  
return this.prevObject || this.constructor(null);  
},  
 
// For internal use only.  
// Behaves like an Array's method, not like a jQuery method.  
push: push,  
sort: [].sort,  
splice: [].splice  
};  
 
// Give the init function the jQuery prototype for later instantiation  
jQuery.fn.init.prototype = jQuery.fn;  
 
jQuery.extend = jQuery.fn.extend = function() {  
var options, name, src, copy, copyIsArray, clone,  
target = arguments[0] || {},  
i = 1,  
length = arguments.length,  
deep = false;  
 
// Handle a deep copy situation  
if ( typeof target === "boolean" ) {  
deep = target;  
target = arguments[1] || {};  
// skip the boolean and the target  
i = 2;  
}  
 
// Handle case when target is a string or something (possible in deep copy)  
if ( typeof target !== "object" && !jQuery.isFunction(target) ) {  
target = {};  
}  
 
// extend jQuery itself if only one argument is passed  
if ( length === i ) {  
target = this;  
--i;  
}  
 
for ( ; i < length; i++ ) {  
// Only deal with non-null/undefined values  
if ( (options = arguments[ i ]) != null ) {  
// Extend the base object  
for ( name in options ) {  
src = target[ name ];  
copy = options[ name ];  
 
// Prevent never-ending loop  
if ( target === copy ) {  
continue;  
}  
 
// Recurse if we're merging plain objects or arrays  
if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {  
if ( copyIsArray ) {  
copyIsArray = false;  
clone = src && jQuery.isArray(src) ? src : [];  
 
} else {  
clone = src && jQuery.isPlainObject(src) ? src : {};  
}  
 
// Never move original objects, clone them  
target[ name ] = jQuery.extend( deep, clone, copy );  
 
// Don't bring in undefined values  
} else if ( copy !== undefined ) {  
target[ name ] = copy;  
}  
}  
}  
}  
 
// Return the modified object  
return target;  
};  
 
jQuery.extend({  
noConflict: function( deep ) {  
window.$ = _$;  
 
if ( deep ) {  
window.jQuery = _jQuery;  
}  
 
return jQuery;  
},  
 
// Is the DOM ready to be used? Set to true once it occurs.  
isReady: false,  
 
// A counter to track how many items to wait for before  
// the ready event fires. See #6781  
readyWait: 1,  
 
// Handle when the DOM is ready  
ready: function( wait ) {  
// A third-party is pushing the ready event forwards  
if ( wait === true ) {  
jQuery.readyWait--;  
}  
 
// Make sure that the DOM is not already loaded  
if ( !jQuery.readyWait || (wait !== true && !jQuery.isReady) ) {  
// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).  
if ( !document.body ) {  
return setTimeout( jQuery.ready, 1 );  
}  
 
// Remember that the DOM is ready  
jQuery.isReady = true;  
 
// If a normal DOM Ready event fired, decrement, and wait if need be  
if ( wait !== true && --jQuery.readyWait > 0 ) {  
return;  
}  
 
// If there are functions bound, to execute  
readyList.resolveWith( document, [ jQuery ] );  
 
// Trigger any bound ready events  
if ( jQuery.fn.trigger ) {  
jQuery( document ).trigger( "ready" ).unbind( "ready" );  
}  
}  
},  
 
bindReady: function() {  
if ( readyBound ) {  
return;  
}  
 
readyBound = true;  
 
// Catch cases where $(document).ready() is called after the  
// browser event has already occurred.  
if ( document.readyState === "complete" ) {  
// Handle it asynchronously to allow scripts the opportunity to delay ready  
return setTimeout( jQuery.ready, 1 );  
}  
 
// Mozilla, Opera and webkit nightlies currently support this event  
if ( document.addEventListener ) {  
// Use the handy event callback  
document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false );  
 
// A fallback to window.onload, that will always work  
window.addEventListener( "load", jQuery.ready, false );  
 
// If IE event model is used  
} else if ( document.attachEvent ) {  
// ensure firing before onload,  
// maybe late but safe also for iframes  
document.attachEvent("onreadystatechange", DOMContentLoaded);  
 
// A fallback to window.onload, that will always work  
window.attachEvent( "onload", jQuery.ready );  
 
// If IE and not a frame  
// continually check to see if the document is ready  
var toplevel = false;  
 
try {  
toplevel = window.frameElement == null;  
} catch(e) {}  
 
if ( document.documentElement.doScroll && toplevel ) {  
doScrollCheck();  
}  
}  
},  
 
// See test/unit/core.js for details concerning isFunction.  
// Since version 1.3, DOM methods and functions like alert  
// aren't supported. They return false on IE (#2968).  
isFunction: function( obj ) {  
return jQuery.type(obj) === "function";  
},  
 
isArray: Array.isArray || function( obj ) {  
return jQuery.type(obj) === "array";  
},  
 
// A crude way of determining if an object is a window  
isWindow: function( obj ) {  
return obj && typeof obj === "object" && "setInterval" in obj;  
},  
 
isNaN: function( obj ) {  
return obj == null || !rdigit.test( obj ) || isNaN( obj );  
},  
 
type: function( obj ) {  
return obj == null ?  
String( obj ) :  
class2type[ toString.call(obj) ] || "object";  
},  
 
isPlainObject: function( obj ) {  
// Must be an Object.  
// Because of IE, we also have to check the presence of the constructor property.  
// Make sure that DOM nodes and window objects don't pass through, as well  
if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {  
return false;  
}  
 
// Not own constructor property must be Object  
if ( obj.constructor &&  
!hasOwn.call(obj, "constructor") &&  
!hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {  
return false;  
}  
 
// Own properties are enumerated firstly, so to speed up,  
// if last one is own, then all properties are own.  
 
var key;  
for ( key in obj ) {}  
 
return key === undefined || hasOwn.call( obj, key );  
},  
 
isEmptyObject: function( obj ) {  
for ( var name in obj ) {  
return false;  
}  
return true;  
},  
 
error: function( msg ) {  
throw msg;  
},  
 
parseJSON: function( data ) {  
if ( typeof data !== "string" || !data ) {  
return null;  
}  
 
// Make sure leading/trailing whitespace is removed (IE can't handle it)  
data = jQuery.trim( data );  
 
// Make sure the incoming data is actual JSON  
// Logic borrowed from http://json.org/json2.js  
if ( rvalidchars.test(data.replace(rvalidescape, "@")  
.replace(rvalidtokens, "]")  
.replace(rvalidbraces, "")) ) {  
 
// Try to use the native JSON parser first  
return window.JSON && window.JSON.parse ?  
window.JSON.parse( data ) :  
(new Function("return " + data))();  
 
} else {  
jQuery.error( "Invalid JSON: " + data );  
}  
},  
 
// Cross-browser xml parsing  
// (xml & tmp used internally)  
parseXML: function( data , xml , tmp ) {  
 
if ( window.DOMParser ) { // Standard  
tmp = new DOMParser();  
xml = tmp.parseFromString( data , "text/xml" );  
} else { // IE  
xml = new ActiveXObject( "Microsoft.XMLDOM" );  
xml.async = "false";  
xml.loadXML( data );  
}  
 
tmp = xml.documentElement;  
 
if ( ! tmp || ! tmp.nodeName || tmp.nodeName === "parsererror" ) {  
jQuery.error( "Invalid XML: " + data );  
}  
 
return xml;  
},  
 
noop: function() {},  
 
// Evalulates a script in a global context  
globalEval: function( data ) {  
if ( data && rnotwhite.test(data) ) {  
// Inspired by code by Andrea Giammarchi  
// http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html  
var head = document.getElementsByTagName("head")[0] || document.documentElement,  
script = document.createElement("script");  
 
script.type = "text/javascript";  
 
if ( jQuery.support.scriptEval() ) {  
script.appendChild( document.createTextNode( data ) );  
} else {  
script.text = data;  
}  
 
// Use insertBefore instead of appendChild to circumvent an IE6 bug.  
// This arises when a base node is used (#2709).  
head.insertBefore( script, head.firstChild );  
head.removeChild( script );  
}  
},  
 
nodeName: function( elem, name ) {  
return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase();  
},  
 
// args is for internal usage only  
each: function( object, callback, args ) {  
var name, i = 0,  
length = object.length,  
isObj = length === undefined || jQuery.isFunction(object);  
 
if ( args ) {  
if ( isObj ) {  
for ( name in object ) {  
if ( callback.apply( object[ name ], args ) === false ) {  
break;  
}  
}  
} else {  
for ( ; i < length; ) {  
if ( callback.apply( object[ i++ ], args ) === false ) {  
break;  
}  
}  
}  
 
// A special, fast, case for the most common use of each  
} else {  
if ( isObj ) {  
for ( name in object ) {  
if ( callback.call( object[ name ], name, object[ name ] ) === false ) {  
break;  
}  
}  
} else {  
for ( var value = object[0];  
i < length && callback.call( value, i, value ) !== false; value = object[++i] ) {}  
}  
}  
 
return object;  
},  
 
// Use native String.trim function wherever possible  
trim: trim ?  
function( text ) {  
return text == null ?  
"" :  
trim.call( text );  
} :  
 
// Otherwise use our own trimming functionality  
function( text ) {  
return text == null ?  
"" :  
text.toString().replace( trimLeft, "" ).replace( trimRight, "" );  
},  
 
// results is for internal usage only  
makeArray: function( array, results ) {  
var ret = results || [];  
 
if ( array != null ) {  
// The window, strings (and functions) also have 'length'  
// The extra typeof function check is to prevent crashes  
// in Safari 2 (See: #3039)  
// Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930  
var type = jQuery.type(array);  
 
if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) {  
push.call( ret, array );  
} else {  
jQuery.merge( ret, array );  
}  
}  
 
return ret;  
},  
 
inArray: function( elem, array ) {  
if ( array.indexOf ) {  
return array.indexOf( elem );  
}  
 
for ( var i = 0, length = array.length; i < length; i++ ) {  
if ( array[ i ] === elem ) {  
return i;  
}  
}  
 
return -1;  
},  
 
merge: function( first, second ) {  
var i = first.length,  
j = 0;  
 
if ( typeof second.length === "number" ) {  
for ( var l = second.length; j < l; j++ ) {  
first[ i++ ] = second[ j ];  
}  
 
} else {  
while ( second[j] !== undefined ) {  
first[ i++ ] = second[ j++ ];  
}  
}  
 
first.length = i;  
 
return first;  
},  
 
grep: function( elems, callback, inv ) {  
var ret = [], retVal;  
inv = !!inv;  
 
// Go through the array, only saving the items  
// that pass the validator function  
for ( var i = 0, length = elems.length; i < length; i++ ) {  
retVal = !!callback( elems[ i ], i );  
if ( inv !== retVal ) {  
ret.push( elems[ i ] );  
}  
}  
 
return ret;  
},  
 
// arg is for internal usage only  
map: function( elems, callback, arg ) {  
var ret = [], value;  
 
// Go through the array, translating each of the items to their  
// new value (or values).  
for ( var i = 0, length = elems.length; i < length; i++ ) {  
value = callback( elems[ i ], i, arg );  
 
if ( value != null ) {  
ret[ ret.length ] = value;  
}  
}  
 
// Flatten any nested arrays  
return ret.concat.apply( [], ret );  
},  
 
// A global GUID counter for objects  
guid: 1,  
 
proxy: function( fn, proxy, thisObject ) {  
if ( arguments.length === 2 ) {  
if ( typeof proxy === "string" ) {  
thisObject = fn;  
fn = thisObject[ proxy ];  
proxy = undefined;  
 
} else if ( proxy && !jQuery.isFunction( proxy ) ) {  
thisObject = proxy;  
proxy = undefined;  
}  
}  
 
if ( !proxy && fn ) {  
proxy = function() {  
return fn.apply( thisObject || this, arguments );  
};  
}  
 
// Set the guid of unique handler to the same of original handler, so it can be removed  
if ( fn ) {  
proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++;  
}  
 
// So proxy can be declared as an argument  
return proxy;  
},  
 
// Mutifunctional method to get and set values to a collection  
// The value/s can be optionally by executed if its a function  
access: function( elems, key, value, exec, fn, pass ) {  
var length = elems.length;  
 
// Setting many attributes  
if ( typeof key === "object" ) {  
for ( var k in key ) {  
jQuery.access( elems, k, key[k], exec, fn, value );  
}  
return elems;  
}  
 
// Setting one attribute  
if ( value !== undefined ) {  
// Optionally, function values get executed if exec is true  
exec = !pass && exec && jQuery.isFunction(value);  
 
for ( var i = 0; i < length; i++ ) {  
fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass );  
}  
 
return elems;  
}  
 
// Getting an attribute  
return length ? fn( elems[0], key ) : undefined;  
},  
 
now: function() {  
return (new Date()).getTime();  
},  
 
// Create a simple deferred (one callbacks list)  
_Deferred: function() {  
var // callbacks list  
callbacks = [],  
// stored [ context , args ]  
fired,  
// to avoid firing when already doing so  
firing,  
// flag to know if the deferred has been cancelled  
cancelled,  
// the deferred itself  
deferred = {  
 
// done( f1, f2, ...)  
done: function() {  
if ( !cancelled ) {  
var args = arguments,  
i,  
length,  
elem,  
type,  
_fired;  
if ( fired ) {  
_fired = fired;  
fired = 0;  
}  
for ( i = 0, length = args.length; i < length; i++ ) {  
elem = args[ i ];  
type = jQuery.type( elem );  
if ( type === "array" ) {  
deferred.done.apply( deferred, elem );  
} else if ( type === "function" ) {  
callbacks.push( elem );  
}  
}  
if ( _fired ) {  
deferred.resolveWith( _fired[ 0 ], _fired[ 1 ] );  
}  
}  
return this;  
},  
 
// resolve with given context and args  
resolveWith: function( context, args ) {  
if ( !cancelled && !fired && !firing ) {  
firing = 1;  
try {  
while( callbacks[ 0 ] ) {  
callbacks.shift().apply( context, args );  
}  
}  
finally {  
fired = [ context, args ];  
firing = 0;  
}  
}  
return this;  
},  
 
// resolve with this as context and given arguments  
resolve: function() {  
deferred.resolveWith( jQuery.isFunction( this.promise ) ? this.promise() : this, arguments );  
return this;  
},  
 
// Has this deferred been resolved?  
isResolved: function() {  
return !!( firing || fired );  
},  
 
// Cancel  
cancel: function() {  
cancelled = 1;  
callbacks = [];  
return this;  
}  
};  
 
return deferred;  
},  
 
// Full fledged deferred (two callbacks list)  
Deferred: function( func ) {  
var deferred = jQuery._Deferred(),  
failDeferred = jQuery._Deferred(),  
promise;  
// Add errorDeferred methods, then and promise  
jQuery.extend( deferred, {  
then: function( doneCallbacks, failCallbacks ) {  
deferred.done( doneCallbacks ).fail( failCallbacks );  
return this;  
},  
fail: failDeferred.done,  
rejectWith: failDeferred.resolveWith,  
reject: failDeferred.resolve,  
isRejected: failDeferred.isResolved,  
// Get a promise for this deferred  
// If obj is provided, the promise aspect is added to the object  
promise: function( obj , i /* internal */ ) {  
if ( obj == null ) {  
if ( promise ) {  
return promise;  
}  
promise = obj = {};  
}  
i = promiseMethods.length;  
while( i-- ) {  
obj[ promiseMethods[ i ] ] = deferred[ promiseMethods[ i ] ];  
}  
return obj;  
}  
} );  
// Make sure only one callback list will be used  
deferred.then( failDeferred.cancel, deferred.cancel );  
// Unexpose cancel  
delete deferred.cancel;  
// Call given func if any  
if ( func ) {  
func.call( deferred, deferred );  
}  
return deferred;  
},  
 
// Deferred helper  
when: function( object ) {  
var args = arguments,  
length = args.length,  
deferred = length <= 1 && object && jQuery.isFunction( object.promise ) ?  
object :  
jQuery.Deferred(),  
promise = deferred.promise(),  
resolveArray;  
 
if ( length > 1 ) {  
resolveArray = new Array( length );  
jQuery.each( args, function( index, element ) {  
jQuery.when( element ).then( function( value ) {  
resolveArray[ index ] = arguments.length > 1 ? slice.call( arguments, 0 ) : value;  
if( ! --length ) {  
deferred.resolveWith( promise, resolveArray );  
}  
}, deferred.reject );  
} );  
} else if ( deferred !== object ) {  
deferred.resolve( object );  
}  
return promise;  
},  
 
// Use of jQuery.browser is frowned upon.  
// More details: http://docs.jquery.com/Utilities/jQuery.browser  
uaMatch: function( ua ) {  
ua = ua.toLowerCase();  
 
var match = rwebkit.exec( ua ) ||  
ropera.exec( ua ) ||  
rmsie.exec( ua ) ||  
ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) ||  
[];  
 
return { browser: match[1] || "", version: match[2] || "0" };  
},  
 
sub: function() {  
function jQuerySubclass( selector, context ) {  
return new jQuerySubclass.fn.init( selector, context );  
}  
jQuery.extend( true, jQuerySubclass, this );  
jQuerySubclass.superclass = this;  
jQuerySubclass.fn = jQuerySubclass.prototype = this();  
jQuerySubclass.fn.constructor = jQuerySubclass;  
jQuerySubclass.subclass = this.subclass;  
jQuerySubclass.fn.init = function init( selector, context ) {  
if ( context && context instanceof jQuery && !(context instanceof jQuerySubclass) ) {  
context = jQuerySubclass(context);  
}  
 
return jQuery.fn.init.call( this, selector, context, rootjQuerySubclass );  
};  
jQuerySubclass.fn.init.prototype = jQuerySubclass.fn;  
var rootjQuerySubclass = jQuerySubclass(document);  
return jQuerySubclass;  
},  
 
browser: {}  
});  
 
// Create readyList deferred  
readyList = jQuery._Deferred();  
 
// Populate the class2type map  
jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) {  
class2type[ "[object " + name + "]" ] = name.toLowerCase();  
});  
 
browserMatch = jQuery.uaMatch( userAgent );  
if ( browserMatch.browser ) {  
jQuery.browser[ browserMatch.browser ] = true;  
jQuery.browser.version = browserMatch.version;  
}  
 
// Deprecated, use jQuery.browser.webkit instead  
if ( jQuery.browser.webkit ) {  
jQuery.browser.safari = true;  
}  
 
if ( indexOf ) {  
jQuery.inArray = function( elem, array ) {  
return indexOf.call( array, elem );  
};  
}  
 
// IE doesn't match non-breaking spaces with \s  
if ( rnotwhite.test( "\xA0" ) ) {  
trimLeft = /^[\s\xA0]+/;  
trimRight = /[\s\xA0]+$/;  
}  
 
// All jQuery objects should point back to these  
rootjQuery = jQuery(document);  
 
// Cleanup functions for the document ready method  
if ( document.addEventListener ) {  
DOMContentLoaded = function() {  
document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );  
jQuery.ready();  
};  
 
} else if ( document.attachEvent ) {  
DOMContentLoaded = function() {  
// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).  
if ( document.readyState === "complete" ) {  
document.detachEvent( "onreadystatechange", DOMContentLoaded );  
jQuery.ready();  
}  
};  
}  
 
// The DOM ready check for Internet Explorer  
function doScrollCheck() {  
if ( jQuery.isReady ) {  
return;  
}  
 
try {  
// If IE is used, use the trick by Diego Perini  
// http://javascript.nwbox.com/IEContentLoaded/  
document.documentElement.doScroll("left");  
} catch(e) {  
setTimeout( doScrollCheck, 1 );  
return;  
}  
 
// and execute any waiting functions  
jQuery.ready();  
}  
 
// Expose jQuery to the global object  
return (window.jQuery = window.$ = jQuery);  
 
})();  
 
 
(function() {  
 
jQuery.support = {};  
 
var div = document.createElement("div");  
 
div.style.display = "none";  
div.innerHTML = " <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";  
 
var all = div.getElementsByTagName("*"),  
a = div.getElementsByTagName("a")[0],  
select = document.createElement("select"),  
opt = select.appendChild( document.createElement("option") );  
 
// Can't get basic test support  
if ( !all || !all.length || !a ) {  
return;  
}  
 
jQuery.support = {  
// IE strips leading whitespace when .innerHTML is used  
leadingWhitespace: div.firstChild.nodeType === 3,  
 
// Make sure that tbody elements aren't automatically inserted  
// IE will insert them into empty tables  
tbody: !div.getElementsByTagName("tbody").length,  
 
// Make sure that link elements get serialized correctly by innerHTML  
// This requires a wrapper element in IE  
htmlSerialize: !!div.getElementsByTagName("link").length,  
 
// Get the style information from getAttribute  
// (IE uses .cssText insted)  
style: /red/.test( a.getAttribute("style") ),  
 
// Make sure that URLs aren't manipulated  
// (IE normalizes it by default)  
hrefNormalized: a.getAttribute("href") === "/a",  
 
// Make sure that element opacity exists  
// (IE uses filter instead)  
// Use a regex to work around a WebKit issue. See #5145  
opacity: /^0.55$/.test( a.style.opacity ),  
 
// Verify style float existence  
// (IE uses styleFloat instead of cssFloat)  
cssFloat: !!a.style.cssFloat,  
 
// Make sure that if no value is specified for a checkbox  
// that it defaults to "on".  
// (WebKit defaults to "" instead)  
checkOn: div.getElementsByTagName("input")[0].value === "on",  
 
// Make sure that a selected-by-default option has a working selected property.  
// (WebKit defaults to false instead of true, IE too, if it's in an optgroup)  
optSelected: opt.selected,  
 
// Will be defined later  
deleteExpando: true,  
optDisabled: false,  
checkClone: false,  
_scriptEval: null,  
noCloneEvent: true,  
boxModel: null,  
inlineBlockNeedsLayout: false,  
shrinkWrapBlocks: false,  
reliableHiddenOffsets: true  
};  
 
// Make sure that the options inside disabled selects aren't marked as disabled  
// (WebKit marks them as diabled)  
select.disabled = true;  
jQuery.support.optDisabled = !opt.disabled;  
 
jQuery.support.scriptEval = function() {  
if ( jQuery.support._scriptEval === null ) {  
var root = document.documentElement,  
script = document.createElement("script"),  
id = "script" + jQuery.now();  
 
script.type = "text/javascript";  
try {  
script.appendChild( document.createTextNode( "window." + id + "=1;" ) );  
} catch(e) {}  
 
root.insertBefore( script, root.firstChild );  
 
// Make sure that the execution of code works by injecting a script  
// tag with appendChild/createTextNode  
// (IE doesn't support this, fails, and uses .text instead)  
if ( window[ id ] ) {  
jQuery.support._scriptEval = true;  
delete window[ id ];  
} else {  
jQuery.support._scriptEval = false;  
}  
 
root.removeChild( script );  
// release memory in IE  
root = script = id = null;  
}  
 
return jQuery.support._scriptEval;  
};  
 
// Test to see if it's possible to delete an expando from an element  
// Fails in Internet Explorer  
try {  
delete div.test;  
 
} catch(e) {  
jQuery.support.deleteExpando = false;  
}  
 
if ( div.attachEvent && div.fireEvent ) {  
div.attachEvent("onclick", function click() {  
// Cloning a node shouldn't copy over any  
// bound event handlers (IE does this)  
jQuery.support.noCloneEvent = false;  
div.detachEvent("onclick", click);  
});  
div.cloneNode(true).fireEvent("onclick");  
}  
 
div = document.createElement("div");  
div.innerHTML = "<input type='radio' name='radiotest' checked='checked'/>";  
 
var fragment = document.createDocumentFragment();  
fragment.appendChild( div.firstChild );  
 
// WebKit doesn't clone checked state correctly in fragments  
jQuery.support.checkClone = fragment.cloneNode(true).cloneNode(true).lastChild.checked;  
 
// Figure out if the W3C box model works as expected  
// document.body must exist before we can do this  
jQuery(function() {  
var div = document.createElement("div"),  
body = document.getElementsByTagName("body")[0];  
 
// Frameset documents with no body should not run this code  
if ( !body ) {  
return;  
}  
 
div.style.width = div.style.paddingLeft = "1px";  
body.appendChild( div );  
jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2;  
 
if ( "zoom" in div.style ) {  
// Check if natively block-level elements act like inline-block  
// elements when setting their display to 'inline' and giving  
// them layout  
// (IE < 8 does this)  
div.style.display = "inline";  
div.style.zoom = 1;  
jQuery.support.inlineBlockNeedsLayout = div.offsetWidth === 2;  
 
// Check if elements with layout shrink-wrap their children  
// (IE 6 does this)  
div.style.display = "";  
div.innerHTML = "<div style='width:4px;'></div>";  
jQuery.support.shrinkWrapBlocks = div.offsetWidth !== 2;  
}  
 
div.innerHTML = "<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>";  
var tds = div.getElementsByTagName("td");  
 
// Check if table cells still have offsetWidth/Height when they are set  
// to display:none and there are still other visible table cells in a  
// table row; if so, offsetWidth/Height are not reliable for use when  
// determining if an element has been hidden directly using  
// display:none (it is still safe to use offsets if a parent element is  
// hidden; don safety goggles and see bug #4512 for more information).  
// (only IE 8 fails this test)  
jQuery.support.reliableHiddenOffsets = tds[0].offsetHeight === 0;  
 
tds[0].style.display = "";  
tds[1].style.display = "none";  
 
// Check if empty table cells still have offsetWidth/Height  
// (IE < 8 fail this test)  
jQuery.support.reliableHiddenOffsets = jQuery.support.reliableHiddenOffsets && tds[0].offsetHeight === 0;  
div.innerHTML = "";  
 
body.removeChild( div ).style.display = "none";  
div = tds = null;  
});  
 
// Technique from Juriy Zaytsev  
// http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/  
var eventSupported = function( eventName ) {  
var el = document.createElement("div");  
eventName = "on" + eventName;  
 
// We only care about the case where non-standard event systems  
// are used, namely in IE. Short-circuiting here helps us to  
// avoid an eval call (in setAttribute) which can cause CSP  
// to go haywire. See: https://developer.mozilla.org/en/Security/CSP  
if ( !el.attachEvent ) {  
return true;  
}  
 
var isSupported = (eventName in el);  
if ( !isSupported ) {  
el.setAttribute(eventName, "return;");  
isSupported = typeof el[eventName] === "function";  
}  
el = null;  
 
return isSupported;  
};  
 
jQuery.support.submitBubbles = eventSupported("submit");  
jQuery.support.changeBubbles = eventSupported("change");  
 
// release memory in IE  
div = all = a = null;  
})();  
 
 
 
var rbrace = /^(?:\{.*\}|\[.*\])$/;  
 
jQuery.extend({  
cache: {},  
 
// Please use with caution  
uuid: 0,  
 
// Unique for each copy of jQuery on the page  
// Non-digits removed to match rinlinejQuery  
expando: "jQuery" + ( jQuery.fn.jquery + Math.random() ).replace( /\D/g, "" ),  
 
// The following elements throw uncatchable exceptions if you  
// attempt to add expando properties to them.  
noData: {  
"embed": true,  
// Ban all objects except for Flash (which handle expandos)  
"object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",  
"applet": true  
},  
 
hasData: function( elem ) {  
elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];  
 
return !!elem && !jQuery.isEmptyObject(elem);  
},  
 
data: function( elem, name, data, pvt /* Internal Use Only */ ) {  
if ( !jQuery.acceptData( elem ) ) {  
return;  
}  
 
var internalKey = jQuery.expando, getByName = typeof name === "string", thisCache,  
 
// We have to handle DOM nodes and JS objects differently because IE6-7  
// can't GC object references properly across the DOM-JS boundary  
isNode = elem.nodeType,  
 
// Only DOM nodes need the global jQuery cache; JS object data is  
// attached directly to the object so GC can occur automatically  
cache = isNode ? jQuery.cache : elem,  
 
// Only defining an ID for JS objects if its cache already exists allows  
// the code to shortcut on the same path as a DOM node with no cache  
id = isNode ? elem[ jQuery.expando ] : elem[ jQuery.expando ] && jQuery.expando;  
 
// Avoid doing any more work than we need to when trying to get data on an  
// object that has no data at all  
if ( (!id || (pvt && id && !cache[ id ][ internalKey ])) && getByName && data === undefined ) {  
return;  
}  
 
if ( !id ) {  
// Only DOM nodes need a new unique ID for each element since their data  
// ends up in the global cache  
if ( isNode ) {  
elem[ jQuery.expando ] = id = ++jQuery.uuid;  
} else {  
id = jQuery.expando;  
}  
}  
 
if ( !cache[ id ] ) {  
cache[ id ] = {};  
}  
 
// An object can be passed to jQuery.data instead of a key/value pair; this gets  
// shallow copied over onto the existing cache  
if ( typeof name === "object" ) {  
if ( pvt ) {  
cache[ id ][ internalKey ] = jQuery.extend(cache[ id ][ internalKey ], name);  
} else {  
cache[ id ] = jQuery.extend(cache[ id ], name);  
}  
}  
 
thisCache = cache[ id ];  
 
// Internal jQuery data is stored in a separate object inside the object's data  
// cache in order to avoid key collisions between internal data and user-defined  
// data  
if ( pvt ) {  
if ( !thisCache[ internalKey ] ) {  
thisCache[ internalKey ] = {};  
}  
 
thisCache = thisCache[ internalKey ];  
}  
 
if ( data !== undefined ) {  
thisCache[ name ] = data;  
}  
 
// TODO: This is a hack for 1.5 ONLY. It will be removed in 1.6. Users should  
// not attempt to inspect the internal events object using jQuery.data, as this  
// internal data object is undocumented and subject to change.  
if ( name === "events" && !thisCache[name] ) {  
return thisCache[ internalKey ] && thisCache[ internalKey ].events;  
}  
 
return getByName ? thisCache[ name ] : thisCache;  
},  
 
removeData: function( elem, name, pvt /* Internal Use Only */ ) {  
if ( !jQuery.acceptData( elem ) ) {  
return;  
}  
 
var internalKey = jQuery.expando, isNode = elem.nodeType,  
 
// See jQuery.data for more information  
cache = isNode ? jQuery.cache : elem,  
 
// See jQuery.data for more information  
id = isNode ? elem[ jQuery.expando ] : jQuery.expando;  
 
// If there is already no cache entry for this object, there is no  
// purpose in continuing  
if ( !cache[ id ] ) {  
return;  
}  
 
if ( name ) {  
var thisCache = pvt ? cache[ id ][ internalKey ] : cache[ id ];  
 
if ( thisCache ) {  
delete thisCache[ name ];  
 
// If there is no data left in the cache, we want to continue  
// and let the cache object itself get destroyed  
if ( !jQuery.isEmptyObject(thisCache) ) {  
return;  
}  
}  
}  
 
// See jQuery.data for more information  
if ( pvt ) {  
delete cache[ id ][ internalKey ];  
 
// Don't destroy the parent cache unless the internal data object  
// had been the only thing left in it  
if ( !jQuery.isEmptyObject(cache[ id ]) ) {  
return;  
}  
}  
 
var internalCache = cache[ id ][ internalKey ];  
 
// Browsers that fail expando deletion also refuse to delete expandos on  
// the window, but it will allow it on all other JS objects; other browsers  
// don't care  
if ( jQuery.support.deleteExpando || cache != window ) {  
delete cache[ id ];  
} else {  
cache[ id ] = null;  
}  
 
// We destroyed the entire user cache at once because it's faster than  
// iterating through each key, but we need to continue to persist internal  
// data if it existed  
if ( internalCache ) {  
cache[ id ] = {};  
cache[ id ][ internalKey ] = internalCache;  
 
// Otherwise, we need to eliminate the expando on the node to avoid  
// false lookups in the cache for entries that no longer exist  
} else if ( isNode ) {  
// IE does not allow us to delete expando properties from nodes,  
// nor does it have a removeAttribute function on Document nodes;  
// we must handle all of these cases  
if ( jQuery.support.deleteExpando ) {  
delete elem[ jQuery.expando ];  
} else if ( elem.removeAttribute ) {  
elem.removeAttribute( jQuery.expando );  
} else {  
elem[ jQuery.expando ] = null;  
}  
}  
},  
 
// For internal use only.  
_data: function( elem, name, data ) {  
return jQuery.data( elem, name, data, true );  
},  
 
// A method for determining if a DOM node can handle the data expando  
acceptData: function( elem ) {  
if ( elem.nodeName ) {  
var match = jQuery.noData[ elem.nodeName.toLowerCase() ];  
 
if ( match ) {  
return !(match === true || elem.getAttribute("classid") !== match);  
}  
}  
 
return true;  
}  
});  
 
jQuery.fn.extend({  
data: function( key, value ) {  
var data = null;  
 
if ( typeof key === "undefined" ) {  
if ( this.length ) {  
data = jQuery.data( this[0] );  
 
if ( this[0].nodeType === 1 ) {  
var attr = this[0].attributes, name;  
for ( var i = 0, l = attr.length; i < l; i++ ) {  
name = attr[i].name;  
 
if ( name.indexOf( "data-" ) === 0 ) {  
name = name.substr( 5 );  
dataAttr( this[0], name, data[ name ] );  
}  
}  
}  
}  
 
return data;  
 
} else if ( typeof key === "object" ) {  
return this.each(function() {  
jQuery.data( this, key );  
});  
}  
 
var parts = key.split(".");  
parts[1] = parts[1] ? "." + parts[1] : "";  
 
if ( value === undefined ) {  
data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);  
 
// Try to fetch any internally stored data first  
if ( data === undefined && this.length ) {  
data = jQuery.data( this[0], key );  
data = dataAttr( this[0], key, data );  
}  
 
return data === undefined && parts[1] ?  
this.data( parts[0] ) :  
data;  
 
} else {  
return this.each(function() {  
var $this = jQuery( this ),  
args = [ parts[0], value ];  
 
$this.triggerHandler( "setData" + parts[1] + "!", args );  
jQuery.data( this, key, value );  
$this.triggerHandler( "changeData" + parts[1] + "!", args );  
});  
}  
},  
 
removeData: function( key ) {  
return this.each(function() {  
jQuery.removeData( this, key );  
});  
}  
});  
 
function dataAttr( elem, key, data ) {  
// If nothing was found internally, try to fetch any  
// data from the HTML5 data-* attribute  
if ( data === undefined && elem.nodeType === 1 ) {  
data = elem.getAttribute( "data-" + key );  
 
if ( typeof data === "string" ) {  
try {  
data = data === "true" ? true :  
data === "false" ? false :  
data === "null" ? null :  
!jQuery.isNaN( data ) ? parseFloat( data ) :  
rbrace.test( data ) ? jQuery.parseJSON( data ) :  
data;  
} catch( e ) {}  
 
// Make sure we set the data so it isn't changed later  
jQuery.data( elem, key, data );  
 
} else {  
data = undefined;  
}  
}  
 
return data;  
}  
 
 
 
 
jQuery.extend({  
queue: function( elem, type, data ) {  
if ( !elem ) {  
return;  
}  
 
type = (type || "fx") + "queue";  
var q = jQuery._data( elem, type );  
 
// Speed up dequeue by getting out quickly if this is just a lookup  
if ( !data ) {  
return q || [];  
}  
 
if ( !q || jQuery.isArray(data) ) {  
q = jQuery._data( elem, type, jQuery.makeArray(data) );  
 
} else {  
q.push( data );  
}  
 
return q;  
},  
 
dequeue: function( elem, type ) {  
type = type || "fx";  
 
var queue = jQuery.queue( elem, type ),  
fn = queue.shift();  
 
// If the fx queue is dequeued, always remove the progress sentinel  
if ( fn === "inprogress" ) {  
fn = queue.shift();  
}  
 
if ( fn ) {  
// Add a progress sentinel to prevent the fx queue from being  
// automatically dequeued  
if ( type === "fx" ) {  
queue.unshift("inprogress");  
}  
 
fn.call(elem, function() {  
jQuery.dequeue(elem, type);  
});  
}  
 
if ( !queue.length ) {  
jQuery.removeData( elem, type + "queue", true );  
}  
}  
});  
 
jQuery.fn.extend({  
queue: function( type, data ) {  
if ( typeof type !== "string" ) {  
data = type;  
type = "fx";  
}  
 
if ( data === undefined ) {  
return jQuery.queue( this[0], type );  
}  
return this.each(function( i ) {  
var queue = jQuery.queue( this, type, data );  
 
if ( type === "fx" && queue[0] !== "inprogress" ) {  
jQuery.dequeue( this, type );  
}  
});  
},  
dequeue: function( type ) {  
return this.each(function() {  
jQuery.dequeue( this, type );  
});  
},  
 
// Based off of the plugin by Clint Helfers, with permission.  
// http://blindsignals.com/index.php/2009/07/jquery-delay/  
delay: function( time, type ) {  
time = jQuery.fx ? jQuery.fx.speeds[time] || time : time;  
type = type || "fx";  
 
return this.queue( type, function() {  
var elem = this;  
setTimeout(function() {  
jQuery.dequeue( elem, type );  
}, time );  
});  
},  
 
clearQueue: function( type ) {  
return this.queue( type || "fx", [] );  
}  
});  
 
 
 
 
var rclass = /[\n\t\r]/g,  
rspaces = /\s+/,  
rreturn = /\r/g,  
rspecialurl = /^(?:href|src|style)$/,  
rtype = /^(?:button|input)$/i,  
rfocusable = /^(?:button|input|object|select|textarea)$/i,  
rclickable = /^a(?:rea)?$/i,  
rradiocheck = /^(?:radio|checkbox)$/i;  
 
jQuery.props = {  
"for": "htmlFor",  
"class": "className",  
readonly: "readOnly",  
maxlength: "maxLength",  
cellspacing: "cellSpacing",  
rowspan: "rowSpan",  
colspan: "colSpan",  
tabindex: "tabIndex",  
usemap: "useMap",  
frameborder: "frameBorder"  
};  
 
jQuery.fn.extend({  
attr: function( name, value ) {  
return jQuery.access( this, name, value, true, jQuery.attr );  
},  
 
removeAttr: function( name, fn ) {  
return this.each(function(){  
jQuery.attr( this, name, "" );  
if ( this.nodeType === 1 ) {  
this.removeAttribute( name );  
}  
});  
},  
 
addClass: function( value ) {  
if ( jQuery.isFunction(value) ) {  
return this.each(function(i) {  
var self = jQuery(this);  
self.addClass( value.call(this, i, self.attr("class")) );  
});  
}  
 
if ( value && typeof value === "string" ) {  
var classNames = (value || "").split( rspaces );  
 
for ( var i = 0, l = this.length; i < l; i++ ) {  
var elem = this[i];  
 
if ( elem.nodeType === 1 ) {  
if ( !elem.className ) {  
elem.className = value;  
 
} else {  
var className = " " + elem.className + " ",  
setClass = elem.className;  
 
for ( var c = 0, cl = classNames.length; c < cl; c++ ) {  
if ( className.indexOf( " " + classNames[c] + " " ) < 0 ) {  
setClass += " " + classNames[c];  
}  
}  
elem.className = jQuery.trim( setClass );  
}  
}  
}  
}  
 
return this;  
},  
 
removeClass: function( value ) {  
if ( jQuery.isFunction(value) ) {  
return this.each(function(i) {  
var self = jQuery(this);  
self.removeClass( value.call(this, i, self.attr("class")) );  
});  
}  
 
if ( (value && typeof value === "string") || value === undefined ) {  
var classNames = (value || "").split( rspaces );  
 
for ( var i = 0, l = this.length; i < l; i++ ) {  
var elem = this[i];  
 
if ( elem.nodeType === 1 && elem.className ) {  
if ( value ) {  
var className = (" " + elem.className + " ").replace(rclass, " ");  
for ( var c = 0, cl = classNames.length; c < cl; c++ ) {  
className = className.replace(" " + classNames[c] + " ", " ");  
}  
elem.className = jQuery.trim( className );  
 
} else {  
elem.className = "";  
}  
}  
}  
}  
 
return this;  
},  
 
toggleClass: function( value, stateVal ) {  
var type = typeof value,  
isBool = typeof stateVal === "boolean";  
 
if ( jQuery.isFunction( value ) ) {  
return this.each(function(i) {  
var self = jQuery(this);  
self.toggleClass( value.call(this, i, self.attr("class"), stateVal), stateVal );  
});  
}  
 
return this.each(function() {  
if ( type === "string" ) {  
// toggle individual class names  
var className,  
i = 0,  
self = jQuery( this ),  
state = stateVal,  
classNames = value.split( rspaces );  
 
while ( (className = classNames[ i++ ]) ) {  
// check each className given, space seperated list  
state = isBool ? state : !self.hasClass( className );  
self[ state ? "addClass" : "removeClass" ]( className );  
}  
 
} else if ( type === "undefined" || type === "boolean" ) {  
if ( this.className ) {  
// store className if set  
jQuery._data( this, "__className__", this.className );  
}  
 
// toggle whole className  
this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";  
}  
});  
},  
 
hasClass: function( selector ) {  
var className = " " + selector + " ";  
for ( var i = 0, l = this.length; i < l; i++ ) {  
if ( (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) {  
return true;  
}  
}  
 
return false;  
},  
 
val: function( value ) {  
if ( !arguments.length ) {  
var elem = this[0];  
 
if ( elem ) {  
if ( jQuery.nodeName( elem, "option" ) ) {  
// attributes.value is undefined in Blackberry 4.7 but  
// uses .value. See #6932  
var val = elem.attributes.value;  
return !val || val.specified ? elem.value : elem.text;  
}  
 
// We need to handle select boxes special  
if ( jQuery.nodeName( elem, "select" ) ) {  
var index = elem.selectedIndex,  
values = [],  
options = elem.options,  
one = elem.type === "select-one";  
 
// Nothing was selected  
if ( index < 0 ) {  
return null;  
}  
 
// Loop through all the selected options  
for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) {  
var option = options[ i ];  
 
// Don't return options that are disabled or in a disabled optgroup  
if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) &&  
(!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) {  
 
// Get the specific value for the option  
value = jQuery(option).val();  
 
// We don't need an array for one selects  
if ( one ) {  
return value;  
}  
 
// Multi-Selects return an array  
values.push( value );  
}  
}  
 
return values;  
}  
 
// Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified  
if ( rradiocheck.test( elem.type ) && !jQuery.support.checkOn ) {  
return elem.getAttribute("value") === null ? "on" : elem.value;  
}  
 
// Everything else, we just grab the value  
return (elem.value || "").replace(rreturn, "");  
 
}  
 
return undefined;  
}  
 
var isFunction = jQuery.isFunction(value);  
 
return this.each(function(i) {  
var self = jQuery(this), val = value;  
 
if ( this.nodeType !== 1 ) {  
return;  
}  
 
if ( isFunction ) {  
val = value.call(this, i, self.val());  
}  
 
// Treat null/undefined as ""; convert numbers to string  
if ( val == null ) {  
val = "";  
} else if ( typeof val === "number" ) {  
val += "";  
} else if ( jQuery.isArray(val) ) {  
val = jQuery.map(val, function (value) {  
return value == null ? "" : value + "";  
});  
}  
 
if ( jQuery.isArray(val) && rradiocheck.test( this.type ) ) {  
this.checked = jQuery.inArray( self.val(), val ) >= 0;  
 
} else if ( jQuery.nodeName( this, "select" ) ) {  
var values = jQuery.makeArray(val);  
 
jQuery( "option", this ).each(function() {  
this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;  
});  
 
if ( !values.length ) {  
this.selectedIndex = -1;  
}  
 
} else {  
this.value = val;  
}  
});  
}  
});  
 
jQuery.extend({  
attrFn: {  
val: true,  
css: true,  
html: true,  
text: true,  
data: true,  
width: true,  
height: true,  
offset: true  
},  
 
attr: function( elem, name, value, pass ) {  
// don't get/set attributes on text, comment and attribute nodes  
if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || elem.nodeType === 2 ) {  
return undefined;  
}  
 
if ( pass && name in jQuery.attrFn ) {  
return jQuery(elem)[name](value);  
}  
 
var notxml = elem.nodeType !== 1 || !jQuery.isXMLDoc( elem ),  
// Whether we are setting (or getting)  
set = value !== undefined;  
 
// Try to normalize/fix the name  
name = notxml && jQuery.props[ name ] || name;  
 
// Only do all the following if this is a node (faster for style)  
if ( elem.nodeType === 1 ) {  
// These attributes require special treatment  
var special = rspecialurl.test( name );  
 
// Safari mis-reports the default selected property of an option  
// Accessing the parent's selectedIndex property fixes it  
if ( name === "selected" && !jQuery.support.optSelected ) {  
var parent = elem.parentNode;  
if ( parent ) {  
parent.selectedIndex;  
 
// Make sure that it also works with optgroups, see #5701  
if ( parent.parentNode ) {  
parent.parentNode.selectedIndex;  
}  
}  
}  
 
// If applicable, access the attribute via the DOM 0 way  
// 'in' checks fail in Blackberry 4.7 #6931  
if ( (name in elem || elem[ name ] !== undefined) && notxml && !special ) {  
if ( set ) {  
// We can't allow the type property to be changed (since it causes problems in IE)  
if ( name === "type" && rtype.test( elem.nodeName ) && elem.parentNode ) {  
jQuery.error( "type property can't be changed" );  
}  
 
if ( value === null ) {  
if ( elem.nodeType === 1 ) {  
elem.removeAttribute( name );  
}  
 
} else {  
elem[ name ] = value;  
}  
}  
 
// browsers index elements by id/name on forms, give priority to attributes.  
if ( jQuery.nodeName( elem, "form" ) && elem.getAttributeNode(name) ) {  
return elem.getAttributeNode( name ).nodeValue;  
}  
 
// elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set  
// http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/  
if ( name === "tabIndex" ) {  
var attributeNode = elem.getAttributeNode( "tabIndex" );  
 
return attributeNode && attributeNode.specified ?  
attributeNode.value :  
rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?  
0 :  
undefined;  
}  
 
return elem[ name ];  
}  
 
if ( !jQuery.support.style && notxml && name === "style" ) {  
if ( set ) {  
elem.style.cssText = "" + value;  
}  
 
return elem.style.cssText;  
}  
 
if ( set ) {  
// convert the value to a string (all browsers do this but IE) see #1070  
elem.setAttribute( name, "" + value );  
}  
 
// Ensure that missing attributes return undefined  
// Blackberry 4.7 returns "" from getAttribute #6938  
if ( !elem.attributes[ name ] && (elem.hasAttribute && !elem.hasAttribute( name )) ) {  
return undefined;  
}  
 
var attr = !jQuery.support.hrefNormalized && notxml && special ?  
// Some attributes require a special call on IE  
elem.getAttribute( name, 2 ) :  
elem.getAttribute( name );  
 
// Non-existent attributes return null, we normalize to undefined  
return attr === null ? undefined : attr;  
}  
// Handle everything which isn't a DOM element node  
if ( set ) {  
elem[ name ] = value;  
}  
return elem[ name ];  
}  
});  
 
 
 
 
var rnamespaces = /\.(.*)$/,  
rformElems = /^(?:textarea|input|select)$/i,  
rperiod = /\./g,  
rspace = / /g,  
rescape = /[^\w\s.|`]/g,  
fcleanup = function( nm ) {  
return nm.replace(rescape, "\\$&");  
},  
eventKey = "events";  
 
/*  
* A number of helper functions used for managing events.  
* Many of the ideas behind this code originated from  
* Dean Edwards' addEvent library.  
*/  
jQuery.event = {  
 
// Bind an event to an element  
// Original by Dean Edwards  
add: function( elem, types, handler, data ) {  
if ( elem.nodeType === 3 || elem.nodeType === 8 ) {  
return;  
}  
 
// For whatever reason, IE has trouble passing the window object  
// around, causing it to be cloned in the process  
if ( jQuery.isWindow( elem ) && ( elem !== window && !elem.frameElement ) ) {  
elem = window;  
}  
 
if ( handler === false ) {  
handler = returnFalse;  
} else if ( !handler ) {  
// Fixes bug #7229. Fix recommended by jdalton  
return;  
}  
 
var handleObjIn, handleObj;  
 
if ( handler.handler ) {  
handleObjIn = handler;  
handler = handleObjIn.handler;  
}  
 
// Make sure that the function being executed has a unique ID  
if ( !handler.guid ) {  
handler.guid = jQuery.guid++;  
}  
 
// Init the element's event structure  
var elemData = jQuery._data( elem );  
 
// If no elemData is found then we must be trying to bind to one of the  
// banned noData elements  
if ( !elemData ) {  
return;  
}  
 
var events = elemData[ eventKey ],  
eventHandle = elemData.handle;  
 
if ( typeof events === "function" ) {  
// On plain objects events is a fn that holds the the data  
// which prevents this data from being JSON serialized  
// the function does not need to be called, it just contains the data  
eventHandle = events.handle;  
events = events.events;  
 
} else if ( !events ) {  
if ( !elem.nodeType ) {  
// On plain objects, create a fn that acts as the holder  
// of the values to avoid JSON serialization of event data  
elemData[ eventKey ] = elemData = function(){};  
}  
 
elemData.events = events = {};  
}  
 
if ( !eventHandle ) {  
elemData.handle = eventHandle = function() {  
// Handle the second event of a trigger and when  
// an event is called after a page has unloaded  
return typeof jQuery !== "undefined" && !jQuery.event.triggered ?  
jQuery.event.handle.apply( eventHandle.elem, arguments ) :  
undefined;  
};  
}  
 
// Add elem as a property of the handle function  
// This is to prevent a memory leak with non-native events in IE.  
eventHandle.elem = elem;  
 
// Handle multiple events separated by a space  
// jQuery(...).bind("mouseover mouseout", fn);  
types = types.split(" ");  
 
var type, i = 0, namespaces;  
 
while ( (type = types[ i++ ]) ) {  
handleObj = handleObjIn ?  
jQuery.extend({}, handleObjIn) :  
{ handler: handler, data: data };  
 
// Namespaced event handlers  
if ( type.indexOf(".") > -1 ) {  
namespaces = type.split(".");  
type = namespaces.shift();  
handleObj.namespace = namespaces.slice(0).sort().join(".");  
 
} else {  
namespaces = [];  
handleObj.namespace = "";  
}  
 
handleObj.type = type;  
if ( !handleObj.guid ) {  
handleObj.guid = handler.guid;  
}  
 
// Get the current list of functions bound to this event  
var handlers = events[ type ],  
special = jQuery.event.special[ type ] || {};  
 
// Init the event handler queue  
if ( !handlers ) {  
handlers = events[ type ] = [];  
 
// Check for a special event handler  
// Only use addEventListener/attachEvent if the special  
// events handler returns false  
if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {  
// Bind the global event handler to the element  
if ( elem.addEventListener ) {  
elem.addEventListener( type, eventHandle, false );  
 
} else if ( elem.attachEvent ) {  
elem.attachEvent( "on" + type, eventHandle );  
}  
}  
}  
 
if ( special.add ) {  
special.add.call( elem, handleObj );  
 
if ( !handleObj.handler.guid ) {  
handleObj.handler.guid = handler.guid;  
}  
}  
 
// Add the function to the element's handler list  
handlers.push( handleObj );  
 
// Keep track of which events have been used, for global triggering  
jQuery.event.global[ type ] = true;  
}  
 
// Nullify elem to prevent memory leaks in IE  
elem = null;  
},  
 
global: {},  
 
// Detach an event or set of events from an element  
remove: function( elem, types, handler, pos ) {  
// don't do events on text and comment nodes  
if ( elem.nodeType === 3 || elem.nodeType === 8 ) {  
return;  
}  
 
if ( handler === false ) {  
handler = returnFalse;  
}  
 
var ret, type, fn, j, i = 0, all, namespaces, namespace, special, eventType, handleObj, origType,  
elemData = jQuery.hasData( elem ) && jQuery._data( elem ),  
events = elemData && elemData[ eventKey ];  
 
if ( !elemData || !events ) {  
return;  
}  
 
if ( typeof events === "function" ) {  
elemData = events;  
events = events.events;  
}  
 
// types is actually an event object here  
if ( types && types.type ) {  
handler = types.handler;  
types = types.type;  
}  
 
// Unbind all events for the element  
if ( !types || typeof types === "string" && types.charAt(0) === "." ) {  
types = types || "";  
 
for ( type in events ) {  
jQuery.event.remove( elem, type + types );  
}  
 
return;  
}  
 
// Handle multiple events separated by a space  
// jQuery(...).unbind("mouseover mouseout", fn);  
types = types.split(" ");  
 
while ( (type = types[ i++ ]) ) {  
origType = type;  
handleObj = null;  
all = type.indexOf(".") < 0;  
namespaces = [];  
 
if ( !all ) {  
// Namespaced event handlers  
namespaces = type.split(".");  
type = namespaces.shift();  
 
namespace = new RegExp("(^|\\.)" +  
jQuery.map( namespaces.slice(0).sort(), fcleanup ).join("\\.(?:.*\\.)?") + "(\\.|$)");  
}  
 
eventType = events[ type ];  
 
if ( !eventType ) {  
continue;  
}  
 
if ( !handler ) {  
for ( j = 0; j < eventType.length; j++ ) {  
handleObj = eventType[ j ];  
 
if ( all || namespace.test( handleObj.namespace ) ) {  
jQuery.event.remove( elem, origType, handleObj.handler, j );  
eventType.splice( j--, 1 );  
}  
}  
 
continue;  
}  
 
special = jQuery.event.special[ type ] || {};  
 
for ( j = pos || 0; j < eventType.length; j++ ) {  
handleObj = eventType[ j ];  
 
if ( handler.guid === handleObj.guid ) {  
// remove the given handler for the given type  
if ( all || namespace.test( handleObj.namespace ) ) {  
if ( pos == null ) {  
eventType.splice( j--, 1 );  
}  
 
if ( special.remove ) {  
special.remove.call( elem, handleObj );  
}  
}  
 
if ( pos != null ) {  
break;  
}  
}  
}  
 
// remove generic event handler if no more handlers exist  
if ( eventType.length === 0 || pos != null && eventType.length === 1 ) {  
if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) {  
jQuery.removeEvent( elem, type, elemData.handle );  
}  
 
ret = null;  
delete events[ type ];  
}  
}  
 
// Remove the expando if it's no longer used  
if ( jQuery.isEmptyObject( events ) ) {  
var handle = elemData.handle;  
if ( handle ) {  
handle.elem = null;  
}  
 
delete elemData.events;  
delete elemData.handle;  
 
if ( typeof elemData === "function" ) {  
jQuery.removeData( elem, eventKey, true );  
 
} else if ( jQuery.isEmptyObject( elemData ) ) {  
jQuery.removeData( elem, undefined, true );  
}  
}  
},  
 
// bubbling is internal  
trigger: function( event, data, elem /*, bubbling */ ) {  
// Event object or event type  
var type = event.type || event,  
bubbling = arguments[3];  
 
if ( !bubbling ) {  
event = typeof event === "object" ?  
// jQuery.Event object  
event[ jQuery.expando ] ? event :  
// Object literal  
jQuery.extend( jQuery.Event(type), event ) :  
// Just the event type (string)  
jQuery.Event(type);  
 
if ( type.indexOf("!") >= 0 ) {  
event.type = type = type.slice(0, -1);  
event.exclusive = true;  
}  
 
// Handle a global trigger  
if ( !elem ) {  
// Don't bubble custom events when global (to avoid too much overhead)  
event.stopPropagation();  
 
// Only trigger if we've ever bound an event for it  
if ( jQuery.event.global[ type ] ) {  
// XXX This code smells terrible. event.js should not be directly  
// inspecting the data cache  
jQuery.each( jQuery.cache, function() {  
// internalKey variable is just used to make it easier to find  
// and potentially change this stuff later; currently it just  
// points to jQuery.expando  
var internalKey = jQuery.expando,  
internalCache = this[ internalKey ];  
if ( internalCache && internalCache.events && internalCache.events[type] ) {  
jQuery.event.trigger( event, data, internalCache.handle.elem );  
}  
});  
}  
}  
 
// Handle triggering a single element  
 
// don't do events on text and comment nodes  
if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) {  
return undefined;  
}  
 
// Clean up in case it is reused  
event.result = undefined;  
event.target = elem;  
 
// Clone the incoming data, if any  
data = jQuery.makeArray( data );  
data.unshift( event );  
}  
 
event.currentTarget = elem;  
 
// Trigger the event, it is assumed that "handle" is a function  
var handle = elem.nodeType ?  
jQuery._data( elem, "handle" ) :  
(jQuery._data( elem, eventKey ) || {}).handle;  
 
if ( handle ) {  
handle.apply( elem, data );  
}  
 
var parent = elem.parentNode || elem.ownerDocument;  
 
// Trigger an inline bound script  
try {  
if ( !(elem && elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()]) ) {  
if ( elem[ "on" + type ] && elem[ "on" + type ].apply( elem, data ) === false ) {  
event.result = false;  
event.preventDefault();  
}  
}  
 
// prevent IE from throwing an error for some elements with some event types, see #3533  
} catch (inlineError) {}  
 
if ( !event.isPropagationStopped() && parent ) {  
jQuery.event.trigger( event, data, parent, true );  
 
} else if ( !event.isDefaultPrevented() ) {  
var old,  
target = event.target,  
targetType = type.replace( rnamespaces, "" ),  
isClick = jQuery.nodeName( target, "a" ) && targetType === "click",  
special = jQuery.event.special[ targetType ] || {};  
 
if ( (!special._default || special._default.call( elem, event ) === false) &&  
!isClick && !(target && target.nodeName && jQuery.noData[target.nodeName.toLowerCase()]) ) {  
 
try {  
if ( target[ targetType ] ) {  
// Make sure that we don't accidentally re-trigger the onFOO events  
old = target[ "on" + targetType ];  
 
if ( old ) {  
target[ "on" + targetType ] = null;  
}  
 
jQuery.event.triggered = true;  
target[ targetType ]();  
}  
 
// prevent IE from throwing an error for some elements with some event types, see #3533  
} catch (triggerError) {}  
 
if ( old ) {  
target[ "on" + targetType ] = old;  
}  
 
jQuery.event.triggered = false;  
}  
}  
},  
 
handle: function( event ) {  
var all, handlers, namespaces, namespace_re, events,  
namespace_sort = [],  
args = jQuery.makeArray( arguments );  
 
event = args[0] = jQuery.event.fix( event || window.event );  
event.currentTarget = this;  
 
// Namespaced event handlers  
all = event.type.indexOf(".") < 0 && !event.exclusive;  
 
if ( !all ) {  
namespaces = event.type.split(".");  
event.type = namespaces.shift();  
namespace_sort = namespaces.slice(0).sort();  
namespace_re = new RegExp("(^|\\.)" + namespace_sort.join("\\.(?:.*\\.)?") + "(\\.|$)");  
}  
 
event.namespace = event.namespace || namespace_sort.join(".");  
 
events = jQuery._data(this, eventKey);  
 
if ( typeof events === "function" ) {  
events = events.events;  
}  
 
handlers = (events || {})[ event.type ];  
 
if ( events && handlers ) {  
// Clone the handlers to prevent manipulation  
handlers = handlers.slice(0);  
 
for ( var j = 0, l = handlers.length; j < l; j++ ) {  
var handleObj = handlers[ j ];  
 
// Filter the functions by class  
if ( all || namespace_re.test( handleObj.namespace ) ) {  
// Pass in a reference to the handler function itself  
// So that we can later remove it  
event.handler = handleObj.handler;  
event.data = handleObj.data;  
event.handleObj = handleObj;  
 
var ret = handleObj.handler.apply( this, args );  
 
if ( ret !== undefined ) {  
event.result = ret;  
if ( ret === false ) {  
event.preventDefault();  
event.stopPropagation();  
}  
}  
 
if ( event.isImmediatePropagationStopped() ) {  
break;  
}  
}  
}  
}  
 
return event.result;  
},  
 
props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),  
 
fix: function( event ) {  
if ( event[ jQuery.expando ] ) {  
return event;  
}  
 
// store a copy of the original event object  
// and "clone" to set read-only properties  
var originalEvent = event;  
event = jQuery.Event( originalEvent );  
 
for ( var i = this.props.length, prop; i; ) {  
prop = this.props[ --i ];  
event[ prop ] = originalEvent[ prop ];  
}  
 
// Fix target property, if necessary  
if ( !event.target ) {  
// Fixes #1925 where srcElement might not be defined either  
event.target = event.srcElement || document;  
}  
 
// check if target is a textnode (safari)  
if ( event.target.nodeType === 3 ) {  
event.target = event.target.parentNode;  
}  
 
// Add relatedTarget, if necessary  
if ( !event.relatedTarget && event.fromElement ) {  
event.relatedTarget = event.fromElement === event.target ? event.toElement : event.fromElement;  
}  
 
// Calculate pageX/Y if missing and clientX/Y available  
if ( event.pageX == null && event.clientX != null ) {  
var doc = document.documentElement,  
body = document.body;  
 
event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0);  
event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0);  
}  
 
// Add which for key events  
if ( event.which == null && (event.charCode != null || event.keyCode != null) ) {  
event.which = event.charCode != null ? event.charCode : event.keyCode;  
}  
 
// Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs)  
if ( !event.metaKey && event.ctrlKey ) {  
event.metaKey = event.ctrlKey;  
}  
 
// Add which for click: 1 === left; 2 === middle; 3 === right  
// Note: button is not normalized, so don't use it  
if ( !event.which && event.button !== undefined ) {  
event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) ));  
}  
 
return event;  
},  
 
// Deprecated, use jQuery.guid instead  
guid: 1E8,  
 
// Deprecated, use jQuery.proxy instead  
proxy: jQuery.proxy,  
 
special: {  
ready: {  
// Make sure the ready event is setup  
setup: jQuery.bindReady,  
teardown: jQuery.noop  
},  
 
live: {  
add: function( handleObj ) {  
jQuery.event.add( this,  
liveConvert( handleObj.origType, handleObj.selector ),  
jQuery.extend({}, handleObj, {handler: liveHandler, guid: handleObj.handler.guid}) );  
},  
 
remove: function( handleObj ) {  
jQuery.event.remove( this, liveConvert( handleObj.origType, handleObj.selector ), handleObj );  
}  
},  
 
beforeunload: {  
setup: function( data, namespaces, eventHandle ) {  
// We only want to do this special case on windows  
if ( jQuery.isWindow( this ) ) {  
this.onbeforeunload = eventHandle;  
}  
},  
 
teardown: function( namespaces, eventHandle ) {  
if ( this.onbeforeunload === eventHandle ) {  
this.onbeforeunload = null;  
}  
}  
}  
}  
};  
 
jQuery.removeEvent = document.removeEventListener ?  
function( elem, type, handle ) {  
if ( elem.removeEventListener ) {  
elem.removeEventListener( type, handle, false );  
}  
} :  
function( elem, type, handle ) {  
if ( elem.detachEvent ) {  
elem.detachEvent( "on" + type, handle );  
}  
};  
 
jQuery.Event = function( src ) {  
// Allow instantiation without the 'new' keyword  
if ( !this.preventDefault ) {  
return new jQuery.Event( src );  
}  
 
// Event object  
if ( src && src.type ) {  
this.originalEvent = src;  
this.type = src.type;  
 
// Events bubbling up the document may have been marked as prevented  
// by a handler lower down the tree; reflect the correct value.  
this.isDefaultPrevented = (src.defaultPrevented || src.returnValue === false ||  
src.getPreventDefault && src.getPreventDefault()) ? returnTrue : returnFalse;  
 
// Event type  
} else {  
this.type = src;  
}  
 
// timeStamp is buggy for some events on Firefox(#3843)  
// So we won't rely on the native value  
this.timeStamp = jQuery.now();  
 
// Mark it as fixed  
this[ jQuery.expando ] = true;  
};  
 
function returnFalse() {  
return false;  
}  
function returnTrue() {  
return true;  
}  
 
// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding  
// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html  
jQuery.Event.prototype = {  
preventDefault: function() {  
this.isDefaultPrevented = returnTrue;  
 
var e = this.originalEvent;  
if ( !e ) {  
return;  
}  
 
// if preventDefault exists run it on the original event  
if ( e.preventDefault ) {  
e.preventDefault();  
 
// otherwise set the returnValue property of the original event to false (IE)  
} else {  
e.returnValue = false;  
}  
},  
stopPropagation: function() {  
this.isPropagationStopped = returnTrue;  
 
var e = this.originalEvent;  
if ( !e ) {  
return;  
}  
// if stopPropagation exists run it on the original event  
if ( e.stopPropagation ) {  
e.stopPropagation();  
}  
// otherwise set the cancelBubble property of the original event to true (IE)  
e.cancelBubble = true;  
},  
stopImmediatePropagation: function() {  
this.isImmediatePropagationStopped = returnTrue;  
this.stopPropagation();  
},  
isDefaultPrevented: returnFalse,  
isPropagationStopped: returnFalse,  
isImmediatePropagationStopped: returnFalse  
};  
 
// Checks if an event happened on an element within another element  
// Used in jQuery.event.special.mouseenter and mouseleave handlers  
var withinElement = function( event ) {  
// Check if mouse(over|out) are still within the same parent element  
var parent = event.relatedTarget;  
 
// Firefox sometimes assigns relatedTarget a XUL element  
// which we cannot access the parentNode property of  
try {  
// Traverse up the tree  
while ( parent && parent !== this ) {  
parent = parent.parentNode;  
}  
 
if ( parent !== this ) {  
// set the correct event type  
event.type = event.data;  
 
// handle event if we actually just moused on to a non sub-element  
jQuery.event.handle.apply( this, arguments );  
}  
 
// assuming we've left the element since we most likely mousedover a xul element  
} catch(e) { }  
},  
 
// In case of event delegation, we only need to rename the event.type,  
// liveHandler will take care of the rest.  
delegate = function( event ) {  
event.type = event.data;  
jQuery.event.handle.apply( this, arguments );  
};  
 
// Create mouseenter and mouseleave events  
jQuery.each({  
mouseenter: "mouseover",  
mouseleave: "mouseout"  
}, function( orig, fix ) {  
jQuery.event.special[ orig ] = {  
setup: function( data ) {  
jQuery.event.add( this, fix, data && data.selector ? delegate : withinElement, orig );  
},  
teardown: function( data ) {  
jQuery.event.remove( this, fix, data && data.selector ? delegate : withinElement );  
}  
};  
});  
 
// submit delegation  
if ( !jQuery.support.submitBubbles ) {  
 
jQuery.event.special.submit = {  
setup: function( data, namespaces ) {  
if ( this.nodeName && this.nodeName.toLowerCase() !== "form" ) {  
jQuery.event.add(this, "click.specialSubmit", function( e ) {  
var elem = e.target,  
type = elem.type;  
 
if ( (type === "submit" || type === "image") && jQuery( elem ).closest("form").length ) {  
e.liveFired = undefined;  
return trigger( "submit", this, arguments );  
}  
});  
 
jQuery.event.add(this, "keypress.specialSubmit", function( e ) {  
var elem = e.target,  
type = elem.type;  
 
if ( (type === "text" || type === "password") && jQuery( elem ).closest("form").length && e.keyCode === 13 ) {  
e.liveFired = undefined;  
return trigger( "submit", this, arguments );  
}  
});  
 
} else {  
return false;  
}  
},  
 
teardown: function( namespaces ) {  
jQuery.event.remove( this, ".specialSubmit" );  
}  
};  
 
}  
 
// change delegation, happens here so we have bind.  
if ( !jQuery.support.changeBubbles ) {  
 
var changeFilters,  
 
getVal = function( elem ) {  
var type = elem.type, val = elem.value;  
 
if ( type === "radio" || type === "checkbox" ) {  
val = elem.checked;  
 
} else if ( type === "select-multiple" ) {  
val = elem.selectedIndex > -1 ?  
jQuery.map( elem.options, function( elem ) {  
return elem.selected;  
}).join("-") :  
"";  
 
} else if ( elem.nodeName.toLowerCase() === "select" ) {  
val = elem.selectedIndex;  
}  
 
return val;  
},  
 
testChange = function testChange( e ) {  
var elem = e.target, data, val;  
 
if ( !rformElems.test( elem.nodeName ) || elem.readOnly ) {  
return;  
}  
 
data = jQuery._data( elem, "_change_data" );  
val = getVal(elem);  
 
// the current data will be also retrieved by beforeactivate  
if ( e.type !== "focusout" || elem.type !== "radio" ) {  
jQuery._data( elem, "_change_data", val );  
}  
 
if ( data === undefined || val === data ) {  
return;  
}  
 
if ( data != null || val ) {  
e.type = "change";  
e.liveFired = undefined;  
return jQuery.event.trigger( e, arguments[1], elem );  
}  
};  
 
jQuery.event.special.change = {  
filters: {  
focusout: testChange,  
 
beforedeactivate: testChange,  
 
click: function( e ) {  
var elem = e.target, type = elem.type;  
 
if ( type === "radio" || type === "checkbox" || elem.nodeName.toLowerCase() === "select" ) {  
return testChange.call( this, e );  
}  
},  
 
// Change has to be called before submit  
// Keydown will be called before keypress, which is used in submit-event delegation  
keydown: function( e ) {  
var elem = e.target, type = elem.type;  
 
if ( (e.keyCode === 13 && elem.nodeName.toLowerCase() !== "textarea") ||  
(e.keyCode === 32 && (type === "checkbox" || type === "radio")) ||  
type === "select-multiple" ) {  
return testChange.call( this, e );  
}  
},  
 
// Beforeactivate happens also before the previous element is blurred  
// with this event you can't trigger a change event, but you can store  
// information  
beforeactivate: function( e ) {  
var elem = e.target;  
jQuery._data( elem, "_change_data", getVal(elem) );  
}  
},  
 
setup: function( data, namespaces ) {  
if ( this.type === "file" ) {  
return false;  
}  
 
for ( var type in changeFilters ) {  
jQuery.event.add( this, type + ".specialChange", changeFilters[type] );  
}  
 
return rformElems.test( this.nodeName );  
},  
 
teardown: function( namespaces ) {  
jQuery.event.remove( this, ".specialChange" );  
 
return rformElems.test( this.nodeName );  
}  
};  
 
changeFilters = jQuery.event.special.change.filters;  
 
// Handle when the input is .focus()'d  
changeFilters.focus = changeFilters.beforeactivate;  
}  
 
function trigger( type, elem, args ) {  
args[0].type = type;  
return jQuery.event.handle.apply( elem, args );  
}  
 
// Create "bubbling" focus and blur events  
if ( document.addEventListener ) {  
jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {  
jQuery.event.special[ fix ] = {  
setup: function() {  
this.addEventListener( orig, handler, true );  
},  
teardown: function() {  
this.removeEventListener( orig, handler, true );  
}  
};  
 
function handler( e ) {  
e = jQuery.event.fix( e );  
e.type = fix;  
return jQuery.event.handle.call( this, e );  
}  
});  
}  
 
jQuery.each(["bind", "one"], function( i, name ) {  
jQuery.fn[ name ] = function( type, data, fn ) {  
// Handle object literals  
if ( typeof type === "object" ) {  
for ( var key in type ) {  
this[ name ](key, data, type[key], fn);  
}  
return this;  
}  
 
if ( jQuery.isFunction( data ) || data === false ) {  
fn = data;  
data = undefined;  
}  
 
var handler = name === "one" ? jQuery.proxy( fn, function( event ) {  
jQuery( this ).unbind( event, handler );  
return fn.apply( this, arguments );  
}) : fn;  
 
if ( type === "unload" && name !== "one" ) {  
this.one( type, data, fn );  
 
} else {  
for ( var i = 0, l = this.length; i < l; i++ ) {  
jQuery.event.add( this[i], type, handler, data );  
}  
}  
 
return this;  
};  
});  
 
jQuery.fn.extend({  
unbind: function( type, fn ) {  
// Handle object literals  
if ( typeof type === "object" && !type.preventDefault ) {  
for ( var key in type ) {  
this.unbind(key, type[key]);  
}  
 
} else {  
for ( var i = 0, l = this.length; i < l; i++ ) {  
jQuery.event.remove( this[i], type, fn );  
}  
}  
 
return this;  
},  
 
delegate: function( selector, types, data, fn ) {  
return this.live( types, data, fn, selector );  
},  
 
undelegate: function( selector, types, fn ) {  
if ( arguments.length === 0 ) {  
return this.unbind( "live" );  
 
} else {  
return this.die( types, null, fn, selector );  
}  
},  
 
trigger: function( type, data ) {  
return this.each(function() {  
jQuery.event.trigger( type, data, this );  
});  
},  
 
triggerHandler: function( type, data ) {  
if ( this[0] ) {  
var event = jQuery.Event( type );  
event.preventDefault();  
event.stopPropagation();  
jQuery.event.trigger( event, data, this[0] );  
return event.result;  
}  
},  
 
toggle: function( fn ) {  
// Save reference to arguments for access in closure  
var args = arguments,  
i = 1;  
 
// link all the functions, so any of them can unbind this click handler  
while ( i < args.length ) {  
jQuery.proxy( fn, args[ i++ ] );  
}  
 
return this.click( jQuery.proxy( fn, function( event ) {  
// Figure out which function to execute  
var lastToggle = ( jQuery._data( this, "lastToggle" + fn.guid ) || 0 ) % i;  
jQuery._data( this, "lastToggle" + fn.guid, lastToggle + 1 );  
 
// Make sure that clicks stop  
event.preventDefault();  
 
// and execute the function  
return args[ lastToggle ].apply( this, arguments ) || false;  
}));  
},  
 
hover: function( fnOver, fnOut ) {  
return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );  
}  
});  
 
var liveMap = {  
focus: "focusin",  
blur: "focusout",  
mouseenter: "mouseover",  
mouseleave: "mouseout"  
};  
 
jQuery.each(["live", "die"], function( i, name ) {  
jQuery.fn[ name ] = function( types, data, fn, origSelector /* Internal Use Only */ ) {  
var type, i = 0, match, namespaces, preType,  
selector = origSelector || this.selector,  
context = origSelector ? this : jQuery( this.context );  
 
if ( typeof types === "object" && !types.preventDefault ) {  
for ( var key in types ) {  
context[ name ]( key, data, types[key], selector );  
}  
 
return this;  
}  
 
if ( jQuery.isFunction( data ) ) {  
fn = data;  
data = undefined;  
}  
 
types = (types || "").split(" ");  
 
while ( (type = types[ i++ ]) != null ) {  
match = rnamespaces.exec( type );  
namespaces = "";  
 
if ( match ) {  
namespaces = match[0];  
type = type.replace( rnamespaces, "" );  
}  
 
if ( type === "hover" ) {  
types.push( "mouseenter" + namespaces, "mouseleave" + namespaces );  
continue;  
}  
 
preType = type;  
 
if ( type === "focus" || type === "blur" ) {  
types.push( liveMap[ type ] + namespaces );  
type = type + namespaces;  
 
} else {  
type = (liveMap[ type ] || type) + namespaces;  
}  
 
if ( name === "live" ) {  
// bind live handler  
for ( var j = 0, l = context.length; j < l; j++ ) {  
jQuery.event.add( context[j], "live." + liveConvert( type, selector ),  
{ data: data, selector: selector, handler: fn, origType: type, origHandler: fn, preType: preType } );  
}  
 
} else {  
// unbind live handler  
context.unbind( "live." + liveConvert( type, selector ), fn );  
}  
}  
 
return this;  
};  
});  
 
function liveHandler( event ) {  
var stop, maxLevel, related, match, handleObj, elem, j, i, l, data, close, namespace, ret,  
elems = [],  
selectors = [],  
events = jQuery._data( this, eventKey );  
 
if ( typeof events === "function" ) {  
events = events.events;  
}  
 
// Make sure we avoid non-left-click bubbling in Firefox (#3861) and disabled elements in IE (#6911)  
if ( event.liveFired === this || !events || !events.live || event.target.disabled || event.button && event.type === "click" ) {  
return;  
}  
 
if ( event.namespace ) {  
namespace = new RegExp("(^|\\.)" + event.namespace.split(".").join("\\.(?:.*\\.)?") + "(\\.|$)");  
}  
 
event.liveFired = this;  
 
var live = events.live.slice(0);  
 
for ( j = 0; j < live.length; j++ ) {  
handleObj = live[j];  
 
if ( handleObj.origType.replace( rnamespaces, "" ) === event.type ) {  
selectors.push( handleObj.selector );  
 
} else {  
live.splice( j--, 1 );  
}  
}  
 
match = jQuery( event.target ).closest( selectors, event.currentTarget );  
 
for ( i = 0, l = match.length; i < l; i++ ) {  
close = match[i];  
 
for ( j = 0; j < live.length; j++ ) {  
handleObj = live[j];  
 
if ( close.selector === handleObj.selector && (!namespace || namespace.test( handleObj.namespace )) ) {  
elem = close.elem;  
related = null;  
 
// Those two events require additional checking  
if ( handleObj.preType === "mouseenter" || handleObj.preType === "mouseleave" ) {  
event.type = handleObj.preType;  
related = jQuery( event.relatedTarget ).closest( handleObj.selector )[0];  
}  
 
if ( !related || related !== elem ) {  
elems.push({ elem: elem, handleObj: handleObj, level: close.level });  
}  
}  
}  
}  
 
for ( i = 0, l = elems.length; i < l; i++ ) {  
match = elems[i];  
 
if ( maxLevel && match.level > maxLevel ) {  
break;  
}  
 
event.currentTarget = match.elem;  
event.data = match.handleObj.data;  
event.handleObj = match.handleObj;  
 
ret = match.handleObj.origHandler.apply( match.elem, arguments );  
 
if ( ret === false || event.isPropagationStopped() ) {  
maxLevel = match.level;  
 
if ( ret === false ) {  
stop = false;  
}  
if ( event.isImmediatePropagationStopped() ) {  
break;  
}  
}  
}  
 
return stop;  
}  
 
function liveConvert( type, selector ) {  
return (type && type !== "*" ? type + "." : "") + selector.replace(rperiod, "`").replace(rspace, "&");  
}  
 
jQuery.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").split(" "), function( i, name ) {  
 
// Handle event binding  
jQuery.fn[ name ] = function( data, fn ) {  
if ( fn == null ) {  
fn = data;  
data = null;  
}  
 
return arguments.length > 0 ?  
this.bind( name, data, fn ) :  
this.trigger( name );  
};  
 
if ( jQuery.attrFn ) {  
jQuery.attrFn[ name ] = true;  
}  
});  
 
 
/*!  
* Sizzle CSS Selector Engine  
* Copyright 2011, The Dojo Foundation  
* Released under the MIT, BSD, and GPL Licenses.  
* More information: http://sizzlejs.com/  
*/  
(function(){  
 
var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,  
done = 0,  
toString = Object.prototype.toString,  
hasDuplicate = false,  
baseHasDuplicate = true;  
 
// Here we check if the JavaScript engine is using some sort of  
// optimization where it does not always call our comparision  
// function. If that is the case, discard the hasDuplicate value.  
// Thus far that includes Google Chrome.  
[0, 0].sort(function() {  
baseHasDuplicate = false;  
return 0;  
});  
 
var Sizzle = function( selector, context, results, seed ) {  
results = results || [];  
context = context || document;  
 
var origContext = context;  
 
if ( context.nodeType !== 1 && context.nodeType !== 9 ) {  
return [];  
}  
 
if ( !selector || typeof selector !== "string" ) {  
return results;  
}  
 
var m, set, checkSet, extra, ret, cur, pop, i,  
prune = true,  
contextXML = Sizzle.isXML( context ),  
parts = [],  
soFar = selector;  
 
// Reset the position of the chunker regexp (start from head)  
do {  
chunker.exec( "" );  
m = chunker.exec( soFar );  
 
if ( m ) {  
soFar = m[3];  
 
parts.push( m[1] );  
 
if ( m[2] ) {  
extra = m[3];  
break;  
}  
}  
} while ( m );  
 
if ( parts.length > 1 && origPOS.exec( selector ) ) {  
 
if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {  
set = posProcess( parts[0] + parts[1], context );  
 
} else {  
set = Expr.relative[ parts[0] ] ?  
[ context ] :  
Sizzle( parts.shift(), context );  
 
while ( parts.length ) {  
selector = parts.shift();  
 
if ( Expr.relative[ selector ] ) {  
selector += parts.shift();  
}  
 
set = posProcess( selector, set );  
}  
}  
 
} else {  
// Take a shortcut and set the context if the root selector is an ID  
// (but not if it'll be faster if the inner selector is an ID)  
if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML &&  
Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) {  
 
ret = Sizzle.find( parts.shift(), context, contextXML );  
context = ret.expr ?  
Sizzle.filter( ret.expr, ret.set )[0] :  
ret.set[0];  
}  
 
if ( context ) {  
ret = seed ?  
{ expr: parts.pop(), set: makeArray(seed) } :  
Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML );  
 
set = ret.expr ?  
Sizzle.filter( ret.expr, ret.set ) :  
ret.set;  
 
if ( parts.length > 0 ) {  
checkSet = makeArray( set );  
 
} else {  
prune = false;  
}  
 
while ( parts.length ) {  
cur = parts.pop();  
pop = cur;  
 
if ( !Expr.relative[ cur ] ) {  
cur = "";  
} else {  
pop = parts.pop();  
}  
 
if ( pop == null ) {  
pop = context;  
}  
 
Expr.relative[ cur ]( checkSet, pop, contextXML );  
}  
 
} else {  
checkSet = parts = [];  
}  
}  
 
if ( !checkSet ) {  
checkSet = set;  
}  
 
if ( !checkSet ) {  
Sizzle.error( cur || selector );  
}  
 
if ( toString.call(checkSet) === "[object Array]" ) {  
if ( !prune ) {  
results.push.apply( results, checkSet );  
 
} else if ( context && context.nodeType === 1 ) {  
for ( i = 0; checkSet[i] != null; i++ ) {  
if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) {  
results.push( set[i] );  
}  
}  
 
} else {  
for ( i = 0; checkSet[i] != null; i++ ) {  
if ( checkSet[i] && checkSet[i].nodeType === 1 ) {  
results.push( set[i] );  
}  
}  
}  
 
} else {  
makeArray( checkSet, results );  
}  
 
if ( extra ) {  
Sizzle( extra, origContext, results, seed );  
Sizzle.uniqueSort( results );  
}  
 
return results;  
};  
 
Sizzle.uniqueSort = function( results ) {  
if ( sortOrder ) {  
hasDuplicate = baseHasDuplicate;  
results.sort( sortOrder );  
 
if ( hasDuplicate ) {  
for ( var i = 1; i < results.length; i++ ) {  
if ( results[i] === results[ i - 1 ] ) {  
results.splice( i--, 1 );  
}  
}  
}  
}  
 
return results;  
};  
 
Sizzle.matches = function( expr, set ) {  
return Sizzle( expr, null, null, set );  
};  
 
Sizzle.matchesSelector = function( node, expr ) {  
return Sizzle( expr, null, null, [node] ).length > 0;  
};  
 
Sizzle.find = function( expr, context, isXML ) {  
var set;  
 
if ( !expr ) {  
return [];  
}  
 
for ( var i = 0, l = Expr.order.length; i < l; i++ ) {  
var match,  
type = Expr.order[i];  
 
if ( (match = Expr.leftMatch[ type ].exec( expr )) ) {  
var left = match[1];  
match.splice( 1, 1 );  
 
if ( left.substr( left.length - 1 ) !== "\\" ) {  
match[1] = (match[1] || "").replace(/\\/g, "");  
set = Expr.find[ type ]( match, context, isXML );  
 
if ( set != null ) {  
expr = expr.replace( Expr.match[ type ], "" );  
break;  
}  
}  
}  
}  
 
if ( !set ) {  
set = typeof context.getElementsByTagName !== "undefined" ?  
context.getElementsByTagName( "*" ) :  
[];  
}  
 
return { set: set, expr: expr };  
};  
 
Sizzle.filter = function( expr, set, inplace, not ) {  
var match, anyFound,  
old = expr,  
result = [],  
curLoop = set,  
isXMLFilter = set && set[0] && Sizzle.isXML( set[0] );  
 
while ( expr && set.length ) {  
for ( var type in Expr.filter ) {  
if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) {  
var found, item,  
filter = Expr.filter[ type ],  
left = match[1];  
 
anyFound = false;  
 
match.splice(1,1);  
 
if ( left.substr( left.length - 1 ) === "\\" ) {  
continue;  
}  
 
if ( curLoop === result ) {  
result = [];  
}  
 
if ( Expr.preFilter[ type ] ) {  
match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter );  
 
if ( !match ) {  
anyFound = found = true;  
 
} else if ( match === true ) {  
continue;  
}  
}  
 
if ( match ) {  
for ( var i = 0; (item = curLoop[i]) != null; i++ ) {  
if ( item ) {  
found = filter( item, match, i, curLoop );  
var pass = not ^ !!found;  
 
if ( inplace && found != null ) {  
if ( pass ) {  
anyFound = true;  
 
} else {  
curLoop[i] = false;  
}  
 
} else if ( pass ) {  
result.push( item );  
anyFound = true;  
}  
}  
}  
}  
 
if ( found !== undefined ) {  
if ( !inplace ) {  
curLoop = result;  
}  
 
expr = expr.replace( Expr.match[ type ], "" );  
 
if ( !anyFound ) {  
return [];  
}  
 
break;  
}  
}  
}  
 
// Improper expression  
if ( expr === old ) {  
if ( anyFound == null ) {  
Sizzle.error( expr );  
 
} else {  
break;  
}  
}  
 
old = expr;  
}  
 
return curLoop;  
};  
 
Sizzle.error = function( msg ) {  
throw "Syntax error, unrecognized expression: " + msg;  
};  
 
var Expr = Sizzle.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( elem ) {  
return elem.getAttribute( "href" );  
}  
},  
 
relative: {  
"+": function(checkSet, part){  
var isPartStr = typeof part === "string",  
isTag = isPartStr && !/\W/.test( part ),  
isPartStrNotTag = isPartStr && !isTag;  
 
if ( isTag ) {  
part = part.toLowerCase();  
}  
 
for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) {  
if ( (elem = checkSet[i]) ) {  
while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {}  
 
checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ?  
elem || false :  
elem === part;  
}  
}  
 
if ( isPartStrNotTag ) {  
Sizzle.filter( part, checkSet, true );  
}  
},  
 
">": function( checkSet, part ) {  
var elem,  
isPartStr = typeof part === "string",  
i = 0,  
l = checkSet.length;  
 
if ( isPartStr && !/\W/.test( part ) ) {  
part = part.toLowerCase();  
 
for ( ; i < l; i++ ) {  
elem = checkSet[i];  
 
if ( elem ) {  
var parent = elem.parentNode;  
checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false;  
}  
}  
 
} else {  
for ( ; i < l; i++ ) {  
elem = checkSet[i];  
 
if ( elem ) {  
checkSet[i] = isPartStr ?  
elem.parentNode :  
elem.parentNode === part;  
}  
}  
 
if ( isPartStr ) {  
Sizzle.filter( part, checkSet, true );  
}  
}  
},  
 
"": function(checkSet, part, isXML){  
var nodeCheck,  
doneName = done++,  
checkFn = dirCheck;  
 
if ( typeof part === "string" && !/\W/.test(part) ) {  
part = part.toLowerCase();  
nodeCheck = part;  
checkFn = dirNodeCheck;  
}  
 
checkFn( "parentNode", part, doneName, checkSet, nodeCheck, isXML );  
},  
 
"~": function( checkSet, part, isXML ) {  
var nodeCheck,  
doneName = done++,  
checkFn = dirCheck;  
 
if ( typeof part === "string" && !/\W/.test( part ) ) {  
part = part.toLowerCase();  
nodeCheck = part;  
checkFn = dirNodeCheck;  
}  
 
checkFn( "previousSibling", part, doneName, checkSet, nodeCheck, isXML );  
}  
},  
 
find: {  
ID: function( match, context, isXML ) {  
if ( typeof context.getElementById !== "undefined" && !isXML ) {  
var m = context.getElementById(match[1]);  
// Check parentNode to catch when Blackberry 4.6 returns  
// nodes that are no longer in the document #6963  
return m && m.parentNode ? [m] : [];  
}  
},  
 
NAME: function( match, context ) {  
if ( typeof context.getElementsByName !== "undefined" ) {  
var ret = [],  
results = context.getElementsByName( match[1] );  
 
for ( var i = 0, l = results.length; i < l; i++ ) {  
if ( results[i].getAttribute("name") === match[1] ) {  
ret.push( results[i] );  
}  
}  
 
return ret.length === 0 ? null : ret;  
}  
},  
 
TAG: function( match, context ) {  
if ( typeof context.getElementsByTagName !== "undefined" ) {  
return context.getElementsByTagName( match[1] );  
}  
}  
},  
preFilter: {  
CLASS: function( match, curLoop, inplace, result, not, isXML ) {  
match = " " + match[1].replace(/\\/g, "") + " ";  
 
if ( isXML ) {  
return match;  
}  
 
for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) {  
if ( elem ) {  
if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n\r]/g, " ").indexOf(match) >= 0) ) {  
if ( !inplace ) {  
result.push( elem );  
}  
 
} else if ( inplace ) {  
curLoop[i] = false;  
}  
}  
}  
 
return false;  
},  
 
ID: function( match ) {  
return match[1].replace(/\\/g, "");  
},  
 
TAG: function( match, curLoop ) {  
return match[1].toLowerCase();  
},  
 
CHILD: function( match ) {  
if ( match[1] === "nth" ) {  
if ( !match[2] ) {  
Sizzle.error( match[0] );  
}  
 
match[2] = match[2].replace(/^\+|\s*/g, '');  
 
// parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'  
var test = /(-?)(\d*)(?:n([+\-]?\d*))?/.exec(  
match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" ||  
!/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);  
 
// calculate the numbers (first)n+(last) including if they are negative  
match[2] = (test[1] + (test[2] || 1)) - 0;  
match[3] = test[3] - 0;  
}  
else if ( match[2] ) {  
Sizzle.error( match[0] );  
}  
 
// TODO: Move to normal caching system  
match[0] = done++;  
 
return match;  
},  
 
ATTR: function( match, curLoop, inplace, result, not, isXML ) {  
var name = match[1] = match[1].replace(/\\/g, "");  
 
if ( !isXML && Expr.attrMap[name] ) {  
match[1] = Expr.attrMap[name];  
}  
 
// Handle if an un-quoted value was used  
match[4] = ( match[4] || match[5] || "" ).replace(/\\/g, "");  
 
if ( match[2] === "~=" ) {  
match[4] = " " + match[4] + " ";  
}  
 
return match;  
},  
 
PSEUDO: function( match, curLoop, inplace, result, not ) {  
if ( match[1] === "not" ) {  
// If we're dealing with a complex expression, or a simple one  
if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) {  
match[3] = Sizzle(match[3], null, null, curLoop);  
 
} else {  
var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);  
 
if ( !inplace ) {  
result.push.apply( result, ret );  
}  
 
return false;  
}  
 
} else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) {  
return true;  
}  
 
return match;  
},  
 
POS: function( match ) {  
match.unshift( true );  
 
return match;  
}  
},  
 
filters: {  
enabled: function( elem ) {  
return elem.disabled === false && elem.type !== "hidden";  
},  
 
disabled: function( elem ) {  
return elem.disabled === true;  
},  
 
checked: function( elem ) {  
return elem.checked === true;  
},  
 
selected: function( elem ) {  
// Accessing this property makes selected-by-default  
// options in Safari work properly  
elem.parentNode.selectedIndex;  
 
return elem.selected === true;  
},  
 
parent: function( elem ) {  
return !!elem.firstChild;  
},  
 
empty: function( elem ) {  
return !elem.firstChild;  
},  
 
has: function( elem, i, match ) {  
return !!Sizzle( match[3], elem ).length;  
},  
 
header: function( elem ) {  
return (/h\d/i).test( elem.nodeName );  
},  
 
text: function( elem ) {  
return "text" === elem.type;  
},  
radio: function( elem ) {  
return "radio" === elem.type;  
},  
 
checkbox: function( elem ) {  
return "checkbox" === elem.type;  
},  
 
file: function( elem ) {  
return "file" === elem.type;  
},  
password: function( elem ) {  
return "password" === elem.type;  
},  
 
submit: function( elem ) {  
return "submit" === elem.type;  
},  
 
image: function( elem ) {  
return "image" === elem.type;  
},  
 
reset: function( elem ) {  
return "reset" === elem.type;  
},  
 
button: function( elem ) {  
return "button" === elem.type || elem.nodeName.toLowerCase() === "button";  
},  
 
input: function( elem ) {  
return (/input|select|textarea|button/i).test( elem.nodeName );  
}  
},  
setFilters: {  
first: function( elem, i ) {  
return i === 0;  
},  
 
last: function( elem, i, match, array ) {  
return i === array.length - 1;  
},  
 
even: function( elem, i ) {  
return i % 2 === 0;  
},  
 
odd: function( elem, i ) {  
return i % 2 === 1;  
},  
 
lt: function( elem, i, match ) {  
return i < match[3] - 0;  
},  
 
gt: function( elem, i, match ) {  
return i > match[3] - 0;  
},  
 
nth: function( elem, i, match ) {  
return match[3] - 0 === i;  
},  
 
eq: function( elem, i, match ) {  
return match[3] - 0 === i;  
}  
},  
filter: {  
PSEUDO: function( elem, match, i, array ) {  
var name = match[1],  
filter = Expr.filters[ name ];  
 
if ( filter ) {  
return filter( elem, i, match, array );  
 
} else if ( name === "contains" ) {  
return (elem.textContent || elem.innerText || Sizzle.getText([ elem ]) || "").indexOf(match[3]) >= 0;  
 
} else if ( name === "not" ) {  
var not = match[3];  
 
for ( var j = 0, l = not.length; j < l; j++ ) {  
if ( not[j] === elem ) {  
return false;  
}  
}  
 
return true;  
 
} else {  
Sizzle.error( name );  
}  
},  
 
CHILD: function( elem, match ) {  
var type = match[1],  
node = elem;  
 
switch ( type ) {  
case "only":  
case "first":  
while ( (node = node.previousSibling) ) {  
if ( node.nodeType === 1 ) {  
return false;  
}  
}  
 
if ( type === "first" ) {  
return true;  
}  
 
node = elem;  
 
case "last":  
while ( (node = node.nextSibling) ) {  
if ( node.nodeType === 1 ) {  
return false;  
}  
}  
 
return true;  
 
case "nth":  
var first = match[2],  
last = match[3];  
 
if ( first === 1 && last === 0 ) {  
return true;  
}  
 
var doneName = match[0],  
parent = elem.parentNode;  
 
if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) {  
var count = 0;  
 
for ( node = parent.firstChild; node; node = node.nextSibling ) {  
if ( node.nodeType === 1 ) {  
node.nodeIndex = ++count;  
}  
}  
 
parent.sizcache = doneName;  
}  
 
var diff = elem.nodeIndex - last;  
 
if ( first === 0 ) {  
return diff === 0;  
 
} else {  
return ( diff % first === 0 && diff / first >= 0 );  
}  
}  
},  
 
ID: function( elem, match ) {  
return elem.nodeType === 1 && elem.getAttribute("id") === match;  
},  
 
TAG: function( elem, match ) {  
return (match === "*" && elem.nodeType === 1) || elem.nodeName.toLowerCase() === match;  
},  
 
CLASS: function( elem, match ) {  
return (" " + (elem.className || elem.getAttribute("class")) + " ")  
.indexOf( match ) > -1;  
},  
 
ATTR: function( elem, match ) {  
var name = match[1],  
result = Expr.attrHandle[ name ] ?  
Expr.attrHandle[ name ]( elem ) :  
elem[ name ] != null ?  
elem[ name ] :  
elem.getAttribute( name ),  
value = result + "",  
type = match[2],  
check = match[4];  
 
return result == null ?  
type === "!=" :  
type === "=" ?  
value === check :  
type === "*=" ?  
value.indexOf(check) >= 0 :  
type === "~=" ?  
(" " + value + " ").indexOf(check) >= 0 :  
!check ?  
value && result !== false :  
type === "!=" ?  
value !== check :  
type === "^=" ?  
value.indexOf(check) === 0 :  
type === "$=" ?  
value.substr(value.length - check.length) === check :  
type === "|=" ?  
value === check || value.substr(0, check.length + 1) === check + "-" :  
false;  
},  
 
POS: function( elem, match, i, array ) {  
var name = match[2],  
filter = Expr.setFilters[ name ];  
 
if ( filter ) {  
return filter( elem, i, match, array );  
}  
}  
}  
};  
 
var origPOS = Expr.match.POS,  
fescape = function(all, num){  
return "\\" + (num - 0 + 1);  
};  
 
for ( var type in Expr.match ) {  
Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) );  
Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) );  
}  
 
var makeArray = function( array, results ) {  
array = Array.prototype.slice.call( array, 0 );  
 
if ( results ) {  
results.push.apply( results, array );  
return results;  
}  
 
return array;  
};  
 
// Perform a simple check to determine if the browser is capable of  
// converting a NodeList to an array using builtin methods.  
// Also verifies that the returned array holds DOM nodes  
// (which is not the case in the Blackberry browser)  
try {  
Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType;  
 
// Provide a fallback method if it does not work  
} catch( e ) {  
makeArray = function( array, results ) {  
var i = 0,  
ret = results || [];  
 
if ( toString.call(array) === "[object Array]" ) {  
Array.prototype.push.apply( ret, array );  
 
} else {  
if ( typeof array.length === "number" ) {  
for ( var l = array.length; i < l; i++ ) {  
ret.push( array[i] );  
}  
 
} else {  
for ( ; array[i]; i++ ) {  
ret.push( array[i] );  
}  
}  
}  
 
return ret;  
};  
}  
 
var sortOrder, siblingCheck;  
 
if ( document.documentElement.compareDocumentPosition ) {  
sortOrder = function( a, b ) {  
if ( a === b ) {  
hasDuplicate = true;  
return 0;  
}  
 
if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) {  
return a.compareDocumentPosition ? -1 : 1;  
}  
 
return a.compareDocumentPosition(b) & 4 ? -1 : 1;  
};  
 
} else {  
sortOrder = function( a, b ) {  
var al, bl,  
ap = [],  
bp = [],  
aup = a.parentNode,  
bup = b.parentNode,  
cur = aup;  
 
// The nodes are identical, we can exit early  
if ( a === b ) {  
hasDuplicate = true;  
return 0;  
 
// If the nodes are siblings (or identical) we can do a quick check  
} else if ( aup === bup ) {  
return siblingCheck( a, b );  
 
// If no parents were found then the nodes are disconnected  
} else if ( !aup ) {  
return -1;  
 
} else if ( !bup ) {  
return 1;  
}  
 
// Otherwise they're somewhere else in the tree so we need  
// to build up a full list of the parentNodes for comparison  
while ( cur ) {  
ap.unshift( cur );  
cur = cur.parentNode;  
}  
 
cur = bup;  
 
while ( cur ) {  
bp.unshift( cur );  
cur = cur.parentNode;  
}  
 
al = ap.length;  
bl = bp.length;  
 
// Start walking down the tree looking for a discrepancy  
for ( var i = 0; i < al && i < bl; i++ ) {  
if ( ap[i] !== bp[i] ) {  
return siblingCheck( ap[i], bp[i] );  
}  
}  
 
// We ended someplace up the tree so do a sibling check  
return i === al ?  
siblingCheck( a, bp[i], -1 ) :  
siblingCheck( ap[i], b, 1 );  
};  
 
siblingCheck = function( a, b, ret ) {  
if ( a === b ) {  
return ret;  
}  
 
var cur = a.nextSibling;  
 
while ( cur ) {  
if ( cur === b ) {  
return -1;  
}  
 
cur = cur.nextSibling;  
}  
 
return 1;  
};  
}  
 
// Utility function for retreiving the text value of an array of DOM nodes  
Sizzle.getText = function( elems ) {  
var ret = "", elem;  
 
for ( var i = 0; elems[i]; i++ ) {  
elem = elems[i];  
 
// Get the text from text nodes and CDATA nodes  
if ( elem.nodeType === 3 || elem.nodeType === 4 ) {  
ret += elem.nodeValue;  
 
// Traverse everything else, except comment nodes  
} else if ( elem.nodeType !== 8 ) {  
ret += Sizzle.getText( elem.childNodes );  
}  
}  
 
return ret;  
};  
 
// Check to see if the browser returns elements by name when  
// querying by getElementById (and provide a workaround)  
(function(){  
// We're going to inject a fake input element with a specified name  
var form = document.createElement("div"),  
id = "script" + (new Date()).getTime(),  
root = document.documentElement;  
 
form.innerHTML = "<a name='" + id + "'/>";  
 
// Inject it into the root element, check its status, and remove it quickly  
root.insertBefore( form, root.firstChild );  
 
// The workaround has to do additional checks after a getElementById  
// Which slows things down for other browsers (hence the branching)  
if ( document.getElementById( id ) ) {  
Expr.find.ID = function( match, context, isXML ) {  
if ( typeof context.getElementById !== "undefined" && !isXML ) {  
var m = context.getElementById(match[1]);  
 
return m ?  
m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ?  
[m] :  
undefined :  
[];  
}  
};  
 
Expr.filter.ID = function( elem, match ) {  
var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");  
 
return elem.nodeType === 1 && node && node.nodeValue === match;  
};  
}  
 
root.removeChild( form );  
 
// release memory in IE  
root = form = null;  
})();  
 
(function(){  
// Check to see if the browser returns only elements  
// when doing getElementsByTagName("*")  
 
// Create a fake element  
var div = document.createElement("div");  
div.appendChild( document.createComment("") );  
 
// Make sure no comments are found  
if ( div.getElementsByTagName("*").length > 0 ) {  
Expr.find.TAG = function( match, context ) {  
var results = context.getElementsByTagName( match[1] );  
 
// Filter out possible comments  
if ( match[1] === "*" ) {  
var tmp = [];  
 
for ( var i = 0; results[i]; i++ ) {  
if ( results[i].nodeType === 1 ) {  
tmp.push( results[i] );  
}  
}  
 
results = tmp;  
}  
 
return results;  
};  
}  
 
// Check to see if an attribute returns normalized href attributes  
div.innerHTML = "<a href='#'></a>";  
 
if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" &&  
div.firstChild.getAttribute("href") !== "#" ) {  
 
Expr.attrHandle.href = function( elem ) {  
return elem.getAttribute( "href", 2 );  
};  
}  
 
// release memory in IE  
div = null;  
})();  
 
if ( document.querySelectorAll ) {  
(function(){  
var oldSizzle = Sizzle,  
div = document.createElement("div"),  
id = "__sizzle__";  
 
div.innerHTML = "<p class='TEST'></p>";  
 
// Safari can't handle uppercase or unicode characters when  
// in quirks mode.  
if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {  
return;  
}  
 
Sizzle = function( query, context, extra, seed ) {  
context = context || document;  
 
// Only use querySelectorAll on non-XML documents  
// (ID selectors don't work in non-HTML documents)  
if ( !seed && !Sizzle.isXML(context) ) {  
// See if we find a selector to speed up  
var match = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec( query );  
 
if ( match && (context.nodeType === 1 || context.nodeType === 9) ) {  
// Speed-up: Sizzle("TAG")  
if ( match[1] ) {  
return makeArray( context.getElementsByTagName( query ), extra );  
 
// Speed-up: Sizzle(".CLASS")  
} else if ( match[2] && Expr.find.CLASS && context.getElementsByClassName ) {  
return makeArray( context.getElementsByClassName( match[2] ), extra );  
}  
}  
 
if ( context.nodeType === 9 ) {  
// Speed-up: Sizzle("body")  
// The body element only exists once, optimize finding it  
if ( query === "body" && context.body ) {  
return makeArray( [ context.body ], extra );  
 
// Speed-up: Sizzle("#ID")  
} else if ( match && match[3] ) {  
var elem = context.getElementById( match[3] );  
 
// Check parentNode to catch when Blackberry 4.6 returns  
// nodes that are no longer in the document #6963  
if ( elem && elem.parentNode ) {  
// Handle the case where IE and Opera return items  
// by name instead of ID  
if ( elem.id === match[3] ) {  
return makeArray( [ elem ], extra );  
}  
 
} else {  
return makeArray( [], extra );  
}  
}  
 
try {  
return makeArray( context.querySelectorAll(query), extra );  
} catch(qsaError) {}  
 
// qSA works strangely on Element-rooted queries  
// We can work around this by specifying an extra ID on the root  
// and working up from there (Thanks to Andrew Dupont for the technique)  
// IE 8 doesn't work on object elements  
} else if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {  
var old = context.getAttribute( "id" ),  
nid = old || id,  
hasParent = context.parentNode,  
relativeHierarchySelector = /^\s*[+~]/.test( query );  
 
if ( !old ) {  
context.setAttribute( "id", nid );  
} else {  
nid = nid.replace( /'/g, "\\$&" );  
}  
if ( relativeHierarchySelector && hasParent ) {  
context = context.parentNode;  
}  
 
try {  
if ( !relativeHierarchySelector || hasParent ) {  
return makeArray( context.querySelectorAll( "[id='" + nid + "'] " + query ), extra );  
}  
 
} catch(pseudoError) {  
} finally {  
if ( !old ) {  
context.removeAttribute( "id" );  
}  
}  
}  
}  
 
return oldSizzle(query, context, extra, seed);  
};  
 
for ( var prop in oldSizzle ) {  
Sizzle[ prop ] = oldSizzle[ prop ];  
}  
 
// release memory in IE  
div = null;  
})();  
}  
 
(function(){  
var html = document.documentElement,  
matches = html.matchesSelector || html.mozMatchesSelector || html.webkitMatchesSelector || html.msMatchesSelector,  
pseudoWorks = false;  
 
try {  
// This should fail with an exception  
// Gecko does not error, returns false instead  
matches.call( document.documentElement, "[test!='']:sizzle" );  
 
} catch( pseudoError ) {  
pseudoWorks = true;  
}  
 
if ( matches ) {  
Sizzle.matchesSelector = function( node, expr ) {  
// Make sure that attribute selectors are quoted  
expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']");  
 
if ( !Sizzle.isXML( node ) ) {  
try {  
if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) {  
return matches.call( node, expr );  
}  
} catch(e) {}  
}  
 
return Sizzle(expr, null, null, [node]).length > 0;  
};  
}  
})();  
 
(function(){  
var div = document.createElement("div");  
 
div.innerHTML = "<div class='test e'></div><div class='test'></div>";  
 
// Opera can't find a second classname (in 9.6)  
// Also, make sure that getElementsByClassName actually exists  
if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) {  
return;  
}  
 
// Safari caches class attributes, doesn't catch changes (in 3.2)  
div.lastChild.className = "e";  
 
if ( div.getElementsByClassName("e").length === 1 ) {  
return;  
}  
 
Expr.order.splice(1, 0, "CLASS");  
Expr.find.CLASS = function( match, context, isXML ) {  
if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) {  
return context.getElementsByClassName(match[1]);  
}  
};  
 
// release memory in IE  
div = null;  
})();  
 
function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {  
for ( var i = 0, l = checkSet.length; i < l; i++ ) {  
var elem = checkSet[i];  
 
if ( elem ) {  
var match = false;  
 
elem = elem[dir];  
 
while ( elem ) {  
if ( elem.sizcache === doneName ) {  
match = checkSet[elem.sizset];  
break;  
}  
 
if ( elem.nodeType === 1 && !isXML ){  
elem.sizcache = doneName;  
elem.sizset = i;  
}  
 
if ( elem.nodeName.toLowerCase() === cur ) {  
match = elem;  
break;  
}  
 
elem = elem[dir];  
}  
 
checkSet[i] = match;  
}  
}  
}  
 
function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {  
for ( var i = 0, l = checkSet.length; i < l; i++ ) {  
var elem = checkSet[i];  
 
if ( elem ) {  
var match = false;  
 
elem = elem[dir];  
 
while ( elem ) {  
if ( elem.sizcache === doneName ) {  
match = checkSet[elem.sizset];  
break;  
}  
 
if ( elem.nodeType === 1 ) {  
if ( !isXML ) {  
elem.sizcache = doneName;  
elem.sizset = i;  
}  
 
if ( typeof cur !== "string" ) {  
if ( elem === cur ) {  
match = true;  
break;  
}  
 
} else if ( Sizzle.filter( cur, [elem] ).length > 0 ) {  
match = elem;  
break;  
}  
}  
 
elem = elem[dir];  
}  
 
checkSet[i] = match;  
}  
}  
}  
 
if ( document.documentElement.contains ) {  
Sizzle.contains = function( a, b ) {  
return a !== b && (a.contains ? a.contains(b) : true);  
};  
 
} else if ( document.documentElement.compareDocumentPosition ) {  
Sizzle.contains = function( a, b ) {  
return !!(a.compareDocumentPosition(b) & 16);  
};  
 
} else {  
Sizzle.contains = function() {  
return false;  
};  
}  
 
Sizzle.isXML = function( elem ) {  
// documentElement is verified for cases where it doesn't yet exist  
// (such as loading iframes in IE - #4833)  
var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement;  
 
return documentElement ? documentElement.nodeName !== "HTML" : false;  
};  
 
var posProcess = function( selector, context ) {  
var match,  
tmpSet = [],  
later = "",  
root = context.nodeType ? [context] : context;  
 
// Position selectors must be done after the filter  
// And so must :not(positional) so we move all PSEUDOs to the end  
while ( (match = Expr.match.PSEUDO.exec( selector )) ) {  
later += match[0];  
selector = selector.replace( Expr.match.PSEUDO, "" );  
}  
 
selector = Expr.relative[selector] ? selector + "*" : selector;  
 
for ( var i = 0, l = root.length; i < l; i++ ) {  
Sizzle( selector, root[i], tmpSet );  
}  
 
return Sizzle.filter( later, tmpSet );  
};  
 
// EXPOSE  
jQuery.find = Sizzle;  
jQuery.expr = Sizzle.selectors;  
jQuery.expr[":"] = jQuery.expr.filters;  
jQuery.unique = Sizzle.uniqueSort;  
jQuery.text = Sizzle.getText;  
jQuery.isXMLDoc = Sizzle.isXML;  
jQuery.contains = Sizzle.contains;  
 
 
})();  
 
 
var runtil = /Until$/,  
rparentsprev = /^(?:parents|prevUntil|prevAll)/,  
// Note: This RegExp should be improved, or likely pulled from Sizzle  
rmultiselector = /,/,  
isSimple = /^.[^:#\[\.,]*$/,  
slice = Array.prototype.slice,  
POS = jQuery.expr.match.POS,  
// methods guaranteed to produce a unique set when starting from a unique set  
guaranteedUnique = {  
children: true,  
contents: true,  
next: true,  
prev: true  
};  
 
jQuery.fn.extend({  
find: function( selector ) {  
var ret = this.pushStack( "", "find", selector ),  
length = 0;  
 
for ( var i = 0, l = this.length; i < l; i++ ) {  
length = ret.length;  
jQuery.find( selector, this[i], ret );  
 
if ( i > 0 ) {  
// Make sure that the results are unique  
for ( var n = length; n < ret.length; n++ ) {  
for ( var r = 0; r < length; r++ ) {  
if ( ret[r] === ret[n] ) {  
ret.splice(n--, 1);  
break;  
}  
}  
}  
}  
}  
 
return ret;  
},  
 
has: function( target ) {  
var targets = jQuery( target );  
return this.filter(function() {  
for ( var i = 0, l = targets.length; i < l; i++ ) {  
if ( jQuery.contains( this, targets[i] ) ) {  
return true;  
}  
}  
});  
},  
 
not: function( selector ) {  
return this.pushStack( winnow(this, selector, false), "not", selector);  
},  
 
filter: function( selector ) {  
return this.pushStack( winnow(this, selector, true), "filter", selector );  
},  
 
is: function( selector ) {  
return !!selector && jQuery.filter( selector, this ).length > 0;  
},  
 
closest: function( selectors, context ) {  
var ret = [], i, l, cur = this[0];  
 
if ( jQuery.isArray( selectors ) ) {  
var match, selector,  
matches = {},  
level = 1;  
 
if ( cur && selectors.length ) {  
for ( i = 0, l = selectors.length; i < l; i++ ) {  
selector = selectors[i];  
 
if ( !matches[selector] ) {  
matches[selector] = jQuery.expr.match.POS.test( selector ) ?  
jQuery( selector, context || this.context ) :  
selector;  
}  
}  
 
while ( cur && cur.ownerDocument && cur !== context ) {  
for ( selector in matches ) {  
match = matches[selector];  
 
if ( match.jquery ? match.index(cur) > -1 : jQuery(cur).is(match) ) {  
ret.push({ selector: selector, elem: cur, level: level });  
}  
}  
 
cur = cur.parentNode;  
level++;  
}  
}  
 
return ret;  
}  
 
var pos = POS.test( selectors ) ?  
jQuery( selectors, context || this.context ) : null;  
 
for ( i = 0, l = this.length; i < l; i++ ) {  
cur = this[i];  
 
while ( cur ) {  
if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) {  
ret.push( cur );  
break;  
 
} else {  
cur = cur.parentNode;  
if ( !cur || !cur.ownerDocument || cur === context ) {  
break;  
}  
}  
}  
}  
 
ret = ret.length > 1 ? jQuery.unique(ret) : ret;  
 
return this.pushStack( ret, "closest", selectors );  
},  
 
// Determine the position of an element within  
// the matched set of elements  
index: function( elem ) {  
if ( !elem || typeof elem === "string" ) {  
return jQuery.inArray( this[0],  
// If it receives a string, the selector is used  
// If it receives nothing, the siblings are used  
elem ? jQuery( elem ) : this.parent().children() );  
}  
// Locate the position of the desired element  
return jQuery.inArray(  
// If it receives a jQuery object, the first element is used  
elem.jquery ? elem[0] : elem, this );  
},  
 
add: function( selector, context ) {  
var set = typeof selector === "string" ?  
jQuery( selector, context ) :  
jQuery.makeArray( selector ),  
all = jQuery.merge( this.get(), set );  
 
return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ?  
all :  
jQuery.unique( all ) );  
},  
 
andSelf: function() {  
return this.add( this.prevObject );  
}  
});  
 
// A painfully simple check to see if an element is disconnected  
// from a document (should be improved, where feasible).  
function isDisconnected( node ) {  
return !node || !node.parentNode || node.parentNode.nodeType === 11;  
}  
 
jQuery.each({  
parent: function( elem ) {  
var parent = elem.parentNode;  
return parent && parent.nodeType !== 11 ? parent : null;  
},  
parents: function( elem ) {  
return jQuery.dir( elem, "parentNode" );  
},  
parentsUntil: function( elem, i, until ) {  
return jQuery.dir( elem, "parentNode", until );  
},  
next: function( elem ) {  
return jQuery.nth( elem, 2, "nextSibling" );  
},  
prev: function( elem ) {  
return jQuery.nth( elem, 2, "previousSibling" );  
},  
nextAll: function( elem ) {  
return jQuery.dir( elem, "nextSibling" );  
},  
prevAll: function( elem ) {  
return jQuery.dir( elem, "previousSibling" );  
},  
nextUntil: function( elem, i, until ) {  
return jQuery.dir( elem, "nextSibling", until );  
},  
prevUntil: function( elem, i, until ) {  
return jQuery.dir( elem, "previousSibling", until );  
},  
siblings: function( elem ) {  
return jQuery.sibling( elem.parentNode.firstChild, elem );  
},  
children: function( elem ) {  
return jQuery.sibling( elem.firstChild );  
},  
contents: function( elem ) {  
return jQuery.nodeName( elem, "iframe" ) ?  
elem.contentDocument || elem.contentWindow.document :  
jQuery.makeArray( elem.childNodes );  
}  
}, function( name, fn ) {  
jQuery.fn[ name ] = function( until, selector ) {  
var ret = jQuery.map( this, fn, until ),  
// The variable 'args' was introduced in  
// https://github.com/jquery/jquery/commit/52a0238  
// to work around a bug in Chrome 10 (Dev) and should be removed when the bug is fixed.  
// http://code.google.com/p/v8/issues/detail?id=1050  
args = slice.call(arguments);  
 
if ( !runtil.test( name ) ) {  
selector = until;  
}  
 
if ( selector && typeof selector === "string" ) {  
ret = jQuery.filter( selector, ret );  
}  
 
ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret;  
 
if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) {  
ret = ret.reverse();  
}  
 
return this.pushStack( ret, name, args.join(",") );  
};  
});  
 
jQuery.extend({  
filter: function( expr, elems, not ) {  
if ( not ) {  
expr = ":not(" + expr + ")";  
}  
 
return elems.length === 1 ?  
jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] :  
jQuery.find.matches(expr, elems);  
},  
 
dir: function( elem, dir, until ) {  
var matched = [],  
cur = elem[ dir ];  
 
while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {  
if ( cur.nodeType === 1 ) {  
matched.push( cur );  
}  
cur = cur[dir];  
}  
return matched;  
},  
 
nth: function( cur, result, dir, elem ) {  
result = result || 1;  
var num = 0;  
 
for ( ; cur; cur = cur[dir] ) {  
if ( cur.nodeType === 1 && ++num === result ) {  
break;  
}  
}  
 
return cur;  
},  
 
sibling: function( n, elem ) {  
var r = [];  
 
for ( ; n; n = n.nextSibling ) {  
if ( n.nodeType === 1 && n !== elem ) {  
r.push( n );  
}  
}  
 
return r;  
}  
});  
 
// Implement the identical functionality for filter and not  
function winnow( elements, qualifier, keep ) {  
if ( jQuery.isFunction( qualifier ) ) {  
return jQuery.grep(elements, function( elem, i ) {  
var retVal = !!qualifier.call( elem, i, elem );  
return retVal === keep;  
});  
 
} else if ( qualifier.nodeType ) {  
return jQuery.grep(elements, function( elem, i ) {  
return (elem === qualifier) === keep;  
});  
 
} else if ( typeof qualifier === "string" ) {  
var filtered = jQuery.grep(elements, function( elem ) {  
return elem.nodeType === 1;  
});  
 
if ( isSimple.test( qualifier ) ) {  
return jQuery.filter(qualifier, filtered, !keep);  
} else {  
qualifier = jQuery.filter( qualifier, filtered );  
}  
}  
 
return jQuery.grep(elements, function( elem, i ) {  
return (jQuery.inArray( elem, qualifier ) >= 0) === keep;  
});  
}  
 
 
 
 
var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,  
rleadingWhitespace = /^\s+/,  
rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,  
rtagName = /<([\w:]+)/,  
rtbody = /<tbody/i,  
rhtml = /<|&#?\w+;/,  
rnocache = /<(?:script|object|embed|option|style)/i,  
// checked="checked" or checked (html5)  
rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,  
wrapMap = {  
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, "", "" ]  
};  
 
wrapMap.optgroup = wrapMap.option;  
wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;  
wrapMap.th = wrapMap.td;  
 
// IE can't serialize <link> and <script> tags normally  
if ( !jQuery.support.htmlSerialize ) {  
wrapMap._default = [ 1, "div<div>", "</div>" ];  
}  
 
jQuery.fn.extend({  
text: function( text ) {  
if ( jQuery.isFunction(text) ) {  
return this.each(function(i) {  
var self = jQuery( this );  
 
self.text( text.call(this, i, self.text()) );  
});  
}  
 
if ( typeof text !== "object" && text !== undefined ) {  
return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) );  
}  
 
return jQuery.text( this );  
},  
 
wrapAll: function( html ) {  
if ( jQuery.isFunction( html ) ) {  
return this.each(function(i) {  
jQuery(this).wrapAll( html.call(this, i) );  
});  
}  
 
if ( this[0] ) {  
// The elements to wrap the target around  
var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);  
 
if ( this[0].parentNode ) {  
wrap.insertBefore( this[0] );  
}  
 
wrap.map(function() {  
var elem = this;  
 
while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {  
elem = elem.firstChild;  
}  
 
return elem;  
}).append(this);  
}  
 
return this;  
},  
 
wrapInner: function( html ) {  
if ( jQuery.isFunction( html ) ) {  
return this.each(function(i) {  
jQuery(this).wrapInner( html.call(this, i) );  
});  
}  
 
return this.each(function() {  
var self = jQuery( this ),  
contents = self.contents();  
 
if ( contents.length ) {  
contents.wrapAll( html );  
 
} else {  
self.append( html );  
}  
});  
},  
 
wrap: function( html ) {  
return this.each(function() {  
jQuery( this ).wrapAll( html );  
});  
},  
 
unwrap: function() {  
return this.parent().each(function() {  
if ( !jQuery.nodeName( this, "body" ) ) {  
jQuery( this ).replaceWith( this.childNodes );  
}  
}).end();  
},  
 
append: function() {  
return this.domManip(arguments, true, function( elem ) {  
if ( this.nodeType === 1 ) {  
this.appendChild( elem );  
}  
});  
},  
 
prepend: function() {  
return this.domManip(arguments, true, function( elem ) {  
if ( this.nodeType === 1 ) {  
this.insertBefore( elem, this.firstChild );  
}  
});  
},  
 
before: function() {  
if ( this[0] && this[0].parentNode ) {  
return this.domManip(arguments, false, function( elem ) {  
this.parentNode.insertBefore( elem, this );  
});  
} else if ( arguments.length ) {  
var set = jQuery(arguments[0]);  
set.push.apply( set, this.toArray() );  
return this.pushStack( set, "before", arguments );  
}  
},  
 
after: function() {  
if ( this[0] && this[0].parentNode ) {  
return this.domManip(arguments, false, function( elem ) {  
this.parentNode.insertBefore( elem, this.nextSibling );  
});  
} else if ( arguments.length ) {  
var set = this.pushStack( this, "after", arguments );  
set.push.apply( set, jQuery(arguments[0]).toArray() );  
return set;  
}  
},  
 
// keepData is for internal use only--do not document  
remove: function( selector, keepData ) {  
for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {  
if ( !selector || jQuery.filter( selector, [ elem ] ).length ) {  
if ( !keepData && elem.nodeType === 1 ) {  
jQuery.cleanData( elem.getElementsByTagName("*") );  
jQuery.cleanData( [ elem ] );  
}  
 
if ( elem.parentNode ) {  
elem.parentNode.removeChild( elem );  
}  
}  
}  
 
return this;  
},  
 
empty: function() {  
for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {  
// Remove element nodes and prevent memory leaks  
if ( elem.nodeType === 1 ) {  
jQuery.cleanData( elem.getElementsByTagName("*") );  
}  
 
// Remove any remaining nodes  
while ( elem.firstChild ) {  
elem.removeChild( elem.firstChild );  
}  
}  
 
return this;  
},  
 
clone: function( dataAndEvents, deepDataAndEvents ) {  
dataAndEvents = dataAndEvents == null ? true : dataAndEvents;  
deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;  
 
return this.map( function () {  
return jQuery.clone( this, dataAndEvents, deepDataAndEvents );  
});  
},  
 
html: function( value ) {  
if ( value === undefined ) {  
return this[0] && this[0].nodeType === 1 ?  
this[0].innerHTML.replace(rinlinejQuery, "") :  
null;  
 
// See if we can take a shortcut and just use innerHTML  
} else if ( typeof value === "string" && !rnocache.test( value ) &&  
(jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value )) &&  
!wrapMap[ (rtagName.exec( value ) || ["", ""])[1].toLowerCase() ] ) {  
 
value = value.replace(rxhtmlTag, "<$1></$2>");  
 
try {  
for ( var i = 0, l = this.length; i < l; i++ ) {  
// Remove element nodes and prevent memory leaks  
if ( this[i].nodeType === 1 ) {  
jQuery.cleanData( this[i].getElementsByTagName("*") );  
this[i].innerHTML = value;  
}  
}  
 
// If using innerHTML throws an exception, use the fallback method  
} catch(e) {  
this.empty().append( value );  
}  
 
} else if ( jQuery.isFunction( value ) ) {  
this.each(function(i){  
var self = jQuery( this );  
 
self.html( value.call(this, i, self.html()) );  
});  
 
} else {  
this.empty().append( value );  
}  
 
return this;  
},  
 
replaceWith: function( value ) {  
if ( this[0] && this[0].parentNode ) {  
// Make sure that the elements are removed from the DOM before they are inserted  
// this can help fix replacing a parent with child elements  
if ( jQuery.isFunction( value ) ) {  
return this.each(function(i) {  
var self = jQuery(this), old = self.html();  
self.replaceWith( value.call( this, i, old ) );  
});  
}  
 
if ( typeof value !== "string" ) {  
value = jQuery( value ).detach();  
}  
 
return this.each(function() {  
var next = this.nextSibling,  
parent = this.parentNode;  
 
jQuery( this ).remove();  
 
if ( next ) {  
jQuery(next).before( value );  
} else {  
jQuery(parent).append( value );  
}  
});  
} else {  
return this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value );  
}  
},  
 
detach: function( selector ) {  
return this.remove( selector, true );  
},  
 
domManip: function( args, table, callback ) {  
var results, first, fragment, parent,  
value = args[0],  
scripts = [];  
 
// We can't cloneNode fragments that contain checked, in WebKit  
if ( !jQuery.support.checkClone && arguments.length === 3 && typeof value === "string" && rchecked.test( value ) ) {  
return this.each(function() {  
jQuery(this).domManip( args, table, callback, true );  
});  
}  
 
if ( jQuery.isFunction(value) ) {  
return this.each(function(i) {  
var self = jQuery(this);  
args[0] = value.call(this, i, table ? self.html() : undefined);  
self.domManip( args, table, callback );  
});  
}  
 
if ( this[0] ) {  
parent = value && value.parentNode;  
 
// If we're in a fragment, just use that instead of building a new one  
if ( jQuery.support.parentNode && parent && parent.nodeType === 11 && parent.childNodes.length === this.length ) {  
results = { fragment: parent };  
 
} else {  
results = jQuery.buildFragment( args, this, scripts );  
}  
 
fragment = results.fragment;  
 
if ( fragment.childNodes.length === 1 ) {  
first = fragment = fragment.firstChild;  
} else {  
first = fragment.firstChild;  
}  
 
if ( first ) {  
table = table && jQuery.nodeName( first, "tr" );  
 
for ( var i = 0, l = this.length, lastIndex = l - 1; i < l; i++ ) {  
callback.call(  
table ?  
root(this[i], first) :  
this[i],  
// Make sure that we do not leak memory by inadvertently discarding  
// the original fragment (which might have attached data) instead of  
// using it; in addition, use the original fragment object for the last  
// item instead of first because it can end up being emptied incorrectly  
// in certain situations (Bug #8070).  
// Fragments from the fragment cache must always be cloned and never used  
// in place.  
results.cacheable || (l > 1 && i < lastIndex) ?  
jQuery.clone( fragment, true, true ) :  
fragment  
);  
}  
}  
 
if ( scripts.length ) {  
jQuery.each( scripts, evalScript );  
}  
}  
 
return this;  
}  
});  
 
function root( elem, cur ) {  
return jQuery.nodeName(elem, "table") ?  
(elem.getElementsByTagName("tbody")[0] ||  
elem.appendChild(elem.ownerDocument.createElement("tbody"))) :  
elem;  
}  
 
function cloneCopyEvent( src, dest ) {  
 
if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) {  
return;  
}  
 
var internalKey = jQuery.expando,  
oldData = jQuery.data( src ),  
curData = jQuery.data( dest, oldData );  
 
// Switch to use the internal data object, if it exists, for the next  
// stage of data copying  
if ( (oldData = oldData[ internalKey ]) ) {  
var events = oldData.events;  
curData = curData[ internalKey ] = jQuery.extend({}, oldData);  
 
if ( events ) {  
delete curData.handle;  
curData.events = {};  
 
for ( var type in events ) {  
for ( var i = 0, l = events[ type ].length; i < l; i++ ) {  
jQuery.event.add( dest, type, events[ type ][ i ], events[ type ][ i ].data );  
}  
}  
}  
}  
}  
 
function cloneFixAttributes(src, dest) {  
// We do not need to do anything for non-Elements  
if ( dest.nodeType !== 1 ) {  
return;  
}  
 
var nodeName = dest.nodeName.toLowerCase();  
 
// clearAttributes removes the attributes, which we don't want,  
// but also removes the attachEvent events, which we *do* want  
dest.clearAttributes();  
 
// mergeAttributes, in contrast, only merges back on the  
// original attributes, not the events  
dest.mergeAttributes(src);  
 
// IE6-8 fail to clone children inside object elements that use  
// the proprietary classid attribute value (rather than the type  
// attribute) to identify the type of content to display  
if ( nodeName === "object" ) {  
dest.outerHTML = src.outerHTML;  
 
} else if ( nodeName === "input" && (src.type === "checkbox" || src.type === "radio") ) {  
// IE6-8 fails to persist the checked state of a cloned checkbox  
// or radio button. Worse, IE6-7 fail to give the cloned element  
// a checked appearance if the defaultChecked value isn't also set  
if ( src.checked ) {  
dest.defaultChecked = dest.checked = src.checked;  
}  
 
// IE6-7 get confused and end up setting the value of a cloned  
// checkbox/radio button to an empty string instead of "on"  
if ( dest.value !== src.value ) {  
dest.value = src.value;  
}  
 
// IE6-8 fails to return the selected option to the default selected  
// state when cloning options  
} else if ( nodeName === "option" ) {  
dest.selected = src.defaultSelected;  
 
// IE6-8 fails to set the defaultValue to the correct value when  
// cloning other types of input fields  
} else if ( nodeName === "input" || nodeName === "textarea" ) {  
dest.defaultValue = src.defaultValue;  
}  
 
// Event data gets referenced instead of copied if the expando  
// gets copied too  
dest.removeAttribute( jQuery.expando );  
}  
 
jQuery.buildFragment = function( args, nodes, scripts ) {  
var fragment, cacheable, cacheresults,  
doc = (nodes && nodes[0] ? nodes[0].ownerDocument || nodes[0] : document);  
 
// Only cache "small" (1/2 KB) HTML strings that are associated with the main document  
// Cloning options loses the selected state, so don't cache them  
// IE 6 doesn't like it when you put <object> or <embed> elements in a fragment  
// Also, WebKit does not clone 'checked' attributes on cloneNode, so don't cache  
if ( args.length === 1 && typeof args[0] === "string" && args[0].length < 512 && doc === document &&  
args[0].charAt(0) === "<" && !rnocache.test( args[0] ) && (jQuery.support.checkClone || !rchecked.test( args[0] )) ) {  
 
cacheable = true;  
cacheresults = jQuery.fragments[ args[0] ];  
if ( cacheresults ) {  
if ( cacheresults !== 1 ) {  
fragment = cacheresults;  
}  
}  
}  
 
if ( !fragment ) {  
fragment = doc.createDocumentFragment();  
jQuery.clean( args, doc, fragment, scripts );  
}  
 
if ( cacheable ) {  
jQuery.fragments[ args[0] ] = cacheresults ? fragment : 1;  
}  
 
return { fragment: fragment, cacheable: cacheable };  
};  
 
jQuery.fragments = {};  
 
jQuery.each({  
appendTo: "append",  
prependTo: "prepend",  
insertBefore: "before",  
insertAfter: "after",  
replaceAll: "replaceWith"  
}, function( name, original ) {  
jQuery.fn[ name ] = function( selector ) {  
var ret = [],  
insert = jQuery( selector ),  
parent = this.length === 1 && this[0].parentNode;  
 
if ( parent && parent.nodeType === 11 && parent.childNodes.length === 1 && insert.length === 1 ) {  
insert[ original ]( this[0] );  
return this;  
 
} else {  
for ( var i = 0, l = insert.length; i < l; i++ ) {  
var elems = (i > 0 ? this.clone(true) : this).get();  
jQuery( insert[i] )[ original ]( elems );  
ret = ret.concat( elems );  
}  
 
return this.pushStack( ret, name, insert.selector );  
}  
};  
});  
 
jQuery.extend({  
clone: function( elem, dataAndEvents, deepDataAndEvents ) {  
var clone = elem.cloneNode(true),  
srcElements,  
destElements,  
i;  
 
if ( !jQuery.support.noCloneEvent && (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) {  
// IE copies events bound via attachEvent when using cloneNode.  
// Calling detachEvent on the clone will also remove the events  
// from the original. In order to get around this, we use some  
// proprietary methods to clear the events. Thanks to MooTools  
// guys for this hotness.  
 
// Using Sizzle here is crazy slow, so we use getElementsByTagName  
// instead  
srcElements = elem.getElementsByTagName("*");  
destElements = clone.getElementsByTagName("*");  
 
// Weird iteration because IE will replace the length property  
// with an element if you are cloning the body and one of the  
// elements on the page has a name or id of "length"  
for ( i = 0; srcElements[i]; ++i ) {  
cloneFixAttributes( srcElements[i], destElements[i] );  
}  
 
cloneFixAttributes( elem, clone );  
}  
 
// Copy the events from the original to the clone  
if ( dataAndEvents ) {  
 
cloneCopyEvent( elem, clone );  
 
if ( deepDataAndEvents && "getElementsByTagName" in elem ) {  
 
srcElements = elem.getElementsByTagName("*");  
destElements = clone.getElementsByTagName("*");  
 
if ( srcElements.length ) {  
for ( i = 0; srcElements[i]; ++i ) {  
cloneCopyEvent( srcElements[i], destElements[i] );  
}  
}  
}  
}  
// Return the cloned set  
return clone;  
},  
clean: function( elems, context, fragment, scripts ) {  
context = context || document;  
 
// !context.createElement fails in IE with an error but returns typeof 'object'  
if ( typeof context.createElement === "undefined" ) {  
context = context.ownerDocument || context[0] && context[0].ownerDocument || document;  
}  
 
var ret = [];  
 
for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {  
if ( typeof elem === "number" ) {  
elem += "";  
}  
 
if ( !elem ) {  
continue;  
}  
 
// Convert html string into DOM nodes  
if ( typeof elem === "string" && !rhtml.test( elem ) ) {  
elem = context.createTextNode( elem );  
 
} else if ( typeof elem === "string" ) {  
// Fix "XHTML"-style tags in all browsers  
elem = elem.replace(rxhtmlTag, "<$1></$2>");  
 
// Trim whitespace, otherwise indexOf won't work as expected  
var tag = (rtagName.exec( elem ) || ["", ""])[1].toLowerCase(),  
wrap = wrapMap[ tag ] || wrapMap._default,  
depth = wrap[0],  
div = context.createElement("div");  
 
// Go to html and back, then peel off extra wrappers  
div.innerHTML = wrap[1] + elem + wrap[2];  
 
// Move to the right depth  
while ( depth-- ) {  
div = div.lastChild;  
}  
 
// Remove IE's autoinserted <tbody> from table fragments  
if ( !jQuery.support.tbody ) {  
 
// String was a <table>, *may* have spurious <tbody>  
var hasBody = rtbody.test(elem),  
tbody = tag === "table" && !hasBody ?  
div.firstChild && div.firstChild.childNodes :  
 
// String was a bare <thead> or <tfoot>  
wrap[1] === "<table>" && !hasBody ?  
div.childNodes :  
[];  
 
for ( var j = tbody.length - 1; j >= 0 ; --j ) {  
if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) {  
tbody[ j ].parentNode.removeChild( tbody[ j ] );  
}  
}  
 
}  
 
// IE completely kills leading whitespace when innerHTML is used  
if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {  
div.insertBefore( context.createTextNode( rleadingWhitespace.exec(elem)[0] ), div.firstChild );  
}  
 
elem = div.childNodes;  
}  
 
if ( elem.nodeType ) {  
ret.push( elem );  
} else {  
ret = jQuery.merge( ret, elem );  
}  
}  
 
if ( fragment ) {  
for ( i = 0; ret[i]; i++ ) {  
if ( scripts && jQuery.nodeName( ret[i], "script" ) && (!ret[i].type || ret[i].type.toLowerCase() === "text/javascript") ) {  
scripts.push( ret[i].parentNode ? ret[i].parentNode.removeChild( ret[i] ) : ret[i] );  
 
} else {  
if ( ret[i].nodeType === 1 ) {  
ret.splice.apply( ret, [i + 1, 0].concat(jQuery.makeArray(ret[i].getElementsByTagName("script"))) );  
}  
fragment.appendChild( ret[i] );  
}  
}  
}  
 
return ret;  
},  
 
cleanData: function( elems ) {  
var data, id, cache = jQuery.cache, internalKey = jQuery.expando, special = jQuery.event.special,  
deleteExpando = jQuery.support.deleteExpando;  
 
for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {  
if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) {  
continue;  
}  
 
id = elem[ jQuery.expando ];  
 
if ( id ) {  
data = cache[ id ] && cache[ id ][ internalKey ];  
 
if ( data && data.events ) {  
for ( var type in data.events ) {  
if ( special[ type ] ) {  
jQuery.event.remove( elem, type );  
 
// This is a shortcut to avoid jQuery.event.remove's overhead  
} else {  
jQuery.removeEvent( elem, type, data.handle );  
}  
}  
 
// Null the DOM reference to avoid IE6/7/8 leak (#7054)  
if ( data.handle ) {  
data.handle.elem = null;  
}  
}  
 
if ( deleteExpando ) {  
delete elem[ jQuery.expando ];  
 
} else if ( elem.removeAttribute ) {  
elem.removeAttribute( jQuery.expando );  
}  
 
delete cache[ id ];  
}  
}  
}  
});  
 
function evalScript( i, elem ) {  
if ( elem.src ) {  
jQuery.ajax({  
url: elem.src,  
async: false,  
dataType: "script"  
});  
} else {  
jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" );  
}  
 
if ( elem.parentNode ) {  
elem.parentNode.removeChild( elem );  
}  
}  
 
 
 
 
var ralpha = /alpha\([^)]*\)/i,  
ropacity = /opacity=([^)]*)/,  
rdashAlpha = /-([a-z])/ig,  
rupper = /([A-Z])/g,  
rnumpx = /^-?\d+(?:px)?$/i,  
rnum = /^-?\d/,  
 
cssShow = { position: "absolute", visibility: "hidden", display: "block" },  
cssWidth = [ "Left", "Right" ],  
cssHeight = [ "Top", "Bottom" ],  
curCSS,  
 
getComputedStyle,  
currentStyle,  
 
fcamelCase = function( all, letter ) {  
return letter.toUpperCase();  
};  
 
jQuery.fn.css = function( name, value ) {  
// Setting 'undefined' is a no-op  
if ( arguments.length === 2 && value === undefined ) {  
return this;  
}  
 
return jQuery.access( this, name, value, true, function( elem, name, value ) {  
return value !== undefined ?  
jQuery.style( elem, name, value ) :  
jQuery.css( elem, name );  
});  
};  
 
jQuery.extend({  
// Add in style property hooks for overriding the default  
// behavior of getting and setting a style property  
cssHooks: {  
opacity: {  
get: function( elem, computed ) {  
if ( computed ) {  
// We should always get a number back from opacity  
var ret = curCSS( elem, "opacity", "opacity" );  
return ret === "" ? "1" : ret;  
 
} else {  
return elem.style.opacity;  
}  
}  
}  
},  
 
// Exclude the following css properties to add px  
cssNumber: {  
"zIndex": true,  
"fontWeight": true,  
"opacity": true,  
"zoom": true,  
"lineHeight": true  
},  
 
// Add in properties whose names you wish to fix before  
// setting or getting the value  
cssProps: {  
// normalize float css property  
"float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat"  
},  
 
// Get and set the style property on a DOM Node  
style: function( elem, name, value, extra ) {  
// Don't set styles on text and comment nodes  
if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {  
return;  
}  
 
// Make sure that we're working with the right name  
var ret, origName = jQuery.camelCase( name ),  
style = elem.style, hooks = jQuery.cssHooks[ origName ];  
 
name = jQuery.cssProps[ origName ] || origName;  
 
// Check if we're setting a value  
if ( value !== undefined ) {  
// Make sure that NaN and null values aren't set. See: #7116  
if ( typeof value === "number" && isNaN( value ) || value == null ) {  
return;  
}  
 
// If a number was passed in, add 'px' to the (except for certain CSS properties)  
if ( typeof value === "number" && !jQuery.cssNumber[ origName ] ) {  
value += "px";  
}  
 
// If a hook was provided, use that value, otherwise just set the specified value  
if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value )) !== undefined ) {  
// Wrapped to prevent IE from throwing errors when 'invalid' values are provided  
// Fixes bug #5509  
try {  
style[ name ] = value;  
} catch(e) {}  
}  
 
} else {  
// If a hook was provided get the non-computed value from there  
if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {  
return ret;  
}  
 
// Otherwise just get the value from the style object  
return style[ name ];  
}  
},  
 
css: function( elem, name, extra ) {  
// Make sure that we're working with the right name  
var ret, origName = jQuery.camelCase( name ),  
hooks = jQuery.cssHooks[ origName ];  
 
name = jQuery.cssProps[ origName ] || origName;  
 
// If a hook was provided get the computed value from there  
if ( hooks && "get" in hooks && (ret = hooks.get( elem, true, extra )) !== undefined ) {  
return ret;  
 
// Otherwise, if a way to get the computed value exists, use that  
} else if ( curCSS ) {  
return curCSS( elem, name, origName );  
}  
},  
 
// A method for quickly swapping in/out CSS properties to get correct calculations  
swap: function( elem, options, callback ) {  
var old = {};  
 
// Remember the old values, and insert the new ones  
for ( var name in options ) {  
old[ name ] = elem.style[ name ];  
elem.style[ name ] = options[ name ];  
}  
 
callback.call( elem );  
 
// Revert the old values  
for ( name in options ) {  
elem.style[ name ] = old[ name ];  
}  
},  
 
camelCase: function( string ) {  
return string.replace( rdashAlpha, fcamelCase );  
}  
});  
 
// DEPRECATED, Use jQuery.css() instead  
jQuery.curCSS = jQuery.css;  
 
jQuery.each(["height", "width"], function( i, name ) {  
jQuery.cssHooks[ name ] = {  
get: function( elem, computed, extra ) {  
var val;  
 
if ( computed ) {  
if ( elem.offsetWidth !== 0 ) {  
val = getWH( elem, name, extra );  
 
} else {  
jQuery.swap( elem, cssShow, function() {  
val = getWH( elem, name, extra );  
});  
}  
 
if ( val <= 0 ) {  
val = curCSS( elem, name, name );  
 
if ( val === "0px" && currentStyle ) {  
val = currentStyle( elem, name, name );  
}  
 
if ( val != null ) {  
// Should return "auto" instead of 0, use 0 for  
// temporary backwards-compat  
return val === "" || val === "auto" ? "0px" : val;  
}  
}  
 
if ( val < 0 || val == null ) {  
val = elem.style[ name ];  
 
// Should return "auto" instead of 0, use 0 for  
// temporary backwards-compat  
return val === "" || val === "auto" ? "0px" : val;  
}  
 
return typeof val === "string" ? val : val + "px";  
}  
},  
 
set: function( elem, value ) {  
if ( rnumpx.test( value ) ) {  
// ignore negative width and height values #1599  
value = parseFloat(value);  
 
if ( value >= 0 ) {  
return value + "px";  
}  
 
} else {  
return value;  
}  
}  
};  
});  
 
if ( !jQuery.support.opacity ) {  
jQuery.cssHooks.opacity = {  
get: function( elem, computed ) {  
// IE uses filters for opacity  
return ropacity.test((computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "") ?  
(parseFloat(RegExp.$1) / 100) + "" :  
computed ? "1" : "";  
},  
 
set: function( elem, value ) {  
var style = elem.style;  
 
// IE has trouble with opacity if it does not have layout  
// Force it by setting the zoom level  
style.zoom = 1;  
 
// Set the alpha filter to set the opacity  
var opacity = jQuery.isNaN(value) ?  
"" :  
"alpha(opacity=" + value * 100 + ")",  
filter = style.filter || "";  
 
style.filter = ralpha.test(filter) ?  
filter.replace(ralpha, opacity) :  
style.filter + ' ' + opacity;  
}  
};  
}  
 
if ( document.defaultView && document.defaultView.getComputedStyle ) {  
getComputedStyle = function( elem, newName, name ) {  
var ret, defaultView, computedStyle;  
 
name = name.replace( rupper, "-$1" ).toLowerCase();  
 
if ( !(defaultView = elem.ownerDocument.defaultView) ) {  
return undefined;  
}  
 
if ( (computedStyle = defaultView.getComputedStyle( elem, null )) ) {  
ret = computedStyle.getPropertyValue( name );  
if ( ret === "" && !jQuery.contains( elem.ownerDocument.documentElement, elem ) ) {  
ret = jQuery.style( elem, name );  
}  
}  
 
return ret;  
};  
}  
 
if ( document.documentElement.currentStyle ) {  
currentStyle = function( elem, name ) {  
var left,  
ret = elem.currentStyle && elem.currentStyle[ name ],  
rsLeft = elem.runtimeStyle && elem.runtimeStyle[ name ],  
style = elem.style;  
 
// From the awesome hack by Dean Edwards  
// http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291  
 
// If we're not dealing with a regular pixel number  
// but a number that has a weird ending, we need to convert it to pixels  
if ( !rnumpx.test( ret ) && rnum.test( ret ) ) {  
// Remember the original values  
left = style.left;  
 
// Put in the new values to get a computed value out  
if ( rsLeft ) {  
elem.runtimeStyle.left = elem.currentStyle.left;  
}  
style.left = name === "fontSize" ? "1em" : (ret || 0);  
ret = style.pixelLeft + "px";  
 
// Revert the changed values  
style.left = left;  
if ( rsLeft ) {  
elem.runtimeStyle.left = rsLeft;  
}  
}  
 
return ret === "" ? "auto" : ret;  
};  
}  
 
curCSS = getComputedStyle || currentStyle;  
 
function getWH( elem, name, extra ) {  
var which = name === "width" ? cssWidth : cssHeight,  
val = name === "width" ? elem.offsetWidth : elem.offsetHeight;  
 
if ( extra === "border" ) {  
return val;  
}  
 
jQuery.each( which, function() {  
if ( !extra ) {  
val -= parseFloat(jQuery.css( elem, "padding" + this )) || 0;  
}  
 
if ( extra === "margin" ) {  
val += parseFloat(jQuery.css( elem, "margin" + this )) || 0;  
 
} else {  
val -= parseFloat(jQuery.css( elem, "border" + this + "Width" )) || 0;  
}  
});  
 
return val;  
}  
 
if ( jQuery.expr && jQuery.expr.filters ) {  
jQuery.expr.filters.hidden = function( elem ) {  
var width = elem.offsetWidth,  
height = elem.offsetHeight;  
 
return (width === 0 && height === 0) || (!jQuery.support.reliableHiddenOffsets && (elem.style.display || jQuery.css( elem, "display" )) === "none");  
};  
 
jQuery.expr.filters.visible = function( elem ) {  
return !jQuery.expr.filters.hidden( elem );  
};  
}  
 
 
 
 
var r20 = /%20/g,  
rbracket = /\[\]$/,  
rCRLF = /\r?\n/g,  
rhash = /#.*$/,  
rheaders = /^(.*?):\s*(.*?)\r?$/mg, // IE leaves an \r character at EOL  
rinput = /^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,  
rnoContent = /^(?:GET|HEAD)$/,  
rprotocol = /^\/\//,  
rquery = /\?/,  
rscript = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,  
rselectTextarea = /^(?:select|textarea)/i,  
rspacesAjax = /\s+/,  
rts = /([?&])_=[^&]*/,  
rurl = /^(\w+:)\/\/([^\/?#:]+)(?::(\d+))?/,  
 
// Keep a copy of the old load method  
_load = jQuery.fn.load,  
 
/* Prefilters  
* 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)  
* 2) These are called:  
* - BEFORE asking for a transport  
* - AFTER param serialization (s.data is a string if s.processData is true)  
* 3) key is the dataType  
* 4) the catchall symbol "*" can be used  
* 5) execution will start with transport dataType and THEN continue down to "*" if needed  
*/  
prefilters = {},  
 
/* Transports bindings  
* 1) key is the dataType  
* 2) the catchall symbol "*" can be used  
* 3) selection will start with transport dataType and THEN go to "*" if needed  
*/  
transports = {};  
 
// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport  
function addToPrefiltersOrTransports( structure ) {  
 
// dataTypeExpression is optional and defaults to "*"  
return function( dataTypeExpression, func ) {  
 
if ( typeof dataTypeExpression !== "string" ) {  
func = dataTypeExpression;  
dataTypeExpression = "*";  
}  
 
if ( jQuery.isFunction( func ) ) {  
var dataTypes = dataTypeExpression.toLowerCase().split( rspacesAjax ),  
i = 0,  
length = dataTypes.length,  
dataType,  
list,  
placeBefore;  
 
// For each dataType in the dataTypeExpression  
for(; i < length; i++ ) {  
dataType = dataTypes[ i ];  
// We control if we're asked to add before  
// any existing element  
placeBefore = /^\+/.test( dataType );  
if ( placeBefore ) {  
dataType = dataType.substr( 1 ) || "*";  
}  
list = structure[ dataType ] = structure[ dataType ] || [];  
// then we add to the structure accordingly  
list[ placeBefore ? "unshift" : "push" ]( func );  
}  
}  
};  
}  
 
//Base inspection function for prefilters and transports  
function inspectPrefiltersOrTransports( structure, options, originalOptions, jXHR,  
dataType /* internal */, inspected /* internal */ ) {  
 
dataType = dataType || options.dataTypes[ 0 ];  
inspected = inspected || {};  
 
inspected[ dataType ] = true;  
 
var list = structure[ dataType ],  
i = 0,  
length = list ? list.length : 0,  
executeOnly = ( structure === prefilters ),  
selection;  
 
for(; i < length && ( executeOnly || !selection ); i++ ) {  
selection = list[ i ]( options, originalOptions, jXHR );  
// If we got redirected to another dataType  
// we try there if not done already  
if ( typeof selection === "string" ) {  
if ( inspected[ selection ] ) {  
selection = undefined;  
} else {  
options.dataTypes.unshift( selection );  
selection = inspectPrefiltersOrTransports(  
structure, options, originalOptions, jXHR, selection, inspected );  
}  
}  
}  
// If we're only executing or nothing was selected  
// we try the catchall dataType if not done already  
if ( ( executeOnly || !selection ) && !inspected[ "*" ] ) {  
selection = inspectPrefiltersOrTransports(  
structure, options, originalOptions, jXHR, "*", inspected );  
}  
// unnecessary when only executing (prefilters)  
// but it'll be ignored by the caller in that case  
return selection;  
}  
 
jQuery.fn.extend({  
load: function( url, params, callback ) {  
if ( typeof url !== "string" && _load ) {  
return _load.apply( this, arguments );  
 
// Don't do a request if no elements are being requested  
} else if ( !this.length ) {  
return this;  
}  
 
var off = url.indexOf( " " );  
if ( off >= 0 ) {  
var selector = url.slice( off, url.length );  
url = url.slice( 0, off );  
}  
 
// Default to a GET request  
var type = "GET";  
 
// If the second parameter was provided  
if ( params ) {  
// If it's a function  
if ( jQuery.isFunction( params ) ) {  
// We assume that it's the callback  
callback = params;  
params = null;  
 
// Otherwise, build a param string  
} else if ( typeof params === "object" ) {  
params = jQuery.param( params, jQuery.ajaxSettings.traditional );  
type = "POST";  
}  
}  
 
var self = this;  
 
// Request the remote document  
jQuery.ajax({  
url: url,  
type: type,  
dataType: "html",  
data: params,  
// Complete callback (responseText is used internally)  
complete: function( jXHR, status, responseText ) {  
// Store the response as specified by the jXHR object  
responseText = jXHR.responseText;  
// If successful, inject the HTML into all the matched elements  
if ( jXHR.isResolved() ) {  
// #4825: Get the actual response in case  
// a dataFilter is present in ajaxSettings  
jXHR.done(function( r ) {  
responseText = r;  
});  
// See if a selector was specified  
self.html( selector ?  
// Create a dummy div to hold the results  
jQuery("<div>")  
// inject the contents of the document in, removing the scripts  
// to avoid any 'Permission Denied' errors in IE  
.append(responseText.replace(rscript, ""))  
 
// Locate the specified elements  
.find(selector) :  
 
// If not, just inject the full result  
responseText );  
}  
 
if ( callback ) {  
self.each( callback, [ responseText, status, jXHR ] );  
}  
}  
});  
 
return this;  
},  
 
serialize: function() {  
return jQuery.param( this.serializeArray() );  
},  
 
serializeArray: function() {  
return this.map(function(){  
return this.elements ? jQuery.makeArray( this.elements ) : this;  
})  
.filter(function(){  
return this.name && !this.disabled &&  
( this.checked || rselectTextarea.test( this.nodeName ) ||  
rinput.test( this.type ) );  
})  
.map(function( i, elem ){  
var val = jQuery( this ).val();  
 
return val == null ?  
null :  
jQuery.isArray( val ) ?  
jQuery.map( val, function( val, i ){  
return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };  
}) :  
{ name: elem.name, value: val.replace( rCRLF, "\r\n" ) };  
}).get();  
}  
});  
 
// Attach a bunch of functions for handling common AJAX events  
jQuery.each( "ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split( " " ), function( i, o ){  
jQuery.fn[ o ] = function( f ){  
return this.bind( o, f );  
};  
} );  
 
jQuery.each( [ "get", "post" ], function( i, method ) {  
jQuery[ method ] = function( url, data, callback, type ) {  
// shift arguments if data argument was omitted  
if ( jQuery.isFunction( data ) ) {  
type = type || callback;  
callback = data;  
data = null;  
}  
 
return jQuery.ajax({  
type: method,  
url: url,  
data: data,  
success: callback,  
dataType: type  
});  
};  
} );  
 
jQuery.extend({  
 
getScript: function( url, callback ) {  
return jQuery.get( url, null, callback, "script" );  
},  
 
getJSON: function( url, data, callback ) {  
return jQuery.get( url, data, callback, "json" );  
},  
 
ajaxSetup: function( settings ) {  
jQuery.extend( true, jQuery.ajaxSettings, settings );  
if ( settings.context ) {  
jQuery.ajaxSettings.context = settings.context;  
}  
},  
 
ajaxSettings: {  
url: location.href,  
global: true,  
type: "GET",  
contentType: "application/x-www-form-urlencoded",  
processData: true,  
async: true,  
/*  
timeout: 0,  
data: null,  
dataType: null,  
username: null,  
password: null,  
cache: null,  
traditional: false,  
headers: {},  
crossDomain: null,  
*/  
 
accepts: {  
xml: "application/xml, text/xml",  
html: "text/html",  
text: "text/plain",  
json: "application/json, text/javascript",  
"*": "*/*"  
},  
 
contents: {  
xml: /xml/,  
html: /html/,  
json: /json/  
},  
 
responseFields: {  
xml: "responseXML",  
text: "responseText"  
},  
 
// List of data converters  
// 1) key format is "source_type destination_type" (a single space in-between)  
// 2) the catchall symbol "*" can be used for source_type  
converters: {  
 
// Convert anything to text  
"* text": window.String,  
 
// Text to html (true = no transformation)  
"text html": true,  
 
// Evaluate text as a json expression  
"text json": jQuery.parseJSON,  
 
// Parse text as xml  
"text xml": jQuery.parseXML  
}  
},  
 
ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),  
ajaxTransport: addToPrefiltersOrTransports( transports ),  
 
// Main method  
ajax: function( url, options ) {  
 
// If options is not an object,  
// we simulate pre-1.5 signature  
if ( typeof options !== "object" ) {  
options = url;  
url = undefined;  
}  
 
// Force options to be an object  
options = options || {};  
 
var // Create the final options object  
s = jQuery.extend( true, {}, jQuery.ajaxSettings, options ),  
// Callbacks contexts  
// We force the original context if it exists  
// or take it from jQuery.ajaxSettings otherwise  
// (plain objects used as context get extended)  
callbackContext =  
( s.context = ( "context" in options ? options : jQuery.ajaxSettings ).context ) || s,  
globalEventContext = callbackContext === s ? jQuery.event : jQuery( callbackContext ),  
// Deferreds  
deferred = jQuery.Deferred(),  
completeDeferred = jQuery._Deferred(),  
// Status-dependent callbacks  
statusCode = s.statusCode || {},  
// Headers (they are sent all at once)  
requestHeaders = {},  
// Response headers  
responseHeadersString,  
responseHeaders,  
// transport  
transport,  
// timeout handle  
timeoutTimer,  
// Cross-domain detection vars  
loc = document.location,  
protocol = loc.protocol || "http:",  
parts,  
// The jXHR state  
state = 0,  
// Loop variable  
i,  
// Fake xhr  
jXHR = {  
 
readyState: 0,  
 
// Caches the header  
setRequestHeader: function( name, value ) {  
if ( state === 0 ) {  
requestHeaders[ name.toLowerCase() ] = value;  
}  
return this;  
},  
 
// Raw string  
getAllResponseHeaders: function() {  
return state === 2 ? responseHeadersString : null;  
},  
 
// Builds headers hashtable if needed  
getResponseHeader: function( key ) {  
var match;  
if ( state === 2 ) {  
if ( !responseHeaders ) {  
responseHeaders = {};  
while( ( match = rheaders.exec( responseHeadersString ) ) ) {  
responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];  
}  
}  
match = responseHeaders[ key.toLowerCase() ];  
}  
return match || null;  
},  
 
// Cancel the request  
abort: function( statusText ) {  
statusText = statusText || "abort";  
if ( transport ) {  
transport.abort( statusText );  
}  
done( 0, statusText );  
return this;  
}  
};  
 
// Callback for when everything is done  
// It is defined here because jslint complains if it is declared  
// at the end of the function (which would be more logical and readable)  
function done( status, statusText, responses, headers) {  
 
// Called once  
if ( state === 2 ) {  
return;  
}  
 
// State is "done" now  
state = 2;  
 
// Clear timeout if it exists  
if ( timeoutTimer ) {  
clearTimeout( timeoutTimer );  
}  
 
// Dereference transport for early garbage collection  
// (no matter how long the jXHR object will be used)  
transport = undefined;  
 
// Cache response headers  
responseHeadersString = headers || "";  
 
// Set readyState  
jXHR.readyState = status ? 4 : 0;  
 
var isSuccess,  
success,  
error,  
response = responses ? ajaxHandleResponses( s, jXHR, responses ) : undefined,  
lastModified,  
etag;  
 
// If successful, handle type chaining  
if ( status >= 200 && status < 300 || status === 304 ) {  
 
// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.  
if ( s.ifModified ) {  
 
if ( ( lastModified = jXHR.getResponseHeader( "Last-Modified" ) ) ) {  
jQuery.lastModified[ s.url ] = lastModified;  
}  
if ( ( etag = jXHR.getResponseHeader( "Etag" ) ) ) {  
jQuery.etag[ s.url ] = etag;  
}  
}  
 
// If not modified  
if ( status === 304 ) {  
 
statusText = "notmodified";  
isSuccess = true;  
 
// If we have data  
} else {  
 
try {  
success = ajaxConvert( s, response );  
statusText = "success";  
isSuccess = true;  
} catch(e) {  
// We have a parsererror  
statusText = "parsererror";  
error = e;  
}  
}  
} else {  
// We extract error from statusText  
// then normalize statusText and status for non-aborts  
error = statusText;  
if( status ) {  
statusText = "error";  
if ( status < 0 ) {  
status = 0;  
}  
}  
}  
 
// Set data for the fake xhr object  
jXHR.status = status;  
jXHR.statusText = statusText;  
 
// Success/Error  
if ( isSuccess ) {  
deferred.resolveWith( callbackContext, [ success, statusText, jXHR ] );  
} else {  
deferred.rejectWith( callbackContext, [ jXHR, statusText, error ] );  
}  
 
// Status-dependent callbacks  
jXHR.statusCode( statusCode );  
statusCode = undefined;  
 
if ( s.global ) {  
globalEventContext.trigger( "ajax" + ( isSuccess ? "Success" : "Error" ),  
[ jXHR, s, isSuccess ? success : error ] );  
}  
 
// Complete  
completeDeferred.resolveWith( callbackContext, [ jXHR, statusText ] );  
 
if ( s.global ) {  
globalEventContext.trigger( "ajaxComplete", [ jXHR, s] );  
// Handle the global AJAX counter  
if ( !( --jQuery.active ) ) {  
jQuery.event.trigger( "ajaxStop" );  
}  
}  
}  
 
// Attach deferreds  
deferred.promise( jXHR );  
jXHR.success = jXHR.done;  
jXHR.error = jXHR.fail;  
jXHR.complete = completeDeferred.done;  
 
// Status-dependent callbacks  
jXHR.statusCode = function( map ) {  
if ( map ) {  
var tmp;  
if ( state < 2 ) {  
for( tmp in map ) {  
statusCode[ tmp ] = [ statusCode[tmp], map[tmp] ];  
}  
} else {  
tmp = map[ jXHR.status ];  
jXHR.then( tmp, tmp );  
}  
}  
return this;  
};  
 
// Remove hash character (#7531: and string promotion)  
// Add protocol if not provided (#5866: IE7 issue with protocol-less urls)  
// We also use the url parameter if available  
s.url = ( "" + ( url || s.url ) ).replace( rhash, "" ).replace( rprotocol, protocol + "//" );  
 
// Extract dataTypes list  
s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().split( rspacesAjax );  
 
// Determine if a cross-domain request is in order  
if ( !s.crossDomain ) {  
parts = rurl.exec( s.url.toLowerCase() );  
s.crossDomain = !!( parts &&  
( parts[ 1 ] != protocol || parts[ 2 ] != loc.hostname ||  
( parts[ 3 ] || ( parts[ 1 ] === "http:" ? 80 : 443 ) ) !=  
( loc.port || ( protocol === "http:" ? 80 : 443 ) ) )  
);  
}  
 
// Convert data if not already a string  
if ( s.data && s.processData && typeof s.data !== "string" ) {  
s.data = jQuery.param( s.data, s.traditional );  
}  
 
// Apply prefilters  
inspectPrefiltersOrTransports( prefilters, s, options, jXHR );  
 
// Uppercase the type  
s.type = s.type.toUpperCase();  
 
// Determine if request has content  
s.hasContent = !rnoContent.test( s.type );  
 
// Watch for a new set of requests  
if ( s.global && jQuery.active++ === 0 ) {  
jQuery.event.trigger( "ajaxStart" );  
}  
 
// More options handling for requests with no content  
if ( !s.hasContent ) {  
 
// If data is available, append data to url  
if ( s.data ) {  
s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.data;  
}  
 
// Add anti-cache in url if needed  
if ( s.cache === false ) {  
 
var ts = jQuery.now(),  
// try replacing _= if it is there  
ret = s.url.replace( rts, "$1_=" + ts );  
 
// if nothing was replaced, add timestamp to the end  
s.url = ret + ( (ret === s.url ) ? ( rquery.test( s.url ) ? "&" : "?" ) + "_=" + ts : "" );  
}  
}  
 
// Set the correct header, if data is being sent  
if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {  
requestHeaders[ "content-type" ] = s.contentType;  
}  
 
// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.  
if ( s.ifModified ) {  
if ( jQuery.lastModified[ s.url ] ) {  
requestHeaders[ "if-modified-since" ] = jQuery.lastModified[ s.url ];  
}  
if ( jQuery.etag[ s.url ] ) {  
requestHeaders[ "if-none-match" ] = jQuery.etag[ s.url ];  
}  
}  
 
// Set the Accepts header for the server, depending on the dataType  
requestHeaders.accept = s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?  
s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", */*; q=0.01" : "" ) :  
s.accepts[ "*" ];  
 
// Check for headers option  
for ( i in s.headers ) {  
requestHeaders[ i.toLowerCase() ] = s.headers[ i ];  
}  
 
// Allow custom headers/mimetypes and early abort  
if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jXHR, s ) === false || state === 2 ) ) {  
// Abort if not done already  
done( 0, "abort" );  
// Return false  
jXHR = false;  
 
} else {  
 
// Install callbacks on deferreds  
for ( i in { success: 1, error: 1, complete: 1 } ) {  
jXHR[ i ]( s[ i ] );  
}  
 
// Get transport  
transport = inspectPrefiltersOrTransports( transports, s, options, jXHR );  
 
// If no transport, we auto-abort  
if ( !transport ) {  
done( -1, "No Transport" );  
} else {  
// Set state as sending  
state = jXHR.readyState = 1;  
// Send global event  
if ( s.global ) {  
globalEventContext.trigger( "ajaxSend", [ jXHR, s ] );  
}  
// Timeout  
if ( s.async && s.timeout > 0 ) {  
timeoutTimer = setTimeout( function(){  
jXHR.abort( "timeout" );  
}, s.timeout );  
}  
 
try {  
transport.send( requestHeaders, done );  
} catch (e) {  
// Propagate exception as error if not done  
if ( status < 2 ) {  
done( -1, e );  
// Simply rethrow otherwise  
} else {  
jQuery.error( e );  
}  
}  
}  
}  
return jXHR;  
},  
 
// Serialize an array of form elements or a set of  
// key/values into a query string  
param: function( a, traditional ) {  
var s = [],  
add = function( key, value ) {  
// If value is a function, invoke it and return its value  
value = jQuery.isFunction( value ) ? value() : value;  
s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );  
};  
 
// Set traditional to true for jQuery <= 1.3.2 behavior.  
if ( traditional === undefined ) {  
traditional = jQuery.ajaxSettings.traditional;  
}  
 
// If an array was passed in, assume that it is an array of form elements.  
if ( jQuery.isArray( a ) || a.jquery ) {  
// Serialize the form elements  
jQuery.each( a, function() {  
add( this.name, this.value );  
} );  
 
} else {  
// If traditional, encode the "old" way (the way 1.3.2 or older  
// did it), otherwise encode params recursively.  
for ( var prefix in a ) {  
buildParams( prefix, a[ prefix ], traditional, add );  
}  
}  
 
// Return the resulting serialization  
return s.join( "&" ).replace( r20, "+" );  
}  
});  
 
function buildParams( prefix, obj, traditional, add ) {  
if ( jQuery.isArray( obj ) && obj.length ) {  
// Serialize array item.  
jQuery.each( obj, function( i, v ) {  
if ( traditional || rbracket.test( prefix ) ) {  
// Treat each array item as a scalar.  
add( prefix, v );  
 
} else {  
// If array item is non-scalar (array or object), encode its  
// numeric index to resolve deserialization ambiguity issues.  
// Note that rack (as of 1.0.0) can't currently deserialize  
// nested arrays properly, and attempting to do so may cause  
// a server error. Possible fixes are to modify rack's  
// deserialization algorithm or to provide an option or flag  
// to force array serialization to be shallow.  
buildParams( prefix + "[" + ( typeof v === "object" || jQuery.isArray(v) ? i : "" ) + "]", v, traditional, add );  
}  
});  
 
} else if ( !traditional && obj != null && typeof obj === "object" ) {  
// If we see an array here, it is empty and should be treated as an empty  
// object  
if ( jQuery.isArray( obj ) || jQuery.isEmptyObject( obj ) ) {  
add( prefix, "" );  
 
// Serialize object item.  
} else {  
jQuery.each( obj, function( k, v ) {  
buildParams( prefix + "[" + k + "]", v, traditional, add );  
});  
}  
 
} else {  
// Serialize scalar item.  
add( prefix, obj );  
}  
}  
 
// This is still on the jQuery object... for now  
// Want to move this to jQuery.ajax some day  
jQuery.extend({  
 
// Counter for holding the number of active queries  
active: 0,  
 
// Last-Modified header cache for next request  
lastModified: {},  
etag: {}  
 
});  
 
/* Handles responses to an ajax request:  
* - sets all responseXXX fields accordingly  
* - finds the right dataType (mediates between content-type and expected dataType)  
* - returns the corresponding response  
*/  
function ajaxHandleResponses( s, jXHR, responses ) {  
 
var contents = s.contents,  
dataTypes = s.dataTypes,  
responseFields = s.responseFields,  
ct,  
type,  
finalDataType,  
firstDataType;  
 
// Fill responseXXX fields  
for( type in responseFields ) {  
if ( type in responses ) {  
jXHR[ responseFields[type] ] = responses[ type ];  
}  
}  
 
// Remove auto dataType and get content-type in the process  
while( dataTypes[ 0 ] === "*" ) {  
dataTypes.shift();  
if ( ct === undefined ) {  
ct = jXHR.getResponseHeader( "content-type" );  
}  
}  
 
// Check if we're dealing with a known content-type  
if ( ct ) {  
for ( type in contents ) {  
if ( contents[ type ] && contents[ type ].test( ct ) ) {  
dataTypes.unshift( type );  
break;  
}  
}  
}  
 
// Check to see if we have a response for the expected dataType  
if ( dataTypes[ 0 ] in responses ) {  
finalDataType = dataTypes[ 0 ];  
} else {  
// Try convertible dataTypes  
for ( type in responses ) {  
if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {  
finalDataType = type;  
break;  
}  
if ( !firstDataType ) {  
firstDataType = type;  
}  
}  
// Or just use first one  
finalDataType = finalDataType || firstDataType;  
}  
 
// If we found a dataType  
// We add the dataType to the list if needed  
// and return the corresponding response  
if ( finalDataType ) {  
if ( finalDataType !== dataTypes[ 0 ] ) {  
dataTypes.unshift( finalDataType );  
}  
return responses[ finalDataType ];  
}  
}  
 
// Chain conversions given the request and the original response  
function ajaxConvert( s, response ) {  
 
// Apply the dataFilter if provided  
if ( s.dataFilter ) {  
response = s.dataFilter( response, s.dataType );  
}  
 
var dataTypes = s.dataTypes,  
converters = s.converters,  
i,  
length = dataTypes.length,  
tmp,  
// Current and previous dataTypes  
current = dataTypes[ 0 ],  
prev,  
// Conversion expression  
conversion,  
// Conversion function  
conv,  
// Conversion functions (transitive conversion)  
conv1,  
conv2;  
 
// For each dataType in the chain  
for( i = 1; i < length; i++ ) {  
 
// Get the dataTypes  
prev = current;  
current = dataTypes[ i ];  
 
// If current is auto dataType, update it to prev  
if( current === "*" ) {  
current = prev;  
// If no auto and dataTypes are actually different  
} else if ( prev !== "*" && prev !== current ) {  
 
// Get the converter  
conversion = prev + " " + current;  
conv = converters[ conversion ] || converters[ "* " + current ];  
 
// If there is no direct converter, search transitively  
if ( !conv ) {  
conv2 = undefined;  
for( conv1 in converters ) {  
tmp = conv1.split( " " );  
if ( tmp[ 0 ] === prev || tmp[ 0 ] === "*" ) {  
conv2 = converters[ tmp[1] + " " + current ];  
if ( conv2 ) {  
conv1 = converters[ conv1 ];  
if ( conv1 === true ) {  
conv = conv2;  
} else if ( conv2 === true ) {  
conv = conv1;  
}  
break;  
}  
}  
}  
}  
// If we found no converter, dispatch an error  
if ( !( conv || conv2 ) ) {  
jQuery.error( "No conversion from " + conversion.replace(" "," to ") );  
}  
// If found converter is not an equivalence  
if ( conv !== true ) {  
// Convert with 1 or 2 converters accordingly  
response = conv ? conv( response ) : conv2( conv1(response) );  
}  
}  
}  
return response;  
}  
 
 
 
 
var jsc = jQuery.now(),  
jsre = /(\=)\?(&|$)|()\?\?()/i;  
 
// Default jsonp settings  
jQuery.ajaxSetup({  
jsonp: "callback",  
jsonpCallback: function() {  
return jQuery.expando + "_" + ( jsc++ );  
}  
});  
 
// Detect, normalize options and install callbacks for jsonp requests  
jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, dataIsString /* internal */ ) {  
 
dataIsString = ( typeof s.data === "string" );  
 
if ( s.dataTypes[ 0 ] === "jsonp" ||  
originalSettings.jsonpCallback ||  
originalSettings.jsonp != null ||  
s.jsonp !== false && ( jsre.test( s.url ) ||  
dataIsString && jsre.test( s.data ) ) ) {  
 
var responseContainer,  
jsonpCallback = s.jsonpCallback =  
jQuery.isFunction( s.jsonpCallback ) ? s.jsonpCallback() : s.jsonpCallback,  
previous = window[ jsonpCallback ],  
url = s.url,  
data = s.data,  
replace = "$1" + jsonpCallback + "$2";  
 
if ( s.jsonp !== false ) {  
url = url.replace( jsre, replace );  
if ( s.url === url ) {  
if ( dataIsString ) {  
data = data.replace( jsre, replace );  
}  
if ( s.data === data ) {  
// Add callback manually  
url += (/\?/.test( url ) ? "&" : "?") + s.jsonp + "=" + jsonpCallback;  
}  
}  
}  
 
s.url = url;  
s.data = data;  
 
window[ jsonpCallback ] = function( response ) {  
responseContainer = [ response ];  
};  
 
s.complete = [ function() {  
 
// Set callback back to previous value  
window[ jsonpCallback ] = previous;  
 
// Call if it was a function and we have a response  
if ( previous) {  
if ( responseContainer && jQuery.isFunction( previous ) ) {  
window[ jsonpCallback ] ( responseContainer[ 0 ] );  
}  
} else {  
// else, more memory leak avoidance  
try{  
delete window[ jsonpCallback ];  
} catch( e ) {}  
}  
 
}, s.complete ];  
 
// Use data converter to retrieve json after script execution  
s.converters["script json"] = function() {  
if ( ! responseContainer ) {  
jQuery.error( jsonpCallback + " was not called" );  
}  
return responseContainer[ 0 ];  
};  
 
// force json dataType  
s.dataTypes[ 0 ] = "json";  
 
// Delegate to script  
return "script";  
}  
} );  
 
 
 
 
// Install script dataType  
jQuery.ajaxSetup({  
accepts: {  
script: "text/javascript, application/javascript"  
},  
contents: {  
script: /javascript/  
},  
converters: {  
"text script": function( text ) {  
jQuery.globalEval( text );  
return text;  
}  
}  
});  
 
// Handle cache's special case and global  
jQuery.ajaxPrefilter( "script", function( s ) {  
if ( s.cache === undefined ) {  
s.cache = false;  
}  
if ( s.crossDomain ) {  
s.type = "GET";  
s.global = false;  
}  
} );  
 
// Bind script tag hack transport  
jQuery.ajaxTransport( "script", function(s) {  
 
// This transport only deals with cross domain requests  
if ( s.crossDomain ) {  
 
var script,  
head = document.getElementsByTagName( "head" )[ 0 ] || document.documentElement;  
 
return {  
 
send: function( _, callback ) {  
 
script = document.createElement( "script" );  
 
script.async = "async";  
 
if ( s.scriptCharset ) {  
script.charset = s.scriptCharset;  
}  
 
script.src = s.url;  
 
// Attach handlers for all browsers  
script.onload = script.onreadystatechange = function( _, isAbort ) {  
 
if ( !script.readyState || /loaded|complete/.test( script.readyState ) ) {  
 
// Handle memory leak in IE  
script.onload = script.onreadystatechange = null;  
 
// Remove the script  
if ( head && script.parentNode ) {  
head.removeChild( script );  
}  
 
// Dereference the script  
script = undefined;  
 
// Callback if not abort  
if ( !isAbort ) {  
callback( 200, "success" );  
}  
}  
};  
// Use insertBefore instead of appendChild to circumvent an IE6 bug.  
// This arises when a base node is used (#2709 and #4378).  
head.insertBefore( script, head.firstChild );  
},  
 
abort: function() {  
if ( script ) {  
script.onload( 0, 1 );  
}  
}  
};  
}  
} );  
 
 
 
 
var // Next active xhr id  
xhrId = jQuery.now(),  
 
// active xhrs  
xhrs = {},  
 
// #5280: see below  
xhrUnloadAbortInstalled,  
 
// XHR used to determine supports properties  
testXHR;  
 
// Create the request object  
// (This is still attached to ajaxSettings for backward compatibility)  
jQuery.ajaxSettings.xhr = window.ActiveXObject ?  
/* Microsoft failed to properly  
* implement the XMLHttpRequest in IE7 (can't request local files),  
* so we use the ActiveXObject when it is available  
* Additionally XMLHttpRequest can be disabled in IE7/IE8 so  
* we need a fallback.  
*/  
function() {  
if ( window.location.protocol !== "file:" ) {  
try {  
return new window.XMLHttpRequest();  
} catch( xhrError ) {}  
}  
 
try {  
return new window.ActiveXObject("Microsoft.XMLHTTP");  
} catch( activeError ) {}  
} :  
// For all other browsers, use the standard XMLHttpRequest object  
function() {  
return new window.XMLHttpRequest();  
};  
 
// Test if we can create an xhr object  
try {  
testXHR = jQuery.ajaxSettings.xhr();  
} catch( xhrCreationException ) {}  
 
//Does this browser support XHR requests?  
jQuery.support.ajax = !!testXHR;  
 
// Does this browser support crossDomain XHR requests  
jQuery.support.cors = testXHR && ( "withCredentials" in testXHR );  
 
// No need for the temporary xhr anymore  
testXHR = undefined;  
 
// Create transport if the browser can provide an xhr  
if ( jQuery.support.ajax ) {  
 
jQuery.ajaxTransport(function( s ) {  
// Cross domain only allowed if supported through XMLHttpRequest  
if ( !s.crossDomain || jQuery.support.cors ) {  
 
var callback;  
 
return {  
send: function( headers, complete ) {  
 
// #5280: we need to abort on unload or IE will keep connections alive  
if ( !xhrUnloadAbortInstalled ) {  
 
xhrUnloadAbortInstalled = 1;  
 
jQuery(window).bind( "unload", function() {  
 
// Abort all pending requests  
jQuery.each( xhrs, function( _, xhr ) {  
if ( xhr.onreadystatechange ) {  
xhr.onreadystatechange( 1 );  
}  
} );  
 
} );  
}  
 
// Get a new xhr  
var xhr = s.xhr(),  
handle;  
 
// Open the socket  
// Passing null username, generates a login popup on Opera (#2865)  
if ( s.username ) {  
xhr.open( s.type, s.url, s.async, s.username, s.password );  
} else {  
xhr.open( s.type, s.url, s.async );  
}  
 
// Requested-With header  
// Not set for crossDomain requests with no content  
// (see why at http://trac.dojotoolkit.org/ticket/9486)  
// Won't change header if already provided  
if ( !( s.crossDomain && !s.hasContent ) && !headers["x-requested-with"] ) {  
headers[ "x-requested-with" ] = "XMLHttpRequest";  
}  
 
// Need an extra try/catch for cross domain requests in Firefox 3  
try {  
jQuery.each( headers, function( key, value ) {  
xhr.setRequestHeader( key, value );  
} );  
} catch( _ ) {}  
 
// Do send the request  
// This may raise an exception which is actually  
// handled in jQuery.ajax (so no try/catch here)  
xhr.send( ( s.hasContent && s.data ) || null );  
 
// Listener  
callback = function( _, isAbort ) {  
 
// Was never called and is aborted or complete  
if ( callback && ( isAbort || xhr.readyState === 4 ) ) {  
 
// Only called once  
callback = 0;  
 
// Do not keep as active anymore  
if ( handle ) {  
xhr.onreadystatechange = jQuery.noop;  
delete xhrs[ handle ];  
}  
 
// If it's an abort  
if ( isAbort ) {  
// Abort it manually if needed  
if ( xhr.readyState !== 4 ) {  
xhr.abort();  
}  
} else {  
// Get info  
var status = xhr.status,  
statusText,  
responseHeaders = xhr.getAllResponseHeaders(),  
responses = {},  
xml = xhr.responseXML;  
 
// Construct response list  
if ( xml && xml.documentElement /* #4958 */ ) {  
responses.xml = xml;  
}  
responses.text = xhr.responseText;  
 
// Firefox throws an exception when accessing  
// statusText for faulty cross-domain requests  
try {  
statusText = xhr.statusText;  
} catch( e ) {  
// We normalize with Webkit giving an empty statusText  
statusText = "";  
}  
 
// Filter status for non standard behaviours  
status =  
// Opera returns 0 when it should be 304  
// Webkit returns 0 for failing cross-domain no matter the real status  
status === 0 ?  
(  
// Webkit, Firefox: filter out faulty cross-domain requests  
!s.crossDomain || statusText ?  
(  
// Opera: filter out real aborts #6060  
responseHeaders ?  
304 :  
0  
) :  
// We assume 302 but could be anything cross-domain related  
302  
) :  
(  
// IE sometimes returns 1223 when it should be 204 (see #1450)  
status == 1223 ?  
204 :  
status  
);  
 
// Call complete  
complete( status, statusText, responses, responseHeaders );  
}  
}  
};  
 
// if we're in sync mode or it's in cache  
// and has been retrieved directly (IE6 & IE7)  
// we need to manually fire the callback  
if ( !s.async || xhr.readyState === 4 ) {  
callback();  
} else {  
// Add to list of active xhrs  
handle = xhrId++;  
xhrs[ handle ] = xhr;  
xhr.onreadystatechange = callback;  
}  
},  
 
abort: function() {  
if ( callback ) {  
callback(0,1);  
}  
}  
};  
}  
});  
}  
 
 
 
 
var elemdisplay = {},  
rfxtypes = /^(?:toggle|show|hide)$/,  
rfxnum = /^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,  
timerId,  
fxAttrs = [  
// height animations  
[ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ],  
// width animations  
[ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ],  
// opacity animations  
[ "opacity" ]  
];  
 
jQuery.fn.extend({  
show: function( speed, easing, callback ) {  
var elem, display;  
 
if ( speed || speed === 0 ) {  
return this.animate( genFx("show", 3), speed, easing, callback);  
 
} else {  
for ( var i = 0, j = this.length; i < j; i++ ) {  
elem = this[i];  
display = elem.style.display;  
 
// Reset the inline display of this element to learn if it is  
// being hidden by cascaded rules or not  
if ( !jQuery._data(elem, "olddisplay") && display === "none" ) {  
display = elem.style.display = "";  
}  
 
// Set elements which have been overridden with display: none  
// in a stylesheet to whatever the default browser style is  
// for such an element  
if ( display === "" && jQuery.css( elem, "display" ) === "none" ) {  
jQuery._data(elem, "olddisplay", defaultDisplay(elem.nodeName));  
}  
}  
 
// Set the display of most of the elements in a second loop  
// to avoid the constant reflow  
for ( i = 0; i < j; i++ ) {  
elem = this[i];  
display = elem.style.display;  
 
if ( display === "" || display === "none" ) {  
elem.style.display = jQuery._data(elem, "olddisplay") || "";  
}  
}  
 
return this;  
}  
},  
 
hide: function( speed, easing, callback ) {  
if ( speed || speed === 0 ) {  
return this.animate( genFx("hide", 3), speed, easing, callback);  
 
} else {  
for ( var i = 0, j = this.length; i < j; i++ ) {  
var display = jQuery.css( this[i], "display" );  
 
if ( display !== "none" && !jQuery._data( this[i], "olddisplay" ) ) {  
jQuery._data( this[i], "olddisplay", display );  
}  
}  
 
// Set the display of the elements in a second loop  
// to avoid the constant reflow  
for ( i = 0; i < j; i++ ) {  
this[i].style.display = "none";  
}  
 
return this;  
}  
},  
 
// Save the old toggle function  
_toggle: jQuery.fn.toggle,  
 
toggle: function( fn, fn2, callback ) {  
var bool = typeof fn === "boolean";  
 
if ( jQuery.isFunction(fn) && jQuery.isFunction(fn2) ) {  
this._toggle.apply( this, arguments );  
 
} else if ( fn == null || bool ) {  
this.each(function() {  
var state = bool ? fn : jQuery(this).is(":hidden");  
jQuery(this)[ state ? "show" : "hide" ]();  
});  
 
} else {  
this.animate(genFx("toggle", 3), fn, fn2, callback);  
}  
 
return this;  
},  
 
fadeTo: function( speed, to, easing, callback ) {  
return this.filter(":hidden").css("opacity", 0).show().end()  
.animate({opacity: to}, speed, easing, callback);  
},  
 
animate: function( prop, speed, easing, callback ) {  
var optall = jQuery.speed(speed, easing, callback);  
 
if ( jQuery.isEmptyObject( prop ) ) {  
return this.each( optall.complete );  
}  
 
return this[ optall.queue === false ? "each" : "queue" ](function() {  
// XXX 'this' does not always have a nodeName when running the  
// test suite  
 
var opt = jQuery.extend({}, optall), p,  
isElement = this.nodeType === 1,  
hidden = isElement && jQuery(this).is(":hidden"),  
self = this;  
 
for ( p in prop ) {  
var name = jQuery.camelCase( p );  
 
if ( p !== name ) {  
prop[ name ] = prop[ p ];  
delete prop[ p ];  
p = name;  
}  
 
if ( prop[p] === "hide" && hidden || prop[p] === "show" && !hidden ) {  
return opt.complete.call(this);  
}  
 
if ( isElement && ( p === "height" || p === "width" ) ) {  
// Make sure that nothing sneaks out  
// Record all 3 overflow attributes because IE does not  
// change the overflow attribute when overflowX and  
// overflowY are set to the same value  
opt.overflow = [ this.style.overflow, this.style.overflowX, this.style.overflowY ];  
 
// Set display property to inline-block for height/width  
// animations on inline elements that are having width/height  
// animated  
if ( jQuery.css( this, "display" ) === "inline" &&  
jQuery.css( this, "float" ) === "none" ) {  
if ( !jQuery.support.inlineBlockNeedsLayout ) {  
this.style.display = "inline-block";  
 
} else {  
var display = defaultDisplay(this.nodeName);  
 
// inline-level elements accept inline-block;  
// block-level elements need to be inline with layout  
if ( display === "inline" ) {  
this.style.display = "inline-block";  
 
} else {  
this.style.display = "inline";  
this.style.zoom = 1;  
}  
}  
}  
}  
 
if ( jQuery.isArray( prop[p] ) ) {  
// Create (if needed) and add to specialEasing  
(opt.specialEasing = opt.specialEasing || {})[p] = prop[p][1];  
prop[p] = prop[p][0];  
}  
}  
 
if ( opt.overflow != null ) {  
this.style.overflow = "hidden";  
}  
 
opt.curAnim = jQuery.extend({}, prop);  
 
jQuery.each( prop, function( name, val ) {  
var e = new jQuery.fx( self, opt, name );  
 
if ( rfxtypes.test(val) ) {  
e[ val === "toggle" ? hidden ? "show" : "hide" : val ]( prop );  
 
} else {  
var parts = rfxnum.exec(val),  
start = e.cur() || 0;  
 
if ( parts ) {  
var end = parseFloat( parts[2] ),  
unit = parts[3] || "px";  
 
// We need to compute starting value  
if ( unit !== "px" ) {  
jQuery.style( self, name, (end || 1) + unit);  
start = ((end || 1) / e.cur()) * start;  
jQuery.style( self, name, start + unit);  
}  
 
// If a +=/-= token was provided, we're doing a relative animation  
if ( parts[1] ) {  
end = ((parts[1] === "-=" ? -1 : 1) * end) + start;  
}  
 
e.custom( start, end, unit );  
 
} else {  
e.custom( start, val, "" );  
}  
}  
});  
 
// For JS strict compliance  
return true;  
});  
},  
 
stop: function( clearQueue, gotoEnd ) {  
var timers = jQuery.timers;  
 
if ( clearQueue ) {  
this.queue([]);  
}  
 
this.each(function() {  
// go in reverse order so anything added to the queue during the loop is ignored  
for ( var i = timers.length - 1; i >= 0; i-- ) {  
if ( timers[i].elem === this ) {  
if (gotoEnd) {  
// force the next step to be the last  
timers[i](true);  
}  
 
timers.splice(i, 1);  
}  
}  
});  
 
// start the next in the queue if the last step wasn't forced  
if ( !gotoEnd ) {  
this.dequeue();  
}  
 
return this;  
}  
 
});  
 
function genFx( type, num ) {  
var obj = {};  
 
jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice(0,num)), function() {  
obj[ this ] = type;  
});  
 
return obj;  
}  
 
// Generate shortcuts for custom animations  
jQuery.each({  
slideDown: genFx("show", 1),  
slideUp: genFx("hide", 1),  
slideToggle: genFx("toggle", 1),  
fadeIn: { opacity: "show" },  
fadeOut: { opacity: "hide" },  
fadeToggle: { opacity: "toggle" }  
}, function( name, props ) {  
jQuery.fn[ name ] = function( speed, easing, callback ) {  
return this.animate( props, speed, easing, callback );  
};  
});  
 
jQuery.extend({  
speed: function( speed, easing, fn ) {  
var opt = speed && typeof speed === "object" ? jQuery.extend({}, speed) : {  
complete: fn || !fn && easing ||  
jQuery.isFunction( speed ) && speed,  
duration: speed,  
easing: fn && easing || easing && !jQuery.isFunction(easing) && easing  
};  
 
opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :  
opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[opt.duration] : jQuery.fx.speeds._default;  
 
// Queueing  
opt.old = opt.complete;  
opt.complete = function() {  
if ( opt.queue !== false ) {  
jQuery(this).dequeue();  
}  
if ( jQuery.isFunction( opt.old ) ) {  
opt.old.call( this );  
}  
};  
 
return opt;  
},  
 
easing: {  
linear: function( p, n, firstNum, diff ) {  
return firstNum + diff * p;  
},  
swing: function( p, n, firstNum, diff ) {  
return ((-Math.cos(p*Math.PI)/2) + 0.5) * diff + firstNum;  
}  
},  
 
timers: [],  
 
fx: function( elem, options, prop ) {  
this.options = options;  
this.elem = elem;  
this.prop = prop;  
 
if ( !options.orig ) {  
options.orig = {};  
}  
}  
 
});  
 
jQuery.fx.prototype = {  
// Simple function for setting a style value  
update: function() {  
if ( this.options.step ) {  
this.options.step.call( this.elem, this.now, this );  
}  
 
(jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this );  
},  
 
// Get the current size  
cur: function() {  
if ( this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null) ) {  
return this.elem[ this.prop ];  
}  
 
var r = parseFloat( jQuery.css( this.elem, this.prop ) );  
return r || 0;  
},  
 
// Start an animation from one number to another  
custom: function( from, to, unit ) {  
var self = this,  
fx = jQuery.fx;  
 
this.startTime = jQuery.now();  
this.start = from;  
this.end = to;  
this.unit = unit || this.unit || "px";  
this.now = this.start;  
this.pos = this.state = 0;  
 
function t( gotoEnd ) {  
return self.step(gotoEnd);  
}  
 
t.elem = this.elem;  
 
if ( t() && jQuery.timers.push(t) && !timerId ) {  
timerId = setInterval(fx.tick, fx.interval);  
}  
},  
 
// Simple 'show' function  
show: function() {  
// Remember where we started, so that we can go back to it later  
this.options.orig[this.prop] = jQuery.style( this.elem, this.prop );  
this.options.show = true;  
 
// Begin the animation  
// Make sure that we start at a small width/height to avoid any  
// flash of content  
this.custom(this.prop === "width" || this.prop === "height" ? 1 : 0, this.cur());  
 
// Start by showing the element  
jQuery( this.elem ).show();  
},  
 
// Simple 'hide' function  
hide: function() {  
// Remember where we started, so that we can go back to it later  
this.options.orig[this.prop] = jQuery.style( this.elem, this.prop );  
this.options.hide = true;  
 
// Begin the animation  
this.custom(this.cur(), 0);  
},  
 
// Each step of an animation  
step: function( gotoEnd ) {  
var t = jQuery.now(), done = true;  
 
if ( gotoEnd || t >= this.options.duration + this.startTime ) {  
this.now = this.end;  
this.pos = this.state = 1;  
this.update();  
 
this.options.curAnim[ this.prop ] = true;  
 
for ( var i in this.options.curAnim ) {  
if ( this.options.curAnim[i] !== true ) {  
done = false;  
}  
}  
 
if ( done ) {  
// Reset the overflow  
if ( this.options.overflow != null && !jQuery.support.shrinkWrapBlocks ) {  
var elem = this.elem,  
options = this.options;  
 
jQuery.each( [ "", "X", "Y" ], function (index, value) {  
elem.style[ "overflow" + value ] = options.overflow[index];  
} );  
}  
 
// Hide the element if the "hide" operation was done  
if ( this.options.hide ) {  
jQuery(this.elem).hide();  
}  
 
// Reset the properties, if the item has been hidden or shown  
if ( this.options.hide || this.options.show ) {  
for ( var p in this.options.curAnim ) {  
jQuery.style( this.elem, p, this.options.orig[p] );  
}  
}  
 
// Execute the complete function  
this.options.complete.call( this.elem );  
}  
 
return false;  
 
} else {  
var n = t - this.startTime;  
this.state = n / this.options.duration;  
 
// Perform the easing function, defaults to swing  
var specialEasing = this.options.specialEasing && this.options.specialEasing[this.prop];  
var defaultEasing = this.options.easing || (jQuery.easing.swing ? "swing" : "linear");  
this.pos = jQuery.easing[specialEasing || defaultEasing](this.state, n, 0, 1, this.options.duration);  
this.now = this.start + ((this.end - this.start) * this.pos);  
 
// Perform the next step of the animation  
this.update();  
}  
 
return true;  
}  
};  
 
jQuery.extend( jQuery.fx, {  
tick: function() {  
var timers = jQuery.timers;  
 
for ( var i = 0; i < timers.length; i++ ) {  
if ( !timers[i]() ) {  
timers.splice(i--, 1);  
}  
}  
 
if ( !timers.length ) {  
jQuery.fx.stop();  
}  
},  
 
interval: 13,  
 
stop: function() {  
clearInterval( timerId );  
timerId = null;  
},  
 
speeds: {  
slow: 600,  
fast: 200,  
// Default speed  
_default: 400  
},  
 
step: {  
opacity: function( fx ) {  
jQuery.style( fx.elem, "opacity", fx.now );  
},  
 
_default: function( fx ) {  
if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) {  
fx.elem.style[ fx.prop ] = (fx.prop === "width" || fx.prop === "height" ? Math.max(0, fx.now) : fx.now) + fx.unit;  
} else {  
fx.elem[ fx.prop ] = fx.now;  
}  
}  
}  
});  
 
if ( jQuery.expr && jQuery.expr.filters ) {  
jQuery.expr.filters.animated = function( elem ) {  
return jQuery.grep(jQuery.timers, function( fn ) {  
return elem === fn.elem;  
}).length;  
};  
}  
 
function defaultDisplay( nodeName ) {  
if ( !elemdisplay[ nodeName ] ) {  
var elem = jQuery("<" + nodeName + ">").appendTo("body"),  
display = elem.css("display");  
 
elem.remove();  
 
if ( display === "none" || display === "" ) {  
display = "block";  
}  
 
elemdisplay[ nodeName ] = display;  
}  
 
return elemdisplay[ nodeName ];  
}  
 
 
 
 
var rtable = /^t(?:able|d|h)$/i,  
rroot = /^(?:body|html)$/i;  
 
if ( "getBoundingClientRect" in document.documentElement ) {  
jQuery.fn.offset = function( options ) {  
var elem = this[0], box;  
 
if ( options ) {  
return this.each(function( i ) {  
jQuery.offset.setOffset( this, options, i );  
});  
}  
 
if ( !elem || !elem.ownerDocument ) {  
return null;  
}  
 
if ( elem === elem.ownerDocument.body ) {  
return jQuery.offset.bodyOffset( elem );  
}  
 
try {  
box = elem.getBoundingClientRect();  
} catch(e) {}  
 
var doc = elem.ownerDocument,  
docElem = doc.documentElement;  
 
// Make sure we're not dealing with a disconnected DOM node  
if ( !box || !jQuery.contains( docElem, elem ) ) {  
return box ? { top: box.top, left: box.left } : { top: 0, left: 0 };  
}  
 
var body = doc.body,  
win = getWindow(doc),  
clientTop = docElem.clientTop || body.clientTop || 0,  
clientLeft = docElem.clientLeft || body.clientLeft || 0,  
scrollTop = (win.pageYOffset || jQuery.support.boxModel && docElem.scrollTop || body.scrollTop ),  
scrollLeft = (win.pageXOffset || jQuery.support.boxModel && docElem.scrollLeft || body.scrollLeft),  
top = box.top + scrollTop - clientTop,  
left = box.left + scrollLeft - clientLeft;  
 
return { top: top, left: left };  
};  
 
} else {  
jQuery.fn.offset = function( options ) {  
var elem = this[0];  
 
if ( options ) {  
return this.each(function( i ) {  
jQuery.offset.setOffset( this, options, i );  
});  
}  
 
if ( !elem || !elem.ownerDocument ) {  
return null;  
}  
 
if ( elem === elem.ownerDocument.body ) {  
return jQuery.offset.bodyOffset( elem );  
}  
 
jQuery.offset.initialize();  
 
var computedStyle,  
offsetParent = elem.offsetParent,  
prevOffsetParent = elem,  
doc = elem.ownerDocument,  
docElem = doc.documentElement,  
body = doc.body,  
defaultView = doc.defaultView,  
prevComputedStyle = defaultView ? defaultView.getComputedStyle( elem, null ) : elem.currentStyle,  
top = elem.offsetTop,  
left = elem.offsetLeft;  
 
while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) {  
if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) {  
break;  
}  
 
computedStyle = defaultView ? defaultView.getComputedStyle(elem, null) : elem.currentStyle;  
top -= elem.scrollTop;  
left -= elem.scrollLeft;  
 
if ( elem === offsetParent ) {  
top += elem.offsetTop;  
left += elem.offsetLeft;  
 
if ( jQuery.offset.doesNotAddBorder && !(jQuery.offset.doesAddBorderForTableAndCells && rtable.test(elem.nodeName)) ) {  
top += parseFloat( computedStyle.borderTopWidth ) || 0;  
left += parseFloat( computedStyle.borderLeftWidth ) || 0;  
}  
 
prevOffsetParent = offsetParent;  
offsetParent = elem.offsetParent;  
}  
 
if ( jQuery.offset.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" ) {  
top += parseFloat( computedStyle.borderTopWidth ) || 0;  
left += parseFloat( computedStyle.borderLeftWidth ) || 0;  
}  
 
prevComputedStyle = computedStyle;  
}  
 
if ( prevComputedStyle.position === "relative" || prevComputedStyle.position === "static" ) {  
top += body.offsetTop;  
left += body.offsetLeft;  
}  
 
if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) {  
top += Math.max( docElem.scrollTop, body.scrollTop );  
left += Math.max( docElem.scrollLeft, body.scrollLeft );  
}  
 
return { top: top, left: left };  
};  
}  
 
jQuery.offset = {  
initialize: function() {  
var body = document.body, container = document.createElement("div"), innerDiv, checkDiv, table, td, bodyMarginTop = parseFloat( jQuery.css(body, "marginTop") ) || 0,  
html = "<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";  
 
jQuery.extend( container.style, { position: "absolute", top: 0, left: 0, margin: 0, border: 0, width: "1px", height: "1px", visibility: "hidden" } );  
 
container.innerHTML = html;  
body.insertBefore( container, body.firstChild );  
innerDiv = container.firstChild;  
checkDiv = innerDiv.firstChild;  
td = innerDiv.nextSibling.firstChild.firstChild;  
 
this.doesNotAddBorder = (checkDiv.offsetTop !== 5);  
this.doesAddBorderForTableAndCells = (td.offsetTop === 5);  
 
checkDiv.style.position = "fixed";  
checkDiv.style.top = "20px";  
 
// safari subtracts parent border width here which is 5px  
this.supportsFixedPosition = (checkDiv.offsetTop === 20 || checkDiv.offsetTop === 15);  
checkDiv.style.position = checkDiv.style.top = "";  
 
innerDiv.style.overflow = "hidden";  
innerDiv.style.position = "relative";  
 
this.subtractsBorderForOverflowNotVisible = (checkDiv.offsetTop === -5);  
 
this.doesNotIncludeMarginInBodyOffset = (body.offsetTop !== bodyMarginTop);  
 
body.removeChild( container );  
body = container = innerDiv = checkDiv = table = td = null;  
jQuery.offset.initialize = jQuery.noop;  
},  
 
bodyOffset: function( body ) {  
var top = body.offsetTop,  
left = body.offsetLeft;  
 
jQuery.offset.initialize();  
 
if ( jQuery.offset.doesNotIncludeMarginInBodyOffset ) {  
top += parseFloat( jQuery.css(body, "marginTop") ) || 0;  
left += parseFloat( jQuery.css(body, "marginLeft") ) || 0;  
}  
 
return { top: top, left: left };  
},  
 
setOffset: function( elem, options, i ) {  
var position = jQuery.css( elem, "position" );  
 
// set position first, in-case top/left are set even on static elem  
if ( position === "static" ) {  
elem.style.position = "relative";  
}  
 
var curElem = jQuery( elem ),  
curOffset = curElem.offset(),  
curCSSTop = jQuery.css( elem, "top" ),  
curCSSLeft = jQuery.css( elem, "left" ),  
calculatePosition = (position === "absolute" && jQuery.inArray('auto', [curCSSTop, curCSSLeft]) > -1),  
props = {}, curPosition = {}, curTop, curLeft;  
 
// need to be able to calculate position if either top or left is auto and position is absolute  
if ( calculatePosition ) {  
curPosition = curElem.position();  
}  
 
curTop = calculatePosition ? curPosition.top : parseInt( curCSSTop, 10 ) || 0;  
curLeft = calculatePosition ? curPosition.left : parseInt( curCSSLeft, 10 ) || 0;  
 
if ( jQuery.isFunction( options ) ) {  
options = options.call( elem, i, curOffset );  
}  
 
if (options.top != null) {  
props.top = (options.top - curOffset.top) + curTop;  
}  
if (options.left != null) {  
props.left = (options.left - curOffset.left) + curLeft;  
}  
 
if ( "using" in options ) {  
options.using.call( elem, props );  
} else {  
curElem.css( props );  
}  
}  
};  
 
 
jQuery.fn.extend({  
position: function() {  
if ( !this[0] ) {  
return null;  
}  
 
var elem = this[0],  
 
// Get *real* offsetParent  
offsetParent = this.offsetParent(),  
 
// Get correct offsets  
offset = this.offset(),  
parentOffset = rroot.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset();  
 
// Subtract element margins  
// note: when an element has margin: auto the offsetLeft and marginLeft  
// are the same in Safari causing offset.left to incorrectly be 0  
offset.top -= parseFloat( jQuery.css(elem, "marginTop") ) || 0;  
offset.left -= parseFloat( jQuery.css(elem, "marginLeft") ) || 0;  
 
// Add offsetParent borders  
parentOffset.top += parseFloat( jQuery.css(offsetParent[0], "borderTopWidth") ) || 0;  
parentOffset.left += parseFloat( jQuery.css(offsetParent[0], "borderLeftWidth") ) || 0;  
 
// Subtract the two offsets  
return {  
top: offset.top - parentOffset.top,  
left: offset.left - parentOffset.left  
};  
},  
 
offsetParent: function() {  
return this.map(function() {  
var offsetParent = this.offsetParent || document.body;  
while ( offsetParent && (!rroot.test(offsetParent.nodeName) && jQuery.css(offsetParent, "position") === "static") ) {  
offsetParent = offsetParent.offsetParent;  
}  
return offsetParent;  
});  
}  
});  
 
 
// Create scrollLeft and scrollTop methods  
jQuery.each( ["Left", "Top"], function( i, name ) {  
var method = "scroll" + name;  
 
jQuery.fn[ method ] = function(val) {  
var elem = this[0], win;  
 
if ( !elem ) {  
return null;  
}  
 
if ( val !== undefined ) {  
// Set the scroll offset  
return this.each(function() {  
win = getWindow( this );  
 
if ( win ) {  
win.scrollTo(  
!i ? val : jQuery(win).scrollLeft(),  
i ? val : jQuery(win).scrollTop()  
);  
 
} else {  
this[ method ] = val;  
}  
});  
} else {  
win = getWindow( elem );  
 
// Return the scroll offset  
return win ? ("pageXOffset" in win) ? win[ i ? "pageYOffset" : "pageXOffset" ] :  
jQuery.support.boxModel && win.document.documentElement[ method ] ||  
win.document.body[ method ] :  
elem[ method ];  
}  
};  
});  
 
function getWindow( elem ) {  
return jQuery.isWindow( elem ) ?  
elem :  
elem.nodeType === 9 ?  
elem.defaultView || elem.parentWindow :  
false;  
}  
 
 
 
 
// Create innerHeight, innerWidth, outerHeight and outerWidth methods  
jQuery.each([ "Height", "Width" ], function( i, name ) {  
 
var type = name.toLowerCase();  
 
// innerHeight and innerWidth  
jQuery.fn["inner" + name] = function() {  
return this[0] ?  
parseFloat( jQuery.css( this[0], type, "padding" ) ) :  
null;  
};  
 
// outerHeight and outerWidth  
jQuery.fn["outer" + name] = function( margin ) {  
return this[0] ?  
parseFloat( jQuery.css( this[0], type, margin ? "margin" : "border" ) ) :  
null;  
};  
 
jQuery.fn[ type ] = function( size ) {  
// Get window width or height  
var elem = this[0];  
if ( !elem ) {  
return size == null ? null : this;  
}  
 
if ( jQuery.isFunction( size ) ) {  
return this.each(function( i ) {  
var self = jQuery( this );  
self[ type ]( size.call( this, i, self[ type ]() ) );  
});  
}  
 
if ( jQuery.isWindow( elem ) ) {  
// Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode  
// 3rd condition allows Nokia support, as it supports the docElem prop but not CSS1Compat  
var docElemProp = elem.document.documentElement[ "client" + name ];  
return elem.document.compatMode === "CSS1Compat" && docElemProp ||  
elem.document.body[ "client" + name ] || docElemProp;  
 
// Get document width or height  
} else if ( elem.nodeType === 9 ) {  
// Either scroll[Width/Height] or offset[Width/Height], whichever is greater  
return Math.max(  
elem.documentElement["client" + name],  
elem.body["scroll" + name], elem.documentElement["scroll" + name],  
elem.body["offset" + name], elem.documentElement["offset" + name]  
);  
 
// Get or set width or height on the element  
} else if ( size === undefined ) {  
var orig = jQuery.css( elem, type ),  
ret = parseFloat( orig );  
 
return jQuery.isNaN( ret ) ? orig : ret;  
 
// Set the width or height on the element (default to pixels if value is unitless)  
} else {  
return this.css( type, typeof size === "string" ? size : size + "px" );  
}  
};  
 
});  
 
 
})(window);  
 
/*!  
* jQuery Mobile v1.0a3  
* http://jquerymobile.com/  
*  
* Copyright 2010, jQuery Project  
* Dual licensed under the MIT or GPL Version 2 licenses.  
* http://jquery.org/license  
*/  
(function(a,d){if(a.cleanData){var c=a.cleanData;a.cleanData=function(b){for(var g=0,e;(e=b[g])!=null;g++)a(e).triggerHandler("remove");c(b)}}else{var f=a.fn.remove;a.fn.remove=function(b,g){return this.each(function(){if(!g)if(!b||a.filter(b,[this]).length)a("*",this).add([this]).each(function(){a(this).triggerHandler("remove")});return f.call(a(this),b,g)})}}a.widget=function(b,g,e){var i=b.split(".")[0],h;b=b.split(".")[1];h=i+"-"+b;if(!e){e=g;g=a.Widget}a.expr[":"][h]=function(k){return!!a.data(k,  
b)};a[i]=a[i]||{};a[i][b]=function(k,j){arguments.length&&this._createWidget(k,j)};g=new g;g.options=a.extend(true,{},g.options);a[i][b].prototype=a.extend(true,g,{namespace:i,widgetName:b,widgetEventPrefix:a[i][b].prototype.widgetEventPrefix||b,widgetBaseClass:h},e);a.widget.bridge(b,a[i][b])};a.widget.bridge=function(b,g){a.fn[b]=function(e){var i=typeof e==="string",h=Array.prototype.slice.call(arguments,1),k=this;e=!i&&h.length?a.extend.apply(null,[true,e].concat(h)):e;if(i&&e.charAt(0)==="_")return k;  
i?this.each(function(){var j=a.data(this,b);if(!j)throw"cannot call methods on "+b+" prior to initialization; attempted to call method '"+e+"'";if(!a.isFunction(j[e]))throw"no such method '"+e+"' for "+b+" widget instance";var o=j[e].apply(j,h);if(o!==j&&o!==d){k=o;return false}}):this.each(function(){var j=a.data(this,b);j?j.option(e||{})._init():a.data(this,b,new g(e,this))});return k}};a.Widget=function(b,g){arguments.length&&this._createWidget(b,g)};a.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",  
options:{disabled:false},_createWidget:function(b,g){a.data(g,this.widgetName,this);this.element=a(g);this.options=a.extend(true,{},this.options,this._getCreateOptions(),b);var e=this;this.element.bind("remove."+this.widgetName,function(){e.destroy()});this._create();this._trigger("create");this._init()},_getCreateOptions:function(){var b={};if(a.metadata)b=a.metadata.get(element)[this.widgetName];return b},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);  
this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled")},widget:function(){return this.element},option:function(b,g){var e=b;if(arguments.length===0)return a.extend({},this.options);if(typeof b==="string"){if(g===d)return this.options[b];e={};e[b]=g}this._setOptions(e);return this},_setOptions:function(b){var g=this;a.each(b,function(e,i){g._setOption(e,i)});return this},_setOption:function(b,g){this.options[b]=g;if(b===  
"disabled")this.widget()[g?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",g);return this},enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(b,g,e){var i=this.options[b];g=a.Event(g);g.type=(b===this.widgetEventPrefix?b:this.widgetEventPrefix+b).toLowerCase();e=e||{};if(g.originalEvent){b=a.event.props.length;for(var h;b;){h=a.event.props[--b];g[h]=g.originalEvent[h]}}this.element.trigger(g,  
e);return!(a.isFunction(i)&&i.call(this.element[0],g,e)===false||g.isDefaultPrevented())}}})(jQuery);(function(a,d){a.widget("mobile.widget",{_getCreateOptions:function(){var c=this.element,f={};a.each(this.options,function(b){var g=c.data(b.replace(/[A-Z]/g,function(e){return"-"+e.toLowerCase()}));if(g!==d)f[b]=g});return f}})})(jQuery);  
(function(a){function d(){var g=c.width(),e=[],i=[],h;f.removeClass("min-width-"+b.join("px min-width-")+"px max-width-"+b.join("px max-width-")+"px");a.each(b,function(k,j){g>=j&&e.push("min-width-"+j+"px");g<=j&&i.push("max-width-"+j+"px")});if(e.length)h=e.join(" ");if(i.length)h+=" "+i.join(" ");f.addClass(h)}var c=a(window),f=a("html"),b=[320,480,768,1024];a.mobile.media=function(){var g={},e=a("<div id='jquery-mediatest'>"),i=a("<body>").append(e);return function(h){if(!(h in g)){var k=document.createElement("style"),  
j="@media "+h+" { #jquery-mediatest { position:absolute; } }";k.type="text/css";if(k.styleSheet)k.styleSheet.cssText=j;else k.appendChild(document.createTextNode(j));f.prepend(i).prepend(k);g[h]=e.css("position")==="absolute";i.add(k).remove()}return g[h]}}();a.mobile.addResolutionBreakpoints=function(g){if(a.type(g)==="array")b=b.concat(g);else b.push(g);b.sort(function(e,i){return e-i});d()};a(document).bind("mobileinit.htmlclass",function(){c.bind("orientationchange.htmlclass resize.htmlclass",  
function(g){g.orientation&&f.removeClass("portrait landscape").addClass(g.orientation);d()})});a(function(){c.trigger("orientationchange.htmlclass")})})(jQuery);  
(function(a,d){function c(h){var k=h.charAt(0).toUpperCase()+h.substr(1);h=(h+" "+g.join(k+" ")+k).split(" ");for(var j in h)if(b[j]!==d)return true}var f=a("<body>").prependTo("html"),b=f[0].style,g=["webkit","moz","o"],e=window.palmGetResource||window.PalmServiceBridge,i=window.blackberry;a.extend(a.support,{orientation:"orientation"in window,touch:"ontouchend"in document,cssTransitions:"WebKitTransitionEvent"in window,pushState:!!history.pushState,mediaquery:a.mobile.media("only all"),cssPseudoElement:!!c("content"),  
boxShadow:!!c("boxShadow")&&!i,scrollTop:("pageXOffset"in window||"scrollTop"in document.documentElement||"scrollTop"in f[0])&&!e,dynamicBaseTag:function(){var h=location.protocol+"//"+location.host+location.pathname+"ui-dir/",k=a("head base"),j=null,o="";if(k.length)o=k.attr("href");else k=j=a("<base>",{href:h}).appendTo("head");var p=a("<a href='testurl'></a>").prependTo(f)[0].href;k[0].href=o?o:location.pathname;j&&j.remove();return p.indexOf(h)===0}()});f.remove();a.support.boxShadow||a("html").addClass("ui-mobile-nosupport-boxshadow")})(jQuery);  
(function(a,d){a.each("touchstart touchmove touchend orientationchange tap taphold swipe swipeleft swiperight scrollstart scrollstop".split(" "),function(e,i){a.fn[i]=function(h){return h?this.bind(i,h):this.trigger(i)};a.attrFn[i]=true});var c=a.support.touch,f=c?"touchstart":"mousedown",b=c?"touchend":"mouseup",g=c?"touchmove":"mousemove";a.event.special.scrollstart={enabled:true,setup:function(){function e(j,o){h=o;var p=j.type;j.type=h?"scrollstart":"scrollstop";a.event.handle.call(i,j);j.type=  
p}var i=this,h,k;a(i).bind("touchmove scroll",function(j){if(a.event.special.scrollstart.enabled){h||e(j,true);clearTimeout(k);k=setTimeout(function(){e(j,false)},50)}})}};a.event.special.tap={setup:function(){var e=this,i=a(e);i.bind("mousedown touchstart",function(h){function k(n){if(n.type=="scroll")j=true;else{n=n.type=="touchmove"?n.originalEvent.touches[0]:n;if(Math.abs(v[0]-n.pageX)>10||Math.abs(v[1]-n.pageY)>10)j=true}}if(h.which&&h.which!==1||i.data("prevEvent")&&i.data("prevEvent")!==h.type)return false;  
i.data("prevEvent",h.type);setTimeout(function(){i.removeData("prevEvent")},800);var j=false,o=true,p=h.target,t=h.originalEvent,v=h.type=="touchstart"?[t.touches[0].pageX,t.touches[0].pageY]:[h.pageX,h.pageY],m,r;r=setTimeout(function(){if(o&&!j){m=h.type;h.type="taphold";a.event.handle.call(e,h);h.type=m}},750);a(window).one("scroll",k);i.bind("mousemove touchmove",k).one("mouseup touchend",function(n){i.unbind("mousemove touchmove",k);a(window).unbind("scroll",k);clearTimeout(r);o=false;if(!j&&  
p==n.target){m=n.type;n.type="tap";a.event.handle.call(e,n);n.type=m}})})}};a.event.special.swipe={setup:function(){var e=a(this);e.bind(f,function(i){function h(p){if(j){var t=p.originalEvent.touches?p.originalEvent.touches[0]:p;o={time:(new Date).getTime(),coords:[t.pageX,t.pageY]};Math.abs(j.coords[0]-o.coords[0])>10&&p.preventDefault()}}var k=i.originalEvent.touches?i.originalEvent.touches[0]:i,j={time:(new Date).getTime(),coords:[k.pageX,k.pageY],origin:a(i.target)},o;e.bind(g,h).one(b,function(){e.unbind(g,  
h);if(j&&o)if(o.time-j.time<1E3&&Math.abs(j.coords[0]-o.coords[0])>30&&Math.abs(j.coords[1]-o.coords[1])<75)j.origin.trigger("swipe").trigger(j.coords[0]>o.coords[0]?"swipeleft":"swiperight");j=o=d})})}};(function(e){function i(){var o=k();if(o!==j){j=o;h.trigger("orientationchange")}}var h=e(window),k,j;e.event.special.orientationchange={setup:function(){if(e.support.orientation)return false;j=k();h.bind("resize",i)},teardown:function(){if(e.support.orientation)return false;h.unbind("resize",i)},  
add:function(o){var p=o.handler;o.handler=function(t){t.orientation=k();return p.apply(this,arguments)}}};k=function(){var o=document.documentElement;return o&&o.clientWidth/o.clientHeight<1.1?"portrait":"landscape"}})(jQuery);a.each({scrollstop:"scrollstart",taphold:"tap",swipeleft:"swipe",swiperight:"swipe"},function(e,i){a.event.special[e]={setup:function(){a(this).bind(i,a.noop)}}})})(jQuery);  
(function(a,d,c){function f(j){j=j||location.href;return"#"+j.replace(/^[^#]*#?(.*)$/,"$1")}var b="hashchange",g=document,e,i=a.event.special,h=g.documentMode,k="on"+b in d&&(h===c||h>7);a.fn[b]=function(j){return j?this.bind(b,j):this.trigger(b)};a.fn[b].delay=50;i[b]=a.extend(i[b],{setup:function(){if(k)return false;a(e.start)},teardown:function(){if(k)return false;a(e.stop)}});e=function(){function j(){var n=f(),u=r(t);if(n!==t){m(t=n,u);a(d).trigger(b)}else if(u!==t)location.href=location.href.replace(/#.*/,  
"")+u;p=setTimeout(j,a.fn[b].delay)}var o={},p,t=f(),v=function(n){return n},m=v,r=v;o.start=function(){p||j()};o.stop=function(){p&&clearTimeout(p);p=c};a.browser.msie&&!k&&function(){var n,u;o.start=function(){if(!n){u=(u=a.fn[b].src)&&u+f();n=a('<iframe tabindex="-1" title="empty"/>').hide().one("load",function(){u||m(f());j()}).attr("src",u||"javascript:0").insertAfter("body")[0].contentWindow;g.onpropertychange=function(){try{if(event.propertyName==="title")n.document.title=g.title}catch(l){}}}};  
o.stop=v;r=function(){return f(n.location.href)};m=function(l,s){var q=n.document,w=a.fn[b].domain;if(l!==s){q.title=g.title;q.open();w&&q.write('<script>document.domain="'+w+'"<\/script>');q.close();n.location.hash=l}}}();return o}()})(jQuery,this);  
(function(a){a.widget("mobile.page",a.mobile.widget,{options:{backBtnText:"Back",addBackBtn:true,degradeInputs:{color:false,date:false,datetime:false,"datetime-local":false,email:false,month:false,number:false,range:"number",search:true,tel:false,time:false,url:false,week:false},keepNative:null},_create:function(){var d=this.element,c=this.options;this.keepNative="[data-role='none'], [data-role='nojs']"+(c.keepNative?", "+c.keepNative:"");if(this._trigger("beforeCreate")!==false){d.find("[data-role='page'], [data-role='content']").andSelf().each(function(){a(this).addClass("ui-"+  
a(this).data("role"))});d.find("[data-role='nojs']").addClass("ui-nojs");d.find("[data-role]").andSelf().each(function(){var f=a(this),b=f.data("role"),g=f.data("theme");if(b==="header"||b==="footer"){f.addClass("ui-bar-"+(g||f.parent("[data-role=page]").data("theme")||"a"));f.attr("role",b==="header"?"banner":"contentinfo");g=f.children("a");var e=g.hasClass("ui-btn-left"),i=g.hasClass("ui-btn-right");if(!e)e=g.eq(0).not(".ui-btn-right").addClass("ui-btn-left").length;i||g.eq(1).addClass("ui-btn-right");  
c.addBackBtn&&b==="header"&&a(".ui-page").length>1&&d.data("url")!==a.mobile.path.stripHash(location.hash)&&!e&&f.data("backbtn")!==false&&a("<a href='#' class='ui-btn-left' data-rel='back' data-icon='arrow-l'>"+c.backBtnText+"</a>").prependTo(f);f.children("h1, h2, h3, h4, h5, h6").addClass("ui-title").attr({tabindex:"0",role:"heading","aria-level":"1"})}else if(b==="content"){g&&f.addClass("ui-body-"+g);f.attr("role","main")}else if(b==="page")f.addClass("ui-body-"+(g||"c"));switch(b){case "header":case "footer":case "page":case "content":f.addClass("ui-"+  
b);break;case "collapsible":case "fieldcontain":case "navbar":case "listview":case "dialog":f[b]()}});this._enhanceControls();d.find("[data-role='button'], .ui-bar > a, .ui-header > a, .ui-footer > a").not(".ui-btn").not(this.keepNative).buttonMarkup();d.find("[data-role='controlgroup']").controlgroup();d.find("a:not(.ui-btn):not(.ui-link-inherit)").not(this.keepNative).addClass("ui-link");d.fixHeaderFooter()}},_enhanceControls:function(){var d=this.options;this.element.find("input").not(this.keepNative).each(function(){var b=  
this.getAttribute("type"),g=d.degradeInputs[b]||"text";d.degradeInputs[b]&&a(this).replaceWith(a("<div>").html(a(this).clone()).html().replace(/type="([a-zA-Z]+)"/,"type="+g+" data-type='$1'"))});var c=this.element.find("input, textarea, select, button"),f=c.not(this.keepNative);c=c.filter("input[type=text]");c.length&&typeof c[0].autocorrect!=="undefined"&&c.each(function(){this.setAttribute("autocorrect","off");this.setAttribute("autocomplete","off")});f.filter("[type='radio'], [type='checkbox']").checkboxradio();  
f.filter("button, [type='button'], [type='submit'], [type='reset'], [type='image']").button();f.filter("input, textarea").not("[type='radio'], [type='checkbox'], [type='button'], [type='submit'], [type='reset'], [type='image'], [type='hidden']").textinput();f.filter("input, select").filter("[data-role='slider'], [data-type='range']").slider();f.filter("select:not([data-role='slider'])").selectmenu()}})})(jQuery);  
(function(a,d,c){a.extend(a.mobile,{subPageUrlKey:"ui-page",nonHistorySelectors:"dialog",activePageClass:"ui-page-active",activeBtnClass:"ui-btn-active",ajaxEnabled:true,hashListeningEnabled:true,ajaxLinksEnabled:true,ajaxFormsEnabled:true,defaultTransition:"slide",loadingMessage:"loading",metaViewportContent:"width=device-width, minimum-scale=1, maximum-scale=1",gradeA:function(){return a.support.mediaquery},autoInitialize:true,keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,  
COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});a(d.document).trigger("mobileinit");if(a.mobile.gradeA()){var f=a(d),b=a("html"),g=a("head"),e=a.mobile.loadingMessage?a("<div class='ui-loader ui-body-a ui-corner-all'><span class='ui-icon ui-icon-loading spin'></span><h1>"+  
a.mobile.loadingMessage+"</h1></div>"):c;b.addClass("ui-mobile ui-mobile-rendering");a.mobile.metaViewportContent&&a("<meta>",{name:"viewport",content:a.mobile.metaViewportContent}).prependTo(g);a.extend(a.mobile,{pageLoading:function(i){if(i)b.removeClass("ui-loading");else{if(a.mobile.loadingMessage){i=a("."+a.mobile.activeBtnClass).first();e.appendTo(a.mobile.pageContainer).css({top:a.support.scrollTop&&a(d).scrollTop()+a(d).height()/2||i.length&&i.offset().top||100})}b.addClass("ui-loading")}},  
silentScroll:function(i){i=i||0;a.event.special.scrollstart.enabled=false;setTimeout(function(){d.scrollTo(0,i);a(document).trigger("silentscroll",{x:0,y:i})},20);setTimeout(function(){a.event.special.scrollstart.enabled=true},150)},initializePage:function(){var i=a("[data-role='page']");i.add("[data-role='dialog']").each(function(){a(this).attr("data-url",a(this).attr("id"))});a.mobile.firstPage=i.first();a.mobile.pageContainer=i.first().parent().addClass("ui-mobile-viewport");a.mobile.pageLoading();  
!a.mobile.hashListeningEnabled||!a.mobile.path.stripHash(location.hash)?a.mobile.changePage(a.mobile.firstPage,false,true,false,true):f.trigger("hashchange",[true])}});a.mobile.autoInitialize&&a(a.mobile.initializePage);f.load(a.mobile.silentScroll)}})(jQuery,this);  
(function(a,d){function c(l){if(i&&(!i.closest(".ui-page-active").length||l))i.removeClass(a.mobile.activeBtnClass);i=null}var f=a(window),b=a("html"),g=a("head"),e={get:function(l){if(l==d)l=location.hash;return e.stripHash(l).replace(/[^\/]*\.[^\/*]+$/,"")},getFilePath:function(l){var s="&"+a.mobile.subPageUrlKey;return l&&l.split(s)[0].split(t)[0]},set:function(l){location.hash=l},origin:"",setOrigin:function(){e.origin=e.get(location.protocol+"//"+location.host+location.pathname)},makeAbsolute:function(l){return e.get()+  
l},clean:function(l){return l.replace(location.protocol+"//"+location.host,"")},stripHash:function(l){return l.replace(/^#/,"")},isExternal:function(l){return e.hasProtocol(e.clean(l))},hasProtocol:function(l){return/^(:?\w+:)/.test(l)},isRelative:function(l){return/^[^\/|#]/.test(l)&&!e.hasProtocol(l)},isEmbeddedPage:function(l){return/^#/.test(l)}},i=null,h={stack:[],activeIndex:0,getActive:function(){return h.stack[h.activeIndex]},getPrev:function(){return h.stack[h.activeIndex-1]},getNext:function(){return h.stack[h.activeIndex+  
1]},addNew:function(l,s){h.getNext()&&h.clearForward();h.stack.push({url:l,transition:s});h.activeIndex=h.stack.length-1},clearForward:function(){h.stack=h.stack.slice(0,h.activeIndex+1)},ignoreNextHashChange:true},k="[tabindex],a,button:visible,select:visible,input",j=null,o=[],p=false,t="&ui-state=dialog",v=g.children("base"),m=location.protocol+"//"+location.host,r=e.get(m+location.pathname),n=r;if(v.length){var u=v.attr("href");if(u)n=u.search(/^[^:/]+:\/\/[^/]+\/?/)==-1?u.charAt(0)=="/"?m+u:  
r+u:u;n+=n.charAt(n.length-1)=="/"?" ":"/"}base=a.support.dynamicBaseTag?{element:v.length?v:a("<base>",{href:n}).prependTo(g),set:function(l){base.element.attr("href",n+e.get(l))},reset:function(){base.element.attr("href",n)}}:d;e.setOrigin();a.fn.animationComplete=function(l){if(a.support.cssTransitions)return a(this).one("webkitAnimationEnd",l);else setTimeout(l,0)};a.mobile.updateHash=e.set;a.mobile.path=e;a.mobile.base=base;a.mobile.urlstack=h.stack;a.mobile.urlHistory=h;a.mobile.changePage=  
function(l,s,q,w,z){function F(){function A(){if(w!==false&&x){h.ignoreNextHashChange=false;e.set(x)}!I&&!K&&h.addNew(x,s);c();a.mobile.silentScroll(l.data("lastScroll"));var G=l,P=G.find(".ui-title:eq(0)");P.length?P.focus():G.find(k).eq(0).focus();y&&y.data("page")._trigger("hide",null,{nextPage:l});l.data("page")._trigger("show",null,{prevPage:y||a("")});a.mobile.activePage=l;L!=null&&L.remove();b.removeClass("ui-mobile-rendering");p=false;o.length>0&&a.mobile.changePage.apply(a.mobile,o.pop())}  
function B(G){a.mobile.pageContainer.addClass(G);D.push(G)}a.mobile.silentScroll();var M=f.scrollTop(),J=["flip"],D=[];if(x.indexOf("&"+a.mobile.subPageUrlKey)>-1)l=a("[data-url='"+x+"']");if(y){y.data("lastScroll",M);y.data("page")._trigger("beforehide",{nextPage:l})}l.data("page")._trigger("beforeshow",{prevPage:y||a("")});if(s&&s!=="none"){a.mobile.pageLoading(true);a.inArray(s,J)>=0&&B("ui-mobile-viewport-perspective");B("ui-mobile-viewport-transitioning");if(y)y.addClass(s+" out "+(q?"reverse":  
""));l.addClass(a.mobile.activePageClass+" "+s+" in "+(q?"reverse":""));l.animationComplete(function(){y.add(l).removeClass("out in reverse "+s);y&&y.removeClass(a.mobile.activePageClass);A();a.mobile.pageContainer.removeClass(D.join(" "));D=[]})}else{a.mobile.pageLoading(true);y&&y.removeClass(a.mobile.activePageClass);l.addClass(a.mobile.activePageClass);A()}}function Q(){if(j||l.data("role")=="dialog"){x=h.getActive().url+t;if(j){l.attr("data-role",j);j=null}}l.page()}var E=a.type(l)==="array",  
H=a.type(l)==="object",y=E?l[0]:a.mobile.activePage;l=E?l[1]:l;var x=fileUrl=a.type(l)==="string"?e.stripHash(l):"",C=d,N="get",R=false,L=null,O=h.getActive(),I=false,K=false;if(!(O&&h.stack.length>1&&O.url===x&&!E&&!H))if(p)o.unshift(arguments);else{p=true;if(z){a.each(h.stack,function(A){if(this.url==x){urlIndex=A;I=A<h.activeIndex;K=!I;h.activeIndex=A}});if(I){q=true;s=s||O.transition}else if(K)s=s||h.getActive().transition}if(H&&l.url){x=l.url;C=l.data;N=l.type;R=true;if(C&&N=="get"){if(a.type(C)==  
"object")C=a.param(C);x+="?"+C;C=d}}base&&base.reset();a(window.document.activeElement).add("input:focus, textarea:focus, select:focus").blur();if(x){l=a("[data-url='"+x+"']");fileUrl=e.getFilePath(x)}else{E=l.attr("data-url");H=e.getFilePath(E);if(E!=H)fileUrl=H}if(s===d)s=a.mobile.defaultTransition;if(l.length&&!R){fileUrl&&base&&base.set(fileUrl);Q();F()}else{if(l.length)L=l;a.mobile.pageLoading();a.ajax({url:fileUrl,type:N,data:C,success:function(A){var B=/ data-url="(.*)"/.test(A)&&RegExp.$1;  
if(B){base&&base.set(B);x=fileUrl=e.getFilePath(B)}else base&&base.set(fileUrl);B=a("<div></div>");B.get(0).innerHTML=A;l=B.find('[data-role="page"], [data-role="dialog"]').first();if(!a.support.dynamicBaseTag){var M=e.get(fileUrl);l.find("[src],link[href]").each(function(){var J=a(this).is("[href]")?"href":"src",D=a(this).attr(J);D.replace(location.protocol+"//"+location.host+location.pathname,"");/^(\w+:|#|\/)/.test(D)||a(this).attr(J,M+D)})}l.attr("data-url",fileUrl).appendTo(a.mobile.pageContainer);  
Q();setTimeout(function(){F()},0)},error:function(){a.mobile.pageLoading(true);c(true);base&&base.set(e.get());a("<div class='ui-loader ui-overlay-shadow ui-body-e ui-corner-all'><h1>Error Loading Page</h1></div>").css({display:"block",opacity:0.96,top:a(window).scrollTop()+100}).appendTo(a.mobile.pageContainer).delay(800).fadeOut(400,function(){a(this).remove()})}})}}};a("form[data-ajax!='false']").live("submit",function(l){if(a.mobile.ajaxEnabled&&a.mobile.ajaxFormsEnabled){var s=a(this).attr("method"),  
q=e.clean(a(this).attr("action"));if(!e.isExternal(q)){if(e.isRelative(q))q=e.makeAbsolute(q);a.mobile.changePage({url:q,type:s,data:a(this).serialize()},d,d,true);l.preventDefault()}}});a("a").live("click",function(l){var s=a(this),q=s.attr("href")||"#";q=e.clean(q);var w=s.is("[rel='external']"),z=e.isEmbeddedPage(q);w=e.isExternal(q)||w&&!z;z=s.is("[target]");var F=s.is("[data-ajax='false']");if(s.is("[data-rel='back']")){window.history.back();return false}if(q==="#")return false;i=s.closest(".ui-btn").addClass(a.mobile.activeBtnClass);  
if(w||F||z||!a.mobile.ajaxEnabled||!a.mobile.ajaxLinksEnabled){c(true);if(z)window.open(q);else if(F)return;else location.href=q}else{w=s.data("transition");z=(z=s.data("direction"))&&z=="reverse"||s.data("back");j=s.attr("data-rel");if(e.isRelative(q))q=e.makeAbsolute(q);q=e.stripHash(q);a.mobile.changePage(q,w,z)}l.preventDefault()});f.bind("hashchange",function(){var l=e.stripHash(location.hash),s=a.mobile.urlHistory.stack.length===0?false:d;if(!a.mobile.hashListeningEnabled||!h.ignoreNextHashChange||  
h.stack.length>1&&l.indexOf(t)>-1&&!a.mobile.activePage.is(".ui-dialog")){if(!h.ignoreNextHashChange)h.ignoreNextHashChange=true}else l?a.mobile.changePage(l,s,d,false,true):a.mobile.changePage(a.mobile.firstPage,s,true,false,true)})})(jQuery);  
(function(a,d){a.fn.fixHeaderFooter=function(){if(!a.support.scrollTop)return this;return this.each(function(){var c=a(this);c.data("fullscreen")&&c.addClass("ui-page-fullscreen");c.find('.ui-header[data-position="fixed"]').addClass("ui-header-fixed ui-fixed-inline fade");c.find('.ui-footer[data-position="fixed"]').addClass("ui-footer-fixed ui-fixed-inline fade")})};a.fixedToolbars=function(){function c(){if(!e&&g=="overlay"){i||a.fixedToolbars.hide(true);a.fixedToolbars.startShowTimer()}}function f(m){var r=  
0;if(m){var n=m.offsetParent,u=document.body;for(r=m.offsetTop;m&&m!=u;){r+=m.scrollTop||0;if(m==n){r+=n.offsetTop;n=m.offsetParent}m=m.parentNode}}return r}function b(m){var r=a(window).scrollTop(),n=f(m[0]),u=m.css("top")=="auto"?0:parseFloat(m.css("top")),l=window.innerHeight,s=m.outerHeight(),q=m.parents(".ui-page:not(.ui-page-fullscreen)").length;if(m.is(".ui-header-fixed")){u=r-n+u;if(u<n)u=0;return m.css("top",q?u:r)}else{u=r+l-s-(n-u);return m.css("top",q?u:r+l-s)}}if(a.support.scrollTop){var g=  
"inline",e=false,i,h,k=a.support.touch,j=k?"touchstart":"mousedown",o=k?"touchend":"mouseup",p=null,t=false,v=true;a(function(){a(document).bind(j,function(m){if(v)a(m.target).closest("a,input,textarea,select,button,label,.ui-header-fixed,.ui-footer-fixed").length||(p=g)}).bind(o,function(m){if(v)if(!a(m.target).closest("a,input,textarea,select,button,label,.ui-header-fixed,.ui-footer-fixed").length)if(!t){a.fixedToolbars.toggle(p);p=null}}).bind("scrollstart",function(m){if(!a(m.target).closest("a,input,textarea,select,button,label,.ui-header-fixed,.ui-footer-fixed").length){t=  
true;if(p==null)p=g;if(e=(m=p=="overlay")||!!i){a.fixedToolbars.clearShowTimer();m&&a.fixedToolbars.hide(true)}}}).bind("scrollstop",function(m){if(!a(m.target).closest("a,input,textarea,select,button,label,.ui-header-fixed,.ui-footer-fixed").length){t=false;if(e){e=false;a.fixedToolbars.startShowTimer()}p=null}}).bind("silentscroll",c);a(window).bind("resize",c)});a(".ui-page").live("pagebeforeshow",function(m){m=a(m.target).find('[data-role="footer"]:not(.ui-sticky-footer)');var r=m.data("id");  
h=null;if(r){h=a('.ui-footer[data-id="'+r+'"].ui-sticky-footer');if(h.length==0){h=m;m=h.clone();h.addClass("ui-sticky-footer").before(m)}m.addClass("ui-footer-duplicate");h.appendTo(a.pageContainer).css("top",0);b(h)}});a(".ui-page").live("pageshow",function(m){h&&h.length&&h.appendTo(m.target).css("top",0);a.fixedToolbars.show(true,this)});return{show:function(m,r){a.fixedToolbars.clearShowTimer();g="overlay";return(r?a(r):a.mobile.activePage?a.mobile.activePage:a(".ui-page-active")).children(".ui-header-fixed:first, .ui-footer-fixed:not(.ui-footer-duplicate):last").each(function(){var n=  
a(this),u=a(window).scrollTop(),l=f(n[0]),s=window.innerHeight,q=n.outerHeight();u=n.is(".ui-header-fixed")&&u<=l+q||n.is(".ui-footer-fixed")&&l<=u+s;n.addClass("ui-fixed-overlay").removeClass("ui-fixed-inline");!u&&!m&&n.animationComplete(function(){n.removeClass("in")}).addClass("in");b(n)})},hide:function(m){g="inline";return(a.mobile.activePage?a.mobile.activePage:a(".ui-page-active")).children(".ui-header-fixed:first, .ui-footer-fixed:not(.ui-footer-duplicate):last").each(function(){var r=a(this),  
n=r.css("top");n=n=="auto"?0:parseFloat(n);r.addClass("ui-fixed-inline").removeClass("ui-fixed-overlay");if(n<0||r.is(".ui-header-fixed")&&n!=0)if(m)r.css("top",0);else r.css("top")!=="auto"&&parseFloat(r.css("top"))!==0&&r.animationComplete(function(){r.removeClass("out reverse");r.css("top",0)}).addClass("out reverse")})},startShowTimer:function(){a.fixedToolbars.clearShowTimer();var m=a.makeArray(arguments);i=setTimeout(function(){i=d;a.fixedToolbars.show.apply(null,m)},100)},clearShowTimer:function(){i&&  
clearTimeout(i);i=d},toggle:function(m){if(m)g=m;return g=="overlay"?a.fixedToolbars.hide():a.fixedToolbars.show()},setTouchToggleEnabled:function(m){v=m}}}}()})(jQuery);  
(function(a,d){a.widget("mobile.checkboxradio",a.mobile.widget,{options:{theme:null},_create:function(){var c=this,f=this.element,b=f.closest("form,fieldset,[data-role='page']").find("label[for='"+f.attr("id")+"']"),g=f.attr("type"),e="ui-icon-"+g+"-off";if(!(g!="checkbox"&&g!="radio")){if(!this.options.theme)this.options.theme=this.element.data("theme");b.buttonMarkup({theme:this.options.theme,icon:this.element.parents("[data-type='horizontal']").length?d:e,shadow:false});f.add(b).wrapAll("<div class='ui-"+  
g+"'></div>");b.bind({mouseover:function(){if(a(this).parent().is(".ui-disabled"))return false},touchmove:function(i){i=i.originalEvent.touches[0];if(b.data("movestart")){if(Math.abs(b.data("movestart")[0]-i.pageX)>10||Math.abs(abel.data("movestart")[1]-i.pageY)>10)b.data("moved",true)}else b.data("movestart",[parseFloat(i.pageX),parseFloat(i.pageY)])},"touchend mouseup":function(i){b.removeData("movestart");if(b.data("etype")&&b.data("etype")!==i.type||b.data("moved")){b.removeData("etype").removeData("moved");  
b.data("moved")&&b.removeData("moved");return false}b.data("etype",i.type);c._cacheVals();f.attr("checked",g==="radio"&&true||!f.is(":checked"));c._updateAll();i.preventDefault()},click:false});f.bind({mousedown:function(){this._cacheVals()},click:function(){c._updateAll()},focus:function(){b.addClass("ui-focus")},blur:function(){b.removeClass("ui-focus")}});this.refresh()}},_cacheVals:function(){this._getInputSet().each(function(){a(this).data("cacheVal",a(this).is(":checked"))})},_getInputSet:function(){return this.element.closest("form,fieldset,[data-role='page']").find("input[name='"+  
this.element.attr("name")+"'][type='"+this.element.attr("type")+"']")},_updateAll:function(){this._getInputSet().each(function(){var c=a(this).data("cacheVal");if(c&&c!==a(this).is(":checked")||a(this).is("[type='checkbox']"))a(this).trigger("change")}).checkboxradio("refresh")},refresh:function(){var c=this.element,f=c.closest("form,fieldset,[data-role='page']").find("label[for='"+c.attr("id")+"']"),b=c.attr("type"),g=f.find(".ui-icon"),e="ui-icon-"+b+"-on";b="ui-icon-"+b+"-off";if(c[0].checked){f.addClass("ui-btn-active");  
g.addClass(e);g.removeClass(b)}else{f.removeClass("ui-btn-active");g.removeClass(e);g.addClass(b)}c.is(":disabled")?this.disable():this.enable()},disable:function(){this.element.attr("disabled",true).parent().addClass("ui-disabled")},enable:function(){this.element.attr("disabled",false).parent().removeClass("ui-disabled")}})})(jQuery);  
(function(a){a.widget("mobile.textinput",a.mobile.widget,{options:{theme:null},_create:function(){var d=this.element,c=this.options,f=c.theme;if(!f){f=this.element.closest("[class*='ui-bar-'],[class*='ui-body-']");f=f.length?/ui-(bar|body)-([a-z])/.exec(f.attr("class"))[2]:"c"}f=" ui-body-"+f;a("label[for="+d.attr("id")+"]").addClass("ui-input-text");d.addClass("ui-input-text ui-body-"+c.theme);var b=d;if(d.is('[type="search"],[data-type="search"]')){b=d.wrap('<div class="ui-input-search ui-shadow-inset ui-btn-corner-all ui-btn-shadow ui-icon-searchfield'+  
f+'"></div>').parent();var g=a('<a href="#" class="ui-input-clear" title="clear text">clear text</a>').tap(function(h){d.val("").focus();d.trigger("change");g.addClass("ui-input-clear-hidden");h.preventDefault()}).appendTo(b).buttonMarkup({icon:"delete",iconpos:"notext",corners:true,shadow:true});c=function(){d.val()==""?g.addClass("ui-input-clear-hidden"):g.removeClass("ui-input-clear-hidden")};c();d.keyup(c)}else d.addClass("ui-corner-all ui-shadow-inset"+f);d.focus(function(){b.addClass("ui-focus")}).blur(function(){b.removeClass("ui-focus")});  
if(d.is("textarea")){var e=function(){var h=d[0].scrollHeight;d[0].clientHeight<h&&d.css({height:h+15})},i;d.keyup(function(){clearTimeout(i);i=setTimeout(e,100)})}},disable:function(){(this.element.attr("disabled",true).is('[type="search"],[data-type="search"]')?this.element.parent():this.element).addClass("ui-disabled")},enable:function(){(this.element.attr("disabled",false).is('[type="search"],[data-type="search"]')?this.element.parent():this.element).removeClass("ui-disabled")}})})(jQuery);  
(function(a){a.widget("mobile.selectmenu",a.mobile.widget,{options:{theme:null,disabled:false,icon:"arrow-d",iconpos:"right",inline:null,corners:true,shadow:true,iconshadow:true,menuPageTheme:"b",overlayTheme:"a",hidePlaceholderMenuItems:true,closeText:"Close",nativeMenu:false},_create:function(){var d=this,c=this.options,f=this.element.wrap("<div class='ui-select'>"),b=f.attr("id"),g=a("label[for="+b+"]").addClass("ui-select"),e=(d.options.nativeMenu?a("<div/>"):a("<a>",{href:"#",role:"button",id:k,  
"aria-haspopup":"true","aria-owns":j})).text(a(f[0].options.item(f[0].selectedIndex)).text()).insertBefore(f).buttonMarkup({theme:c.theme,icon:c.icon,iconpos:c.iconpos,inline:c.inline,corners:c.corners,shadow:c.shadow,iconshadow:c.iconshadow}),i=d.isMultiple=f[0].multiple;c.nativeMenu&&window.opera&&window.opera.version&&f.addClass("ui-select-nativeonly");if(!c.nativeMenu){var h=f.find("option"),k=b+"-button",j=b+"-menu",o=f.closest(".ui-page"),p=/ui-btn-up-([a-z])/.exec(e.attr("class"))[1],t=a("<div data-role='dialog' data-theme='"+  
c.menuPageTheme+"'><div data-role='header'><div class='ui-title'>"+g.text()+"</div></div><div data-role='content'></div></div>").appendTo(a.mobile.pageContainer).page(),v=t.find(".ui-content"),m=t.find(".ui-header a"),r=a("<div>",{"class":"ui-selectmenu-screen ui-screen-hidden"}).appendTo(o),n=a("<div>",{"class":"ui-selectmenu ui-selectmenu-hidden ui-overlay-shadow ui-corner-all pop ui-body-"+c.overlayTheme}).insertAfter(r),u=a("<ul>",{"class":"ui-selectmenu-list",id:j,role:"listbox","aria-labelledby":k,  
"data-theme":p}).appendTo(n);p=a("<div>",{"class":"ui-header ui-bar-"+p}).prependTo(n);var l=a("<h1>",{"class":"ui-title"}).appendTo(p),s=a("<a>",{"data-iconpos":"notext","data-icon":"delete",text:c.closeText,href:"#","class":"ui-btn-left"}).appendTo(p).buttonMarkup()}if(i)d.buttonCount=a("<span>").addClass("ui-li-count ui-btn-up-c ui-btn-corner-all").hide().appendTo(e);c.disabled&&this.disable();f.change(function(){d.refresh()});a.extend(d,{select:f,optionElems:h,selectID:b,label:g,buttonId:k,menuId:j,  
thisPage:o,button:e,menuPage:t,menuPageContent:v,screen:r,listbox:n,list:u,menuType:void 0,header:p,headerClose:s,headerTitle:l,placeholder:""});if(c.nativeMenu){f.appendTo(e).bind("touchstart mousedown",function(){e.addClass(a.mobile.activeBtnClass)}).bind("focus mouseover",function(){e.trigger("mouseover")}).bind("touchmove",function(){e.removeClass(a.mobile.activeBtnClass)}).bind("change blur mouseout",function(){e.trigger("mouseout").removeClass(a.mobile.activeBtnClass)});e.attr("tabindex","-1")}else{d.refresh();  
f.attr("tabindex","-1").focus(function(){a(this).blur();e.focus()});e.bind("touchstart",function(q){a(this).data("startTouches",a.extend({},q.originalEvent.touches[0]))}).bind(a.support.touch?"touchend":"mouseup",function(q){a(this).data("moved")?a(this).removeData("moved"):d.open();q.preventDefault()}).bind("touchmove",function(q){q=q.originalEvent.touches[0];var w=a(this).data("startTouches"),z=Math.abs(q.pageY-w.pageY);if(Math.abs(q.pageX-w.pageX)>10||z>10)a(this).data("moved",true)});u.delegate("li:not(.ui-disabled, .ui-li-divider)",  
"click",function(q){if(a(q.target).is("a")){var w=u.find("li:not(.ui-li-divider)").index(this);w=d.optionElems.eq(w)[0];w.selected=i?!w.selected:true;i&&a(this).find(".ui-icon").toggleClass("ui-icon-checkbox-on",w.selected).toggleClass("ui-icon-checkbox-off",!w.selected);f.trigger("change");i||d.close();q.preventDefault()}});r.add(s).add(m).bind("click",function(q){d.close();q.preventDefault();a.contains(m[0],q.target)&&q.stopImmediatePropagation()})}},_buildList:function(){var d=this,c=this.options,  
f=this.placeholder,b=[],g=[],e=d.isMultiple?"checkbox-off":"false";d.list.empty().filter(".ui-listview").listview("destroy");d.select.find("option").each(function(){var i=a(this),h=i.parent(),k=i.text(),j="<a href='#'>"+k+"</a>",o=[],p=[];if(h.is("optgroup")){h=h.attr("label");if(a.inArray(h,b)===-1){g.push("<li data-role='list-divider'>"+h+"</li>");b.push(h)}}if(!this.getAttribute("value")||k.length==0||i.data("placeholder")){c.hidePlaceholderMenuItems&&o.push("ui-selectmenu-placeholder");f=d.placeholder=  
k}if(this.disabled){o.push("ui-disabled");p.push("aria-disabled='true'")}g.push("<li data-icon='"+e+"' class='"+o.join(" ")+"' "+p.join(" ")+">"+j+"</li>")});d.list.html(g.join(" "));this.isMultiple||this.headerClose.hide();!this.isMultiple&&!f.length?this.header.hide():this.headerTitle.text(this.placeholder);d.list.listview()},refresh:function(d){var c=this,f=this.element,b=this.isMultiple,g=this.optionElems=f.find("option"),e=g.filter(":selected"),i=e.map(function(){return g.index(this)}).get();  
if(!c.options.nativeMenu&&(d||f[0].options.length>c.list.find("li").length))c._buildList();c.button.find(".ui-btn-text").text(function(){if(!b)return e.text();return e.length?e.map(function(){return a(this).text()}).get().join(", "):c.placeholder});if(b)c.buttonCount[e.length>1?"show":"hide"]().text(e.length);c.options.nativeMenu||c.list.find("li:not(.ui-li-divider)").removeClass(a.mobile.activeBtnClass).attr("aria-selected",false).each(function(h){if(a.inArray(h,i)>-1){h=a(this).addClass(a.mobile.activeBtnClass);  
h.find("a").attr("aria-selected",true);b&&h.find(".ui-icon").removeClass("ui-icon-checkbox-off").addClass("ui-icon-checkbox-on")}})},open:function(){function d(){c.list.find(".ui-btn-active").focus()}if(!(this.options.disabled||this.options.nativeMenu)){var c=this,f=c.list.outerHeight(),b=c.list.outerWidth(),g=a(window).scrollTop(),e=c.button.offset().top,i=window.innerHeight,h=c.list.parents(".ui-dialog").length;c.button.addClass(a.mobile.activeBtnClass);if(h||f>i-80||!a.support.scrollTop){g==0&&  
e>i&&c.thisPage.one("pagehide",function(){a(this).data("lastScroll",e)});c.menuPage.one("pageshow",function(){a(window).one("silentscroll",function(){d()})});c.menuType="page";c.menuPageContent.append(c.list);a.mobile.changePage(c.menuPage,"pop",false,true)}else{c.menuType="overlay";c.screen.height(a(document).height()).removeClass("ui-screen-hidden");h=e-g;var k=g+i-e,j=f/2;f=h>f/2&&k>f/2?e+c.button.outerHeight()/2-j:h>k?g+i-f-30:g+30;b=c.button.offset().left+c.button.outerWidth()/2-b/2;c.listbox.append(c.list).removeClass("ui-selectmenu-hidden").css({top:f,  
left:b}).addClass("in");d()}setTimeout(function(){c.isOpen=true},400)}},close:function(){function d(){setTimeout(function(){c.button.focus();c.button.removeClass(a.mobile.activeBtnClass)},40);c.listbox.removeAttr("style").append(c.list)}if(!(this.options.disabled||!this.isOpen||this.options.nativeMenu)){var c=this;if(c.menuType=="page"){a.mobile.changePage([c.menuPage,c.thisPage],"pop",true,false);c.menuPage.one("pagehide",d)}else{c.screen.addClass("ui-screen-hidden");c.listbox.addClass("ui-selectmenu-hidden").removeAttr("style").removeClass("in");  
d()}this.isOpen=false}},disable:function(){this.element.attr("disabled",true);this.button.addClass("ui-disabled").attr("aria-disabled",true);return this._setOption("disabled",true)},enable:function(){this.element.attr("disabled",false);this.button.removeClass("ui-disabled").attr("aria-disabled",false);return this._setOption("disabled",false)}})})(jQuery);  
(function(a){a.fn.buttonMarkup=function(c){return this.each(function(){var f=a(this),b=a.extend({},a.fn.buttonMarkup.defaults,f.data(),c),g,e="ui-btn-inner",i;d&&d();if(!b.theme){g=f.closest("[class*='ui-bar-'],[class*='ui-body-']");b.theme=g.length?/ui-(bar|body)-([a-z])/.exec(g.attr("class"))[2]:"c"}g="ui-btn ui-btn-up-"+b.theme;if(b.inline)g+=" ui-btn-inline";if(b.icon){b.icon="ui-icon-"+b.icon;b.iconpos=b.iconpos||"left";i="ui-icon "+b.icon;if(b.shadow)i+=" ui-icon-shadow"}if(b.iconpos){g+=" ui-btn-icon-"+  
b.iconpos;b.iconpos=="notext"&&!f.attr("title")&&f.attr("title",f.text())}if(b.corners){g+=" ui-btn-corner-all";e+=" ui-btn-corner-all"}if(b.shadow)g+=" ui-shadow";f.attr("data-theme",b.theme).addClass(g);b=("<D class='"+e+"'><D class='ui-btn-text'></D>"+(b.icon?"<span class='"+i+"'></span>":"")+"</D>").replace(/D/g,b.wrapperEls);f.wrapInner(b)})};a.fn.buttonMarkup.defaults={corners:true,shadow:true,iconshadow:true,wrapperEls:"span"};var d=function(){a(".ui-btn:not(.ui-disabled)").live({"touchstart mousedown":function(){var c=  
a(this).attr("data-theme");a(this).removeClass("ui-btn-up-"+c).addClass("ui-btn-down-"+c)},"touchmove touchend mouseup":function(){var c=a(this).attr("data-theme");a(this).removeClass("ui-btn-down-"+c).addClass("ui-btn-up-"+c)},"mouseover focus":function(){var c=a(this).attr("data-theme");a(this).removeClass("ui-btn-up-"+c).addClass("ui-btn-hover-"+c)},"mouseout blur":function(){var c=a(this).attr("data-theme");a(this).removeClass("ui-btn-hover-"+c).addClass("ui-btn-up-"+c)}});d=null}})(jQuery);  
(function(a){a.widget("mobile.button",a.mobile.widget,{options:{theme:null,icon:null,iconpos:null,inline:null,corners:true,shadow:true,iconshadow:true},_create:function(){var d=this.element,c=this.options;this.button=a("<div></div>").text(d.text()||d.val()).buttonMarkup({theme:c.theme,icon:c.icon,iconpos:c.iconpos,inline:c.inline,corners:c.corners,shadow:c.shadow,iconshadow:c.iconshadow}).insertBefore(d).append(d.addClass("ui-btn-hidden"));d.attr("type")!=="reset"&&d.click(function(){var f=a("<input>",  
{type:"hidden",name:d.attr("name"),value:d.attr("value")}).insertBefore(d);a(document).submit(function(){f.remove()})})},enable:function(){this.element.attr("disabled",false);this.button.removeClass("ui-disabled").attr("aria-disabled",false);return this._setOption("disabled",false)},disable:function(){this.element.attr("disabled",true);this.button.addClass("ui-disabled").attr("aria-disabled",true);return this._setOption("disabled",true)}})})(jQuery);  
(function(a){a.widget("mobile.slider",a.mobile.widget,{options:{theme:null,trackTheme:null,disabled:false},_create:function(){var d=this,c=this.element,f=c.parents("[class*=ui-bar-],[class*=ui-body-]").eq(0);f=f.length?f.attr("class").match(/ui-(bar|body)-([a-z])/)[2]:"c";var b=this.options.theme?this.options.theme:f,g=this.options.trackTheme?this.options.trackTheme:f,e=c[0].nodeName.toLowerCase();f=e=="select"?"ui-slider-switch":"";var i=c.attr("id"),h=i+"-label";i=a("[for="+i+"]").attr("id",h);  
var k=function(){return e=="input"?parseFloat(c.val()):c[0].selectedIndex},j=e=="input"?parseFloat(c.attr("min")):0,o=e=="input"?parseFloat(c.attr("max")):c.find("option").length-1,p=window.parseFloat(c.attr("step")||1),t=a('<div class="ui-slider '+f+" ui-btn-down-"+g+' ui-btn-corner-all" role="application"></div>'),v=a('<a href="#" class="ui-slider-handle"></a>').appendTo(t).buttonMarkup({corners:true,theme:b,shadow:true}).attr({role:"slider","aria-valuemin":j,"aria-valuemax":o,"aria-valuenow":k(),  
"aria-valuetext":k(),title:k(),"aria-labelledby":h});a.extend(this,{slider:t,handle:v,dragging:false,beforeStart:null});if(e=="select"){t.wrapInner('<div class="ui-slider-inneroffset"></div>');c.find("option");c.find("option").each(function(m){var r=m==0?"b":"a",n=m==0?"right":"left";m=m==0?" ui-btn-down-"+g:" ui-btn-active";a('<div class="ui-slider-labelbg ui-slider-labelbg-'+r+m+" ui-btn-corner-"+n+'"></div>').prependTo(t);a('<span class="ui-slider-label ui-slider-label-'+r+m+" ui-btn-corner-"+  
n+'" role="img">'+a(this).text()+"</span>").prependTo(v)})}i.addClass("ui-slider");c.addClass(e=="input"?"ui-slider-input":"ui-slider-switch").change(function(){d.refresh(k(),true)}).keyup(function(){d.refresh(k(),true,true)}).blur(function(){d.refresh(k(),true)});a(document).bind("touchmove mousemove",function(m){if(d.dragging){d.refresh(m);return false}});t.bind("touchstart mousedown",function(m){d.dragging=true;if(e==="select")d.beforeStart=c[0].selectedIndex;d.refresh(m);return false});t.add(document).bind("touchend mouseup",  
function(){if(d.dragging){d.dragging=false;if(e==="select"){if(d.beforeStart===c[0].selectedIndex)d.refresh(d.beforeStart===0?1:0);var m=k();m=Math.round(m/(o-j)*100);v.addClass("ui-slider-handle-snapping").css("left",m+"%").animationComplete(function(){v.removeClass("ui-slider-handle-snapping")})}return false}});t.insertAfter(c);this.handle.bind("touchstart mousedown",function(){a(this).focus()});this.handle.bind("keydown",function(m){var r=k();if(!d.options.disabled){switch(m.keyCode){case a.mobile.keyCode.HOME:case a.mobile.keyCode.END:case a.mobile.keyCode.PAGE_UP:case a.mobile.keyCode.PAGE_DOWN:case a.mobile.keyCode.UP:case a.mobile.keyCode.RIGHT:case a.mobile.keyCode.DOWN:case a.mobile.keyCode.LEFT:m.preventDefault();  
if(!d._keySliding){d._keySliding=true;a(this).addClass("ui-state-active")}}switch(m.keyCode){case a.mobile.keyCode.HOME:d.refresh(j);break;case a.mobile.keyCode.END:d.refresh(o);break;case a.mobile.keyCode.PAGE_UP:case a.mobile.keyCode.UP:case a.mobile.keyCode.RIGHT:d.refresh(r+p);break;case a.mobile.keyCode.PAGE_DOWN:case a.mobile.keyCode.DOWN:case a.mobile.keyCode.LEFT:d.refresh(r-p)}}}).keyup(function(){if(d._keySliding){d._keySliding=false;a(this).removeClass("ui-state-active")}});this.refresh()},  
refresh:function(d,c,f){if(!this.options.disabled){var b=this.element,g=b[0].nodeName.toLowerCase(),e=g==="input"?parseFloat(b.attr("min")):0,i=g==="input"?parseFloat(b.attr("max")):b.find("option").length-1;if(typeof d==="object"){d=d.originalEvent.touches?d.originalEvent.touches[0]:d;if(!this.dragging||d.pageX<this.slider.offset().left-8||d.pageX>this.slider.offset().left+this.slider.width()+8)return;d=Math.round((d.pageX-this.slider.offset().left)/this.slider.width()*100)}else{if(d==null)d=g===  
"input"?parseFloat(b.val()):b[0].selectedIndex;d=(parseFloat(d)-e)/(i-e)*100}if(!isNaN(d)){if(d<0)d=0;if(d>100)d=100;var h=Math.round(d/100*(i-e))+e;if(h<e)h=e;if(h>i)h=i;this.handle.css("left",d+"%");this.handle.attr({"aria-valuenow":g==="input"?h:b.find("option").eq(h).attr("value"),"aria-valuetext":g==="input"?h:b.find("option").eq(h).text(),title:h});if(g==="select")h===0?this.slider.addClass("ui-slider-switch-a").removeClass("ui-slider-switch-b"):this.slider.addClass("ui-slider-switch-b").removeClass("ui-slider-switch-a");  
if(!f){if(g==="input")b.val(h);else b[0].selectedIndex=h;c||b.trigger("change")}}}},enable:function(){this.element.attr("disabled",false);this.slider.removeClass("ui-disabled").attr("aria-disabled",false);return this._setOption("disabled",false)},disable:function(){this.element.attr("disabled",true);this.slider.addClass("ui-disabled").attr("aria-disabled",true);return this._setOption("disabled",true)}})})(jQuery);  
(function(a){a.widget("mobile.collapsible",a.mobile.widget,{options:{expandCueText:" click to expand contents",collapseCueText:" click to collapse contents",collapsed:false,heading:">:header,>legend",theme:null,iconTheme:"d"},_create:function(){var d=this.element,c=this.options,f=d.addClass("ui-collapsible-contain"),b=d.find(c.heading).eq(0),g=f.wrapInner('<div class="ui-collapsible-content"></div>').find(".ui-collapsible-content");d=d.closest('[data-role="collapsible-set"]').addClass("ui-collapsible-set");  
if(b.is("legend")){b=a('<div role="heading">'+b.html()+"</div>").insertBefore(b);b.next().remove()}b.insertBefore(g);b.addClass("ui-collapsible-heading").append('<span class="ui-collapsible-heading-status"></span>').wrapInner('<a href="#" class="ui-collapsible-heading-toggle"></a>').find("a:eq(0)").buttonMarkup({shadow:!!!d.length,corners:false,iconPos:"left",icon:"plus",theme:c.theme}).find(".ui-icon").removeAttr("class").buttonMarkup({shadow:true,corners:true,iconPos:"notext",icon:"plus",theme:c.iconTheme});  
if(d.length)f.data("collapsible-last")&&b.find("a:eq(0), .ui-btn-inner").addClass("ui-corner-bottom");else b.find("a:eq(0)").addClass("ui-corner-all").find(".ui-btn-inner").addClass("ui-corner-all");f.bind("collapse",function(e){if(!e.isDefaultPrevented()){e.preventDefault();b.addClass("ui-collapsible-heading-collapsed").find(".ui-collapsible-heading-status").text(c.expandCueText);b.find(".ui-icon").removeClass("ui-icon-minus").addClass("ui-icon-plus");g.addClass("ui-collapsible-content-collapsed").attr("aria-hidden",  
true);f.data("collapsible-last")&&b.find("a:eq(0), .ui-btn-inner").addClass("ui-corner-bottom")}}).bind("expand",function(e){if(!e.isDefaultPrevented()){e.preventDefault();b.removeClass("ui-collapsible-heading-collapsed").find(".ui-collapsible-heading-status").text(c.collapseCueText);b.find(".ui-icon").removeClass("ui-icon-plus").addClass("ui-icon-minus");g.removeClass("ui-collapsible-content-collapsed").attr("aria-hidden",false);f.data("collapsible-last")&&b.find("a:eq(0), .ui-btn-inner").removeClass("ui-corner-bottom")}}).trigger(c.collapsed?  
"collapse":"expand");if(d.length&&!d.data("collapsiblebound")){d.data("collapsiblebound",true).bind("expand",function(e){a(this).find(".ui-collapsible-contain").not(a(e.target).closest(".ui-collapsible-contain")).not("> .ui-collapsible-contain .ui-collapsible-contain").trigger("collapse")});d=d.find("[data-role=collapsible]");d.first().find("a:eq(0)").addClass("ui-corner-top").find(".ui-btn-inner").addClass("ui-corner-top");d.last().data("collapsible-last",true)}b.bind(a.support.touch?"touchstart":  
"click",function(){b.is(".ui-collapsible-heading-collapsed")?f.trigger("expand"):f.trigger("collapse");return false})}})})(jQuery);  
(function(a){a.fn.controlgroup=function(d){return this.each(function(){function c(e){e.removeClass("ui-btn-corner-all ui-shadow").eq(0).addClass(g[0]).end().filter(":last").addClass(g[1]).addClass("ui-controlgroup-last")}var f=a.extend({direction:a(this).data("type")||"vertical",shadow:false},d),b=a(this).find(">legend"),g=f.direction=="horizontal"?["ui-corner-left","ui-corner-right"]:["ui-corner-top","ui-corner-bottom"];a(this).find("input:eq(0)").attr("type");if(b.length){a(this).wrapInner('<div class="ui-controlgroup-controls"></div>');  
a('<div role="heading" class="ui-controlgroup-label">'+b.html()+"</div>").insertBefore(a(this).children(0));b.remove()}a(this).addClass("ui-corner-all ui-controlgroup ui-controlgroup-"+f.direction);c(a(this).find(".ui-btn"));c(a(this).find(".ui-btn-inner"));f.shadow&&a(this).addClass("ui-shadow")})}})(jQuery);(function(a){a.fn.fieldcontain=function(){return this.addClass("ui-field-contain ui-body ui-br")}})(jQuery);  
(function(a){a.widget("mobile.listview",a.mobile.widget,{options:{theme:"c",countTheme:"c",headerTheme:"b",dividerTheme:"b",splitIcon:"arrow-r",splitTheme:"b",inset:false},_create:function(){var d=this.element,c=this.options;d.addClass("ui-listview").attr("role","listbox");c.inset&&d.addClass("ui-listview-inset ui-corner-all ui-shadow");d.delegate(".ui-li","focusin",function(){a(this).attr("tabindex","0")});this._itemApply(d,d);this.refresh(true);d.keydown(function(f){var b=a(f.target),g=b.closest("li");  
switch(f.keyCode){case 38:f=g.prev();if(f.length){b.blur().attr("tabindex","-1");f.find("a").first().focus()}return false;case 40:f=g.next();if(f.length){b.blur().attr("tabindex","-1");f.find("a").first().focus()}return false;case 39:f=g.find("a.ui-li-link-alt");if(f.length){b.blur();f.first().focus()}return false;case 37:f=g.find("a.ui-link-inherit");if(f.length){b.blur();f.first().focus()}return false;case 13:case 32:b.trigger("click");return false}});d.delegate("li","click",function(f){if(!a(f.target).closest("a").length){a(this).find("a").first().trigger("click");  
return false}})},_itemApply:function(d,c){c.find(".ui-li-count").addClass("ui-btn-up-"+(d.data("counttheme")||this.options.countTheme)+" ui-btn-corner-all");c.find("h1, h2, h3, h4, h5, h6").addClass("ui-li-heading");c.find("p, dl").addClass("ui-li-desc");c.find("li").find("img:eq(0)").addClass("ui-li-thumb").each(function(){a(this).closest("li").addClass(a(this).is(".ui-li-icon")?"ui-li-has-icon":"ui-li-has-thumb")});var f=c.find(".ui-li-aside");f.length&&f.each(function(b,g){a(g).prependTo(a(g).parent())});  
a.support.cssPseudoElement||a.nodeName(c[0],"ol")},_removeCorners:function(d){d.add(d.find(".ui-btn-inner, .ui-li-link-alt, .ui-li-thumb")).removeClass("ui-corner-top ui-corner-bottom ui-corner-br ui-corner-bl ui-corner-tr ui-corner-tl")},refresh:function(d){this._createSubPages();var c=this.options,f=this.element,b=this,g=f.data("dividertheme")||c.dividerTheme,e=f.children("li"),i=a.support.cssPseudoElement||!a.nodeName(f[0],"ol")?0:1;i&&f.find(".ui-li-dec").remove();e.attr({role:"option",tabindex:"-1"});  
e.first().attr("tabindex","0");e.each(function(h){var k=a(this),j="ui-li";if(!(!d&&k.hasClass("ui-li"))){var o=k.data("theme")||c.theme,p=k.find("a");if(p.length){var t=k.data("icon");k.buttonMarkup({wrapperEls:"div",shadow:false,corners:false,iconpos:"right",icon:p.length>1||t===false?false:t||"arrow-r",theme:o});p.first().addClass("ui-link-inherit");if(p.length>1){j+=" ui-li-has-alt";p=p.last();t=f.data("splittheme")||p.data("theme")||c.splitTheme;p.appendTo(k).attr("title",p.text()).addClass("ui-li-link-alt").empty().buttonMarkup({shadow:false,  
corners:false,theme:o,icon:false,iconpos:false}).find(".ui-btn-inner").append(a("<span>").buttonMarkup({shadow:true,corners:true,theme:t,iconpos:"notext",icon:f.data("spliticon")||p.data("icon")||c.splitIcon}))}}else if(k.data("role")==="list-divider"){j+=" ui-li-divider ui-btn ui-bar-"+g;k.attr("role","heading");if(i)i=1}else j+=" ui-li-static ui-btn-up-"+o;if(c.inset){if(h===0){j+=" ui-corner-top";k.add(k.find(".ui-btn-inner")).find(".ui-li-link-alt").addClass("ui-corner-tr").end().find(".ui-li-thumb").addClass("ui-corner-tl");  
k.next().next().length&&b._removeCorners(k.next())}if(h===e.length-1){j+=" ui-corner-bottom";k.add(k.find(".ui-btn-inner")).find(".ui-li-link-alt").addClass("ui-corner-br").end().find(".ui-li-thumb").addClass("ui-corner-bl");k.prev().prev().length&&b._removeCorners(k.prev())}}i&&j.indexOf("ui-li-divider")<0&&k.find(".ui-link-inherit").first().addClass("ui-li-jsnumbering").prepend("<span class='ui-li-dec'>"+i++ +". </span>");k.addClass(j);d||b._itemApply(f,k)}})},_idStringEscape:function(d){return d.replace(/[^a-zA-Z0-9]/g,  
"-")},_createSubPages:function(){var d=this.element,c=d.closest(".ui-page"),f=c.data("url"),b=this.options,g=this,e=c.find("[data-role='footer']").data("id");a(d.find("ul, ol").toArray().reverse()).each(function(i){var h=a(this),k=h.parent(),j=a.trim(k.contents()[0].nodeValue)||k.find("a:first").text();i=f+"&"+a.mobile.subPageUrlKey+"="+g._idStringEscape(j+" "+i);var o=h.data("theme")||b.theme,p=h.data("counttheme")||d.data("counttheme")||b.countTheme;h.wrap("<div data-role='page'><div data-role='content'></div></div>").parent().before("<div data-role='header' data-theme='"+  
b.headerTheme+"'><div class='ui-title'>"+j+"</div></div>").after(e?a("<div>",{"data-role":"footer","data-id":e,"class":"ui-footer-duplicate"}):"").parent().attr({"data-url":i,"data-theme":o,"data-count-theme":p}).appendTo(a.mobile.pageContainer).page();h=k.find("a:first");h.length||(h=a("<a></a>").html(j).prependTo(k.empty()));h.attr("href","#"+i)}).listview()}})})(jQuery);  
(function(a){a.mobile.listview.prototype.options.filter=false;a("[data-role='listview']").live("listviewcreate",function(){var d=a(this);if(d.data("listview").options.filter){var c=a("<form>",{"class":"ui-listview-filter ui-bar-c",role:"search"});a("<input>",{placeholder:"Filter results...","data-type":"search"}).bind("keyup change",function(){var f=this.value.toLowerCase();d.children().show();f&&d.children().filter(function(){return a(this).text().toLowerCase().indexOf(f)===-1}).hide()}).appendTo(c).textinput();  
c.insertBefore(d)}})})(jQuery);  
(function(a){a.widget("mobile.dialog",a.mobile.widget,{options:{},_create:function(){this.element.attr("role","dialog").addClass("ui-page ui-dialog ui-body-a").find("[data-role=header]").addClass("ui-corner-top ui-overlay-shadow").prepend('<a href="#" data-icon="delete" data-rel="back" data-iconpos="notext">Close</a>').end().find('.ui-content:not([class*="ui-body-"])').addClass("ui-body-c").end().find(".ui-content,[data-role=footer]").last().addClass("ui-corner-bottom ui-overlay-shadow");this.element.bind("click submit",  
function(d){d=d.type=="click"?a(d.target).closest("a"):a(d.target).closest("form");d.length&&!d.data("transition")&&d.attr("data-transition",a.mobile.urlHistory.getActive().transition).attr("data-direction","reverse")})},close:function(){window.history.back()}})})(jQuery);  
(function(a,d){a.widget("mobile.navbar",a.mobile.widget,{options:{iconpos:"top",grid:null},_create:function(){var c=this.element,f=c.find("a"),b=f.filter("[data-icon]").length?this.options.iconpos:d;c.addClass("ui-navbar").attr("role","navigation").find("ul").grid({grid:this.options.grid});b||c.addClass("ui-navbar-noicons");f.buttonMarkup({corners:false,shadow:false,iconpos:b});c.delegate("a","click",function(){f.removeClass("ui-btn-active");a(this).addClass("ui-btn-active")})}})})(jQuery);  
(function(a){a.fn.grid=function(d){return this.each(function(){var c=a.extend({grid:null},d),f=a(this).children(),b={a:2,b:3,c:4,d:5};c=c.grid;if(!c)if(f.length<=5)for(var g in b){if(b[g]==f.length)c=g}else c="a";b=b[c];a(this).addClass("ui-grid-"+c);f.filter(":nth-child("+b+"n+1)").addClass("ui-block-a");f.filter(":nth-child("+b+"n+2)").addClass("ui-block-b");b>2&&f.filter(":nth-child(3n+3)").addClass("ui-block-c");b>3&&f.filter(":nth-child(4n+4)").addClass("ui-block-d");b>4&&f.filter(":nth-child(5n+5)").addClass("ui-block-e")})}})(jQuery);  
 
/*  
* jQuery UI Effects @VERSION  
*  
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)  
* Dual licensed under the MIT or GPL Version 2 licenses.  
* http://jquery.org/license  
*  
* http://docs.jquery.com/UI/Effects/  
*/  
;jQuery.effects || (function($, undefined) {  
 
$.effects = {};  
 
 
 
/******************************************************************************/  
/****************************** COLOR ANIMATIONS ******************************/  
/******************************************************************************/  
 
// override the animation for color styles  
$.each(['backgroundColor', 'borderBottomColor', 'borderLeftColor',  
'borderRightColor', 'borderTopColor', 'borderColor', 'color', 'outlineColor'],  
function(i, attr) {  
$.fx.step[attr] = function(fx) {  
if (!fx.colorInit) {  
fx.start = getColor(fx.elem, attr);  
fx.end = getRGB(fx.end);  
fx.colorInit = true;  
}  
 
fx.elem.style[attr] = 'rgb(' +  
Math.max(Math.min(parseInt((fx.pos * (fx.end[0] - fx.start[0])) + fx.start[0], 10), 255), 0) + ',' +  
Math.max(Math.min(parseInt((fx.pos * (fx.end[1] - fx.start[1])) + fx.start[1], 10), 255), 0) + ',' +  
Math.max(Math.min(parseInt((fx.pos * (fx.end[2] - fx.start[2])) + fx.start[2], 10), 255), 0) + ')';  
};  
});  
 
// Color Conversion functions from highlightFade  
// By Blair Mitchelmore  
// http://jquery.offput.ca/highlightFade/  
 
// Parse strings looking for color tuples [255,255,255]  
function getRGB(color) {  
var result;  
 
// Check if we're already dealing with an array of colors  
if ( color && color.constructor == Array && color.length == 3 )  
return color;  
 
// Look for rgb(num,num,num)  
if (result = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(color))  
return [parseInt(result[1],10), parseInt(result[2],10), parseInt(result[3],10)];  
 
// Look for rgb(num%,num%,num%)  
if (result = /rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(color))  
return [parseFloat(result[1])*2.55, parseFloat(result[2])*2.55, parseFloat(result[3])*2.55];  
 
// Look for #a0b1c2  
if (result = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color))  
return [parseInt(result[1],16), parseInt(result[2],16), parseInt(result[3],16)];  
 
// Look for #fff  
if (result = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color))  
return [parseInt(result[1]+result[1],16), parseInt(result[2]+result[2],16), parseInt(result[3]+result[3],16)];  
 
// Look for rgba(0, 0, 0, 0) == transparent in Safari 3  
if (result = /rgba\(0, 0, 0, 0\)/.exec(color))  
return colors['transparent'];  
 
// Otherwise, we're most likely dealing with a named color  
return colors[$.trim(color).toLowerCase()];  
}  
 
function getColor(elem, attr) {  
var color;  
 
do {  
color = $.curCSS(elem, attr);  
 
// Keep going until we find an element that has color, or we hit the body  
if ( color != '' && color != 'transparent' || $.nodeName(elem, "body") )  
break;  
 
attr = "backgroundColor";  
} while ( elem = elem.parentNode );  
 
return getRGB(color);  
};  
 
// Some named colors to work with  
// From Interface by Stefan Petre  
// http://interface.eyecon.ro/  
 
var colors = {  
aqua:[0,255,255],  
azure:[240,255,255],  
beige:[245,245,220],  
black:[0,0,0],  
blue:[0,0,255],  
brown:[165,42,42],  
cyan:[0,255,255],  
darkblue:[0,0,139],  
darkcyan:[0,139,139],  
darkgrey:[169,169,169],  
darkgreen:[0,100,0],  
darkkhaki:[189,183,107],  
darkmagenta:[139,0,139],  
darkolivegreen:[85,107,47],  
darkorange:[255,140,0],  
darkorchid:[153,50,204],  
darkred:[139,0,0],  
darksalmon:[233,150,122],  
darkviolet:[148,0,211],  
fuchsia:[255,0,255],  
gold:[255,215,0],  
green:[0,128,0],  
indigo:[75,0,130],  
khaki:[240,230,140],  
lightblue:[173,216,230],  
lightcyan:[224,255,255],  
lightgreen:[144,238,144],  
lightgrey:[211,211,211],  
lightpink:[255,182,193],  
lightyellow:[255,255,224],  
lime:[0,255,0],  
magenta:[255,0,255],  
maroon:[128,0,0],  
navy:[0,0,128],  
olive:[128,128,0],  
orange:[255,165,0],  
pink:[255,192,203],  
purple:[128,0,128],  
violet:[128,0,128],  
red:[255,0,0],  
silver:[192,192,192],  
white:[255,255,255],  
yellow:[255,255,0],  
transparent: [255,255,255]  
};  
 
 
 
/******************************************************************************/  
/****************************** CLASS ANIMATIONS ******************************/  
/******************************************************************************/  
 
var classAnimationActions = ['add', 'remove', 'toggle'],  
shorthandStyles = {  
border: 1,  
borderBottom: 1,  
borderColor: 1,  
borderLeft: 1,  
borderRight: 1,  
borderTop: 1,  
borderWidth: 1,  
margin: 1,  
padding: 1  
};  
 
function getElementStyles() {  
var style = document.defaultView  
? document.defaultView.getComputedStyle(this, null)  
: this.currentStyle,  
newStyle = {},  
key,  
camelCase;  
 
// webkit enumerates style porperties  
if (style && style.length && style[0] && style[style[0]]) {  
var len = style.length;  
while (len--) {  
key = style[len];  
if (typeof style[key] == 'string') {  
camelCase = key.replace(/\-(\w)/g, function(all, letter){  
return letter.toUpperCase();  
});  
newStyle[camelCase] = style[key];  
}  
}  
} else {  
for (key in style) {  
if (typeof style[key] === 'string') {  
newStyle[key] = style[key];  
}  
}  
}  
 
return newStyle;  
}  
 
function filterStyles(styles) {  
var name, value;  
for (name in styles) {  
value = styles[name];  
if (  
// ignore null and undefined values  
value == null ||  
// ignore functions (when does this occur?)  
$.isFunction(value) ||  
// shorthand styles that need to be expanded  
name in shorthandStyles ||  
// ignore scrollbars (break in IE)  
(/scrollbar/).test(name) ||  
 
// only colors or values that can be converted to numbers  
(!(/color/i).test(name) && isNaN(parseFloat(value)))  
) {  
delete styles[name];  
}  
}  
 
return styles;  
}  
 
function styleDifference(oldStyle, newStyle) {  
var diff = { _: 0 }, // http://dev.jquery.com/ticket/5459  
name;  
 
for (name in newStyle) {  
if (oldStyle[name] != newStyle[name]) {  
diff[name] = newStyle[name];  
}  
}  
 
return diff;  
}  
 
$.effects.animateClass = function(value, duration, easing, callback) {  
if ($.isFunction(easing)) {  
callback = easing;  
easing = null;  
}  
 
return this.queue('fx', function() {  
var that = $(this),  
originalStyleAttr = that.attr('style') || ' ',  
originalStyle = filterStyles(getElementStyles.call(this)),  
newStyle,  
className = that.attr('className');  
 
$.each(classAnimationActions, function(i, action) {  
if (value[action]) {  
that[action + 'Class'](value[action]);  
}  
});  
newStyle = filterStyles(getElementStyles.call(this));  
that.attr('className', className);  
 
that.animate(styleDifference(originalStyle, newStyle), duration, easing, function() {  
$.each(classAnimationActions, function(i, action) {  
if (value[action]) { that[action + 'Class'](value[action]); }  
});  
// work around bug in IE by clearing the cssText before setting it  
if (typeof that.attr('style') == 'object') {  
that.attr('style').cssText = '';  
that.attr('style').cssText = originalStyleAttr;  
} else {  
that.attr('style', originalStyleAttr);  
}  
if (callback) { callback.apply(this, arguments); }  
});  
 
// $.animate adds a function to the end of the queue  
// but we want it at the front  
var queue = $.queue(this),  
anim = queue.splice(queue.length - 1, 1)[0];  
queue.splice(1, 0, anim);  
$.dequeue(this);  
});  
};  
 
$.fn.extend({  
_addClass: $.fn.addClass,  
addClass: function(classNames, speed, easing, callback) {  
return speed ? $.effects.animateClass.apply(this, [{ add: classNames },speed,easing,callback]) : this._addClass(classNames);  
},  
 
_removeClass: $.fn.removeClass,  
removeClass: function(classNames,speed,easing,callback) {  
return speed ? $.effects.animateClass.apply(this, [{ remove: classNames },speed,easing,callback]) : this._removeClass(classNames);  
},  
 
_toggleClass: $.fn.toggleClass,  
toggleClass: function(classNames, force, speed, easing, callback) {  
if ( typeof force == "boolean" || force === undefined ) {  
if ( !speed ) {  
// without speed parameter;  
return this._toggleClass(classNames, force);  
} else {  
return $.effects.animateClass.apply(this, [(force?{add:classNames}:{remove:classNames}),speed,easing,callback]);  
}  
} else {  
// without switch parameter;  
return $.effects.animateClass.apply(this, [{ toggle: classNames },force,speed,easing]);  
}  
},  
 
switchClass: function(remove,add,speed,easing,callback) {  
return $.effects.animateClass.apply(this, [{ add: add, remove: remove },speed,easing,callback]);  
}  
});  
 
 
 
/******************************************************************************/  
/*********************************** EFFECTS **********************************/  
/******************************************************************************/  
 
$.extend($.effects, {  
version: "@VERSION",  
 
// Saves a set of properties in a data storage  
save: function(element, set) {  
for(var i=0; i < set.length; i++) {  
if(set[i] !== null) element.data("ec.storage."+set[i], element[0].style[set[i]]);  
}  
},  
 
// Restores a set of previously saved properties from a data storage  
restore: function(element, set) {  
for(var i=0; i < set.length; i++) {  
if(set[i] !== null) element.css(set[i], element.data("ec.storage."+set[i]));  
}  
},  
 
setMode: function(el, mode) {  
if (mode == 'toggle') mode = el.is(':hidden') ? 'show' : 'hide'; // Set for toggle  
return mode;  
},  
 
getBaseline: function(origin, original) { // Translates a [top,left] array into a baseline value  
// this should be a little more flexible in the future to handle a string & hash  
var y, x;  
switch (origin[0]) {  
case 'top': y = 0; break;  
case 'middle': y = 0.5; break;  
case 'bottom': y = 1; break;  
default: y = origin[0] / original.height;  
};  
switch (origin[1]) {  
case 'left': x = 0; break;  
case 'center': x = 0.5; break;  
case 'right': x = 1; break;  
default: x = origin[1] / original.width;  
};  
return {x: x, y: y};  
},  
 
// Wraps the element around a wrapper that copies position properties  
createWrapper: function(element) {  
 
// if the element is already wrapped, return it  
if (element.parent().is('.ui-effects-wrapper')) {  
return element.parent();  
}  
 
// wrap the element  
var props = {  
width: element.outerWidth(true),  
height: element.outerHeight(true),  
'float': element.css('float')  
},  
wrapper = $('<div></div>')  
.addClass('ui-effects-wrapper')  
.css({  
fontSize: '100%',  
background: 'transparent',  
border: 'none',  
margin: 0,  
padding: 0  
});  
 
element.wrap(wrapper);  
wrapper = element.parent(); //Hotfix for jQuery 1.4 since some change in wrap() seems to actually loose the reference to the wrapped element  
 
// transfer positioning properties to the wrapper  
if (element.css('position') == 'static') {  
wrapper.css({ position: 'relative' });  
element.css({ position: 'relative' });  
} else {  
$.extend(props, {  
position: element.css('position'),  
zIndex: element.css('z-index')  
});  
$.each(['top', 'left', 'bottom', 'right'], function(i, pos) {  
props[pos] = element.css(pos);  
if (isNaN(parseInt(props[pos], 10))) {  
props[pos] = 'auto';  
}  
});  
element.css({position: 'relative', top: 0, left: 0, right: 'auto', bottom: 'auto' });  
}  
 
return wrapper.css(props).show();  
},  
 
removeWrapper: function(element) {  
if (element.parent().is('.ui-effects-wrapper'))  
return element.parent().replaceWith(element);  
return element;  
},  
 
setTransition: function(element, list, factor, value) {  
value = value || {};  
$.each(list, function(i, x){  
unit = element.cssUnit(x);  
if (unit[0] > 0) value[x] = unit[0] * factor + unit[1];  
});  
return value;  
}  
});  
 
 
function _normalizeArguments(effect, options, speed, callback) {  
// shift params for method overloading  
if (typeof effect == 'object') {  
callback = options;  
speed = null;  
options = effect;  
effect = options.effect;  
}  
if ($.isFunction(options)) {  
callback = options;  
speed = null;  
options = {};  
}  
if (typeof options == 'number' || $.fx.speeds[options]) {  
callback = speed;  
speed = options;  
options = {};  
}  
if ($.isFunction(speed)) {  
callback = speed;  
speed = null;  
}  
 
options = options || {};  
 
speed = speed || options.duration;  
speed = $.fx.off ? 0 : typeof speed == 'number'  
? speed : speed in $.fx.speeds ? $.fx.speeds[speed] : $.fx.speeds._default;  
 
callback = callback || options.complete;  
 
return [effect, options, speed, callback];  
}  
 
function standardSpeed( speed ) {  
// valid standard speeds  
if ( !speed || typeof speed === "number" || $.fx.speeds[ speed ] ) {  
return true;  
}  
 
// invalid strings - treat as "normal" speed  
if ( typeof speed === "string" && !$.effects[ speed ] ) {  
return true;  
}  
 
return false;  
}  
 
$.fn.extend({  
effect: function(effect, options, speed, callback) {  
var args = _normalizeArguments.apply(this, arguments),  
// TODO: make effects take actual parameters instead of a hash  
args2 = {  
options: args[1],  
duration: args[2],  
callback: args[3]  
},  
mode = args2.options.mode,  
effectMethod = $.effects[effect];  
 
if ( $.fx.off || !effectMethod ) {  
// delegate to the original method (e.g., .show()) if possible  
if ( mode ) {  
return this[ mode ]( args2.duration, args2.callback );  
} else {  
return this.each(function() {  
if ( args2.callback ) {  
args2.callback.call( this );  
}  
});  
}  
}  
 
return effectMethod.call(this, args2);  
},  
 
_show: $.fn.show,  
show: function(speed) {  
if ( standardSpeed( speed ) ) {  
return this._show.apply(this, arguments);  
} else {  
var args = _normalizeArguments.apply(this, arguments);  
args[1].mode = 'show';  
return this.effect.apply(this, args);  
}  
},  
 
_hide: $.fn.hide,  
hide: function(speed) {  
if ( standardSpeed( speed ) ) {  
return this._hide.apply(this, arguments);  
} else {  
var args = _normalizeArguments.apply(this, arguments);  
args[1].mode = 'hide';  
return this.effect.apply(this, args);  
}  
},  
 
// jQuery core overloads toggle and creates _toggle  
__toggle: $.fn.toggle,  
toggle: function(speed) {  
if ( standardSpeed( speed ) || typeof speed === "boolean" || $.isFunction( speed ) ) {  
return this.__toggle.apply(this, arguments);  
} else {  
var args = _normalizeArguments.apply(this, arguments);  
args[1].mode = 'toggle';  
return this.effect.apply(this, args);  
}  
},  
 
// helper functions  
cssUnit: function(key) {  
var style = this.css(key), val = [];  
$.each( ['em','px','%','pt'], function(i, unit){  
if(style.indexOf(unit) > 0)  
val = [parseFloat(style), unit];  
});  
return val;  
}  
});  
 
 
 
/******************************************************************************/  
/*********************************** EASING ***********************************/  
/******************************************************************************/  
 
/*  
* jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/  
*  
* Uses the built in easing capabilities added In jQuery 1.1  
* to offer multiple easing options  
*  
* TERMS OF USE - jQuery Easing  
*  
* Open source under the BSD License.  
*  
* Copyright 2008 George McGinley Smith  
* All rights reserved.  
*  
* Redistribution and use in source and binary forms, with or without modification,  
* are permitted provided that the following conditions are met:  
*  
* Redistributions of source code must retain the above copyright notice, this list of  
* conditions and the following disclaimer.  
* Redistributions in binary form must reproduce the above copyright notice, this list  
* of conditions and the following disclaimer in the documentation and/or other materials  
* provided with the distribution.  
*  
* Neither the name of the author nor the names of contributors may be used to endorse  
* or promote products derived from this software without specific prior written permission.  
*  
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY  
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF  
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE  
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,  
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE  
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED  
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING  
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED  
* OF THE POSSIBILITY OF SUCH DAMAGE.  
*  
*/  
 
// t: current time, b: begInnIng value, c: change In value, d: duration  
$.easing.jswing = $.easing.swing;  
 
$.extend($.easing,  
{  
def: 'easeOutQuad',  
swing: function (x, t, b, c, d) {  
//alert($.easing.default);  
return $.easing[$.easing.def](x, t, b, c, d);  
},  
easeInQuad: function (x, t, b, c, d) {  
return c*(t/=d)*t + b;  
},  
easeOutQuad: function (x, t, b, c, d) {  
return -c *(t/=d)*(t-2) + b;  
},  
easeInOutQuad: function (x, t, b, c, d) {  
if ((t/=d/2) < 1) return c/2*t*t + b;  
return -c/2 * ((--t)*(t-2) - 1) + b;  
},  
easeInCubic: function (x, t, b, c, d) {  
return c*(t/=d)*t*t + b;  
},  
easeOutCubic: function (x, t, b, c, d) {  
return c*((t=t/d-1)*t*t + 1) + b;  
},  
easeInOutCubic: function (x, t, b, c, d) {  
if ((t/=d/2) < 1) return c/2*t*t*t + b;  
return c/2*((t-=2)*t*t + 2) + b;  
},  
easeInQuart: function (x, t, b, c, d) {  
return c*(t/=d)*t*t*t + b;  
},  
easeOutQuart: function (x, t, b, c, d) {  
return -c * ((t=t/d-1)*t*t*t - 1) + b;  
},  
easeInOutQuart: function (x, t, b, c, d) {  
if ((t/=d/2) < 1) return c/2*t*t*t*t + b;  
return -c/2 * ((t-=2)*t*t*t - 2) + b;  
},  
easeInQuint: function (x, t, b, c, d) {  
return c*(t/=d)*t*t*t*t + b;  
},  
easeOutQuint: function (x, t, b, c, d) {  
return c*((t=t/d-1)*t*t*t*t + 1) + b;  
},  
easeInOutQuint: function (x, t, b, c, d) {  
if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;  
return c/2*((t-=2)*t*t*t*t + 2) + b;  
},  
easeInSine: function (x, t, b, c, d) {  
return -c * Math.cos(t/d * (Math.PI/2)) + c + b;  
},  
easeOutSine: function (x, t, b, c, d) {  
return c * Math.sin(t/d * (Math.PI/2)) + b;  
},  
easeInOutSine: function (x, t, b, c, d) {  
return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;  
},  
easeInExpo: function (x, t, b, c, d) {  
return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;  
},  
easeOutExpo: function (x, t, b, c, d) {  
return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;  
},  
easeInOutExpo: function (x, t, b, c, d) {  
if (t==0) return b;  
if (t==d) return b+c;  
if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;  
return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;  
},  
easeInCirc: function (x, t, b, c, d) {  
return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;  
},  
easeOutCirc: function (x, t, b, c, d) {  
return c * Math.sqrt(1 - (t=t/d-1)*t) + b;  
},  
easeInOutCirc: function (x, t, b, c, d) {  
if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;  
return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;  
},  
easeInElastic: function (x, t, b, c, d) {  
var s=1.70158;var p=0;var a=c;  
if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;  
if (a < Math.abs(c)) { a=c; var s=p/4; }  
else var s = p/(2*Math.PI) * Math.asin (c/a);  
return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;  
},  
easeOutElastic: function (x, t, b, c, d) {  
var s=1.70158;var p=0;var a=c;  
if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;  
if (a < Math.abs(c)) { a=c; var s=p/4; }  
else var s = p/(2*Math.PI) * Math.asin (c/a);  
return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;  
},  
easeInOutElastic: function (x, t, b, c, d) {  
var s=1.70158;var p=0;var a=c;  
if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5);  
if (a < Math.abs(c)) { a=c; var s=p/4; }  
else var s = p/(2*Math.PI) * Math.asin (c/a);  
if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;  
return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;  
},  
easeInBack: function (x, t, b, c, d, s) {  
if (s == undefined) s = 1.70158;  
return c*(t/=d)*t*((s+1)*t - s) + b;  
},  
easeOutBack: function (x, t, b, c, d, s) {  
if (s == undefined) s = 1.70158;  
return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;  
},  
easeInOutBack: function (x, t, b, c, d, s) {  
if (s == undefined) s = 1.70158;  
if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;  
return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;  
},  
easeInBounce: function (x, t, b, c, d) {  
return c - $.easing.easeOutBounce (x, d-t, 0, c, d) + b;  
},  
easeOutBounce: function (x, t, b, c, d) {  
if ((t/=d) < (1/2.75)) {  
return c*(7.5625*t*t) + b;  
} else if (t < (2/2.75)) {  
return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;  
} else if (t < (2.5/2.75)) {  
return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;  
} else {  
return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;  
}  
},  
easeInOutBounce: function (x, t, b, c, d) {  
if (t < d/2) return $.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;  
return $.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;  
}  
});  
 
/*  
*  
* TERMS OF USE - EASING EQUATIONS  
*  
* Open source under the BSD License.  
*  
* Copyright 2001 Robert Penner  
* All rights reserved.  
*  
* Redistribution and use in source and binary forms, with or without modification,  
* are permitted provided that the following conditions are met:  
*  
* Redistributions of source code must retain the above copyright notice, this list of  
* conditions and the following disclaimer.  
* Redistributions in binary form must reproduce the above copyright notice, this list  
* of conditions and the following disclaimer in the documentation and/or other materials  
* provided with the distribution.  
*  
* Neither the name of the author nor the names of contributors may be used to endorse  
* or promote products derived from this software without specific prior written permission.  
*  
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY  
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF  
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE  
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,  
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE  
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED  
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING  
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED  
* OF THE POSSIBILITY OF SUCH DAMAGE.  
*  
*/  
 
})(jQuery);  
 
/*  
* jQuery UI Autocomplete @VERSION  
*  
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)  
* Dual licensed under the MIT or GPL Version 2 licenses.  
* http://jquery.org/license  
*  
* http://docs.jquery.com/UI/Autocomplete  
*  
* Depends:  
* jquery.ui.core.js  
* jquery.ui.widget.js  
* jquery.ui.position.js  
* jquery.ui.menu.js  
*/  
(function( $, undefined ) {  
 
// used to prevent race conditions with remote data sources  
var requestIndex = 0;  
 
$.widget( "ui.autocomplete", {  
defaultElement: "<input>",  
options: {  
appendTo: "body",  
delay: 300,  
minLength: 1,  
position: {  
my: "left top",  
at: "left bottom",  
collision: "none"  
},  
source: null  
},  
 
pending: 0,  
 
_create: function() {  
var self = this,  
doc = this.element[ 0 ].ownerDocument,  
suppressKeyPress;  
 
this.element  
.addClass( "ui-autocomplete-input" )  
.attr( "autocomplete", "off" )  
// TODO verify these actually work as intended  
.attr({  
role: "textbox",  
"aria-autocomplete": "list",  
"aria-haspopup": "true"  
})  
.bind( "keydown.autocomplete", function( event ) {  
if ( self.options.disabled || self.element.attr( "readonly" ) ) {  
return;  
}  
 
suppressKeyPress = false;  
var keyCode = $.ui.keyCode;  
switch( event.keyCode ) {  
case keyCode.PAGE_UP:  
self._move( "previousPage", event );  
break;  
case keyCode.PAGE_DOWN:  
self._move( "nextPage", event );  
break;  
case keyCode.UP:  
self._move( "previous", event );  
// prevent moving cursor to beginning of text field in some browsers  
event.preventDefault();  
break;  
case keyCode.DOWN:  
self._move( "next", event );  
// prevent moving cursor to end of text field in some browsers  
event.preventDefault();  
break;  
case keyCode.ENTER:  
case keyCode.NUMPAD_ENTER:  
// when menu is open and has focus  
if ( self.menu.active ) {  
// #6055 - Opera still allows the keypress to occur  
// which causes forms to submit  
suppressKeyPress = true;  
event.preventDefault();  
}  
//passthrough - ENTER and TAB both select the current element  
case keyCode.TAB:  
if ( !self.menu.active ) {  
return;  
}  
self.menu.select( event );  
break;  
case keyCode.ESCAPE:  
self.element.val( self.term );  
self.close( event );  
break;  
default:  
// keypress is triggered before the input value is changed  
clearTimeout( self.searching );  
self.searching = setTimeout(function() {  
// only search if the value has changed  
if ( self.term != self.element.val() ) {  
self.selectedItem = null;  
self.search( null, event );  
}  
}, self.options.delay );  
break;  
}  
})  
.bind( "keypress.autocomplete", function( event ) {  
if ( suppressKeyPress ) {  
suppressKeyPress = false;  
event.preventDefault();  
}  
})  
.bind( "focus.autocomplete", function() {  
if ( self.options.disabled ) {  
return;  
}  
 
self.selectedItem = null;  
self.previous = self.element.val();  
})  
.bind( "blur.autocomplete", function( event ) {  
if ( self.options.disabled ) {  
return;  
}  
 
clearTimeout( self.searching );  
// clicks on the menu (or a button to trigger a search) will cause a blur event  
self.closing = setTimeout(function() {  
self.close( event );  
self._change( event );  
}, 150 );  
});  
this._initSource();  
this.response = function() {  
return self._response.apply( self, arguments );  
};  
this.menu = $( "<ul></ul>" )  
.addClass( "ui-autocomplete" )  
.appendTo( $( this.options.appendTo || "body", doc )[0] )  
// prevent the close-on-blur in case of a "slow" click on the menu (long mousedown)  
.mousedown(function( event ) {  
// clicking on the scrollbar causes focus to shift to the body  
// but we can't detect a mouseup or a click immediately afterward  
// so we have to track the next mousedown and close the menu if  
// the user clicks somewhere outside of the autocomplete  
var menuElement = self.menu.element[ 0 ];  
if ( !$( event.target ).closest( ".ui-menu-item" ).length ) {  
setTimeout(function() {  
$( document ).one( 'mousedown', function( event ) {  
if ( event.target !== self.element[ 0 ] &&  
event.target !== menuElement &&  
!$.contains( menuElement, event.target ) ) {  
self.close();  
}  
});  
}, 1 );  
}  
 
// use another timeout to make sure the blur-event-handler on the input was already triggered  
setTimeout(function() {  
clearTimeout( self.closing );  
}, 13);  
})  
.menu({  
// custom key handling for now  
input: $(),  
focus: function( event, ui ) {  
var item = ui.item.data( "item.autocomplete" );  
if ( false !== self._trigger( "focus", event, { item: item } ) ) {  
// use value to match what will end up in the input, if it was a key event  
if ( /^key/.test(event.originalEvent.type) ) {  
self.element.val( item.value );  
}  
}  
},  
select: function( event, ui ) {  
var item = ui.item.data( "item.autocomplete" ),  
previous = self.previous;  
 
// only trigger when focus was lost (click on menu)  
if ( self.element[0] !== doc.activeElement ) {  
self.element.focus();  
self.previous = previous;  
// #6109 - IE triggers two focus events and the second  
// is asynchronous, so we need to reset the previous  
// term synchronously and asynchronously :-(  
setTimeout(function() {  
self.previous = previous;  
self.selectedItem = item;  
}, 1);  
}  
 
if ( false !== self._trigger( "select", event, { item: item } ) ) {  
self.element.val( item.value );  
}  
// reset the term after the select event  
// this allows custom select handling to work properly  
self.term = self.element.val();  
 
self.close( event );  
self.selectedItem = item;  
},  
blur: function( event, ui ) {  
// don't set the value of the text field if it's already correct  
// this prevents moving the cursor unnecessarily  
if ( self.menu.element.is(":visible") &&  
( self.element.val() !== self.term ) ) {  
self.element.val( self.term );  
}  
}  
})  
.zIndex( this.element.zIndex() + 1 )  
.hide()  
.data( "menu" );  
if ( $.fn.bgiframe ) {  
this.menu.element.bgiframe();  
}  
},  
 
_destroy: function() {  
this.element  
.removeClass( "ui-autocomplete-input" )  
.removeAttr( "autocomplete" )  
.removeAttr( "role" )  
.removeAttr( "aria-autocomplete" )  
.removeAttr( "aria-haspopup" );  
this.menu.element.remove();  
},  
 
_setOption: function( key, value ) {  
this._super( "_setOption", key, value );  
if ( key === "source" ) {  
this._initSource();  
}  
if ( key === "appendTo" ) {  
this.menu.element.appendTo( $( value || "body", this.element[0].ownerDocument )[0] )  
}  
if ( key === "disabled" && value && this.xhr ) {  
this.xhr.abort();  
}  
},  
 
_initSource: function() {  
var self = this,  
array,  
url;  
if ( $.isArray(this.options.source) ) {  
array = this.options.source;  
this.source = function( request, response ) {  
response( $.ui.autocomplete.filter(array, request.term) );  
};  
} else if ( typeof this.options.source === "string" ) {  
url = this.options.source;  
this.source = function( request, response ) {  
if ( self.xhr ) {  
self.xhr.abort();  
}  
self.xhr = $.ajax({  
url: url,  
data: request,  
dataType: "json",  
autocompleteRequest: ++requestIndex,  
success: function( data, status ) {  
if ( this.autocompleteRequest === requestIndex ) {  
response( data );  
}  
},  
error: function() {  
if ( this.autocompleteRequest === requestIndex ) {  
response( [] );  
}  
}  
});  
};  
} else {  
this.source = this.options.source;  
}  
},  
 
search: function( value, event ) {  
value = value != null ? value : this.element.val();  
 
// always save the actual value, not the one passed as an argument  
this.term = this.element.val();  
 
if ( value.length < this.options.minLength ) {  
return this.close( event );  
}  
 
clearTimeout( this.closing );  
if ( this._trigger( "search", event ) === false ) {  
return;  
}  
 
return this._search( value );  
},  
 
_search: function( value ) {  
this.pending++;  
this.element.addClass( "ui-autocomplete-loading" );  
 
this.source( { term: value }, this.response );  
},  
 
_response: function( content ) {  
if ( !this.options.disabled && content && content.length ) {  
content = this._normalize( content );  
this._suggest( content );  
this._trigger( "open" );  
} else {  
this.close();  
}  
this.pending--;  
if ( !this.pending ) {  
this.element.removeClass( "ui-autocomplete-loading" );  
}  
},  
 
close: function( event ) {  
clearTimeout( this.closing );  
if ( this.menu.element.is(":visible") ) {  
this.menu.element.hide();  
this.menu.deactivate();  
this._trigger( "close", event );  
}  
},  
 
_change: function( event ) {  
if ( this.previous !== this.element.val() ) {  
this._trigger( "change", event, { item: this.selectedItem } );  
}  
},  
 
_normalize: function( items ) {  
// assume all items have the right format when the first item is complete  
if ( items.length && items[0].label && items[0].value ) {  
return items;  
}  
return $.map( items, function(item) {  
if ( typeof item === "string" ) {  
return {  
label: item,  
value: item  
};  
}  
return $.extend({  
label: item.label || item.value,  
value: item.value || item.label  
}, item );  
});  
},  
 
_suggest: function( items ) {  
var ul = this.menu.element  
.empty()  
.zIndex( this.element.zIndex() + 1 );  
this._renderMenu( ul, items );  
// TODO refresh should check if the active item is still in the dom, removing the need for a manual deactivate  
this.menu.deactivate();  
this.menu.refresh();  
 
// size and position menu  
ul.show();  
this._resizeMenu();  
ul.position( $.extend({  
of: this.element  
}, this.options.position ));  
},  
 
_resizeMenu: function() {  
var ul = this.menu.element;  
ul.outerWidth( Math.max(  
ul.width( "" ).outerWidth(),  
this.element.outerWidth()  
) );  
},  
 
_renderMenu: function( ul, items ) {  
var self = this;  
$.each( items, function( index, item ) {  
self._renderItem( ul, item );  
});  
},  
 
_renderItem: function( ul, item) {  
return $( "<li></li>" )  
.data( "item.autocomplete", item )  
.append( $( "<a></a>" ).text( item.label ) )  
.appendTo( ul );  
},  
 
_move: function( direction, event ) {  
if ( !this.menu.element.is(":visible") ) {  
this.search( null, event );  
return;  
}  
if ( this.menu.first() && /^previous/.test(direction) ||  
this.menu.last() && /^next/.test(direction) ) {  
this.element.val( this.term );  
this.menu.deactivate();  
return;  
}  
this.menu[ direction ]( event );  
},  
 
widget: function() {  
return this.menu.element;  
}  
});  
 
$.extend( $.ui.autocomplete, {  
version: "@VERSION",  
escapeRegex: function( value ) {  
return value.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");  
},  
filter: function(array, term) {  
var matcher = new RegExp( $.ui.autocomplete.escapeRegex(term), "i" );  
return $.grep( array, function(value) {  
return matcher.test( value.label || value.value || value );  
});  
}  
});  
 
}( jQuery ));  
 
/*  
* jQuery Mobile Framework : temporary extension to port jQuery UI's datepicker for mobile  
* Copyright (c) jQuery Project  
* Dual licensed under the MIT or GPL Version 2 licenses.  
* http://jquery.org/license  
*/  
(function($, undefined ) {  
 
//cache previous datepicker ui method  
var prevDp = $.fn.datepicker;  
 
//rewrite datepicker  
$.fn.datepicker = function( options ){  
 
var dp = this;  
 
//call cached datepicker plugin  
prevDp.call( this, options );  
 
//extend with some dom manipulation to update the markup for jQM  
//call immediately  
function updateDatepicker(){  
$( ".ui-datepicker-header", dp ).addClass("ui-body-c ui-corner-top").removeClass("ui-corner-all");  
$( ".ui-datepicker-prev, .ui-datepicker-next", dp ).attr("href", "#");  
$( ".ui-datepicker-prev", dp ).buttonMarkup({iconpos: "notext", icon: "arrow-l", shadow: true, corners: true});  
$( ".ui-datepicker-next", dp ).buttonMarkup({iconpos: "notext", icon: "arrow-r", shadow: true, corners: true});  
$( ".ui-datepicker-calendar th", dp ).addClass("ui-bar-c");  
$( ".ui-datepicker-calendar td", dp ).addClass("ui-body-c");  
$( ".ui-datepicker-calendar a", dp ).buttonMarkup({corners: false, shadow: false});  
$( ".ui-datepicker-calendar a.ui-state-active", dp ).addClass("ui-btn-active"); // selected date  
$( ".ui-datepicker-calendar a.ui-state-highlight", dp ).addClass("ui-btn-up-e"); // today"s date  
$( ".ui-datepicker-calendar .ui-btn", dp ).each(function(){  
var el = $(this);  
// remove extra button markup - necessary for date value to be interpreted correctly  
el.html( el.find( ".ui-btn-text" ).text() );  
});  
};  
 
//update now  
updateDatepicker();  
 
// and on click  
$( dp ).click( updateDatepicker );  
 
//return jqm obj  
return this;  
};  
 
//bind to pagecreate to automatically enhance date inputs  
$( ".ui-page" ).live( "pagecreate", function(){  
$( "input[type='date'], input[data-type='date']" ).each(function(){  
if ($(this).hasClass("hasDatepicker") == false) {  
$(this).after( $( "<div />" ).datepicker({ altField: "#" + $(this).attr( "id" ), showOtherMonths: true }) );  
$(this).addClass("hasDatepicker");  
}  
});  
});  
})( jQuery );  
/*  
* jQuery UI Position @VERSION  
*  
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)  
* Dual licensed under the MIT or GPL Version 2 licenses.  
* http://jquery.org/license  
*  
* http://docs.jquery.com/UI/Position  
*/  
(function( $, undefined ) {  
 
$.ui = $.ui || {};  
 
var horizontalPositions = /left|center|right/,  
verticalPositions = /top|center|bottom/,  
center = "center",  
_position = $.fn.position,  
_offset = $.fn.offset;  
 
$.fn.position = function( options ) {  
if ( !options || !options.of ) {  
return _position.apply( this, arguments );  
}  
 
// make a copy, we don't want to modify arguments  
options = $.extend( {}, options );  
 
var target = $( options.of ),  
targetElem = target[0],  
collision = ( options.collision || "flip" ).split( " " ),  
offset = options.offset ? options.offset.split( " " ) : [ 0, 0 ],  
targetWidth,  
targetHeight,  
basePosition;  
 
if ( targetElem.nodeType === 9 ) {  
targetWidth = target.width();  
targetHeight = target.height();  
basePosition = { top: 0, left: 0 };  
} else if ( $.isWindow( targetElem ) ) {  
targetWidth = target.width();  
targetHeight = target.height();  
basePosition = { top: target.scrollTop(), left: target.scrollLeft() };  
} else if ( targetElem.preventDefault ) {  
// force left top to allow flipping  
options.at = "left top";  
targetWidth = targetHeight = 0;  
basePosition = { top: options.of.pageY, left: options.of.pageX };  
} else {  
targetWidth = target.outerWidth();  
targetHeight = target.outerHeight();  
basePosition = target.offset();  
}  
 
// force my and at to have valid horizontal and veritcal positions  
// if a value is missing or invalid, it will be converted to center  
$.each( [ "my", "at" ], function() {  
var pos = ( options[this] || "" ).split( " " );  
if ( pos.length === 1) {  
pos = horizontalPositions.test( pos[0] ) ?  
pos.concat( [center] ) :  
verticalPositions.test( pos[0] ) ?  
[ center ].concat( pos ) :  
[ center, center ];  
}  
pos[ 0 ] = horizontalPositions.test( pos[0] ) ? pos[ 0 ] : center;  
pos[ 1 ] = verticalPositions.test( pos[1] ) ? pos[ 1 ] : center;  
options[ this ] = pos;  
});  
 
// normalize collision option  
if ( collision.length === 1 ) {  
collision[ 1 ] = collision[ 0 ];  
}  
 
// normalize offset option  
offset[ 0 ] = parseInt( offset[0], 10 ) || 0;  
if ( offset.length === 1 ) {  
offset[ 1 ] = offset[ 0 ];  
}  
offset[ 1 ] = parseInt( offset[1], 10 ) || 0;  
 
if ( options.at[0] === "right" ) {  
basePosition.left += targetWidth;  
} else if ( options.at[0] === center ) {  
basePosition.left += targetWidth / 2;  
}  
 
if ( options.at[1] === "bottom" ) {  
basePosition.top += targetHeight;  
} else if ( options.at[1] === center ) {  
basePosition.top += targetHeight / 2;  
}  
 
basePosition.left += offset[ 0 ];  
basePosition.top += offset[ 1 ];  
 
return this.each(function() {  
var elem = $( this ),  
elemWidth = elem.outerWidth(),  
elemHeight = elem.outerHeight(),  
marginLeft = parseInt( $.curCSS( this, "marginLeft", true ) ) || 0,  
marginTop = parseInt( $.curCSS( this, "marginTop", true ) ) || 0,  
collisionWidth = elemWidth + marginLeft +  
( parseInt( $.curCSS( this, "marginRight", true ) ) || 0 ),  
collisionHeight = elemHeight + marginTop +  
( parseInt( $.curCSS( this, "marginBottom", true ) ) || 0 ),  
position = $.extend( {}, basePosition ),  
collisionPosition;  
 
if ( options.my[0] === "right" ) {  
position.left -= elemWidth;  
} else if ( options.my[0] === center ) {  
position.left -= elemWidth / 2;  
}  
 
if ( options.my[1] === "bottom" ) {  
position.top -= elemHeight;  
} else if ( options.my[1] === center ) {  
position.top -= elemHeight / 2;  
}  
 
// prevent fractions (see #5280)  
position.left = Math.round( position.left );  
position.top = Math.round( position.top );  
 
collisionPosition = {  
left: position.left - marginLeft,  
top: position.top - marginTop  
};  
 
$.each( [ "left", "top" ], function( i, dir ) {  
if ( $.ui.position[ collision[i] ] ) {  
$.ui.position[ collision[i] ][ dir ]( position, {  
targetWidth: targetWidth,  
targetHeight: targetHeight,  
elemWidth: elemWidth,  
elemHeight: elemHeight,  
collisionPosition: collisionPosition,  
collisionWidth: collisionWidth,  
collisionHeight: collisionHeight,  
offset: offset,  
my: options.my,  
at: options.at  
});  
}  
});  
 
if ( $.fn.bgiframe ) {  
elem.bgiframe();  
}  
elem.offset( $.extend( position, { using: options.using } ) );  
});  
};  
 
$.ui.position = {  
fit: {  
left: function( position, data ) {  
var win = $( window ),  
over = data.collisionPosition.left + data.collisionWidth - win.width() - win.scrollLeft();  
position.left = over > 0 ? position.left - over : Math.max( position.left - data.collisionPosition.left, position.left );  
},  
top: function( position, data ) {  
var win = $( window ),  
over = data.collisionPosition.top + data.collisionHeight - win.height() - win.scrollTop();  
position.top = over > 0 ? position.top - over : Math.max( position.top - data.collisionPosition.top, position.top );  
}  
},  
 
flip: {  
left: function( position, data ) {  
if ( data.at[0] === center ) {  
return;  
}  
var win = $( window ),  
over = data.collisionPosition.left + data.collisionWidth - win.width() - win.scrollLeft(),  
myOffset = data.my[ 0 ] === "left" ?  
-data.elemWidth :  
data.my[ 0 ] === "right" ?  
data.elemWidth :  
0,  
atOffset = data.at[ 0 ] === "left" ?  
data.targetWidth :  
-data.targetWidth,  
offset = -2 * data.offset[ 0 ];  
position.left += data.collisionPosition.left < 0 ?  
myOffset + atOffset + offset :  
over > 0 ?  
myOffset + atOffset + offset :  
0;  
},  
top: function( position, data ) {  
if ( data.at[1] === center ) {  
return;  
}  
var win = $( window ),  
over = data.collisionPosition.top + data.collisionHeight - win.height() - win.scrollTop(),  
myOffset = data.my[ 1 ] === "top" ?  
-data.elemHeight :  
data.my[ 1 ] === "bottom" ?  
data.elemHeight :  
0,  
atOffset = data.at[ 1 ] === "top" ?  
data.targetHeight :  
-data.targetHeight,  
offset = -2 * data.offset[ 1 ];  
position.top += data.collisionPosition.top < 0 ?  
myOffset + atOffset + offset :  
over > 0 ?  
myOffset + atOffset + offset :  
0;  
}  
}  
};  
 
// offset setter from jQuery 1.4  
if ( !$.offset.setOffset ) {  
$.offset.setOffset = function( elem, options ) {  
// set position first, in-case top/left are set even on static elem  
if ( /static/.test( $.curCSS( elem, "position" ) ) ) {  
elem.style.position = "relative";  
}  
var curElem = $( elem ),  
curOffset = curElem.offset(),  
curTop = parseInt( $.curCSS( elem, "top", true ), 10 ) || 0,  
curLeft = parseInt( $.curCSS( elem, "left", true ), 10) || 0,  
props = {  
top: (options.top - curOffset.top) + curTop,  
left: (options.left - curOffset.left) + curLeft  
};  
 
if ( 'using' in options ) {  
options.using.call( elem, props );  
} else {  
curElem.css( props );  
}  
};  
 
$.fn.offset = function( options ) {  
var elem = this[ 0 ];  
if ( !elem || !elem.ownerDocument ) { return null; }  
if ( options ) {  
return this.each(function() {  
$.offset.setOffset( this, options );  
});  
}  
return _offset.call( this );  
};  
}  
 
}( jQuery ));  
 
/*!  
* jQuery UI Widget @VERSION  
*  
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)  
* Dual licensed under the MIT or GPL Version 2 licenses.  
* http://jquery.org/license  
*  
* http://docs.jquery.com/UI/Widget  
*/  
(function( $, undefined ) {  
 
var slice = Array.prototype.slice;  
 
var _cleanData = $.cleanData;  
$.cleanData = function( elems ) {  
for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {  
$( elem ).triggerHandler( "remove" );  
}  
_cleanData( elems );  
};  
 
$.widget = function( name, base, prototype ) {  
var namespace = name.split( "." )[ 0 ],  
fullName;  
name = name.split( "." )[ 1 ];  
fullName = namespace + "-" + name;  
 
if ( !prototype ) {  
prototype = base;  
base = $.Widget;  
}  
 
// create selector for plugin  
$.expr[ ":" ][ fullName ] = function( elem ) {  
return !!$.data( elem, name );  
};  
 
$[ namespace ] = $[ namespace ] || {};  
$[ namespace ][ name ] = $[ namespace ][ name ] || function( options, element ) {  
// allow instantiation without "new" keyword  
if ( !this._createWidget ) {  
return new $[ namespace ][ name ]( options, element );  
}  
 
// allow instantiation without initializing for simple inheritance  
// must use "new" keyword (the code above always passes args)  
if ( arguments.length ) {  
this._createWidget( options, element );  
}  
};  
 
var basePrototype = new base();  
// we need to make the options hash a property directly on the new instance  
// otherwise we'll modify the options hash on the prototype that we're  
// inheriting from  
basePrototype.options = $.extend( true, {}, basePrototype.options );  
$[ namespace ][ name ].prototype = $.extend( true, basePrototype, {  
namespace: namespace,  
widgetName: name,  
widgetEventPrefix: name,  
widgetBaseClass: fullName,  
base: base.prototype  
}, prototype );  
 
$.widget.bridge( name, $[ namespace ][ name ] );  
};  
 
$.widget.bridge = function( name, object ) {  
$.fn[ name ] = function( options ) {  
var isMethodCall = typeof options === "string",  
args = slice.call( arguments, 1 ),  
returnValue = this;  
 
// allow multiple hashes to be passed on init  
options = !isMethodCall && args.length ?  
$.extend.apply( null, [ true, options ].concat(args) ) :  
options;  
 
// prevent calls to internal methods  
if ( isMethodCall && options.charAt( 0 ) === "_" ) {  
return returnValue;  
}  
 
if ( isMethodCall ) {  
this.each(function() {  
var instance = $.data( this, name );  
if ( !instance ) {  
return $.error( "cannot call methods on " + name + " prior to initialization; " +  
"attempted to call method '" + options + "'" );  
}  
if ( !$.isFunction( instance[options] ) ) {  
return $.error( "no such method '" + options + "' for " + name + " widget instance" );  
}  
var methodValue = instance[ options ].apply( instance, args );  
if ( methodValue !== instance && methodValue !== undefined ) {  
returnValue = methodValue;  
return false;  
}  
});  
} else {  
this.each(function() {  
var instance = $.data( this, name );  
if ( instance ) {  
instance.option( options || {} )._init();  
} else {  
object( options, this );  
}  
});  
}  
 
return returnValue;  
};  
};  
 
$.Widget = function( options, element ) {  
// allow instantiation without "new" keyword  
if ( !this._createWidget ) {  
return new $[ namespace ][ name ]( options, element );  
}  
 
// allow instantiation without initializing for simple inheritance  
// must use "new" keyword (the code above always passes args)  
if ( arguments.length ) {  
this._createWidget( options, element );  
}  
};  
 
$.Widget.prototype = {  
widgetName: "widget",  
widgetEventPrefix: "",  
defaultElement: "<div>",  
options: {  
disabled: false  
},  
_createWidget: function( options, element ) {  
element = $( element || this.defaultElement || this )[ 0 ];  
this.element = $( element );  
this.options = $.extend( true, {},  
this.options,  
this._getCreateOptions(),  
options );  
 
this.bindings = $();  
this.hoverable = $();  
this.focusable = $();  
 
if ( element !== this ) {  
$.data( element, this.widgetName, this );  
this._bind({ remove: "destroy" });  
}  
 
this._create();  
this._trigger( "create" );  
this._init();  
},  
_getCreateOptions: function() {  
return $.metadata && $.metadata.get( this.element[0] )[ this.widgetName ];  
},  
_create: $.noop,  
_init: $.noop,  
 
_super: function( method ) {  
return this.base[ method ].apply( this, slice.call( arguments, 1 ) );  
},  
_superApply: function( method, args ) {  
return this.base[ method ].apply( this, args );  
},  
 
destroy: function() {  
this._destroy();  
// we can probably remove the unbind calls in 2.0  
// all event bindings should go through this._bind()  
this.element  
.unbind( "." + this.widgetName )  
.removeData( this.widgetName );  
this.widget()  
.unbind( "." + this.widgetName )  
.removeAttr( "aria-disabled" )  
.removeClass(  
this.widgetBaseClass + "-disabled " +  
"ui-state-disabled" );  
 
// clean up events and states  
this.bindings.unbind( "." + this.widgetName );  
this.hoverable.removeClass( "ui-state-hover" );  
this.focusable.removeClass( "ui-state-focus" );  
},  
_destroy: $.noop,  
 
widget: function() {  
return this.element;  
},  
 
option: function( key, value ) {  
var options = key;  
 
if ( arguments.length === 0 ) {  
// don't return a reference to the internal hash  
return $.extend( {}, this.options );  
}  
 
if (typeof key === "string" ) {  
if ( value === undefined ) {  
return this.options[ key ];  
}  
options = {};  
options[ key ] = value;  
}  
 
this._setOptions( options );  
 
return this;  
},  
_setOptions: function( options ) {  
var self = this;  
$.each( options, function( key, value ) {  
self._setOption( key, value );  
});  
 
return this;  
},  
_setOption: function( key, value ) {  
this.options[ key ] = value;  
 
if ( key === "disabled" ) {  
this.widget()  
.toggleClass( this.widgetBaseClass + "-disabled ui-state-disabled", !!value )  
.attr( "aria-disabled", value );  
this.hoverable.removeClass( "ui-state-hover" );  
this.focusable.removeClass( "ui-state-focus" );  
}  
 
return this;  
},  
 
enable: function() {  
return this._setOption( "disabled", false );  
},  
disable: function() {  
return this._setOption( "disabled", true );  
},  
 
_bind: function( element, handlers ) {  
// no element argument, shuffle and use this.element  
if ( !handlers ) {  
handlers = element;  
element = this.element;  
} else {  
this.bindings = this.bindings.add( element );  
}  
var instance = this;  
$.each( handlers, function( event, handler ) {  
element.bind( event + "." + instance.widgetName, function() {  
// allow widgets to customize the disabled handling  
// - disabled as an array instead of boolean  
// - disabled class as method for disabling individual parts  
if ( instance.options.disabled === true ||  
$( this ).hasClass( "ui-state-disabled" ) ) {  
return;  
}  
return ( typeof handler === "string" ? instance[ handler ] : handler )  
.apply( instance, arguments );  
});  
});  
},  
 
_hoverable: function( element ) {  
this.hoverable = this.hoverable.add( element );  
this._bind( element, {  
mouseenter: function( event ) {  
$( event.currentTarget ).addClass( "ui-state-hover" );  
},  
mouseleave: function( event ) {  
$( event.currentTarget ).removeClass( "ui-state-hover" );  
}  
});  
},  
 
_focusable: function( element ) {  
this.focusable = this.focusable.add( element );  
this._bind( element, {  
focusin: function( event ) {  
$( event.currentTarget ).addClass( "ui-state-focus" );  
},  
focusout: function( event ) {  
$( event.currentTarget ).removeClass( "ui-state-focus" );  
}  
});  
},  
 
_trigger: function( type, event, data ) {  
var callback = this.options[ type ],  
args;  
 
event = $.Event( event );  
event.type = ( type === this.widgetEventPrefix ?  
type :  
this.widgetEventPrefix + type ).toLowerCase();  
data = data || {};  
 
// copy original event properties over to the new event  
// this would happen if we could call $.event.fix instead of $.Event  
// but we don't have a way to force an event to be fixed multiple times  
if ( event.originalEvent ) {  
for ( var i = $.event.props.length, prop; i; ) {  
prop = $.event.props[ --i ];  
event[ prop ] = event.originalEvent[ prop ];  
}  
}  
 
this.element.trigger( event, data );  
 
args = $.isArray( data ) ?  
[ event ].concat( data ) :  
[ event, data ];  
 
return !( $.isFunction( callback ) &&  
callback.apply( this.element[0], args ) === false ||  
event.isDefaultPrevented() );  
}  
};  
 
})( jQuery );  
 
file:a/busui/layar_api.php (deleted)
<?php  
include('common.inc.php');  
$output = Array();  
$output['hotspots'] = Array();  
$output['layer'] = "canberrabusstops";  
 
$max_page = 10;  
$max_results = 50;  
$page_start = 0+$_REQUEST['pageKey'];  
$page_end = $max_page+$_REQUEST['pageKey'];  
 
$url = $APIurl."/json/neareststops?lat={$_REQUEST['lat']}&lon={$_REQUEST['lon']}&limit=50";  
$contents = json_decode(getPage($url));  
debug(print_r($contents,true));  
$stopNum = 0;  
foreach ($contents as $row)  
{  
$stopNum++;  
if ($stopNum > $page_start && $stopNum <= $page_end) {  
$hotspot = Array();  
$hotspot['id'] = $row[0];  
$hotspot['title'] = $row[1];  
$hotspot['type'] = 0;  
$hotspot['lat'] = floor($row[2]*1000000);  
$hotspot['lon'] = floor($row[3]*1000000);  
$hotspot['distance'] = distance($row[2], $row[3], $_REQUEST['lat'], $_REQUEST['lon']);  
if (!isset($_REQUEST['radius']) || $hotspot['distance'] < $_REQUEST['radius']) {  
$hotspot['actions'] = Array(Array("label" => 'View more trips/information', 'uri' => 'http://bus.lambdacomplex.org/'.'stop.php?stopid='.$row[0]));  
$url = $APIurl."/json/stoptrips?stop=".$row[0]."&time=".midnight_seconds()."&service_period=".service_period();  
$trips = json_decode(getPage($url));  
debug(print_r($trips,true));  
foreach ($trips as $key => $row)  
{  
if ($key < 3) {  
$hotspot['line'.strval($key+2)]= $row[1][1] .' @ ' .midnight_seconds_to_time($row[0]);  
}  
}  
if (sizeof($trips) == 0) $hotspot['line2'] = 'No trips in the near future.';  
$output['hotspots'][] = $hotspot;  
}  
}  
}  
if (sizeof($hotspot) > 0) {  
$output['errorString'] = 'ok';  
$output['errorCode'] = 0;  
} else {  
$output['errorString'] = 'no results, try increasing range';  
$output['errorCode'] = 21;  
}  
if ($page_end >= $max_results || sizeof($hotspot) < $max_page) {  
$output["morePages"] = false;  
$output["nextPageKey"] = null;  
} else {  
$output["morePages"] = true;  
$output["nextPageKey"] = $page_end;  
}  
echo json_encode($output);  
?>  
file:a/busui/readme.txt (deleted)
# input location (via GPS or favourites or search) and destination (via searchable list, optional)  
# http://10.0.1.153:8765/json/boundboxstops?n=-35.27568499917103&e=149.1346514225006&s=-35.279495003493516  
&w=149.12622928619385&limit=50  
# http://10.0.1.153:8765/json/stoptrips?stop=43&time=64440 # recursively call to show all services nearby, sort by distance, need to filter by service period  
# Hey, can pick destination again from a list filtered to places these stops go if you're curious!  
# http://10.0.1.153:8765/json/tripstoptimes?trip=2139 # Can recursively call and parse based on intended destination to show ETA  
# http://10.0.1.153:8765/json/triprows?trip=2139 # For pretty maps  
 
have to do  
/usr/sbin/setsebool -P httpd_can_network_connect=1  
on fedora  
 
might need http://forum.jquery.com/topic/google-maps-inside-jquery-mobile  
 
some extras  
/json/routes = all routes  
/json/neareststops?lat/lng/number  
TODO  
Destinations  
Favourites  
OOP stops/routes  
Stop sorting/search-filter  
 
static maps  
https://code.google.com/apis/maps/documentation/staticmaps/  
http://www.multimap.com/openapidocs/1.2/web_service/staticmaps.htm  
http://dev.openstreetmap.de/staticmap/ (os @ http://sourceforge.net/projects/staticmaplite/)  
(php and open source @ http://trac.openstreetmap.org/browser/sites/other/StaticMap?rev=16348)  
http://pafciu17.dev.openstreetmap.org/  
 
file:a/busui/routeList.php (deleted)
<?php  
include('common.inc.php');  
include_header("Routes");  
echo'  
<div data-role="navbar">  
<ul>  
<li><a href="routeList.php">By Final Destination...</a></li>  
<li><a href="routeList.php?bynumber=yes">By Number... </a></li>  
<li><a href="routeList.php?bysuburb=yes">By Suburb... </a></li>  
<li><a href="routeList.php?nearby=yes">Nearby... </a></li>  
</ul>  
</div>  
';  
echo ' <ul data-role="listview" data-inset="true">';  
$url = $APIurl."/json/routes";  
$contents = json_decode(getPage($url));  
debug(print_r($contents,true));  
 
function printRoutes($routes){  
foreach($routes as $row) {  
echo '<li>'.$row[1].' <a href="trip.php?routeid='.$row[0].'">'.$row[2]." (".ucwords($row[3]).")</a></li>\n";  
}  
}  
 
if ($_REQUEST['bynumber']) {  
$routeSeries = Array();  
$seriesRange = Array();  
foreach ($contents as $key => $row) {  
foreach (explode(" ",$row[1]) as $routeNumber ) {  
$seriesNum = substr($routeNumber, 0, -1)."0";  
if ($seriesNum == "0") $seriesNum = $routeNumber;  
$finalDigit = substr($routeNumber, sizeof($routeNumber)-1, 1);  
if (isset($seriesRange[$seriesNum])) {  
if ($finalDigit < $seriesRange[$seriesNum]['max'])  
$seriesRange[$seriesNum]['max'] = $routeNumber;  
if ($finalDigit > $seriesRange[$seriesNum]['min'])  
$seriesRange[$seriesNum]['min'] = $routeNumber;  
} else {  
$seriesRange[$seriesNum]['max'] = $routeNumber;  
$seriesRange[$seriesNum]['min'] = $routeNumber;  
}  
$routeSeries[$seriesNum][$seriesNum."-".$row[1]."-".$row[0]] = $row;  
}  
}  
ksort($routeSeries);  
ksort($seriesRange);  
echo '<div class="noscriptnav"> Go to route numbers: ';  
foreach ($seriesRange as $series => $range)  
{  
if ($range['min'] == $range['max']) echo "<a href=\"#$series\">$series</a>&nbsp;";  
else echo "<a href=\"#$series\">{$range['min']}-{$range['max']}</a>&nbsp;";  
}  
echo "</div>  
<script>  
$('.noscriptnav').hide();  
</script>";  
foreach ($routeSeries as $series => $routes)  
{  
echo '<a name="'.$series.'"></a>';  
if ($series <= 9) echo '<li>'.$series."<ul>\n";  
else echo "<li>{$seriesRange[$series]['min']}-{$seriesRange[$series]['max']}<ul>\n";  
printRoutes($routes);  
echo "</ul></li>\n";  
}  
} else {  
foreach ($contents as $key => $row) {  
$routeDestinations[$row[2]][] = $row;  
}  
echo '<div class="noscriptnav"> Go to Destination: ';  
foreach(ksort($routeDestinations) as $destination => $routes)  
{  
echo "<a href=\"#$destination\">$destination</a>&nbsp;";  
}  
echo "</div>  
<script>  
$('.noscriptnav').hide();  
</script>";  
foreach ($routeDestinations as $destination => $routes)  
{  
echo '<a name="'.$destination.'"></a>';  
echo '<li>'.$destination."... <ul>\n";  
printRoutes($routes);  
echo "</ul></li>\n";  
}  
}  
echo "</ul>\n";  
 
 
include_footer();  
?>  
 
#!/usr/bin/python2.5  
 
# Copyright (C) 2007 Google Inc.  
#  
# Licensed under the Apache License, Version 2.0 (the "License");  
# you may not use this file except in compliance with the License.  
# You may obtain a copy of the License at  
#  
# http://www.apache.org/licenses/LICENSE-2.0  
#  
# Unless required by applicable law or agreed to in writing, software  
# distributed under the License is distributed on an "AS IS" BASIS,  
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  
# See the License for the specific language governing permissions and  
# limitations under the License.  
 
"""  
An example application that uses the transitfeed module.  
 
You must provide a Google Maps API key.  
"""  
 
 
import BaseHTTPServer, sys, urlparse  
import bisect  
from gtfsscheduleviewer.marey_graph import MareyGraph  
import gtfsscheduleviewer  
import mimetypes  
import os.path  
import re  
import signal  
import simplejson  
import socket  
import time  
import transitfeed  
from transitfeed import util  
import urllib  
 
 
# By default Windows kills Python with Ctrl+Break. Instead make Ctrl+Break  
# raise a KeyboardInterrupt.  
if hasattr(signal, 'SIGBREAK'):  
signal.signal(signal.SIGBREAK, signal.default_int_handler)  
 
 
mimetypes.add_type('text/plain', '.vbs')  
 
 
class ResultEncoder(simplejson.JSONEncoder):  
def default(self, obj):  
try:  
iterable = iter(obj)  
except TypeError:  
pass  
else:  
return list(iterable)  
return simplejson.JSONEncoder.default(self, obj)  
 
# Code taken from  
# http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/425210/index_txt  
# An alternate approach is shown at  
# http://mail.python.org/pipermail/python-list/2003-July/212751.html  
# but it requires multiple threads. A sqlite object can only be used from one  
# thread.  
class StoppableHTTPServer(BaseHTTPServer.HTTPServer):  
def server_bind(self):  
BaseHTTPServer.HTTPServer.server_bind(self)  
self.socket.settimeout(1)  
self._run = True  
 
def get_request(self):  
while self._run:  
try:  
sock, addr = self.socket.accept()  
sock.settimeout(None)  
return (sock, addr)  
except socket.timeout:  
pass  
 
def stop(self):  
self._run = False  
 
def serve(self):  
while self._run:  
self.handle_request()  
 
 
def StopToTuple(stop):  
"""Return tuple as expected by javascript function addStopMarkerFromList"""  
return (stop.stop_id, stop.stop_name, float(stop.stop_lat),  
float(stop.stop_lon), stop.location_type, stop.stop_code)  
def StopZoneToTuple(stop):  
"""Return tuple as expected by javascript function addStopMarkerFromList"""  
return (stop.stop_id, stop.stop_name, float(stop.stop_lat),  
float(stop.stop_lon), stop.location_type, stop.stop_code, stop.zone_id)  
 
class ScheduleRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):  
def do_GET(self):  
scheme, host, path, x, params, fragment = urlparse.urlparse(self.path)  
parsed_params = {}  
for k in params.split('&'):  
k = urllib.unquote(k)  
if '=' in k:  
k, v = k.split('=', 1)  
parsed_params[k] = unicode(v, 'utf8')  
else:  
parsed_params[k] = ''  
 
if path == '/':  
return self.handle_GET_home()  
 
m = re.match(r'/json/([a-z]{1,64})', path)  
if m:  
handler_name = 'handle_json_GET_%s' % m.group(1)  
handler = getattr(self, handler_name, None)  
if callable(handler):  
return self.handle_json_wrapper_GET(handler, parsed_params)  
 
# Restrict allowable file names to prevent relative path attacks etc  
m = re.match(r'/file/([a-z0-9_-]{1,64}\.?[a-z0-9_-]{1,64})$', path)  
if m and m.group(1):  
try:  
f, mime_type = self.OpenFile(m.group(1))  
return self.handle_static_file_GET(f, mime_type)  
except IOError, e:  
print "Error: unable to open %s" % m.group(1)  
# Ignore and treat as 404  
 
m = re.match(r'/([a-z]{1,64})', path)  
if m:  
handler_name = 'handle_GET_%s' % m.group(1)  
handler = getattr(self, handler_name, None)  
if callable(handler):  
return handler(parsed_params)  
 
return self.handle_GET_default(parsed_params, path)  
 
def OpenFile(self, filename):  
"""Try to open filename in the static files directory of this server.  
Return a tuple (file object, string mime_type) or raise an exception."""  
(mime_type, encoding) = mimetypes.guess_type(filename)  
assert mime_type  
# A crude guess of when we should use binary mode. Without it non-unix  
# platforms may corrupt binary files.  
if mime_type.startswith('text/'):  
mode = 'r'  
else:  
mode = 'rb'  
return open(os.path.join(self.server.file_dir, filename), mode), mime_type  
 
def handle_GET_default(self, parsed_params, path):  
self.send_error(404)  
 
def handle_static_file_GET(self, fh, mime_type):  
content = fh.read()  
self.send_response(200)  
self.send_header('Content-Type', mime_type)  
self.send_header('Content-Length', str(len(content)))  
self.end_headers()  
self.wfile.write(content)  
 
def AllowEditMode(self):  
return False  
 
def handle_GET_home(self):  
schedule = self.server.schedule  
(min_lat, min_lon, max_lat, max_lon) = schedule.GetStopBoundingBox()  
forbid_editing = ('true', 'false')[self.AllowEditMode()]  
 
agency = ', '.join(a.agency_name for a in schedule.GetAgencyList()).encode('utf-8')  
 
key = self.server.key  
host = self.server.host  
 
# A very simple template system. For a fixed set of values replace [xxx]  
# with the value of local variable xxx  
f, _ = self.OpenFile('index.html')  
content = f.read()  
for v in ('agency', 'min_lat', 'min_lon', 'max_lat', 'max_lon', 'key',  
'host', 'forbid_editing'):  
content = content.replace('[%s]' % v, str(locals()[v]))  
 
self.send_response(200)  
self.send_header('Content-Type', 'text/html')  
self.send_header('Content-Length', str(len(content)))  
self.end_headers()  
self.wfile.write(content)  
 
def handle_json_GET_routepatterns(self, params):  
"""Given a route_id generate a list of patterns of the route. For each  
pattern include some basic information and a few sample trips."""  
schedule = self.server.schedule  
route = schedule.GetRoute(params.get('route', None))  
if not route:  
self.send_error(404)  
return  
time = int(params.get('time', 0))  
sample_size = 10 # For each pattern return the start time for this many trips  
 
pattern_id_trip_dict = route.GetPatternIdTripDict()  
patterns = []  
 
for pattern_id, trips in pattern_id_trip_dict.items():  
time_stops = trips[0].GetTimeStops()  
if not time_stops:  
continue  
has_non_zero_trip_type = False;  
for trip in trips:  
if trip['trip_type'] and trip['trip_type'] != '0':  
has_non_zero_trip_type = True  
name = u'%s to %s, %d stops' % (time_stops[0][2].stop_name, time_stops[-1][2].stop_name, len(time_stops))  
transitfeed.SortListOfTripByTime(trips)  
 
num_trips = len(trips)  
if num_trips <= sample_size:  
start_sample_index = 0  
num_after_sample = 0  
else:  
# Will return sample_size trips that start after the 'time' param.  
 
# Linear search because I couldn't find a built-in way to do a binary  
# search with a custom key.  
start_sample_index = len(trips)  
for i, trip in enumerate(trips):  
if trip.GetStartTime() >= time:  
start_sample_index = i  
break  
 
num_after_sample = num_trips - (start_sample_index + sample_size)  
if num_after_sample < 0:  
# Less than sample_size trips start after 'time' so return all the  
# last sample_size trips.  
num_after_sample = 0  
start_sample_index = num_trips - sample_size  
 
sample = []  
for t in trips[start_sample_index:start_sample_index + sample_size]:  
sample.append( (t.GetStartTime(), t.trip_id) )  
 
patterns.append((name, pattern_id, start_sample_index, sample,  
num_after_sample, (0,1)[has_non_zero_trip_type]))  
 
patterns.sort()  
return patterns  
 
def handle_json_wrapper_GET(self, handler, parsed_params):  
"""Call handler and output the return value in JSON."""  
schedule = self.server.schedule  
result = handler(parsed_params)  
content = ResultEncoder().encode(result)  
self.send_response(200)  
self.send_header('Content-Type', 'text/plain')  
self.send_header('Content-Length', str(len(content)))  
self.end_headers()  
self.wfile.write(content)  
 
def handle_json_GET_routes(self, params):  
"""Return a list of all routes."""  
schedule = self.server.schedule  
result = []  
for r in schedule.GetRouteList():  
servicep = None  
for t in schedule.GetTripList():  
if t.route_id == r.route_id:  
servicep = t.service_period  
break  
result.append( (r.route_id, r.route_short_name, r.route_long_name, servicep.service_id) )  
result.sort(key = lambda x: x[1:3])  
return result  
 
def handle_json_GET_routerow(self, params):  
schedule = self.server.schedule  
route = schedule.GetRoute(params.get('route', None))  
return [transitfeed.Route._FIELD_NAMES, route.GetFieldValuesTuple()]  
 
def handle_json_GET_routetrips(self, params):  
""" Get a trip for a route_id (preferablly the next one) """  
schedule = self.server.schedule  
query = params.get('route_id', None).lower()  
result = []  
for t in schedule.GetTripList():  
if t.route_id == query:  
result.append ( (t.GetStartTime(), t.trip_id) )  
return sorted(result, key=lambda trip: trip[0])  
 
def handle_json_GET_triprows(self, params):  
"""Return a list of rows from the feed file that are related to this  
trip."""  
schedule = self.server.schedule  
try:  
trip = schedule.GetTrip(params.get('trip', None))  
except KeyError:  
# if a non-existent trip is searched for, the return nothing  
return  
route = schedule.GetRoute(trip.route_id)  
trip_row = dict(trip.iteritems())  
route_row = dict(route.iteritems())  
return [['trips.txt', trip_row], ['routes.txt', route_row]]  
 
def handle_json_GET_tripstoptimes(self, params):  
schedule = self.server.schedule  
try:  
trip = schedule.GetTrip(params.get('trip'))  
except KeyError:  
# if a non-existent trip is searched for, the return nothing  
return  
time_stops = trip.GetTimeInterpolatedStops()  
stops = []  
times = []  
for arr,ts,is_timingpoint in time_stops:  
stops.append(StopToTuple(ts.stop))  
times.append(arr)  
return [stops, times]  
 
def handle_json_GET_tripshape(self, params):  
schedule = self.server.schedule  
try:  
trip = schedule.GetTrip(params.get('trip'))  
except KeyError:  
# if a non-existent trip is searched for, the return nothing  
return  
points = []  
if trip.shape_id:  
shape = schedule.GetShape(trip.shape_id)  
for (lat, lon, dist) in shape.points:  
points.append((lat, lon))  
else:  
time_stops = trip.GetTimeStops()  
for arr,dep,stop in time_stops:  
points.append((stop.stop_lat, stop.stop_lon))  
return points  
 
def handle_json_GET_neareststops(self, params):  
"""Return a list of the nearest 'limit' stops to 'lat', 'lon'"""  
schedule = self.server.schedule  
lat = float(params.get('lat'))  
lon = float(params.get('lon'))  
limit = int(params.get('limit'))  
stops = schedule.GetNearestStops(lat=lat, lon=lon, n=limit)  
return [StopToTuple(s) for s in stops]  
 
def handle_json_GET_boundboxstops(self, params):  
"""Return a list of up to 'limit' stops within bounding box with 'n','e'  
and 's','w' in the NE and SW corners. Does not handle boxes crossing  
longitude line 180."""  
schedule = self.server.schedule  
n = float(params.get('n'))  
e = float(params.get('e'))  
s = float(params.get('s'))  
w = float(params.get('w'))  
limit = int(params.get('limit'))  
stops = schedule.GetStopsInBoundingBox(north=n, east=e, south=s, west=w, n=limit)  
return [StopToTuple(s) for s in stops]  
 
def handle_json_GET_stops(self, params):  
schedule = self.server.schedule  
return [StopToTuple(s) for s in schedule.GetStopList()]  
 
def handle_json_GET_timingpoints(self, params):  
schedule = self.server.schedule  
matches = []  
for s in schedule.GetStopList():  
if s.stop_code.find("Wj") == -1:  
matches.append(StopToTuple(s))  
return matches  
 
def handle_json_GET_stopsearch(self, params):  
schedule = self.server.schedule  
query = params.get('q', None).lower()  
matches = []  
for s in schedule.GetStopList():  
if s.stop_name.lower().find(query) != -1 or s.stop_code.lower().find(query) != -1:  
matches.append(StopToTuple(s))  
return matches  
 
def handle_json_GET_stopnamesearch(self, params):  
schedule = self.server.schedule  
query = params.get('q', None).lower()  
matches = []  
for s in schedule.GetStopList():  
if s.stop_name.lower().find(query) != -1:  
matches.append(StopToTuple(s))  
return matches  
 
def handle_json_GET_stopcodesearch(self, params):  
schedule = self.server.schedule  
query = params.get('q', None).lower()  
matches = []  
for s in schedule.GetStopList():  
if s.stop_code.lower().find(query) != -1:  
matches.append(StopToTuple(s))  
return matches  
 
def handle_json_GET_stopzonesearch(self, params):  
schedule = self.server.schedule  
query = params.get('q', None).lower()  
matches = []  
for s in schedule.GetStopList():  
if s.zone_id != None and s.zone_id.lower().find(query) != -1:  
matches.append(StopToTuple(s))  
return matches  
 
def handle_json_GET_stop(self, params):  
schedule = self.server.schedule  
query = params.get('stop_id', None).lower()  
for s in schedule.GetStopList():  
if s.stop_id.lower() == query:  
return StopToTuple(s)  
return []  
 
def handle_json_GET_stoptrips(self, params):  
"""Given a stop_id and time in seconds since midnight return the next  
trips to visit the stop."""  
schedule = self.server.schedule  
stop = schedule.GetStop(params.get('stop', None))  
time = int(params.get('time', 0))  
service_period = params.get('service_period', None)  
time_trips = stop.GetStopTimeTrips(schedule)  
time_trips.sort() # OPT: use bisect.insort to make this O(N*ln(N)) -> O(N)  
# Keep the first 15 after param 'time'.  
# Need make a tuple to find correct bisect point  
time_trips = time_trips[bisect.bisect_left(time_trips, (time, 0)):]  
time_trips = time_trips[:15]  
result = []  
for time, (trip, index), tp in time_trips:  
headsign = None  
# Find the most recent headsign from the StopTime objects  
for stoptime in trip.GetStopTimes()[index::-1]:  
if stoptime.stop_headsign:  
headsign = stoptime.stop_headsign  
break  
# If stop_headsign isn't found, look for a trip_headsign  
if not headsign:  
headsign = trip.trip_headsign  
route = schedule.GetRoute(trip.route_id)  
trip_name = ''  
if route.route_short_name:  
trip_name += route.route_short_name  
if route.route_long_name:  
if len(trip_name):  
trip_name += " - "  
trip_name += route.route_long_name  
# comment out directions because we already have them in the long name  
#if headsign:  
# trip_name += " (Direction: %s)" % headsign  
if service_period == None or trip.service_id == service_period:  
result.append((time, (trip.trip_id, trip_name, trip.service_id), tp))  
return result  
 
def handle_GET_ttablegraph(self,params):  
"""Draw a Marey graph in SVG for a pattern (collection of trips in a route  
that visit the same sequence of stops)."""  
schedule = self.server.schedule  
marey = MareyGraph()  
trip = schedule.GetTrip(params.get('trip', None))  
route = schedule.GetRoute(trip.route_id)  
height = int(params.get('height', 300))  
 
if not route:  
print 'no such route'  
self.send_error(404)  
return  
 
pattern_id_trip_dict = route.GetPatternIdTripDict()  
pattern_id = trip.pattern_id  
if pattern_id not in pattern_id_trip_dict:  
print 'no pattern %s found in %s' % (pattern_id, pattern_id_trip_dict.keys())  
self.send_error(404)  
return  
triplist = pattern_id_trip_dict[pattern_id]  
 
pattern_start_time = min((t.GetStartTime() for t in triplist))  
pattern_end_time = max((t.GetEndTime() for t in triplist))  
 
marey.SetSpan(pattern_start_time,pattern_end_time)  
marey.Draw(triplist[0].GetPattern(), triplist, height)  
 
content = marey.Draw()  
 
self.send_response(200)  
self.send_header('Content-Type', 'image/svg+xml')  
self.send_header('Content-Length', str(len(content)))  
self.end_headers()  
self.wfile.write(content)  
 
 
def FindPy2ExeBase():  
"""If this is running in py2exe return the install directory else return  
None"""  
# py2exe puts gtfsscheduleviewer in library.zip. For py2exe setup.py is  
# configured to put the data next to library.zip.  
windows_ending = gtfsscheduleviewer.__file__.find('\\library.zip\\')  
if windows_ending != -1:  
return transitfeed.__file__[:windows_ending]  
else:  
return None  
 
 
def FindDefaultFileDir():  
"""Return the path of the directory containing the static files. By default  
the directory is called 'files'. The location depends on where setup.py put  
it."""  
base = FindPy2ExeBase()  
if base:  
return os.path.join(base, 'schedule_viewer_files')  
else:  
# For all other distributions 'files' is in the gtfsscheduleviewer  
# directory.  
base = os.path.dirname(gtfsscheduleviewer.__file__) # Strip __init__.py  
return os.path.join(base, 'files')  
 
 
def GetDefaultKeyFilePath():  
"""In py2exe return absolute path of file in the base directory and in all  
other distributions return relative path 'key.txt'"""  
windows_base = FindPy2ExeBase()  
if windows_base:  
return os.path.join(windows_base, 'key.txt')  
else:  
return 'key.txt'  
 
 
def main(RequestHandlerClass = ScheduleRequestHandler):  
usage = \  
'''%prog [options] [<input GTFS.zip>]  
 
Runs a webserver that lets you explore a <input GTFS.zip> in your browser.  
 
If <input GTFS.zip> is omited the filename is read from the console. Dragging  
a file into the console may enter the filename.  
'''  
parser = util.OptionParserLongError(  
usage=usage, version='%prog '+transitfeed.__version__)  
parser.add_option('--feed_filename', '--feed', dest='feed_filename',  
help='file name of feed to load')  
parser.add_option('--key', dest='key',  
help='Google Maps API key or the name '  
'of a text file that contains an API key')  
parser.add_option('--host', dest='host', help='Host name of Google Maps')  
parser.add_option('--port', dest='port', type='int',  
help='port on which to listen')  
parser.add_option('--file_dir', dest='file_dir',  
help='directory containing static files')  
parser.add_option('-n', '--noprompt', action='store_false',  
dest='manual_entry',  
help='disable interactive prompts')  
parser.set_defaults(port=8765,  
host='maps.google.com',  
file_dir=FindDefaultFileDir(),  
manual_entry=True)  
(options, args) = parser.parse_args()  
 
if not os.path.isfile(os.path.join(options.file_dir, 'index.html')):  
print "Can't find index.html with --file_dir=%s" % options.file_dir  
exit(1)  
 
if not options.feed_filename and len(args) == 1:  
options.feed_filename = args[0]  
 
if not options.feed_filename and options.manual_entry:  
options.feed_filename = raw_input('Enter Feed Location: ').strip('"')  
 
default_key_file = GetDefaultKeyFilePath()  
if not options.key and os.path.isfile(default_key_file):  
options.key = open(default_key_file).read().strip()  
 
if options.key and os.path.isfile(options.key):  
options.key = open(options.key).read().strip()  
 
schedule = transitfeed.Schedule(problem_reporter=transitfeed.ProblemReporter())  
print 'Loading data from feed "%s"...' % options.feed_filename  
print '(this may take a few minutes for larger cities)'  
schedule.Load(options.feed_filename)  
 
server = StoppableHTTPServer(server_address=('', options.port),  
RequestHandlerClass=RequestHandlerClass)  
server.key = options.key  
server.schedule = schedule  
server.file_dir = options.file_dir  
server.host = options.host  
server.feed_path = options.feed_filename  
 
print ("To view, point your browser at http://localhost:%d/" %  
(server.server_port))  
server.serve_forever()  
 
 
if __name__ == '__main__':  
main()  
 
cache/tiles  
cache/map  
 
[InternetShortcut]  
URL=http://gplotter.offwhite.net/  
 
[InternetShortcut]  
URL=http://brennan.offwhite.net/blog/2005/07/23/new-google-maps-icons-free/  
 
 Binary files a/busui/staticmaplite/images/markers/Thumbs.db and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/iconb.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/iconb1.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/iconb10.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/iconb11.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/iconb12.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/iconb13.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/iconb14.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/iconb15.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/iconb16.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/iconb17.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/iconb18.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/iconb19.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/iconb2.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/iconb20.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/iconb21.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/iconb22.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/iconb23.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/iconb24.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/iconb25.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/iconb3.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/iconb4.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/iconb5.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/iconb6.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/iconb7.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/iconb8.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/iconb9.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/icong.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/icong1.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/icong10.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/icong11.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/icong12.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/icong13.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/icong14.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/icong15.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/icong16.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/icong17.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/icong18.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/icong19.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/icong2.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/icong20.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/icong21.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/icong22.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/icong23.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/icong24.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/icong25.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/icong3.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/icong4.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/icong5.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/icong6.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/icong7.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/icong8.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/icong9.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/iconr.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/iconr1.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/iconr10.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/iconr11.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/iconr12.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/iconr13.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/iconr14.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/iconr15.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/iconr16.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/iconr17.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/iconr18.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/iconr19.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/iconr2.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/iconr20.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/iconr21.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/iconr22.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/iconr23.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/iconr24.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/iconr25.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/iconr3.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/iconr4.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/iconr5.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/iconr6.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/iconr7.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/iconr8.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/iconr9.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/icons.psd and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/lightblue1.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/lightblue2.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/lightblue3.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/lightblue4.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/lightblue5.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/ol-marker-blue.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/ol-marker-gold.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/ol-marker-green.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/markers/ol-marker.png and /dev/null differ
 Binary files a/busui/staticmaplite/images/osm_logo.png and /dev/null differ
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"  
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de-de" lang="de-de">  
<head>  
<!--  
CSS based on template of Dandelion wiki engine by Radomir Dopieralski who released this  
template under the terms of GNU GPL. http://dandelion.sheep.art.pl/  
-->  
<meta http-equiv="content-type" content="text/html; charset=utf-8" />  
<title>staticMapLite</title>  
<style type="text/css">  
html{font:96% sans-serif;color:#000;background:#f7f7f7;line-height:1.4;}  
body{color:#333;}  
#wrapper{margin:auto;width:60em;position:relative;}  
#header{padding:0px 0px 7px 0px; height: 1em;}  
#header h1 { float:left; width: 40%; }  
#content{background:white;padding:1em;border:1px solid #e0d78a;outline:0.5em solid #fef4a4; margin:0.5em 0;padding:20px;min-height:20em;}  
h1{margin-top:0px;}  
h1,h2,h3,h4,h5,h6{letter-spacing:0.05em;color:#1474CA;font-weight:normal;}  
h1 a:hover,h2 a:hover,h3 a:hover,h4 a:hover,h5 a:hover,h6 a:hover{text-decoration:none;}  
a{color:#1474CA;text-decoration:none;}  
a:visited{color:#1474CA;}  
a.pending{color:#c174a0;}  
a:hover{text-decoration:underline;}  
a img{border:none;}  
input,textarea{font-size:94%;border:1px solid #999;background:#fff;color:#666;outline:0.2em solid #eee;padding:0px;line-height:1.2;margin:0.5em;vertical-align:middle;}  
textarea{display:block;margin:0.5em auto;width:100%;}  
pre{outline:0.4em solid #eee;padding:0.5em;margin:0.5em;border:1px solid #e0d78a;background:#fef4a4;color:#644e22;}  
img{border:1px solid #ccc;outline:0.25em solid #eee;padding:0.25em;margin:0.25em 0 0.25em 0.5em;background:#fff;}  
hr{height:0;border:none;color:#fff;background:transparent;border-bottom:1px solid #ccc; margin:0.5em 0;}  
#diff {outline:none;border:none;}  
#diff ins{color:green;text-decoration:none;font-weight:bold;}  
#diff del{color:red;text-decoration:line-through;}  
#diff{background:#fff;line-height:1.25;padding:1em;white-space:pre-wrap;word-wrap:break-word; white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap;width:97%;}  
hr{margin:10px 0 10px 0;height:0px;overflow:hidden;border:0px;border-top:2px solid #ccc;}  
.error{color:#F25A5A;font-weight:bold;}  
form{display:inline;}  
#contentTextarea{height:44em;}  
#toc{margin:5px 0 5px 10px;padding:6px 5px 7px 0px;float:right;list-style:none;outline:0.4em solid #eee;background:#fef4a4;border:1px solid #e0d78a;}  
#toc ul{list-style:none;padding:3px 0 3px 10px;}  
#toc li{font-size:11px;padding-left:10px;}  
#toc ul li{font-size:10px;}  
#toc ul ul li{font-size:9px;}  
#toc ul ul ul li{font-size:8px;}  
#toc ul ul ul ul li{font-size:7px;}  
.pageVersionsList{letter-spacing:0px;font-variant:normal;font-size:12px;}  
#renameForm{float:left;}  
.clear{clear:both;}  
.tagList{padding:0.2em 0.4em 0.2em 0.4em;margin-top:0.5em;border:1px dashed #e0d78a;background:#fef4a4;color:#644e22;}  
.tagCloud{float:right;width:200px;padding:0.5em;margin:1em;border:1px dashed #e0d78a;background:#fef4a4;color:#644e22;}  
#fileTable{border-collapse:collapse;}  
#fileTable td{border:1px solid #FEF4A4;padding:2px 6px 2px 6px;}  
h2 span.par-edit, h3 span.par-edit, h4 span.par-edit, h5 span.par-edit, h6 span.par-edit {display:none;}  
h2:hover span.par-edit, h3:hover span.par-edit, h4:hover span.par-edit, h5:hover span.par-edit, h6:hover span.par-edit {display:inline;font-size:x-small;}  
.comment-item { border:1px solid #999;color:#666;outline:0.2em solid #eee; }  
.resizeTextareaDiv { margin-top: 5px;}  
a.toolbarTextareaItem { padding-right: 10px; }  
a.external:after { content: "\2197";}  
</style>  
</head>  
 
<body>  
<div id="wrapper">  
<div id="header">  
</div>  
<div id="content">  
 
<div class="par-div">  
<h2>  
staticMapLite - simple map for your website  
</h2>  
<p>  
<img src="staticmap.php?center=40.714728,-73.998672&zoom=14&size=865x512&maptype=mapnik" width="865" height="512" /></p>  
<p>  
This image was created using the following simple &lt;img> tag:  
<pre>&lt;img src="staticmap.php?center=40.714728,-73.998672&amp;zoom=14&amp;size=865x512&amp;maptype=mapnik" /&gt;</pre>  
</p>  
</div>  
<hr />  
<div class="par-div">  
<h3>  
Place Markers  
</h3>  
 
<p>  
<img src="staticmap.php?center=40.714728,-73.998672&zoom=14&size=865x512&maptype=mapnik&markers=40.702147,-74.015794,lightblue1|40.711614,-74.012318,lightblue2|40.718217,-73.998284,lightblue3" width="865" height="512" />  
</p><p> Add markers by appending them to the image URL:  
<pre>markers=40.702147,-74.015794,lightblue1|40.711614,-74.012318,lightblue2|40.718217,-73.998284,lightblue3</pre>  
</p>  
</div>  
<hr />  
<div class="par-div">  
<h3>  
Use Different Map Styles (Tile Sources)  
</h3>  
 
<p>  
<div style="float:left; margin-right: 10px">  
<img src="staticmap.php?center=40.714728,-73.998672&zoom=14&size=256x256&maptype=mapnik" width="256" height="256" />  
<pre>maptype=mapnik</pre>  
</div>  
<div style="float:left; margin-right: 10px">  
<img src="staticmap.php?center=40.714728,-73.998672&zoom=14&size=256x256&maptype=osmarenderer" width="256" height="256" />  
<pre>maptype=osmarenderer</pre>  
</div>  
<div style="float:left; margin-right: 10px">  
<img src="staticmap.php?center=40.714728,-73.998672&zoom=14&size=256x256&maptype=cycle" width="256" height="256" />  
<pre>maptype=cycle</pre>  
</div>  
<br style="clear:both" />  
</p>  
</div>  
 
</div>  
<div id="footer">  
<div style="text-align:center;padding:7px;color:#ccc">  
sponsored by <a href="http://dfacts.de">dFacts Network</a>  
</div>  
</div>  
</div>  
</body>  
</html>  
chcon -R -t httpd_sys_content_rw_t cache  
 
 
<?php  
 
/**  
* staticMapLite 0.02  
*  
* Copyright 2009 Gerhard Koch  
*  
* Licensed under the Apache License, Version 2.0 (the "License");  
* you may not use this file except in compliance with the License.  
* You may obtain a copy of the License at  
*  
* http://www.apache.org/licenses/LICENSE-2.0  
*  
* Unless required by applicable law or agreed to in writing, software  
* distributed under the License is distributed on an "AS IS" BASIS,  
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  
* See the License for the specific language governing permissions and  
* limitations under the License.  
*  
* @author Gerhard Koch <gerhard.koch AT ymail.com>  
*  
* USAGE:  
*  
* staticmap.php?center=40.714728,-73.998672&zoom=14&size=512x512&maptype=mapnik&markers=40.702147,-74.015794,blues|40.711614,-74.012318,greeng|40.718217,-73.998284,redc  
*  
*/  
 
error_reporting(0);  
ini_set('display_errors','off');  
 
Class staticMapLite {  
 
protected $tileSize = 256;  
protected $tileSrcUrl = array( 'mapnik' => 'http://tile.openstreetmap.org/{Z}/{X}/{Y}.png',  
'osmarenderer' => 'http://c.tah.openstreetmap.org/Tiles/tile/{Z}/{X}/{Y}.png',  
'cycle' => 'http://c.andy.sandbox.cloudmade.com/tiles/cycle/{Z}/{X}/{Y}.png'  
);  
 
protected $tileDefaultSrc = 'mapnik';  
protected $markerBaseDir = 'images/markers';  
protected $osmLogo = 'images/osm_logo.png';  
 
protected $useTileCache = true;  
protected $tileCacheBaseDir = './cache/tiles';  
 
protected $useMapCache = true;  
protected $mapCacheBaseDir = './cache/maps';  
protected $mapCacheID = '';  
protected $mapCacheFile = '';  
protected $mapCacheExtension = 'png';  
 
protected $zoom, $lat, $lon, $width, $height, $markers, $image, $maptype;  
protected $centerX, $centerY, $offsetX, $offsetY;  
 
public function __construct(){  
$this->zoom = 0;  
$this->lat = 0;  
$this->lon = 0;  
$this->width = 500;  
$this->height = 350;  
$this->markers = array();  
$this->maptype = $this->tileDefaultSrc;  
}  
 
public function parseParams(){  
global $_GET;  
 
// get zoom from GET paramter  
$this->zoom = $_GET['zoom']?intval($_GET['zoom']):0;  
if($this->zoom>18)$this->zoom = 18;  
 
// get lat and lon from GET paramter  
list($this->lat,$this->lon) = split(',',$_GET['center']);  
$this->lat = floatval($this->lat);  
$this->lon = floatval($this->lon);  
 
// get zoom from GET paramter  
if($_GET['size']){  
list($this->width, $this->height) = split('x',$_GET['size']);  
$this->width = intval($this->width);  
$this->height = intval($this->height);  
}  
if($_GET['markers']){  
$markers = split('%7C|\|',$_GET['markers']);  
foreach($markers as $marker){  
list($markerLat, $markerLon, $markerImage) = split(',',$marker);  
$markerLat = floatval($markerLat);  
$markerLon = floatval($markerLon);  
$markerImage = basename($markerImage);  
$this->markers[] = array('lat'=>$markerLat, 'lon'=>$markerLon, 'image'=>$markerImage);  
}  
 
}  
if($_GET['maptype']){  
if(array_key_exists($_GET['maptype'],$this->tileSrcUrl)) $this->maptype = $_GET['maptype'];  
}  
}  
 
public function lonToTile($long, $zoom){  
return (($long + 180) / 360) * pow(2, $zoom);  
}  
 
public function latToTile($lat, $zoom){  
return (1 - log(tan($lat * pi()/180) + 1 / cos($lat* pi()/180)) / pi()) /2 * pow(2, $zoom);  
}  
 
public function initCoords(){  
$this->centerX = $this->lonToTile($this->lon, $this->zoom);  
$this->centerY = $this->latToTile($this->lat, $this->zoom);  
$this->offsetX = floor((floor($this->centerX)-$this->centerX)*$this->tileSize);  
$this->offsetY = floor((floor($this->centerY)-$this->centerY)*$this->tileSize);  
}  
 
public function createBaseMap(){  
$this->image = imagecreatetruecolor($this->width, $this->height);  
$startX = floor($this->centerX-($this->width/$this->tileSize)/2);  
$startY = floor($this->centerY-($this->height/$this->tileSize)/2);  
$endX = ceil($this->centerX+($this->width/$this->tileSize)/2);  
$endY = ceil($this->centerY+($this->height/$this->tileSize)/2);  
$this->offsetX = -floor(($this->centerX-floor($this->centerX))*$this->tileSize);  
$this->offsetY = -floor(($this->centerY-floor($this->centerY))*$this->tileSize);  
$this->offsetX += floor($this->width/2);  
$this->offsetY += floor($this->height/2);  
$this->offsetX += floor($startX-floor($this->centerX))*$this->tileSize;  
$this->offsetY += floor($startY-floor($this->centerY))*$this->tileSize;  
 
for($x=$startX; $x<=$endX; $x++){  
for($y=$startY; $y<=$endY; $y++){  
$url = str_replace(array('{Z}','{X}','{Y}'),array($this->zoom, $x, $y), $this->tileSrcUrl[$this->maptype]);  
$tileImage = imagecreatefromstring($this->fetchTile($url));  
$destX = ($x-$startX)*$this->tileSize+$this->offsetX;  
$destY = ($y-$startY)*$this->tileSize+$this->offsetY;  
imagecopy($this->image, $tileImage, $destX, $destY, 0, 0, $this->tileSize, $this->tileSize);  
}  
}  
}  
 
 
public function placeMarkers(){  
foreach($this->markers as $marker){  
$markerLat = $marker['lat'];  
$markerLon = $marker['lon'];  
$markerImage = $marker['image'];  
$markerIndex++;  
$markerFilename = $markerImage?(file_exists($this->markerBaseDir.'/'.$markerImage.".png")?$markerImage:'lightblue'.$markerIndex):'lightblue'.$markerIndex;  
if(file_exists($this->markerBaseDir.'/'.$markerFilename.".png")){  
$markerImg = imagecreatefrompng($this->markerBaseDir.'/'.$markerFilename.".png");  
} else {  
$markerImg = imagecreatefrompng($this->markerBaseDir.'/lightblue1.png');  
}  
$destX = floor(($this->width/2)-$this->tileSize*($this->centerX-$this->lonToTile($markerLon, $this->zoom)));  
$destY = floor(($this->height/2)-$this->tileSize*($this->centerY-$this->latToTile($markerLat, $this->zoom)));  
$destY = $destY - imagesy($markerImg);  
 
imagecopy($this->image, $markerImg, $destX, $destY, 0, 0, imagesx($markerImg), imagesy($markerImg));  
 
};  
}  
 
 
 
public function tileUrlToFilename($url){  
return $this->tileCacheBaseDir."/".str_replace(array('http://'),'',$url);  
}  
 
public function checkTileCache($url){  
$filename = $this->tileUrlToFilename($url);  
if(file_exists($filename)){  
return file_get_contents($filename);  
}  
}  
 
public function checkMapCache(){  
$this->mapCacheID = md5($this->serializeParams());  
$filename = $this->mapCacheIDToFilename();  
if(file_exists($filename)) return true;  
}  
 
public function serializeParams(){  
return join("&",array($this->zoom,$this->lat,$this->lon,$this->width,$this->height, serialize($this->markers),$this->maptype));  
}  
 
public function mapCacheIDToFilename(){  
if(!$this->mapCacheFile){  
$this->mapCacheFile = $this->mapCacheBaseDir."/".substr($this->mapCacheID,0,2)."/".substr($this->mapCacheID,2,2)."/".substr($this->mapCacheID,4);  
}  
return $this->mapCacheFile.".".$this->mapCacheExtension;  
}  
 
 
 
public function mkdir_recursive($pathname, $mode){  
return mkdir($pathname, $mode, true);  
}  
public function writeTileToCache($url, $data){  
$filename = $this->tileUrlToFilename($url);  
$this->mkdir_recursive(dirname($filename),0777);  
file_put_contents($filename, $data);  
}  
 
public function fetchTile($url){  
if($this->useTileCache && ($cached = $this->checkTileCache($url))) return $cached;  
$ch = curl_init();  
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);  
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0");  
curl_setopt($ch, CURLOPT_URL, $url);  
$tile = curl_exec($ch);  
curl_close($ch);  
if($this->useTileCache){  
$this->writeTileToCache($url,$tile);  
}  
return $tile;  
 
}  
 
public function copyrightNotice(){  
$logoImg = imagecreatefrompng($this->osmLogo);  
imagecopy($this->image, $logoImg, imagesx($this->image)-imagesx($logoImg), imagesy($this->image)-imagesy($logoImg), 0, 0, imagesx($logoImg), imagesy($logoImg));  
 
}  
 
public function sendHeader(){  
header('Content-Type: image/png');  
$expires = 60*60*24*14;  
header("Pragma: public");  
header("Cache-Control: maxage=".$expires);  
header('Expires: ' . gmdate('D, d M Y H:i:s', time()+$expires) . ' GMT');  
}  
 
public function makeMap(){  
$this->initCoords();  
$this->createBaseMap();  
if(count($this->markers))$this->placeMarkers();  
if($this->osmLogo) $this->copyrightNotice();  
}  
 
public function showMap(){  
$this->parseParams();  
if($this->useMapCache){  
// use map cache, so check cache for map  
if(!$this->checkMapCache()){  
// map is not in cache, needs to be build  
$this->makeMap();  
$this->mkdir_recursive(dirname($this->mapCacheIDToFilename()),0777);  
imagepng($this->image,$this->mapCacheIDToFilename(),9);  
$this->sendHeader();  
if(file_exists($this->mapCacheIDToFilename())){  
return file_get_contents($this->mapCacheIDToFilename());  
} else {  
return imagepng($this->image);  
}  
} else {  
// map is in cache  
$this->sendHeader();  
return file_get_contents($this->mapCacheIDToFilename());  
}  
 
} else {  
// no cache, make map, send headers and deliver png  
$this->makeMap();  
$this->sendHeader();  
return imagepng($this->image);  
 
}  
}  
 
}  
 
$map = new staticMapLite();  
print $map->showMap();  
 
?>  
 
file:a/busui/stop.php (deleted)
<?php  
include('common.inc.php');  
$url = $APIurl."/json/stop?stop_id=".$_REQUEST['stopid'];  
$stop = json_decode(getPage($url));  
 
include_header($stop[1]);  
timePlaceSettings();  
echo '<div data-role="content" class="ui-content" role="main"><p>'.staticmap(Array(0 => Array($stop[2],$stop[3]))).'</p>';  
echo ' <ul data-role="listview" data-inset="true">';  
$url = $APIurl."/json/stoptrips?stop=".$_REQUEST['stopid']."&time=".midnight_seconds()."&service_period=".service_period();  
$trips = json_decode(getPage($url));  
debug(print_r($trips,true));  
foreach ($trips as $row)  
{  
echo '<li>';  
echo '<h3><a href="trip.php?stopid='.$_REQUEST['stopid'].'&tripid='.$row[1][0].'">'.$row[1][1];  
echo '<br><small>Via: '.viaPointNames($row[1][0],$_REQUEST['stopid']).'</small> </a></h3>';  
echo '<p class="ui-li-aside"><strong>'.midnight_seconds_to_time($row[0]).'</strong></p>';  
echo '</li>';  
}  
if (sizeof($trips) == 0) echo "<li> <center>No trips in the near future.</center> </li>";  
echo '</ul></div>';  
include_footer();  
?>  
 
file:a/busui/stopList.php (deleted)
<?php  
include('common.inc.php');  
 
function navbar() {  
echo'  
<div data-role="navbar">  
<ul>  
<li><a href="stopList.php">Timing Points</a></li>  
<li><a href="stopList.php?suburbs=yes">By Suburb</a></li>  
<li><a href="stopList.php?nearby=yes">Nearby Stops</a></li>  
<li><a href="stopList.php?allstops=yes">All Stops</a></li>  
</ul>  
</div>  
';  
timePlaceSettings();  
}  
// By suburb  
if (isset($_REQUEST['suburbs'])) {  
include_header("Stops by Suburb");  
navbar();  
echo ' <ul data-role="listview" data-filter="true" data-inset="true" >';  
foreach ($suburbs as $suburb) {  
echo '<li><a href="stopList.php?suburb='.urlencode($suburb).'">'.$suburb.'</a></li>';  
}  
echo '</ul>';  
} else {  
// Timing Points / All stops  
 
if ($_REQUEST['allstops']) {  
$url = $APIurl."/json/stops";  
include_header("All Stops");  
navbar();  
} else if ($_REQUEST['nearby']) {  
$url = $APIurl."/json/neareststops?lat={$_SESSION['lat']}&lon={$_SESSION['lon']}&limit=15";  
include_header("Nearby Stops");  
navbar();  
timePlaceSettings();  
} else if ($_REQUEST['suburb']) {  
$url = $APIurl."/json/stopzonesearch?q=".filter_var($_REQUEST['suburb'], FILTER_SANITIZE_STRING);  
include_header("Stops in ".ucwords(filter_var($_REQUEST['suburb'], FILTER_SANITIZE_STRING)));  
navbar();  
} else {  
$url = $APIurl."/json/timingpoints";  
include_header("Timing Points / Major Stops");  
navbar();  
}  
echo '<div class="noscriptnav"> Go to letter: ';  
foreach(range('A','Z') as $letter)  
{  
echo "<a href=\"#$letter\">$letter</a>&nbsp;";  
}  
echo "</div>  
<script>  
$('.noscriptnav').hide();  
</script>";  
echo ' <ul data-role="listview" data-filter="true" data-inset="true" >';  
$contents = json_decode(getPage($url));  
debug(print_r($contents,true));  
foreach ($contents as $key => $row) {  
$stopName[$key] = $row[1];  
}  
 
// Sort the stops by name  
array_multisort($stopName, SORT_ASC, $contents);  
 
$firstletter = "";  
foreach ($contents as $row)  
{  
if (substr($row[1],0,1) != $firstletter){  
echo "<a name=$firstletter></a>";  
$firstletter = substr($row[1],0,1);  
}  
echo '<li><a href="stop.php?stopid='.$row[0].'">'.bracketsMeanNewLine($row[1]).'</a></li>';  
}  
echo '</ul>';  
}  
include_footer();  
?>  
 
 
file:a/busui/trip.php (deleted)
<?php  
include('common.inc.php');  
$tripid = filter_var($_REQUEST['tripid'],FILTER_SANITIZE_NUMBER_INT);  
$stopid = filter_var($_REQUEST['stopid'],FILTER_SANITIZE_NUMBER_INT);  
if ($_REQUEST['routeid']) {  
$url = $APIurl."/json/routetrips?route_id=".filter_var($_REQUEST['routeid'],FILTER_SANITIZE_NUMBER_INT);  
$trips = json_decode(getPage($url));  
debug(print_r($trips,true));  
foreach ($trips as $trip)  
{  
if ($trip[0] < midnight_seconds()) {  
$tripid = $trip[1];  
break;  
}  
}  
if (!($tripid > 0)) $tripid = $trips[0][1];  
}  
$url = $APIurl."/json/triprows?trip=".$tripid;  
$trips = array_flatten(json_decode(getPage($url)));  
debug(print_r($trips,true));  
include_header("Stops on ". $trips[1]->route_short_name . ' '. $trips[1]->route_long_name);  
timePlaceSettings();  
echo ' <ul data-role="listview" data-inset="true">';  
 
 
$url = $APIurl."/json/tripstoptimes?trip=".$tripid;  
 
$json = json_decode(getPage($url));  
debug(print_r($json,true));  
$stops = $json[0];  
$times = $json[1];  
foreach ($stops as $key => $row)  
{  
echo '<li>';  
echo '<h3><a href="stop.php?stopid='.$row[0].'">'.bracketsMeanNewLine($row[1]);  
if ($row[0] == $stopid) echo "<br><small> Current Location</small>";  
echo '</a></h3>';  
echo '<p class="ui-li-aside">'.midnight_seconds_to_time($times[$key]).'</p>';  
echo '</li>';  
}  
echo '</ul>';  
include_footer();  
?>  
 
file:a/busui/tripPlanner.php (deleted)
<?php  
include('common.inc.php');  
include_header("Trip Planner", true, true);  
$from = (isset($_REQUEST['from']) ? filter_var($_REQUEST['from'],FILTER_SANITIZE_STRING) : "Brigalow");  
$to = (isset($_REQUEST['to']) ? filter_var($_REQUEST['to'],FILTER_SANITIZE_STRING) : "Barry");  
$date = (isset($_REQUEST['date']) ? filter_var($_REQUEST['date'],FILTER_SANITIZE_STRING) : date("m/d/Y"));  
$time = (isset($_REQUEST['time']) ? filter_var($_REQUEST['time'],FILTER_SANITIZE_STRING) : date("H:m"));  
# todo: convert date from form to h:ia?  
 
function tripPlanForm($errorMessage = "")  
{  
global $date,$time,$from,$to;  
echo "<font color=red>$errorMessage</font>";  
echo '<form action="tripPlanner.php" method="post">  
<div data-role="fieldcontain">  
<label for="from">I would like to go from</label>  
<input type="text" name="from" id="from" value="' . $from . '" />  
<a href="#" style="display:none" name="fromHere" id="fromHere"/>Here?</a>  
</div>  
<div data-role="fieldcontain">  
<label for="to"> to </label>  
<input type="text" name="to" id="to" value="' . $to . '" />  
<a href="#" style="display:none" name="toHere" id="toHere"/>Here?</a>  
</div>  
<div data-role="fieldcontain">  
<label for="date"> on </label>  
<input type="date" name="date" id="date" value="' . $date . '" />  
</div>  
<div data-role="fieldcontain">  
<label for="time"> at </label>  
<input type="time" name="time" id="time" value="' . $time . '" />  
</div>  
<input type="submit" value="Go!"></form>';  
echo "<script>  
$('#toHere').click(function(event) { $('#to').val(getCookie('geolocate')); return false;});  
$('#toHere').show();  
$('#fromHere').click(function(event) { $('#from').val(getCookie('geolocate')); return false;});  
$('#fromHere').show();  
 
</script>";  
}  
 
function processItinerary($itineraryNumber, $itinerary)  
{  
echo '<div data-role="collapsible" ' . ($itineraryNumber > 0 ? 'data-collapsed="true"' : "") . '> <h3> Option #' . ($itineraryNumber + 1) . ": " . floor($itinerary->duration / 60000) . " minutes ({$itinerary->startTime} to {$itinerary->endTime})</h3><p>";  
echo "Walking time: " . floor($itinerary->walkTime / 60000) . " minutes (" . floor($itinerary->walkDistance) . " meters)<br>\n";  
echo "Transit time: " . floor($itinerary->transitTime / 60000) . " minutes<br>\n";  
echo "Waiting time: " . floor($itinerary->waitingTime / 60000) . " minutes<br>\n";  
 
 
 
if (is_array($itinerary->legs->leg)) {  
$legMarkers = array();  
foreach ($itinerary->legs->leg as $legNumber => $leg) {  
$legMarkers[] = array($leg->from->lat, $leg->from->lon);  
}  
echo '' . staticmap($legMarkers) . "<br>\n";  
echo '<ul>';  
foreach ($itinerary->legs->leg as $legNumber => $leg) {  
echo '<li>';  
processLeg($legNumber, $leg);  
echo "</li>";  
}  
echo "</ul>";  
} else {  
echo '' . staticmap(array(array($itinerary->legs->leg->from->lat, $itinerary->legs->leg->from->lon))) . "<br>\n";  
processLeg(0, $itinerary->legs->leg);  
}  
 
echo "</p></div>";  
}  
 
function processLeg($legNumber, $leg) {  
$legArray = object2array($leg);  
echo '<h3>Leg #' . ($legNumber + 1) . " ( {$legArray['@mode']} from: {$leg->from->name} to {$leg->to->name}, " . floor($leg->duration / 60000) . " minutes) </h3>\n";  
if ($legArray["@mode"] === "BUS") {  
echo "Take bus {$legArray['@route']} " . str_replace("To", "towards", $legArray['@headsign']) . "<br>";  
} else {  
$walkStepMarkers = array();  
foreach ($leg->steps->walkSteps as $stepNumber => $step) {  
$walkStepMarkers[] = array($step->lat, $step->lon);  
}  
echo "" . staticmap($walkStepMarkers, "icong") . "<br>\n";  
foreach ($leg->steps->walkSteps as $stepNumber => $step) {  
echo "Walking step " . ($stepNumber + 1) . " $step->absoluteDirection / $step->relativeDirection on $step->streetName for " . floor($step->distance) . " meters<br>\n";  
}  
}  
}  
 
if ($_REQUEST['time']) {  
$toPlace = (startsWith($to, "-") ? $to : geocode($to, false));  
$fromPlace = (startsWith($from, "-") ? $from : geocode($from, false));  
if ($toPlace == "" || $fromPlace == "") {  
$errorMessage = "";  
if ($toPlace === "")  
$errorMessage .= urlencode($to) . " not found.<br>\n";  
if ($fromPlace === "")  
$errorMessage .= urlencode($from) . " not found.<br>\n";  
tripPlanForm($errorMessage);  
} else {  
$url = $otpAPIurl."ws/plan?date=" . urlencode($_REQUEST['date']) . "&time=" . urlencode($_REQUEST['time']) . "&mode=TRANSIT%2CWALK&optimize=QUICK&maxWalkDistance=840&wheelchair=false&toPlace=$toPlace&fromPlace=$fromPlace&intermediatePlaces=";  
$ch = curl_init($url);  
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);  
curl_setopt($ch, CURLOPT_HEADER, 0);  
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Accept: application/json"));  
curl_setopt($ch,CURLOPT_TIMEOUT,5);  
$page = curl_exec($ch);  
 
if(curl_errno($ch)) { tripPlanForm("Trip planner temporarily unavailable: ".curl_errno($ch)." ".curl_error($ch));}  
else {  
$tripplan = json_decode($page);  
debug(print_r($triplan,true));  
echo "<h1> From: {$tripplan->plan->from->name} To: {$tripplan->plan->to->name} </h1>";  
echo "<h1> At: {$tripplan->plan->date} </h1>";  
 
if (is_array($tripplan->plan->itineraries->itinerary)) {  
echo '<div data-role="collapsible-set">';  
foreach ($tripplan->plan->itineraries->itinerary as $itineraryNumber => $itinerary) {  
processItinerary($itineraryNumber, $itinerary);  
}  
echo "</div>";  
} else {  
processItinerary(0, $tripplan->plan->itineraries->itinerary);  
}  
}  
curl_close($ch);  
}  
} else {  
tripPlanForm();  
}  
include_footer();  
?>  
 
file:a/busui/view.sh (deleted)
python schedule_viewer.py --feed=../maxious-canberra-transit-feed/cbrfeed.zip --key=ABQIAAAA95XYXN0cki3Yj_Sb71CFvBTPaLd08ONybQDjcH_VdYtHHLgZvRTw2INzI_m17_IoOUqH3RNNmlTk1Q