var Tripplanner = {

		InitializeTripPlannerPage: function () {

		var TripPlanText = "Do not include city/zip";

		if($("#TripStart").val() == '' | $("#TripStart").val() == TripPlanText) {
			$("#TripStart").val(TripPlanText);
			$("#TripStart").css({ "color":"gray" });
		};
		
		if($("#TripEnd").val() == '' | $("#TripEnd").val() == TripPlanText) {
			$("#TripEnd").val(TripPlanText);
			$("#TripEnd").css({ "color":"gray" });
		};

		
	
	
		$("#TripStart").focus(
			function () {
				if($(this).val() == TripPlanText) {
						$(this).val("");
						$(this).css({ "color":"black" });
				};
			}
		 );
		
		
		$("#TripStart").blur(
			function () {
				if($(this).val() == '') {
						$(this).val(TripPlanText);
						$(this).css({ "color":"gray" });
				};
			}
		 );
		
		$("#TripEnd").focus(
			function () {
				if($(this).val() == TripPlanText) {
						$(this).val("");
						$(this).css({ "color":"black" });
				};
			}
		 );
		
		$("#TripEnd").blur(
			function () {
				if($(this).val() == '') {
						$(this).val(TripPlanText);
						$(this).css({ "color":"gray" });
				};
			}
		 );

	} //InitializeTripPlannerPage
};

$(Tripplanner.InitializeTripPlannerPage);


function printPage(obj){
	var newwindow = window.open('','', config='height=400,width=600, toolbar=no, menubar=no, scrollbars=yes, resizable=yes,location=no, directories=no, status=no',false);
	// get content
	content = $("#"+obj).html();
	
	// style
	var style;
	style = "<style>";
	style = style + "body{font-family:Arial;font-size:.85em;}";
	style = style + "ul{list-style:none;}";
	style = style + ".TripInstructions a{display:inline;text-align:left;text-decoration:none;color:#18519C;}";
	style = style + "h5,h6{padding:0px;margin:0px;}";
	style = style + "h5{font-size:2em;font-family:Arial;font-weight:normal}";
	style = style + ".TripInstructions li{list-style:none;padding:2px 0px;}";
	style = style + ".TripInstructions .bus{font-size:2em;vertical-align:middle;}";
	style = style + ".TripInstructions .fare{color:#18519C;border:0px;display:block;}";
	style = style + ".TripInstructions .indent{padding-left:30px;}";
	style = style + ".TripInstructions .transfer{color:#999;}";
	style = style + ".TripInstructions .min{color:#999;}";
	style = style + "a{padding-bottom:10px;font-size:.85em;display:block;text-align:right;}";
	style = style + ".miles,.info{font-size:.85em;color:#999;padding-left:5px;}";
	style = style + "</style>";
	
	// build html object
	var htmlobj;
	htmlobj = '<html>';
	htmlobj = htmlobj + '<head>';
	htmlobj = htmlobj + '<title>Print Trip</title>';
	htmlobj = htmlobj + style;
	htmlobj = htmlobj + '</head>';
	htmlobj = htmlobj + '<body>';
	htmlobj = htmlobj + '<a href="#" onclick="window.print();">Print page</a>';
	htmlobj = htmlobj + content;
	htmlobj = htmlobj + '</body>';
	htmlobj = htmlobj + '</html>';
	
	// attach object
	newwindow.document.write(htmlobj);
	newwindow.document.close();
	newwindow.print();
	//$(htmlobj).appendTo($(newwindow.document));
	// newwindow.location.reload(false);
	// newwindow.focus();
	// newwindow.print();
}
		




		


